JP2004295195A - Method and device for issuing instruction, central processing unit, instruction issuing program, and computer readable storage medium for storing the program - Google Patents

Method and device for issuing instruction, central processing unit, instruction issuing program, and computer readable storage medium for storing the program Download PDF

Info

Publication number
JP2004295195A
JP2004295195A JP2003083001A JP2003083001A JP2004295195A JP 2004295195 A JP2004295195 A JP 2004295195A JP 2003083001 A JP2003083001 A JP 2003083001A JP 2003083001 A JP2003083001 A JP 2003083001A JP 2004295195 A JP2004295195 A JP 2004295195A
Authority
JP
Japan
Prior art keywords
instruction
thread
reservation station
entry
operand
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003083001A
Other languages
Japanese (ja)
Other versions
JP3646137B2 (en
Inventor
Nobuyuki Yamazaki
信行 山崎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Japan Science and Technology Agency
Keio University
Original Assignee
Japan Science and Technology Agency
Keio University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Japan Science and Technology Agency, Keio University filed Critical Japan Science and Technology Agency
Priority to JP2003083001A priority Critical patent/JP3646137B2/en
Publication of JP2004295195A publication Critical patent/JP2004295195A/en
Application granted granted Critical
Publication of JP3646137B2 publication Critical patent/JP3646137B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3851Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To cause a multithreaded processor to achieve real-time processing through overtaking based on priority of instruction. <P>SOLUTION: An instruction fetching unit 2 fetches instructions from an instruction cache 3 and sends them to an instruction decoding unit 9. The instruction decoding unit 89 decodes the instructions. A reservation station 20 obtains from a register file 1-1 the instructions and the operands needed for executing the instructions. A thread control unit 21 sets the priority of each thread. The reservation station 20 supervises a common data bus 12 if not all the operands needed for executing the instructions are obtained, and fetches, if any, necessary operands. The reservation station 20 selects an entry with the highest priority from among entries where there are all the operands needed for executing the instructions, and sends its instruction and operand to a computing unit 4. The computing unit 4 executes the instructions according to the instruction and the operand. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、命令発行方法及び装置、中央演算装置、命令発行プログラム及びそれを記憶したコンピュータ読み取り可能な記憶媒体に係り、特に、各種ロボット、自動車、プラント、ホームオートメーション等の種々の分散実時間制御を実現するために必要な実時間処理をハードウェアで支援する命令発行方法及び装置、中央演算装置、命令発行プログラム及びそれを記憶したコンピュータ読み取り可能な記憶媒体に関する。
【0002】
【従来の技術】
従来、マルチスレッドプロセッサを用いた技術として、特許文献1には、複数の命令フローを独立に処理し、命令フロー単位で処理性能を柔軟に制御するものが記載されている。このマルチスレッドプロセッサでは、命令フロー中の命令によって命令フロー毎の優先順位を制御し、一つの機能ユニットに対して複数同時に命令発行要求が出力された場合、機能ユニットに発行すべき命令を優先度によって決定することで命令フロー単位に必要とされる処理性能を動的に実現する。なお、スレッドとは、一般に、OSがあるプロセス又はタスクを並列処理するため、プロセス又はタスクを分割した処理単位又は最小単位のことをいう。この際、プロセス又はタスクが分割されることなく、1プロセス又は1タスクが1スレッドとなる場合もある。
【特許文献1】
特開平10−124316号公報
【0003】
【発明が解決しようとする課題】
従来のマルチスレッドプロセッサのリザベーションステーションでは、命令がどのスレッドのものかということに関係なく処理が行われる。そのため、複数のスレッドが同時に実行されていると、あるスレッドの実行時間が他のスレッドの実行に影響を受け、実行時間を予測することが難しくなる。そのためリアルタイム処理のように時間制約に厳しいシステムにおいては、この点が課題となる。
【0004】
本発明は、以上の点に鑑み、マルチスレッドプロセッサにおいて実時間処理を、
(1)命令の優先度による追い越し、及び/又は、
(2)クロック毎の優先度の付け替え、
という手法を用いて実現することにより、他のスレッドに影響されることなく、スレッドの実時間処理の実行を可能とすることを目的とする。
【0005】
【課題を解決するための手段】
本発明では、特に、
1.実行する命令に優先度を付け、リザベーションステーションにおいて高い優先度の命令が低い優先度の命令を追い越すこと、及び/又は、
2.命令の優先度をクロック毎に付け替えること、
により、他のスレッドの影響を受けずにスレッドがリアルタイム処理を行うことを実現する。
【0006】
本発明の第1の解決手段によると、
中央演算装置が複数のスレッドの命令を実行するマルチスレッドプロセッサにおける命令発行装置であって、
各スレッドに対応して優先度を設定するためのスレッド制御ユニットと、
演算処理及び/又はメモリアクセス処理において実行すべきスレッドの命令及びオペランドが記憶されたレジスタファイルと、
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、前記レジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと、
前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と、
を備え、
前記リザベーションステーションは、
前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込む手段と、
スレッドIDに対応した優先度情報を前記スレッド制御ユニットから求める手段と、
命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送る手段と
を有することにより、前記リザベーションステーションから前記演算器への命令発行を高い優先度のスレッドの命令が低い優先度の命令を追い越すようにした前記命令発行装置が提供される。
【0007】
本発明の第2の解決手段によると、
上述のような命令発行装置と、
命令及びデータをそれぞれキャッシュする命令キャッシュ及びデータキャッシュと、
前記命令キャッシュから命令をフェッチ及びデコードし、デコードされた命令を基に前記レジスタファイルをアクセスする命令フェッチユニットと、
外部の記憶装置及び/又は入出力装置とデータの入出力を行うためのインターフェースユニットと、
を備えた中央演算装置が提供される。
【0008】
本発明の第3の解決手段によると、
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、実行すべきスレッドのオペランドが記憶されたレジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと; 前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と; を備え、マルチスレッドプロセッサにおける命令発行装置を用いた命令発行方法であって、
前記リザベーションステーションは、前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込むステップと、
前記リザベーションステーションは、スレッドIDに対応した優先度情報を、各スレッドに対応して優先度を設定するためのスレッド制御ユニットから求めるステップと、
前記リザベーションステーションは、命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送るステップと
を含むことにより、前記リザベーションステーションから前記演算器への命令発行を高い優先度のスレッドの命令が低い優先度の命令を追い越すようにした前記命令発行方法が提供される。さらに、第3の解決手段に記載された各ステップを、コンピュータに実行させるための命令発行プログラム及びその命令発行プログラムを記憶したコンピュータ読み取り可能な記憶媒体が提供される。
【0009】
【発明の実施の形態】
1.関連技術
本実施の形態は、一例として、レスポンシブ・マルチスレッドプロセッサ(Responsive Multi−Threaded(RMT)Processor)等のマルチスレッドプロセッサの中央演算装置(CPU)上で利用されている。そこで、まず、本実施の形態に関連するCPUを有するマルチスレッドプロセッサについて説明する。
【0010】
図1に、本実施の形態に関連するアウトオブオーダ実行を行うマルチスレッドプロセッサの構成図を示す。ここで、アウトオブオーダ実行とは、プログラムで記述されている順番と異なる順番でも命令の演算を行うことをいう。そのために、アウトオブオーダ実行では、以下に説明するように、リオーダバッファとリザベーションステーションを用いて、実行可能な命令から順に演算器に送り、リオーダバッファで順番を元に戻すことが行われる。
【0011】
このプロセッサは、CPU101、メモリ200、I/O300、バス400を有する。CPU101は、バス400を介して、メモリ200、I/O300等と接続されている。CPU101は、レジスタ群1、命令フェッチユニット2、命令キャッシュ3、演算器4、メモリアクセスユニット5、データキャッシュ6、バスインターフェースユニット7、リオーダバッファ8、命令デコードユニット9、リザベーションステーション10、演算バス11、コモンデータバス12を備える。レジスタ群1は、レジスタファイル1−1、リネームレジスタ1−2を有する。
【0012】
命令キャッシュ3及びデータキャッシュ6は、例えば、SRAM、フリップフロップ(FF)等の素子が用いられ、アクセス、読み出し、書き込み等の処理速度が速いものの記憶容量が小さい。一方、CPU101外部のメモリ200は、SDRAM、DRAM等の素子が用いられ、アクセス、読み出し、書き込み等の処理速度がキャッシュより遅いものの記憶容量が大きい。
【0013】
命令フェッチユニット2は、命令キャッシュ3へアドレス(Address)を出力し、命令キャッシュ3から命令(instruction)をフェッチし、フェッチした命令を命令デコードユニット9に送る。命令デコードユニット9は、命令フェッチユニット2でフェッチされた命令をデコードし、それを基にレジスタ群1のレジスタファイル1−1から演算に必要なデータを読み出す。
【0014】
レジスタ群1のレジスタファイル1−1は、汎用レジスタ(GPR)、浮動小数点レジスタ(FPR)、プログラムカウンタ(PC)、ステータスレジスタ(SR)等の各種レジスタを含む。レジスタファイル1−1は、現在実行中の命令に必要なオペランド又はデータ等を記憶する。マルチスレッドプロセッサの場合は、レジスタファイル1−1が並列に複数存在することになる。レジスタ群1のリネームレジスタ1−2は、オペランドの依存関係を解決するためにオペランド名を変更する。リネームレジスタ1−2は、必要なオペランドがまだ演算中で結果が出ていない場合、データの代わりにリネームされたレジスタIDを出力する。レジスタファイル1−1又はリネームレジスタ1−2から出力された、オペランド又はデータは、デコードされた命令と共に演算バス11を介してリザベーションステーション10へ送られる。
【0015】
演算バス11は、レジスタ群1のレジスタファイル1−1又はリネームレジスタ1−2、リオーダバッファ8とリザベーションステーション10を並列に接続する。
【0016】
リザベーションステーション10は、レジスタファイル1−1及び/又はリネームレジスタ1−2から、デコードされた命令に従ってレジスタ群1から読み出された、演算に必要なオペランド又はデータを格納する。また、リザベーションステーション10は、各演算器4及びメモリアクセスユニット5からの出力をコモンデータバス12を介して監視し、レジスタファイル1−1で未解決のオペランドについては必要なデータが演算器4から出力されると、その結果をオペランドとして取り込む。リザベーションステーション10は、全てのオペランドがそろった命令から順に接続されている演算器4又はメモリアクセスユニット5へ送る。なお、ロード(Load)又はストア(Store)等のメモリアクセス命令の場合、メモリアクセスユニット5に接続されたリザベーションステーション10にその命令及びオペランドが格納される。
【0017】
演算器4は、局所性原理に従い、命令キャッシュ3、データキャッシュ6又はメモリ200から必要なデータ及び命令をリザベーションステーション10又はレジスタ群1を介して利用する。演算器4は、リザベーションステーション10から受け取った命令に従い演算を実行し、計算した結果をコモンデータバス12に出力する。
【0018】
また、メモリアクセスユニット5は、データキャッシュ6にアクセスしロード又はストアを実行し、コモンデータバス12に出力する。ストア命令の場合、メモリアクセスユニット5は、アドレスとデータをデータキャッシュ6に送り、データをデータキャッシュ6に格納する。ロード命令の場合、メモリアクセスユニット5は、アドレスをデータキャッシュ6に送りデータキャッシュ6からデータを読み出す。読み出したデータは、コモンデータバス12を介してレジスタファイル1−1に書き戻される。このとき、データキャッシュ6に求めるデータがなければ、バスインターフェースユニット7を介してメモリ200からそれを読み出す。バスインターフェースユニット7は、命令キャッシュ3、データキャッシュ6とCPU外部のメモリ200、I/O300等をバス400を介して接続し、CPU内部と外部の間でデータの入出力行うユニットである。
【0019】
コモンデータバス12は、演算器4の演算結果、メモリアクセスユニット5のロード又はストアの実行結果をレジスタファイル1−1又はリネームレジスタ1−2、リオーダバッファ8、リザベーションステーション10に受け渡す。
【0020】
リオーダバッファ8は、各演算器4によりアウトオブオーダで実行された命令の順番を元の順番にもどしてから、演算結果を実際のレジスタファイル1−1へ書き込む。
【0021】
図2に、リザベーションステーション10のエントリのフォーマットを示す。リザベーションステーション10のエントリは、ビジービット(busy bit)、命令(operation)、ひとつ又は複数の有効ビット及びデータの組、(valid0及びdata0、valid1及びdata1、・・・)を含む。
【0022】
「ビジービット」は、エントリが有効であるか無効であるか、即ちエントリに命令があるかないかを示し、「命令」は、演算器4で演算するための命令又はメモリアクセスユニット5で実行するための命令を示す。また、「データ」は、命令実行に必要なオペランドを示し、「有効ビット」は、演算に用いる対応するオペランドに対して値が有効であるか否かを示す。リザベーションステーション10は、命令に応じて有効ビットとデータの組の数を設定することができる。リザベーションステーション10は、有効ビットを用いて、全てのオペランドがそろったことを判断することができる。
【0023】
図3及び図4に、リザベーションステーション10における演算器4への命令発行処理のフローチャート(1)及び(2)を示す。図3は、ステップS101からステップS109までのステップを、図4は、ステップS111からステップS117までのステップを示す。命令発行処理は、ステップS101からステップS109までのステップを処理した後、ステップS111からステップS117までのステップを処理する。
【0024】
リザベーションステーション10は、レジスタファイル1−1から読み出されたデータを受け取り、その命令実行に必要なデータを記憶するためのエントリを作成して記憶している。リザベーションステーション10は、このようなエントリをひとつ又は複数内部に記憶する。
【0025】
命令発行処理が開始されると、リザベーションステーション10の全てのエントリに対して、ステップS101からステップS109の繰り返しループ処理を行う。繰り返しループ処理では、まず、リザベーションステーション10は、各エントリについて、そのエントリが示す命令を実行するために必要なオペランドが全てそろっているか否か判断する(S103)。リザベーションステーション10は、必要なオペランドの数を命令に従って判別してもよいし、予め命令毎に必要な数又は領域をエントリに定めてもよい。リザベーションステーション10は、例えば、各エントリの有効ビットが全て有効であるか否かを判断する。ステップS103で、命令の実行に必要な全てのデータがオペランドとして得られた場合、例えば、該当する命令実行に必要な全てのオペランドに対する全ての有効ビットがセットされている場合、ステップS109に移る。一方、必要なオペランドがそろっていない場合、例えば、全ての有効ビットがセットされていない場合(S103)、リザベーションステーション10は、必要なデータをまだ得ていないことになり、ステップS105に移る。この場合、リザベーションステーション10は、コモンデータバス12から流れてくる演算結果を監視し、必要なデータが来れば(S105)、それをエントリのデータにオペランドとして取り込み、該当する有効ビットをセットする(S107)。一方、必要なデータが来なければ(S105)、ステップS109に移る。
【0026】
リザベーションステーション10の全てのエントリに対して、ステップS101からステップS109の処理を繰り返し行った後、ステップS111に進んで処理を継続する。
【0027】
つぎに、図4を用いて、ステップS111からステップS117の処理について説明する。
ステップS111では、リザベーションステーション10は、命令実行に必要な全てのオペランドがそろったエントリがあるか否か判断する(S111)。例えば、上述のように、リザベーションステーション10は全ての有効ビットが有効かどうかでこれを判断することができる。全てのオペランドがそろったエントリが無い場合は、命令発行を終了する。一方、全てのオペランドがそろったエントリがある場合は、リザベーションステーション10は、そのようなエントリがひとつか複数か判断する(S113)。例えば、全ての有効ビットがセットされると、命令実行に必要な全てのオペランドがそろったことになる。
【0028】
リザベーションステーション10は、全てのオペランドがそろったエントリが1つの場合、該当エントリの命令及びオペランドを演算器4に送る(S115)。一方、複数のエントリが全てのエントリがそろい演算可能である場合、リザベーションステーション10は、より古いエントリから演算器4に送る(S117)。選択されなかったエントリは次の命令発行の処理クロック以降まで発行を待たされる。
【0029】
2.優先度による複数スレッドの命令発行装置を備えたCPU
上述の「1.関連技術」では、リザベーションステーション10の動作は、主に、オペランドがそろい、演算が可能になった命令から演算器4に送り、複数の命令が同時に演算可能になっている場合は最も古い命令から実行することについて説明した。以下では、複数の命令が同時に演算可能になった場合、優先度の最も高いスレッドの命令から先に実行するための命令発行について説明する。
【0030】
図5に、優先度を用いたアウトオブオーダ実行を行うマルチスレッドプロセッサの構成図を示す。
このプロセッサは、CPU102、メモリ200、I/O300、バス400を有する。CPU102は、バス400を介して、メモリ200、I/O300等と接続されている。CPU102は、レジスタ群1、命令フェッチユニット2、命令キャッシュ3、演算器4、メモリアクセスユニット5、データキャッシュ6、バスインターフェースユニット7、リオーダバッファ8、命令デコードユニット9、演算バス11、コモンデータバス12、リザベーションステーション20、スレッド制御ユニット21を備える。レジスタ群1は、レジスタファイル1−1、リネームレジスタ1−2を含む。
【0031】
命令フェッチユニット2は、命令キャッシュ3へアドレス(Address)を出力し、命令キャッシュ3から命令(instruction)をフェッチし、命令デコードユニット9で命令をデコードする。
【0032】
スレッド制御ユニット21は、各スレッドの優先度を設定する。また、スレッド制御ユニット21は、設定した優先度を全てのリザベーションステーション20に送る。スレッド制御ユニット21内部には、各スレッドの優先度を識別するためのデータを所定数保持する。スレッド制御ユニット21は、そのために、例えば、各スレッドに対応した優先度の情報を記憶したメモリを備えることができる。また、スレッド制御ユニット21は、他に、スレッドの実行、停止、コンテキストをキャッシュするコンテキストキャッシュとの入れ替え制御等を行うことができる。ここで、コンテキストとは、例えば、汎用レジスタ、浮動小数点レジスタ、プログラムカウンタ、ステータスレジスタ等、記憶部(例、レジスタファイル1−1)に記憶されている各スレッドの実行のための情報又は現在実行中の状態のことをいう。
【0033】
リザベーションステーション20は、上述したように、デコードされた命令に従ってレジスタファイル1−1及び/又はリネームレジスタ1−2から読み出された、演算に必要なオペランド又はデータを格納する。
【0034】
また、リザベーションステーション20は、各演算器4及びメモリアクセスユニット5からの出力をコモンデータバス12を介して監視し、レジスタファイル1−1で未解決のオペランドについては必要なデータが演算器4から出力されると、その結果をオペランドとして取り込む。さらに、リザベーションステーション20は、スレッド制御ユニット21から設定された優先度情報を受け取る、又は、スレッド制御ユニット21をアクセスし、所定のスレッドの優先度情報を得る。また、リザベーションステーション20は、スレッド毎に優先度情報を記憶したテーブルを内部のレジスタに記憶してもよい。リザベーションステーション20は、全てのオペランドがそろった命令のうち優先度が高い命令から順に接続されている演算器4又はメモリアクセスユニット5へ送る。なお、ロード又はストア等のメモリアクセス命令の場合、メモリアクセスユニット5に接続されたリザベーションステーション20にその命令及びオペランドが送られる。
【0035】
他の各部の構成及び動作は、上述したように、図1のCPU101の同符号で示される各部の構成及び動作と同様である。
【0036】
図6に、リザベーションステーション20のエントリのフォーマットを示す。このエントリは、リザベーションステーション10のエントリに、命令の優先度情報(priority)が付加されている。
【0037】
リザベーションステーション20のエントリは、ビジービット(busy bit)、スレッドID(thread ID)、優先度情報(priority)、命令(operation)、ひとつ又は複数の有効ビット及びデータの組、(valid0及びdata0、valid1及びdata1、・・・)を含む。
【0038】
ビジービット、命令、有効ビット、データは、図2で説明したものと同様である。「スレッドID」は、エントリの命令がどのスレッドのものかを示す。なお、スレッドIDを省略し、スレッドID毎に各エントリを識別する情報を記憶したテーブルを用いること等により、リザベーションステーション20は、各スレッドIDを適宜把握することもできる。「優先度情報」は、命令の優先度を示し、リザベーションステーション20に命令が入れられるとき、オペランドを得たとき、処理クロック毎、及び/又は全てのオペランドがそろったとき等にスレッド制御ユニット21からセットされる。リザベーションステーション20は、スレッド毎に別途指定されたレジスタやスレッド制御ユニット21の設定に基づき、スレッド毎に優先度の値を調べ、優先度情報を変更する。本実施の形態ではスレッド制御ユニット21は、例えば、スレッド毎に8bitのレジスタを用意し、優先度情報を256レベルの値として指定する。この値は、例えば、高い(大きい)ほど優先度が高く、低い(小さい)ほど優先度が低いとすることができる。
【0039】
図7及び図8に、優先度を用いた、リザベーションステーション20における演算器4への命令発行処理のフローチャート(1)及び(2)を示す。図7は、ステップS201からステップS209までのステップを、図8は、ステップS211からステップS217までのステップを示す。命令発行処理は、ステップS201からステップS209までのステップを処理した後、ステップS211からステップS217までのステップを処理する。
【0040】
リザベーションステーション20は、レジスタファイル1−1から送られてくるデータを及び命令を格納し、その命令実行に必要なデータを記憶するためのエントリを作成して記憶している。リザベーションステーション20は、このようなエントリをひとつ又は複数内部に記憶する。
【0041】
命令発行処理が開始されると、リザベーションステーション20の全てのエントリに対して、ステップS201からステップS209の繰り返しループ処理を行う。繰り返しループ処理では、まず、リザベーションステーション20は、各エントリについて、そのエントリが示す命令を実行するために必要なオペランドが全てそろっているか否か判断する(S203)。リザベーションステーション20は、必要なオペランドの数を命令に従って判別してもよいし、予め命令毎に必要な数又は領域をエントリに定めてもよい。リザベーションステーション20は、例えば、各エントリの有効ビットが全て有効であるか否かを判断する。ステップS203で命令の実行に必要な全てのオペランドがそろっている場合、例えば、該当する命令実行に必要な全てのオペランドに対する全ての有効ビットがセットされている場合、ステップS208に移る。一方、必要なオペランドがそろっていない場合、例えば、全ての有効ビットがセットされていない場合(S203)、リザベーションステーション20は、当該エントリの命令の実行のために必要なデータをまだ得ていないことになり、ステップS205に移る。ここで、リザベーションステーション20は、コモンデータバス12を監視し必要なデータが来れば(S205)、それをエントリにオペランドとして取り込み該当する有効ビットをセットする(S207)。一方、必要なデータが来なければ(S205)、ステップS208に移る。
【0042】
つぎに、リザベーションステーション20は、各エントリのスレッドIDから優先度情報を更新する(S208)。例えば、リザベーションステーション20は、各エントリにはどのスレッドのものかを示すフィールド、即ちスレッドIDがあるため、それを参照することによりそのエントリがどのスレッドのものかを判断することができる。また、スレッド制御ユニット21では、メモリ等によりスレッドID毎に優先度情報が指定されているため、リザベーションステーション20は、スレッド制御ユニット21のメモリをアクセスする等により設定された優先度を得て、該当するエントリの優先度情報を更新することができる。逆に、スレッド制御ユニット21が、各リザベーションステーション20のエントリのスレッドIDを得て、そのスレッドIDに該当する優先度情報を与えることで、リザベーションステーション20が優先度情報を得るようにしてもよい。また、リザベーションステーション20は、この優先度のデータを適当なタイミングでスレッド制御ユニット21から得て、スレッドIDに対応して優先度情報を内部メモリに記憶しておくようにして、それを参照することでスレッドIDに従い優先度情報を得てもよい。
【0043】
リザベーションステーション20は、全てのエントリに対して、ステップS201からステップS209の処理を繰り返し行った後、ステップS211に進む。
【0044】
つぎに、図8を用いて、ステップS211からステップS217の処理について説明する。
ステップS211では、リザベーションステーション20は、命令実行に必要な全てのオペランドがそろったエントリがあるか否か判断する(S211)。例えば、上述のように、リザベーションステーション20は全ての有効ビットが有効かどうかでこれを判断することができる。全てのオペランドがそろったエントリが無い場合は、命令発行を終了する。一方、全てのオペランドがそろったエントリがある場合は、リザベーションステーション20は、そのようなエントリがひとつか複数か判断する(S213)。例えば、上述のように、全ての有効ビットがセットされると、命令実行に必要なオペランドがそろったことになる。
【0045】
リザベーションステーション20は、全てのオペランドがそろったエントリが1つの場合、該当エントリの命令及びオペランドを演算器4に送る(S215)。一方、複数のエントリが全てのオペランドがそろい演算可能である場合、リザベーションステーション20は、命令の実行可能な各エントリの優先度情報を比較して、より高い優先度を持つエントリを選択する(S217)。なお、ここで、リザベーションステーション20は、優先度が等しい又は略等しいエントリが複数あれば、その中でより古いエントリを選択して、又は、予め定められた順序によりエントリを選択して演算器4に送る。なお、選択されなかったエントリは次の命令発行の処理クロック以降まで発行を待たされる。
【0046】
このように、リザベーションステーション20は、優先度の値が高いエントリを優先的に演算器4に送ることができ、これにより優先度の高い命令が先に演算される。なお、ステップS208の処理をステップS203の前に実行してもよい。
【0047】
3.優先度とカウンタを用いた複数スレッドの命令発行装置及びCPU
この実施の形態では、優先度とカウンタに基づき、先に実行すべき命令を発行するための命令発行について説明する。この実施の形態の命令発行装置及びCPUの構成及び動作は、上述の図5及びその説明箇所の通りであり、リザベーションステーション20で用いるエントリが異なる。
【0048】
図9に、リザベーションステーション20のカウンタ(counter)を付加したエントリのフォーマットを示す。
【0049】
このエントリは、ビジービット(busy bit)、スレッドID(thread ID)、優先度情報(priority)、命令(operation)、ひとつ又は複数の有効ビット及びデータの組、(valid0及びdata0、valid1及びdata1、・・・)、カウンタ(counter)を含む。ビジービット、スレッドID、優先度情報、命令、有効ビット、データは、図2又は図5で説明したものと同様である。
カウンタは、例えば、リザベーションステーション20により命令がエントリに入れられた時にリセットされ、命令発行の処理クロック毎にカウントアップされるカウンタ値である。
【0050】
図10及び図11に、カウンタを用いた、リザベーションステーション20における演算器4への命令発行のフローチャート(1)及び(2)を示す。図10は、ステップS201からステップS209までのステップを、図11は、ステップS211からステップS307までのステップを示す。命令発行処理は、ステップS201からステップS209までのステップを処理した後、ステップS211からステップS307までのステップを処理する。
【0051】
図10及び図11のフローチャートは、上述した図7及び図8のフローチャートと同じステップ番号の各ステップにおける処理は、上述した通りである。以下の説明では、主に、図10及び図11のステップS301からステップS307の処理、図10及び図11の処理の順序と図7及び図8の順序で異なる部分について説明する。
【0052】
リザベーションステーション20は、上述のように、レジスタファイル1−1から送られてくるデータ及び命令を格納し、その命令実行に必要なデータを記憶するためのエントリを作成して記憶している。リザベーションステーション20は、このようなエントリをひとつ又は複数内部に記憶する。
【0053】
命令発行処理が開始されると、リザベーションステーション20の全てのエントリに対して、ステップS201からステップS209の繰り返しループ処理を行う。繰り返しループ処理では、まず、リザベーションステーション20は、各エントリについて、エントリが有効か無効か、(例えば、命令が記憶されているか否か)を判断する(S301)。リザベーションステーション20は、例えば、各エントリのビジービットにより、エントリが有効か無効かを判断する。ステップS301でエントリが無効の場合、ステップS209に移る。一方、エントリが有効である場合、リザベーションステーション20は、そのエントリのカウンタ値を1つ増やす(S303)。カウンタは、例えば、命令がエントリに入れられた時にリセットされ、以後命令発行の処理クロック毎にカウントアップされる。
【0054】
つぎに、上述のように、リザベーションステーション20は、各エントリのスレッドIDから優先度情報を更新する(S208)。そして、上述のように、リザベーションステーション20は、各エントリが示す命令を実行するために必要なオペランドが全てそろっているか否か判断し(S203)、命令の実行に必要な全てのオペランドがそろっている場合、ステップS209に移り、ステップS201から繰り返しループ処理を実行する。一方、必要なオペランドがそろっていない場合(S203)、リザベーションステーション20は、コモンデータバス12を監視して必要なデータが来れば(S205)、それをエントリのデータにオペランドとして取り込み該当する有効ビットをセットする(S207)。一方、必要なデータが来なければ(S205)、ステップS209に移り、ステップS201から繰り返しループ処理を実行する。
【0055】
つぎに、図11を用いて、ステップS211からステップS307の処理について説明する。
ステップS211では、上述のように、リザベーションステーション20は、命令実行に必要な全てのオペランドがそろったエントリがあるか否か判断する(S211)。全てのオペランドがそろったエントリが無い場合は、命令発行を終了する。一方、全てのオペランドがそろったエントリがある場合は、リザベーションステーション20は、そのようなエントリがひとつか複数か判断する(S213)。
【0056】
リザベーションステーション20は、全てのオペランドがそろったエントリが1つの場合、該当エントリの命令及びオペランドを演算器4に送る(S215)。一方、複数のエントリが全てのオペランドがそろい演算可能である場合、リザベーションステーション20は、命令の実行可能な各エントリの優先度情報を比較して、より高い優先度を持つエントリを選択する(S305)。さらに、リザベーションステーション20は、最も高い優先度のエントリが複数ある場合は、その中で最もカウンタ値の大きいエントリの命令を演算器4に送る(S305)。なお、複数のエントリが演算可能だった場合、リザベーションステーション20は、例えば、上位bitに優先度情報、下位bitにカウンタの連結値を用いて比較し、より数値の大きい命令を選択するようにしてもよい。選択されなかったエントリは、次の命令発行の処理クロック以降まで発行を待たされる。ステップS215又はS305の処理を終了すると、リザベーションステーション20は、演算器4に命令を送ったエントリのカウンタ値をクリアし、ビジービットを変更してエントリを無効とする(S307)。なお、ステップS208の処理をステップS207の後に実行してもよい。
これにより優先度の高い命令が選択され、優先度が等しい場合はより古い命令が選択される。
【0057】
4.その他
本発明の命令発行方法又は命令発行装置・システムは、その各手順をコンピュータに実行させるための命令発行プログラム、命令発行プログラムを記録したコンピュータ読み取り可能な記録媒体、命令発行プログラムを含みコンピュータの内部メモリにロード可能なプログラム製品、そのプログラムを含むサーバ等のコンピュータ、等により提供されることもできる。
【0058】
【発明の効果】
本発明によれば、マルチスレッドプロセッサにおいて実時間処理を、
(1)命令の優先度による追い越し、及び/又は、
(2)クロック毎の優先度の付け替え、
という手法を用いて実現することにより、他のスレッドに影響されることなく、スレッドの実時間処理の実行を可能とすることができる。
【図面の簡単な説明】
【図1】本実施の形態に関連するアウトオブオーダ実行を行うマルチスレッドプロセッサの構成図。
【図2】リザベーションステーション10のエントリのフォーマット。
【図3】リザベーションステーション10における演算器4への命令発行のフローチャート(1)。
【図4】リザベーションステーション10における演算器4への命令発行のフローチャート(2)。
【図5】優先度を用いたアウトオブオーダ実行を行うマルチスレッドプロセッサの構成図。
【図6】リザベーションステーション20のエントリのフォーマット。
【図7】優先度を用いた、リザベーションステーション20における演算器4への命令発行のフローチャート(1)。
【図8】優先度を用いた、リザベーションステーション20における演算器4への命令発行のフローチャート(2)。
【図9】リザベーションステーション20のカウンタ(counter)を付加したエントリのフォーマット。
【図10】カウンタを用いた、リザベーションステーション20における演算器4への命令発行のフローチャート(1)。
【図11】カウンタを用いた、リザベーションステーション20における演算器4への命令発行のフローチャート(2)。
【符号の説明】
1 レジスタ群
1−1 レジスタファイル
1−2 リネームレジスタ
2 命令フェッチユニット
3 命令キャッシュ
4 演算器
5 メモリアクセスユニット
6 データキャッシュ
7 バスインターフェースユニット
8 リオーダバッファ
9 命令デコードユニット
10 リザベーションステーション
11 演算バス
12 コモンデータバス
20 リザベーションステーション
21 スレッド制御ユニット
101、102 CPU
200 メモリ
300 I/O
400 バス
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an instruction issuing method and apparatus, a central processing unit, an instruction issuing program, and a computer-readable storage medium storing the instruction issuing program, and in particular, to various kinds of distributed real-time control of various robots, automobiles, plants, home automation, and the like. TECHNICAL FIELD The present invention relates to an instruction issuing method and apparatus, a central processing unit, an instruction issuing program, and a computer-readable storage medium that stores the instruction issuing method and apparatus, which support real-time processing necessary for realizing the processing by hardware.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, as a technique using a multi-thread processor, Patent Literature 1 discloses a technique that independently processes a plurality of instruction flows and flexibly controls processing performance in units of instruction flows. In this multi-thread processor, the priority in each instruction flow is controlled by the instructions in the instruction flow, and when a plurality of instruction issuance requests are output to one functional unit at the same time, the instructions to be issued to the functional unit are given priority. , The processing performance required for each instruction flow is dynamically realized. Note that a thread generally refers to a processing unit or a minimum unit obtained by dividing a process or a task in order to process a certain process or task in parallel. At this time, one process or one task may become one thread without dividing the process or the task.
[Patent Document 1]
JP-A-10-124316
[0003]
[Problems to be solved by the invention]
In a reservation station of a conventional multithread processor, processing is performed irrespective of which thread the instruction belongs to. Therefore, when a plurality of threads are executed simultaneously, the execution time of a certain thread is affected by the execution of another thread, and it becomes difficult to predict the execution time. Therefore, this point is a problem in a system that is strict in time constraints such as real-time processing.
[0004]
In view of the above, the present invention provides real-time processing in a multi-thread processor,
(1) Overtaking by instruction priority and / or
(2) Priority change for each clock,
It is an object of the present invention to enable a thread to execute real-time processing without being affected by other threads.
[0005]
[Means for Solving the Problems]
In the present invention, in particular,
1. Prioritize the instructions to be executed so that higher priority instructions overtake lower priority instructions at the reservation station; and / or
2. Changing the priority of instructions for each clock,
This realizes that a thread performs real-time processing without being affected by another thread.
[0006]
According to a first solution of the present invention,
An instruction issuing device in a multi-thread processor in which a central processing unit executes instructions of a plurality of threads,
A thread control unit for setting a priority for each thread;
A register file storing instructions and operands of a thread to be executed in arithmetic processing and / or memory access processing;
Corresponding to the thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used for executing the instruction is stored, data is received from the register file, and the instruction and the operand are stored. A reservation station to issue,
An operation unit that receives an instruction and an operand issued from the reservation station, performs various operations according to the instruction, and writes an operation result back to the register file;
With
The reservation station,
Means for monitoring an output from the arithmetic unit and, when necessary data which is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand;
Means for obtaining priority information corresponding to the thread ID from the thread control unit;
Means for sending an instruction of a thread having a high priority according to the priority information to the arithmetic unit, wherein the instruction has all the operands necessary for the execution of the instruction.
The instruction issuing device, wherein the instruction issued from the reservation station to the arithmetic unit is such that the instruction of the thread with the higher priority overtakes the instruction with the lower priority.
[0007]
According to a second solution of the present invention,
An instruction issuing device as described above,
An instruction cache and a data cache for respectively caching instructions and data;
An instruction fetch unit that fetches and decodes instructions from the instruction cache and accesses the register file based on the decoded instructions;
An interface unit for inputting and outputting data to and from an external storage device and / or an input / output device;
A central processing unit having the following is provided.
[0008]
According to a third solution of the present invention,
A register file storing, in correspondence with a thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used for executing the instruction, and storing an operand of a thread to be executed A reservation station for receiving data from the reservation station and issuing instructions and operands; and an operation unit for receiving the instructions and operands issued from the reservation station, performing various operations in accordance with the instructions, and writing the operation results back to the register file. An instruction issuing method using an instruction issuing device in a multi-thread processor, comprising:
The reservation station monitors an output from the arithmetic unit, and when necessary data that is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand. ,
The reservation station obtaining priority information corresponding to a thread ID from a thread control unit for setting a priority corresponding to each thread;
The reservation station sends an instruction of a thread having a high priority according to priority information to the arithmetic unit, the instruction including all operands necessary for executing the instruction;
And the instruction issuance method from the reservation station to the arithmetic unit is provided such that an instruction of a thread with a higher priority overtakes an instruction with a lower priority. Furthermore, there is provided an instruction issuing program for causing a computer to execute each step described in the third solving means, and a computer-readable storage medium storing the instruction issuing program.
[0009]
BEST MODE FOR CARRYING OUT THE INVENTION
1. Related technology
As an example, the present embodiment is used on a central processing unit (CPU) of a multi-thread processor such as a responsive multi-threaded processor (Responsive Multi-Threaded (RMT) Processor). Therefore, first, a multi-thread processor having a CPU according to the present embodiment will be described.
[0010]
FIG. 1 shows a configuration diagram of a multi-thread processor that performs out-of-order execution related to the present embodiment. Here, out-of-order execution refers to performing instruction operations in an order different from the order described in the program. Therefore, in the out-of-order execution, as described below, using the reorder buffer and the reservation station, the executable instructions are sequentially sent to the arithmetic unit, and the order is restored in the reorder buffer.
[0011]
This processor has a CPU 101, a memory 200, an I / O 300, and a bus 400. The CPU 101 is connected to the memory 200, the I / O 300, and the like via the bus 400. The CPU 101 includes a register group 1, an instruction fetch unit 2, an instruction cache 3, an arithmetic unit 4, a memory access unit 5, a data cache 6, a bus interface unit 7, a reorder buffer 8, an instruction decode unit 9, a reservation station 10, and an arithmetic bus 11. , A common data bus 12. The register group 1 has a register file 1-1 and a rename register 1-2.
[0012]
As the instruction cache 3 and the data cache 6, for example, elements such as an SRAM and a flip-flop (FF) are used, and although the processing speed of access, reading, writing, and the like is high, the storage capacity is small. On the other hand, as the memory 200 outside the CPU 101, an element such as an SDRAM or a DRAM is used, and the processing speed of access, reading, writing, and the like is slower than that of the cache, but the storage capacity is large.
[0013]
The instruction fetch unit 2 outputs an address (Address) to the instruction cache 3, fetches an instruction (instruction) from the instruction cache 3, and sends the fetched instruction to the instruction decode unit 9. The instruction decode unit 9 decodes the instruction fetched by the instruction fetch unit 2 and reads data necessary for the operation from the register file 1-1 of the register group 1 based on the decoded instruction.
[0014]
The register file 1-1 of the register group 1 includes various registers such as a general-purpose register (GPR), a floating-point register (FPR), a program counter (PC), and a status register (SR). The register file 1-1 stores operands or data required for the currently executed instruction. In the case of a multi-thread processor, a plurality of register files 1-1 exist in parallel. The rename register 1-2 of the register group 1 changes the operand name to resolve the dependency of the operand. The rename register 1-2 outputs the renamed register ID instead of the data when the necessary operand is still being calculated and the result is not obtained. The operand or data output from the register file 1-1 or the rename register 1-2 is sent to the reservation station 10 via the operation bus 11 together with the decoded instruction.
[0015]
The operation bus 11 connects the register file 1-1 or the rename register 1-2 of the register group 1, the reorder buffer 8, and the reservation station 10 in parallel.
[0016]
The reservation station 10 stores, from the register file 1-1 and / or the rename register 1-2, operands or data that are read from the register group 1 according to the decoded instruction and that are necessary for the operation. The reservation station 10 monitors the output from each of the arithmetic units 4 and the memory access unit 5 via the common data bus 12, and obtains necessary data from the arithmetic unit 4 for operands that have not been resolved in the register file 1-1. When output, capture the result as an operand. The reservation station 10 sends to the arithmetic unit 4 or the memory access unit 5 connected in order from an instruction having all the operands. In the case of a memory access instruction such as a load (Load) or a store (Store), the instruction and the operand are stored in the reservation station 10 connected to the memory access unit 5.
[0017]
The arithmetic unit 4 uses necessary data and instructions from the instruction cache 3, the data cache 6, or the memory 200 via the reservation station 10 or the register group 1 according to the principle of locality. The arithmetic unit 4 executes an operation according to the instruction received from the reservation station 10 and outputs the calculated result to the common data bus 12.
[0018]
Further, the memory access unit 5 accesses the data cache 6 to execute load or store, and outputs the data to the common data bus 12. In the case of a store instruction, the memory access unit 5 sends an address and data to the data cache 6, and stores the data in the data cache 6. In the case of a load instruction, the memory access unit 5 sends an address to the data cache 6 and reads data from the data cache 6. The read data is written back to the register file 1-1 via the common data bus 12. At this time, if there is no data to be sought in the data cache 6, it is read from the memory 200 via the bus interface unit 7. The bus interface unit 7 is a unit that connects the instruction cache 3 and the data cache 6 to the memory 200 and the I / O 300 outside the CPU via the bus 400 and inputs and outputs data between the inside and the outside of the CPU.
[0019]
The common data bus 12 transfers the operation result of the operation unit 4 and the execution result of loading or storing of the memory access unit 5 to the register file 1-1 or the rename register 1-2, the reorder buffer 8, and the reservation station 10.
[0020]
The reorder buffer 8 restores the order of the instructions executed out-of-order by the operation units 4 to the original order, and then writes the operation result to the actual register file 1-1.
[0021]
FIG. 2 shows a format of the entry of the reservation station 10. The entry of the reservation station 10 includes a busy bit, an operation, a set of one or more valid bits and data, (valid0 and data0, valid1 and data1,...).
[0022]
The "busy bit" indicates whether the entry is valid or invalid, that is, whether or not the entry has an instruction. The "instruction" is an instruction to be operated by the arithmetic unit 4 or executed by the memory access unit 5. Here are the instructions for “Data” indicates an operand necessary for executing the instruction, and “valid bit” indicates whether or not the value is valid for the corresponding operand used in the operation. The reservation station 10 can set the number of pairs of valid bits and data according to the instruction. The reservation station 10 can use the valid bit to determine that all the operands have been prepared.
[0023]
3 and 4 show flowcharts (1) and (2) of processing for issuing an instruction to the arithmetic unit 4 in the reservation station 10. FIG. 3 shows steps from step S101 to step S109, and FIG. 4 shows steps from step S111 to step S117. In the instruction issuing process, after processing the steps from step S101 to step S109, the steps from step S111 to step S117 are processed.
[0024]
The reservation station 10 receives the data read from the register file 1-1, and creates and stores an entry for storing data necessary for executing the instruction. The reservation station 10 stores one or a plurality of such entries inside.
[0025]
When the instruction issuance process is started, a repetitive loop process from step S101 to step S109 is performed for all entries of the reservation station 10. In the repetitive loop processing, first, the reservation station 10 determines whether or not all the operands necessary for executing the instruction indicated by the entry are provided for each entry (S103). The reservation station 10 may determine the required number of operands according to the instruction, or may determine the required number or area for each instruction in advance in the entry. The reservation station 10 determines, for example, whether all the valid bits of each entry are valid. In step S103, if all the data necessary for the execution of the instruction has been obtained as operands, for example, if all the valid bits for all the operands necessary for the execution of the corresponding instruction have been set, the process proceeds to step S109. On the other hand, if the necessary operands are not available, for example, if all the valid bits have not been set (S103), the reservation station 10 has not obtained the necessary data yet, and proceeds to step S105. In this case, the reservation station 10 monitors the operation result flowing from the common data bus 12, and when necessary data comes (S105), fetches it as an operand in the entry data and sets the corresponding valid bit (S105). S107). On the other hand, if the necessary data does not come (S105), the process proceeds to step S109.
[0026]
After repeating the processing from step S101 to step S109 for all entries of the reservation station 10, the process proceeds to step S111 to continue the processing.
[0027]
Next, the processing from step S111 to step S117 will be described with reference to FIG.
In step S111, the reservation station 10 determines whether or not there is an entry having all the operands necessary for executing the instruction (S111). For example, as described above, the reservation station 10 can determine that all valid bits are valid. If there is no entry with all the operands, the instruction issuance ends. On the other hand, when there is an entry having all the operands, the reservation station 10 determines whether there is one or more such entries (S113). For example, when all the valid bits are set, all the operands necessary for executing the instruction are complete.
[0028]
If there is one entry with all the operands, the reservation station 10 sends the instruction and operand of the entry to the arithmetic unit 4 (S115). On the other hand, when all of the plurality of entries can be calculated, the reservation station 10 sends the oldest entry to the computing unit 4 (S117). The entry which is not selected is kept from issuing until the processing clock for issuing the next instruction.
[0029]
2. CPU with instruction issuing device of multiple threads according to priority
In the above-mentioned “1. Related Art”, the operation of the reservation station 10 mainly includes a case where operands are aligned and an instruction that can be operated is sent to the arithmetic unit 4 so that a plurality of instructions can be operated simultaneously. Described running from the oldest instruction. In the following, description will be given of instruction issuance for executing instructions of a thread with the highest priority first when a plurality of instructions can be operated simultaneously.
[0030]
FIG. 5 shows a configuration diagram of a multi-thread processor that performs out-of-order execution using priority.
This processor has a CPU 102, a memory 200, an I / O 300, and a bus 400. The CPU 102 is connected to the memory 200, the I / O 300, and the like via the bus 400. The CPU 102 includes a register group 1, an instruction fetch unit 2, an instruction cache 3, an arithmetic unit 4, a memory access unit 5, a data cache 6, a bus interface unit 7, a reorder buffer 8, an instruction decode unit 9, an arithmetic bus 11, and a common data bus. 12, a reservation station 20, and a thread control unit 21. The register group 1 includes a register file 1-1 and a rename register 1-2.
[0031]
The instruction fetch unit 2 outputs an address (Address) to the instruction cache 3, fetches an instruction (instruction) from the instruction cache 3, and decodes the instruction with the instruction decode unit 9.
[0032]
The thread control unit 21 sets the priority of each thread. In addition, the thread control unit 21 sends the set priority to all the reservation stations 20. The thread control unit 21 holds a predetermined number of data for identifying the priority of each thread. For this purpose, the thread control unit 21 can include, for example, a memory that stores priority information corresponding to each thread. In addition, the thread control unit 21 can perform execution and stop of a thread, control of replacement with a context cache that caches a context, and the like. Here, the context is information for execution of each thread stored in a storage unit (eg, register file 1-1) such as a general-purpose register, a floating-point register, a program counter, and a status register, or the current execution. Refers to the inside state.
[0033]
As described above, the reservation station 20 stores the operands or data necessary for the operation, read from the register file 1-1 and / or the rename register 1-2 according to the decoded instruction.
[0034]
The reservation station 20 monitors the output from each of the arithmetic units 4 and the memory access unit 5 via the common data bus 12, and obtains necessary data from the arithmetic unit 4 for operands that have not been resolved in the register file 1-1. When output, capture the result as an operand. Further, the reservation station 20 receives the priority information set from the thread control unit 21 or accesses the thread control unit 21 to obtain the priority information of a predetermined thread. The reservation station 20 may store a table storing priority information for each thread in an internal register. The reservation station 20 sends to the arithmetic unit 4 or the memory access unit 5 connected in order from the instruction having the highest priority among instructions having all operands. In the case of a memory access instruction such as load or store, the instruction and the operand are sent to the reservation station 20 connected to the memory access unit 5.
[0035]
As described above, the configuration and operation of each of the other units are the same as the configuration and operation of each unit of the CPU 101 shown in FIG.
[0036]
FIG. 6 shows a format of the entry of the reservation station 20. In this entry, instruction priority information (priority) is added to the entry of the reservation station 10.
[0037]
The entries of the reservation station 20 include a busy bit, a thread ID (thread ID), priority information (priority), an instruction (operation), a set of one or more valid bits and data, (valid0 and data0, valid1). , And data1,...).
[0038]
The busy bit, instruction, valid bit, and data are the same as those described in FIG. “Thread ID” indicates which thread the instruction of the entry belongs to. By omitting the thread ID and using a table storing information for identifying each entry for each thread ID, the reservation station 20 can also appropriately grasp each thread ID. The "priority information" indicates the priority of an instruction, and indicates whether the thread control unit 21 has received an instruction in the reservation station 20, obtained an operand, every processing clock, and / or when all operands have been prepared. Set from. The reservation station 20 checks the value of the priority for each thread and changes the priority information based on the settings of the register and the thread control unit 21 specified separately for each thread. In the present embodiment, the thread control unit 21 prepares, for example, an 8-bit register for each thread, and specifies the priority information as a value of 256 levels. For example, this value can be set such that the higher (larger) the higher the priority is, and the lower (small) the lower the priority.
[0039]
FIGS. 7 and 8 show flowcharts (1) and (2) of processing for issuing an instruction to the arithmetic unit 4 in the reservation station 20 using the priority. FIG. 7 shows steps from step S201 to step S209, and FIG. 8 shows steps from step S211 to step S217. In the instruction issuing process, after processing the steps from step S201 to step S209, the steps from step S211 to step S217 are processed.
[0040]
The reservation station 20 stores data and instructions sent from the register file 1-1, and creates and stores entries for storing data necessary for executing the instructions. The reservation station 20 stores one or more such entries internally.
[0041]
When the instruction issuance process is started, a repetitive loop process from step S201 to step S209 is performed on all entries of the reservation station 20. In the repetitive loop processing, first, the reservation station 20 determines whether or not all the operands necessary for executing the instruction indicated by the entry are provided for each entry (S203). The reservation station 20 may determine the required number of operands according to the instruction, or may determine the required number or area for each instruction in advance in the entry. The reservation station 20 determines, for example, whether all the valid bits of each entry are valid. If all the operands necessary for the execution of the instruction are available in step S203, for example, if all the valid bits for all the operands necessary for the execution of the corresponding instruction are set, the process proceeds to step S208. On the other hand, if the necessary operands are not available, for example, if all the valid bits are not set (S203), the reservation station 20 has not yet obtained the data necessary for executing the instruction of the entry. , And the process proceeds to step S205. Here, the reservation station 20 monitors the common data bus 12 and, when necessary data comes (S205), takes it as an operand in an entry and sets a corresponding valid bit (S207). On the other hand, if the necessary data does not come (S205), the process proceeds to step S208.
[0042]
Next, the reservation station 20 updates the priority information from the thread ID of each entry (S208). For example, since the reservation station 20 has a field indicating which thread belongs to each entry, that is, a thread ID, the reservation station 20 can determine which thread the entry belongs to by referring to the field. Further, in the thread control unit 21, priority information is specified for each thread ID by a memory or the like. Therefore, the reservation station 20 obtains the set priority by accessing the memory of the thread control unit 21 or the like. The priority information of the corresponding entry can be updated. Conversely, the thread control unit 21 may obtain the thread ID of the entry of each reservation station 20 and give priority information corresponding to the thread ID, so that the reservation station 20 can obtain the priority information. . The reservation station 20 obtains the data of the priority from the thread control unit 21 at an appropriate timing, stores the priority information in the internal memory corresponding to the thread ID, and refers to the priority information. Thus, the priority information may be obtained according to the thread ID.
[0043]
The reservation station 20 repeats the processing from step S201 to step S209 for all entries, and then proceeds to step S211.
[0044]
Next, the processing from step S211 to step S217 will be described with reference to FIG.
In step S211, the reservation station 20 determines whether there is an entry in which all the operands necessary for executing the instruction are present (S211). For example, as described above, the reservation station 20 can determine that all valid bits are valid. If there is no entry with all the operands, the instruction issuance ends. On the other hand, when there is an entry having all the operands, the reservation station 20 determines whether there is one or more such entries (S213). For example, as described above, when all the valid bits are set, the operands required for executing the instruction are complete.
[0045]
When there is one entry having all the operands, the reservation station 20 sends the instruction and the operand of the entry to the arithmetic unit 4 (S215). On the other hand, if the plurality of entries can be operated with all operands being the same, the reservation station 20 compares the priority information of each entry in which the instruction can be executed, and selects an entry having a higher priority (S217). ). Here, if there are a plurality of entries having the same or substantially equal priorities, the reservation station 20 selects an older entry or an entry in a predetermined order to select the arithmetic unit 4. Send to It should be noted that the entry which is not selected is issued until the processing clock of the next instruction issuance.
[0046]
In this way, the reservation station 20 can preferentially send an entry having a higher priority value to the arithmetic unit 4, whereby an instruction having a higher priority is operated first. Note that the process of step S208 may be performed before step S203.
[0047]
3. Multi-thread instruction issuing device and CPU using priority and counter
In this embodiment, an instruction issuance for issuing an instruction to be executed first based on a priority and a counter will be described. The configuration and operation of the instruction issuing device and the CPU of this embodiment are as shown in FIG. 5 and the description thereof, and the entries used in the reservation station 20 are different.
[0048]
FIG. 9 shows a format of an entry to which a counter of the reservation station 20 is added.
[0049]
The entry includes a busy bit, a thread ID (thread ID), priority information (priority), an instruction (operation), a set of one or more valid bits and data, (valid0 and data0, valid1 and data1, ..) And a counter. The busy bit, thread ID, priority information, instruction, valid bit, and data are the same as those described in FIG. 2 or FIG.
The counter is, for example, a counter value that is reset when an instruction is entered into an entry by the reservation station 20, and is counted up every processing clock for issuing an instruction.
[0050]
FIGS. 10 and 11 show flowcharts (1) and (2) of issuing an instruction to the arithmetic unit 4 in the reservation station 20 using a counter. FIG. 10 shows steps from step S201 to step S209, and FIG. 11 shows steps from step S211 to step S307. In the instruction issuing process, after processing the steps from step S201 to step S209, the steps from step S211 to step S307 are processed.
[0051]
In the flowcharts of FIGS. 10 and 11, the processes in the steps having the same step numbers as those of the flowcharts of FIGS. 7 and 8 are as described above. In the following description, mainly the parts different from the processing of steps S301 to S307 of FIGS. 10 and 11 and the order of the processing of FIGS. 10 and 11 and the order of FIGS. 7 and 8 will be described.
[0052]
As described above, the reservation station 20 stores data and instructions sent from the register file 1-1, and creates and stores entries for storing data necessary for executing the instructions. The reservation station 20 stores one or more such entries internally.
[0053]
When the instruction issuance process is started, a repetitive loop process from step S201 to step S209 is performed on all entries of the reservation station 20. In the repetitive loop processing, first, the reservation station 20 determines, for each entry, whether the entry is valid or invalid (for example, whether or not an instruction is stored) (S301). The reservation station 20 determines whether the entry is valid or invalid based on, for example, a busy bit of each entry. If the entry is invalid in step S301, the process proceeds to step S209. On the other hand, if the entry is valid, the reservation station 20 increases the counter value of the entry by one (S303). The counter is reset, for example, when an instruction is entered into an entry, and thereafter, is incremented every processing clock for issuing the instruction.
[0054]
Next, as described above, the reservation station 20 updates the priority information from the thread ID of each entry (S208). Then, as described above, the reservation station 20 determines whether all the operands necessary to execute the instruction indicated by each entry are available (S203), and all the operands necessary to execute the instruction are available. If there is, the process proceeds to step S209, and a loop process is repeatedly executed from step S201. On the other hand, if the necessary operands are not available (S203), the reservation station 20 monitors the common data bus 12 and, when necessary data comes (S205), fetches the data as an operand into the data of the entry and reads the corresponding valid bit. Is set (S207). On the other hand, if the necessary data does not come (S205), the process proceeds to step S209, and the loop processing is repeatedly executed from step S201.
[0055]
Next, the processing from step S211 to step S307 will be described with reference to FIG.
In step S211, as described above, the reservation station 20 determines whether there is an entry having all the operands necessary for executing the instruction (S211). If there is no entry with all the operands, the instruction issuance ends. On the other hand, when there is an entry having all the operands, the reservation station 20 determines whether there is one or more such entries (S213).
[0056]
When there is one entry having all the operands, the reservation station 20 sends the instruction and the operand of the entry to the arithmetic unit 4 (S215). On the other hand, when the plurality of entries can be operated with all the operands being the same, the reservation station 20 compares the priority information of each entry in which the instruction can be executed, and selects an entry having a higher priority (S305). ). Further, when there are a plurality of entries having the highest priority, the reservation station 20 sends the instruction of the entry having the largest counter value to the arithmetic unit 4 (S305). In the case where a plurality of entries can be calculated, the reservation station 20 compares, for example, the priority information for the high-order bit and the concatenated value of the counter for the low-order bit, and selects an instruction having a larger numerical value. Is also good. The entry that is not selected is issued until the processing clock for issuing the next instruction. When the processing in step S215 or S305 is completed, the reservation station 20 clears the counter value of the entry that sent the instruction to the arithmetic unit 4, changes the busy bit, and invalidates the entry (S307). Note that the process of step S208 may be performed after step S207.
As a result, an instruction with a higher priority is selected, and if the priorities are equal, an older instruction is selected.
[0057]
4. Other
An instruction issuing method or an instruction issuing apparatus / system of the present invention includes an instruction issuing program for causing a computer to execute each procedure, a computer-readable recording medium on which the instruction issuing program is recorded, and an internal memory of the computer including the instruction issuing program. The program can be provided by a program product that can be loaded into a computer, a computer such as a server including the program, or the like.
[0058]
【The invention's effect】
According to the present invention, real-time processing is performed in a multi-thread processor,
(1) Overtaking by instruction priority and / or
(2) Priority change for each clock,
By using such a technique, execution of a real-time process of a thread can be performed without being affected by another thread.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a multi-thread processor that performs out-of-order execution related to the present embodiment.
FIG. 2 is a format of a reservation station 10 entry.
FIG. 3 is a flowchart (1) of issuing an instruction to a computing unit 4 in the reservation station 10.
FIG. 4 is a flowchart (2) of issuing an instruction to a computing unit 4 in the reservation station 10.
FIG. 5 is a configuration diagram of a multi-thread processor that performs out-of-order execution using priority.
FIG. 6 shows a format of the reservation station 20 entry.
FIG. 7 is a flowchart (1) of issuing an instruction to the arithmetic unit 4 in the reservation station 20 using priority.
FIG. 8 is a flowchart (2) of issuing an instruction to the arithmetic unit 4 in the reservation station 20 using the priority.
FIG. 9 is a format of an entry to which a counter of the reservation station 20 is added.
FIG. 10 is a flowchart (1) of issuing an instruction to the arithmetic unit 4 in the reservation station 20 using a counter.
FIG. 11 is a flowchart (2) of issuing an instruction to the arithmetic unit 4 in the reservation station 20 using a counter.
[Explanation of symbols]
1 register group
1-1 Register file
1-2 Rename register
2 Instruction fetch unit
3 Instruction cache
4 arithmetic unit
5 Memory access unit
6 Data cache
7 Bus interface unit
8 Reorder buffer
9 Instruction decode unit
10 Reservation Station
11 arithmetic bus
12 Common data bus
20 reservation stations
21 Thread control unit
101, 102 CPU
200 memory
300 I / O
400 bus

Claims (13)

中央演算装置が複数のスレッドの命令を実行するマルチスレッドプロセッサにおける命令発行装置であって、
各スレッドに対応して優先度を設定するためのスレッド制御ユニットと、
演算処理及び/又はメモリアクセス処理において実行すべきスレッドの命令及びオペランドが記憶されたレジスタファイルと、
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、前記レジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと、
前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と、
を備え、
前記リザベーションステーションは、
前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込む手段と、
スレッドIDに対応した優先度情報を前記スレッド制御ユニットから求める手段と、
命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送る手段と
を有することにより、前記リザベーションステーションから前記演算器への命令発行を高い優先度のスレッドの命令が低い優先度の命令を追い越すようにした前記命令発行装置。
An instruction issuing device in a multi-thread processor in which a central processing unit executes instructions of a plurality of threads,
A thread control unit for setting a priority for each thread;
A register file storing instructions and operands of a thread to be executed in arithmetic processing and / or memory access processing;
Corresponding to the thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used for executing the instruction is stored, data is received from the register file, and the instruction and the operand are stored. A reservation station to issue,
An operation unit that receives an instruction and an operand issued from the reservation station, performs various operations according to the instruction, and writes an operation result back to the register file;
With
The reservation station,
Means for monitoring an output from the arithmetic unit and, when necessary data which is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand;
Means for obtaining priority information corresponding to the thread ID from the thread control unit;
Means for sending an instruction of a thread having a high priority according to priority information to the arithmetic unit in accordance with priority information. The instruction issuance apparatus wherein the instruction of the high-priority thread overtakes the instruction of the low-priority instruction.
前記リザベーションステーションは、デコードされた命令を基に前記レジスタファイルから読み出されたオペランドを格納し、各オペランドに対してデータが有効であることを示す有効ビットをさらに含む、エントリを作成する手段と、
前記リザベーションステーションは、該リザベーションステーションに記憶された各エントリに対して、命令実行に必要なオペランドが全てそろうまで前記演算器の演算結果から必要なデータをオペランドとして取り込み、そのデータに対応する有効ビットをセットし、各エントリに対するスレッドIDに従い前記スレッド制御ユニットを参照して優先度を得てセットすることにより、各エントリを更新する手段と、
前記リザベーションステーションは、全ての有効ビットがセットされているエントリをオペランドがそろった演算可能なエントリを判断する手段と、
前記リザベーションステーションは、オペランドがそろったエントリが複数の演算可能である場合、各エントリの優先度を比較して、より高い優先度を持つエントリを選択して、前記演算器に該エントリの命令及びオペランド送る手段と
を含む請求項1に記載の命令発行装置。
Means for creating an entry, wherein the reservation station stores operands read from the register file based on the decoded instruction, and further includes a valid bit indicating that data is valid for each operand; ,
The reservation station fetches, for each entry stored in the reservation station, necessary data as an operand from the operation result of the arithmetic unit until all the operands necessary for executing the instruction are obtained, and a valid bit corresponding to the data. Means for updating each entry by setting and obtaining and setting a priority by referring to the thread control unit according to the thread ID for each entry;
Means for determining an operable entry in which all of the valid bits are set to the operand, and
When a plurality of entries having the same operand can be operated, the reservation station compares the priorities of the entries, selects an entry having a higher priority, and sends the instruction of the entry and the instruction of the entry to the arithmetic unit. 2. The instruction issuing device according to claim 1, further comprising: an operand sending unit.
前記リザベーションステーションは、スレッドの命令の優先度を、エントリ更新又は命令発行の処理クロック毎に更新制御することを特徴とする請求項1に記載の命令発行装置。2. The instruction issuing apparatus according to claim 1, wherein the reservation station updates the priority of the instruction of the thread at each entry update or instruction issuance processing clock. 前記リザベーションステーションは、命令がエントリに入力又は作成されたときにカウンタをリセットし、以後エントリを更新する処理クロック毎に又は命令を発行する処理クロック毎に該カウンタをカウントアップする手段と、
前記リザベーションステーションは、優先度の高いエントリが複数ある場合に、カウンタに従いその値の大きいエントリを選択して、その命令及びオペランドを前記演算器に発行する手段と、
をさらに含むことを特徴とする請求項1に記載の命令発行装置。
Means for resetting a counter when an instruction is input or created in an entry, and counting up the counter for each processing clock that updates the entry or every processing clock that issues the instruction; and
Means for, when there are a plurality of high-priority entries, selecting an entry having a large value according to a counter and issuing the instruction and operand to the arithmetic unit;
The instruction issuing device according to claim 1, further comprising:
前記リザベーションステーションからの命令及びオペランドを受け取り、前記レジスタファイル又はデータキャッシュへのロード又はストアを実行するメモリアクセスユニットをさらに備えた請求項1に記載の命令発行装置。2. The instruction issuing device according to claim 1, further comprising a memory access unit that receives instructions and operands from the reservation station and executes loading or storing to the register file or the data cache. 前記リザベーションステーション及び前記演算器の組は複数設けられ、
各々の前記演算器によりアウトオブオーダに演算された命令の順番を元の順番に戻し、元の順番にもどした演算結果を前記レジスタファイルへ書き込むリオーダバッファと、
各々の前記演算器の出力を、前記リザベーションステーション及び前記レジスタファイル及び前記リオーダバッファに供給するためのコモンデータバスと
をさらに備えた請求項1に記載の命令発行装置。
A plurality of sets of the reservation station and the computing unit are provided,
A reorder buffer for returning the order of the instructions calculated out-of-order by the respective arithmetic units to the original order, and writing the operation result returned to the original order to the register file;
2. The instruction issuing device according to claim 1, further comprising: a common data bus for supplying an output of each of the arithmetic units to the reservation station, the register file, and the reorder buffer.
前記リザベーションステーション及び/又は前記スレッド制御ユニットは、スレッドIDに対応して優先度情報を記憶したメモリを含む請求項1に記載の命令発行装置。The instruction issuing device according to claim 1, wherein the reservation station and / or the thread control unit includes a memory storing priority information corresponding to a thread ID. 前記請求項1乃至7のいずれかに記載の命令発行装置と、
命令及びデータをそれぞれキャッシュする命令キャッシュ及びデータキャッシュと、
前記命令キャッシュから命令をフェッチ及びデコードし、デコードされた命令を基に前記レジスタファイルをアクセスする命令フェッチユニットと、
外部の記憶装置及び/又は入出力装置とデータの入出力を行うためのインターフェースユニットと、
を備えた中央演算装置。
An instruction issuing device according to any one of claims 1 to 7,
An instruction cache and a data cache for respectively caching instructions and data;
An instruction fetch unit that fetches and decodes instructions from the instruction cache and accesses the register file based on the decoded instructions;
An interface unit for inputting and outputting data to and from an external storage device and / or an input / output device;
Central processing unit equipped with.
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、実行すべきスレッドのオペランドが記憶されたレジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと; 前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と; を備え、マルチスレッドプロセッサにおける命令発行装置を用いた命令発行方法であって、
前記リザベーションステーションは、前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込むステップと、
前記リザベーションステーションは、スレッドIDに対応した優先度情報を、各スレッドに対応して優先度を設定するためのスレッド制御ユニットから求めるステップと、
前記リザベーションステーションは、命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送るステップと
を含むことにより、前記リザベーションステーションから前記演算器への命令発行を高い優先度のスレッドの命令が低い優先度の命令を追い越すようにした前記命令発行方法。
A register file storing, in correspondence with a thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used for executing the instruction, and storing an operand of a thread to be executed A reservation station for receiving data from the reservation station and issuing instructions and operands; and an operation unit for receiving the instructions and operands issued from the reservation station, performing various operations in accordance with the instructions, and writing the operation results back to the register file. An instruction issuing method using an instruction issuing device in a multi-thread processor, comprising:
The reservation station monitors an output from the arithmetic unit, and when necessary data that is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand. ,
The reservation station obtaining priority information corresponding to a thread ID from a thread control unit for setting a priority corresponding to each thread;
Sending the instruction of the thread having a higher priority according to the priority information to the arithmetic unit, wherein the reservation station is an instruction having all the operands necessary for executing the instruction. The instruction issuance method according to claim 1, wherein an instruction of a thread having a higher priority overtakes an instruction of a lower priority.
前記リザベーションステーションは、デコードされた命令を基に前記レジスタファイルから読み出されたデータを格納し、各オペランドに対してデータが有効であることを示す有効ビットをさらに含む、エントリを作成するステップと、
前記リザベーションステーションは、該リザベーションステーションに記憶された各エントリに対して、命令実行に必要なオペランドが全てそろうまで前記演算器の演算結果をオペランドとして取り込み、そのデータに対応する有効ビットをセットし、各エントリに対するスレッドIDに従い前記スレッド制御ユニットを参照して優先度を得てセットすることにより、各エントリを更新するステップと、
前記リザベーションステーションは、全ての有効ビットがセットされているエントリをオペランドがそろった演算可能なエントリと判断するステップと、
前記リザベーションステーションは、オペランドがそろったエントリが複数の演算可能である場合、各エントリの優先度を比較して、より高い優先度を持つエントリを選択して、前記演算器に該エントリの命令及びオペランド送るステップと
を含む請求項9に記載の命令発行方法。
Creating an entry, wherein the reservation station stores data read from the register file based on the decoded instruction, and further includes a valid bit indicating that the data is valid for each operand; ,
The reservation station, for each entry stored in the reservation station, fetches the operation result of the operation unit as an operand until all operands necessary for instruction execution are obtained, sets a valid bit corresponding to the data, Updating each entry by obtaining and setting a priority by referring to the thread control unit according to the thread ID for each entry;
The reservation station determining an entry in which all the valid bits are set as an operable entry having all operands;
When a plurality of entries having the same operand can be operated, the reservation station compares the priorities of the entries, selects an entry having a higher priority, and sends the instruction of the entry and the instruction of the entry to the arithmetic unit. The instruction issuing method according to claim 9, further comprising a step of sending an operand.
前記リザベーションステーションは、命令がエントリに入力又は作成されたときにカウンタをリセットし、以後エントリを更新する処理クロック毎に又は命令を発行する処理クロック毎に該カウンタをカウントアップするステップと、
前記リザベーションステーションは、優先度の高いエントリが複数ある場合に、カウンタに従いその値の大きいエントリを選択して、その命令及びオペランドを前記演算器に発行するステップと、
をさらに含むことを特徴とする請求項9に記載の命令発行方法。
The reservation station resetting a counter when an instruction is input or created in an entry, and counting up the counter every processing clock for updating the entry or every processing clock for issuing the instruction thereafter;
The reservation station, when there are a plurality of entries having a high priority, selecting an entry having a large value according to a counter, and issuing the instruction and the operand to the arithmetic unit;
The method according to claim 9, further comprising:
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、実行すべきスレッドの命令及びオペランドが記憶されたレジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと; 前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と; を備え、マルチスレッドプロセッサにおける命令発行装置を用い、コンピュータに次の各ステップを実行させるための命令発行プログラムであって、
前記リザベーションステーションは、前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込むステップと、
前記リザベーションステーションは、スレッドIDに対応した優先度情報を、各スレッドに対応して優先度を設定するためのスレッド制御ユニットから求めるステップと、
前記リザベーションステーションは、命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送るステップと
を、コンピュータに実行させるための命令発行プログラム。
Corresponding to the thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used to execute the instruction is stored, and the instruction and operand of the thread to be executed are stored. A reservation station for receiving data from the register file and issuing instructions and operands; and an arithmetic unit for receiving the instructions and operands issued from the reservation station, performing various operations in accordance with the instructions, and writing the operation results back to the register file. An instruction issuing program for causing a computer to execute each of the following steps using an instruction issuing device in a multi-thread processor,
The reservation station monitors an output from the arithmetic unit, and when necessary data that is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand. ,
The reservation station obtaining priority information corresponding to a thread ID from a thread control unit for setting a priority corresponding to each thread;
Sending the instruction to the arithmetic unit, which is an instruction having all the operands necessary for the execution of the instruction and having a high priority thread in accordance with priority information, to the computer. Instruction issuing program.
スレッド識別子(スレッドID)に対応して、優先度情報と、命令と、該命令の実行に用いる各オペランドを示すデータとを含むエントリを記憶し、実行すべきスレッドのオペランドが記憶されたレジスタファイルからデータを受け取り、命令及びオペランドを発行するリザベーションステーションと; 前記リザベーションステーションから発行された命令及びオペランドを受け取り、該命令に従い各種演算を行い、演算結果を前記レジスタファイルに書き戻す演算器と; を備え、マルチスレッドプロセッサにおける命令発行装置を用い、コンピュータに次の各ステップを実行させるための命令発行プログラムを記憶したコンピュータ読み取り可能な記憶媒体であって、
前記リザベーションステーションは、前記演算器からの出力を監視し、前記レジスタファイルで未解決のオペランドである必要なデータが前記演算器から演算結果として出力された場合、その演算結果をオペランドとして取り込むステップと、
前記リザベーションステーションは、スレッドIDに対応した優先度情報を、各スレッドに対応して優先度を設定するためのスレッド制御ユニットから求めるステップと、
前記リザベーションステーションは、命令実行に必要な全てのオペランドがそろった命令であって、且つ、優先度情報に従い優先度の高いスレッドの命令を前記演算器へ送るステップと
を、コンピュータに実行させるための命令発行プログラムを記憶したコンピュータ読み取り可能な記憶媒体。
A register file storing, in correspondence with a thread identifier (thread ID), an entry including priority information, an instruction, and data indicating each operand used for executing the instruction, and storing an operand of a thread to be executed A reservation station for receiving data from the reservation station and issuing instructions and operands; and an operation unit for receiving the instructions and operands issued from the reservation station, performing various operations in accordance with the instructions, and writing the operation results back to the register file. A computer-readable storage medium storing an instruction issuing program for causing a computer to execute each of the following steps using an instruction issuing device in a multi-thread processor,
The reservation station monitors an output from the arithmetic unit, and when necessary data that is an unresolved operand in the register file is output as an arithmetic result from the arithmetic unit, capturing the arithmetic result as an operand. ,
The reservation station obtaining priority information corresponding to a thread ID from a thread control unit for setting a priority corresponding to each thread;
Sending the instruction to the arithmetic unit, which is an instruction having all the operands necessary for the execution of the instruction and having a high priority thread in accordance with priority information, to the computer. A computer-readable storage medium storing an instruction issuing program.
JP2003083001A 2003-03-25 2003-03-25 Instruction issuing method and apparatus, central processing unit, instruction issuing program, and computer-readable storage medium storing the same Expired - Fee Related JP3646137B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003083001A JP3646137B2 (en) 2003-03-25 2003-03-25 Instruction issuing method and apparatus, central processing unit, instruction issuing program, and computer-readable storage medium storing the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003083001A JP3646137B2 (en) 2003-03-25 2003-03-25 Instruction issuing method and apparatus, central processing unit, instruction issuing program, and computer-readable storage medium storing the same

Publications (2)

Publication Number Publication Date
JP2004295195A true JP2004295195A (en) 2004-10-21
JP3646137B2 JP3646137B2 (en) 2005-05-11

Family

ID=33398607

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003083001A Expired - Fee Related JP3646137B2 (en) 2003-03-25 2003-03-25 Instruction issuing method and apparatus, central processing unit, instruction issuing program, and computer-readable storage medium storing the same

Country Status (1)

Country Link
JP (1) JP3646137B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003807A (en) * 2007-06-22 2009-01-08 Fujitsu Ltd Microprocessor
US8788793B2 (en) 2009-05-18 2014-07-22 Panasonic Corporation Instruction issue to plural computing units from plural stream buffers based on priority in instruction order table
CN110007966A (en) * 2019-04-10 2019-07-12 龚伟峰 A method of it reducing memory and reads random ordering
JP2019169082A (en) * 2018-03-26 2019-10-03 日本電気株式会社 Processor core, instruction control method and program
JP2021120849A (en) * 2019-04-04 2021-08-19 中科寒武紀科技股▲分▼有限公司Cambricon Technologies Corporation Limited Data processing method, apparatus, and related product
US11687339B2 (en) 2019-04-19 2023-06-27 Cambricon Technologies Corporation Limited Data processing method and apparatus, and related product

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2159688A4 (en) 2007-06-20 2011-01-05 Fujitsu Ltd Instruction execution controller and instruction execution control method
JP5316407B2 (en) * 2007-06-20 2013-10-16 富士通株式会社 Arithmetic processing device and control method of arithmetic processing device
JP5088754B2 (en) 2009-12-18 2012-12-05 インターナショナル・ビジネス・マシーンズ・コーポレーション System, method, program, and code generation apparatus

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003807A (en) * 2007-06-22 2009-01-08 Fujitsu Ltd Microprocessor
US8788793B2 (en) 2009-05-18 2014-07-22 Panasonic Corporation Instruction issue to plural computing units from plural stream buffers based on priority in instruction order table
JP2019169082A (en) * 2018-03-26 2019-10-03 日本電気株式会社 Processor core, instruction control method and program
JP7102840B2 (en) 2018-03-26 2022-07-20 日本電気株式会社 Processor core, instruction control method, program
JP2021120849A (en) * 2019-04-04 2021-08-19 中科寒武紀科技股▲分▼有限公司Cambricon Technologies Corporation Limited Data processing method, apparatus, and related product
JP7121101B2 (en) 2019-04-04 2022-08-17 中科寒武紀科技股▲分▼有限公司 Data processing method, apparatus, and related products
CN110007966A (en) * 2019-04-10 2019-07-12 龚伟峰 A method of it reducing memory and reads random ordering
US11687339B2 (en) 2019-04-19 2023-06-27 Cambricon Technologies Corporation Limited Data processing method and apparatus, and related product

Also Published As

Publication number Publication date
JP3646137B2 (en) 2005-05-11

Similar Documents

Publication Publication Date Title
US8539485B2 (en) Polling using reservation mechanism
JP5653762B2 (en) System and method for selectively committing the results of executed instructions
JP3547482B2 (en) Information processing equipment
US7302527B2 (en) Systems and methods for executing load instructions that avoid order violations
US6671827B2 (en) Journaling for parallel hardware threads in multithreaded processor
KR100304182B1 (en) A device that detects and executes traps on superscalar processors
US8291431B2 (en) Dependent instruction thread scheduling
US20120060015A1 (en) Vector Loads with Multiple Vector Elements from a Same Cache Line in a Scattered Load Operation
JP2004220070A (en) Context switching method and device, central processing unit, context switching program and computer-readable storage medium storing it
JP2008047145A (en) Dual thread processor
WO2011141337A1 (en) Hardware assist thread
JP2010527071A (en) Thread de-emphasis instructions for multi-threaded processors
US9274829B2 (en) Handling interrupt actions for inter-thread communication
US7203821B2 (en) Method and apparatus to handle window management instructions without post serialization in an out of order multi-issue processor supporting multiple strands
US6957323B2 (en) Operand file using pointers and reference counters and a method of use
JP4608099B2 (en) Job signal processing method and processing system in processing system having multiple processing units for processing job signals
JP3646137B2 (en) Instruction issuing method and apparatus, central processing unit, instruction issuing program, and computer-readable storage medium storing the same
JP5128382B2 (en) Method and apparatus for executing multiple load instructions
JP2020091751A (en) Operation processing device and method for controlling the same
US8250346B2 (en) Register renaming of a partially updated data granule
US20040128484A1 (en) Method and apparatus for transparent delayed write-back
US11829762B2 (en) Time-resource matrix for a microprocessor with time counter for statically dispatching instructions
US20230273796A1 (en) Microprocessor with time counter for statically dispatching instructions with phantom registers
US20230342153A1 (en) Microprocessor with a time counter for statically dispatching extended instructions
JP3493768B2 (en) Data processing device

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041116

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041209

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20041209

R150 Certificate of patent or registration of utility model

Ref document number: 3646137

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R154 Certificate of patent or utility model (reissue)

Free format text: JAPANESE INTERMEDIATE CODE: R154

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080218

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090218

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110218

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees