JP3659941B2 - Microprocessor and processing method thereof - Google Patents

Microprocessor and processing method thereof Download PDF

Info

Publication number
JP3659941B2
JP3659941B2 JP2002218774A JP2002218774A JP3659941B2 JP 3659941 B2 JP3659941 B2 JP 3659941B2 JP 2002218774 A JP2002218774 A JP 2002218774A JP 2002218774 A JP2002218774 A JP 2002218774A JP 3659941 B2 JP3659941 B2 JP 3659941B2
Authority
JP
Japan
Prior art keywords
register
source
cache
instruction
address
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.)
Expired - Fee Related
Application number
JP2002218774A
Other languages
Japanese (ja)
Other versions
JP2004062449A (en
Inventor
潤香 岡澤
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.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2002218774A priority Critical patent/JP3659941B2/en
Publication of JP2004062449A publication Critical patent/JP2004062449A/en
Application granted granted Critical
Publication of JP3659941B2 publication Critical patent/JP3659941B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、レジスタ・ファイル(レジスタ群)に格納されるコンテンツ(以下、レジスタ値と呼ぶ)をキャッシュするレジスタ・キャッシュを有するマイクロプロセッサおよびレジスタ・ファイルとレジスタ・キャッシュ間のレジスタ値の退避(セーブ)と復元(リストア)に関する。
【0002】
【従来の技術】
一般に、マイクロプロセッサにはレジスタ・ファイルが備えられている。レジスタ・ファイルは複数のレジスタ値を記憶する。レジスタ値の中で、マイクロプロセッサの実行ユニットでの演算に使用されるレジスタ値をソース・レジスタと呼ぶ。
【0003】
命令セットで使用されるソース・レジスタが増加すると、レジスタ・ファイルが大型化する。命令セットは、マイクロプロセッサにおいて使用される命令の集合である。レジスタ・ファイルは実行ユニットの性能要求から多ポート化が必要である。レジスタ・ファイルの大型化によるコストの増加やパフォーマンスの低下の問題が生じる。
【0004】
その問題を解決するための手段として、レジスタ・ファイルは少ポートにし、そのポートの一部を多ポートのレジスタ・キャッシュに復元するマイクロプロセッサが知られている。なお、ポートは、マイクロプロセッサのある手段で同時に読み書きできるソース・レジスタの数である。
【0005】
図5に示すように、マイクロプロセッサ50の構成は、複数のソース・レジスタ11を含む複数のレジスタ値が記憶されたレジスタ・ファイル12と、命令、および、その命令による演算で使用されるソース・レジスタ11および演算された結果となる宛先レジスタのアドレスを発行する命令制御・発行ユニット14と、命令を受け取って、命令を実行する実行ユニット16と、ソース・レジスタ11が復元されるレジスタ・キャッシュ18と、を含む。
【0006】
しかし、割り込みなどによるタスクの切り替えにより、レジスタ・キャッシュの退避/復元の作業が発生する。すなわち、レジスタ・キャッシュの内容(現在のタスクのコンテキスト)をレジスタ・ファイル12へ退避する作業が必要となる。一般的にこれら一連の作業はマイクロプロセッサ50のプログラム実行を停止して行われるため、プログラムの実行性能を低下させる。
【0007】
これらレジスタ・キャッシュ18でのソース・レジスタ11の退避/復元からプログラムの実行開始までの時間であるミス・ペナルティを低減する方法として、マイクロプロセッサ50の要求するソース・レジスタ11からレジスタ・キャッシュ18を復元する要求データ先送り(Requested data first/Critical data first)手法がある。この手法では、マイクロプロセッサ50の要求するソース・レジスタ11を最初に復元する。レジスタ・キャッシュ18に復元開始とともにマイクロプロセッサ50はプログラムを実行開始できる。
【0008】
図6に示すように、要求データ先送り手法ではマイクロプロセッサ50の要求するソース・レジスタ11から順次復元する。そのため、以下の問題が発生する。
【0009】
マイクロプロセッサ50の要求するソース・レジスタ11の順番がレジスタ・キャッシュ18への復元の順番と必ずしも一致しないため、マイクロプロセッサ50がプログラム実行開始後、再び停止する可能性がある。例えば、復元をおこないたいソース・レジスタ11が最後の方にある場合に停止する可能性があり、図6においては、命令▲2▼が必要とするソース・レジスタR0,R1の復元まで時間があり、ソース・レジスタR0,R1を復元するまで停止する。また、ソース・レジスタ11の処理結果である宛先レジスタとしてレジスタ・キャッシュ18に書き込む場合でも、図6のソース・レジスタR5,R6のように1度復元を行うため、処理に無駄が生じている。
【0010】
【発明が解決しようとする課題】
本発明の目的は、プログラムの実行性能の低下を防止するマイクロプロセッサおよびソース・レジスタの処理方法を提供することである。
【0011】
【課題を解決するための手段】
本発明のマイクロプロセッサの要旨は、複数のソース・レジスタを含む複数のレジスタ値が記憶されたレジスタ・ファイルと、命令を発行し、かつ、該命令で処理されるソース・レジスタのアドレスおよび処理された結果となる宛先レジスタのアドレスを発行するユニットと、前記命令を受け取って、命令を実行するユニットと、ソース・レジスタが復元されるレジスタ・キャッシュと、前記ソース・レジスタのアドレスを受け取り、ソース・レジスタの復元、および、前記実行するユニットへのソース・レジスタの読み出しを制御する回路と、を含む。制御する回路によって、ソース・レジスタの復元や実行するユニットへの送信を制御することによって、プログラムの実行性能を低下させることなく、命令による演算をおこなうことができる。
【0012】
本発明のソース・レジスタの処理方法は、ソース・レジスタを用いて演算をおこなうための命令を発行するステップと、前記命令で用いられるソース・レジスタのアドレスおよび命令で処理された結果となる宛先レジスタのアドレスを発行するステップと、前記アドレスのソース・レジスタをレジスタ・キャッシュへ復元するステップと、前記命令が実行されるユニットへソース・レジスタを転送するステップと、前記命令を実行するステップと、を含む。
【0013】
【発明の実施の形態】
本発明のマイクロプロセッサおよびソース・レジスタの処理方法について図面を使用して説明する。なお、本明細書および図1から図4において、符号R0,R1,R2,R3,R4,R5,R6,R7は、それぞれ符号11または宛先レジスタを示す。
【0014】
図1に示すようには、本発明のマイクロプロセッサ10は、複数のソース・レジスタ11を含むレジスタ値が記憶されたレジスタ・ファイル12と、命令を発行し、かつ、その命令による演算で使用されるソース・レジスタ11のアドレスおよび命令で処理された結果である宛先レジスタのアドレスを発行する命令制御・発行ユニット14と、命令を受け取って、命令を実行する実行ユニット16と、ソース・レジスタ11が復元されるレジスタ・キャッシュ18と、アドレスを受け取り、ソース・レジスタ11の復元、および、実行ユニット16へのソース・レジスタ11の読み出しを制御するキャッシュ復元制御回路20と、を含む。
【0015】
ソース・レジスタ11は、実行ユニット16での演算に使用されるレジスタ値である。また、レジスタ値の中に宛先レジスタも含まれる。
【0016】
レジスタ・キャッシュ18は、宛先レジスタも書き込まれる。宛先レジスタは、レジスタ・キャッシュ18に記憶後、レジスタ・キャッシュ18に復元されたソース・レジスタ11と同様に扱う。
【0017】
図2に示すように、キャッシュ復元制御回路20は、ソース・レジスタ11の復元順序を記憶するキュー22と、そのキュー22にしたがってソース・レジスタ11の復元、および実行ユニット16への読み出しを制御する手段24と、レジスタ・キャッシュ18へのソース・レジスタ11の状態を記憶するフラグ26と、を含む。なお、フラグ26が記憶するソース・レジスタ11の状態には、復元されたソース・レジスタ11と、書き込まれた後の宛先レジスタが含まれる。
【0018】
命令制御・発行ユニット14は、最大1サイクルに1命令を発行するインオーダー発行インオーダー完了のスカラープロセッサである。命令制御・発行ユニット14とキャッシュ復元制御回路20とは複数のバス21で接続されており、例えば2つのソース・レジスタ11と1つの宛先レジスタのアドレスがキャッシュ復元制御回路20に転送される。宛先レジスタは、実行ユニット16での処理結果である。
【0019】
さらに本発明は、レジスタ・キャッシュ18に復元されたソース・レジスタ11とレジスタ・ファイル12に記憶されたソース・レジスタ11とを選択する選択回路28と、レジスタ・ファイル12から選択回路28にソース・レジスタ11を送るための読み出しバス30と、読み出しバス30から途中で分岐し、レジスタ・キャッシュ18に接続された復元用バス32と、を含む。2本のバス30,32によって、選択回路28とレジスタ・キャッシュ18とに同時にソース・レジスタ11を送ることができる。
【0020】
実行ユニット16とレジスタ・キャッシュ18とは複数のソース・レジスタバス34a,34bで接続される。例えば2本のソース・レジスタバス34a,34bで接続されており、1本のソース・レジスタバス34bに選択回路28が介在する。選択回路28によって、レジスタ・ファイル12に記憶されたソース・レジスタ11かレジスタ・キャッシュ18に復元されたソース・レジスタ11を選択して、実行ユニット16に送ることができる。選択回路28は、キャッシュ復元制御回路20によって、上述の選択が制御される。また、複数のソース・レジスタバス34a,34bによって、レジスタ・キャッシュ18から実行ユニット16に同時に複数のソース・レジスタ11を送ることができる。
【0021】
宛先レジスタをレジスタ・キャッシュ18に書き込むために、実行ユニット16とレジスタ・キャッシュ18とを接続する宛先レジスタバス36を含む。
【0022】
宛先レジスタバス36は、分岐して、宛先レジスタバス36bによってレジスタ・ファイル12に接続されても良い。分岐することによって、レジスタ・キャッシュ18に実行ユニット16での処理結果である宛先レジスタを書き込むと同時に、レジスタ・ファイル12にも書き込むことができる。したがって、タスクの切り替え時に、レジスタ・キャッシュ18のソース・レジスタ11をレジスタ・ファイル12に退避させる作業が発生しない。
【0023】
レジスタ・ファイル12において、連続したレジスタ値のアドレスの内、最初のアドレスを指定するコンテキスト・ポインタ(CP)38を含む。このレジスタ値には、ソース・レジスタ11や宛先レジスタが含まれる。例えば、図においては、命令セットで規定されるレジスタ値はR0からR7の8個である。コンテキスト・ポインタ38が示した任意のアドレスがR0であり、このR0から連続した8個のレジスタ値が、レジスタ・キャッシュ18に復元されることになる。コンテキスト・ポインタ38が示す任意のアドレスは、タスクの切り替え時に変更される。
【0024】
次に、本発明のマイクロプロセッサ10を使用したソース・レジスタ11の処理方法について説明する。▲1▼タスクの切り替え後、コンテキスト・ポインタ38でレジスタ・ファイル12におけるアドレスを指定する。▲2▼命令制御・発行ユニット14が命令を発行、および/または、その命令で処理されるソース・レジスタ11のアドレスおよび命令で処理された結果である宛先レジスタのアドレスを発行する。▲3▼レジスタ・ファイル12のソース・レジスタ11をレジスタ・キャッシュ18へ復元する。▲4▼レジスタ・ファイル12のソース・レジスタ11を実行ユニット16へ転送する。▲5▼実行ユニット16が、転送されたソース・レジスタ11を用いて命令を実行する。▲6▼命令の演算結果を宛先レジスタとしてレジスタ・キャッシュ18に書き込む。なお、▲6▼の工程を行うときの宛先レジスタは、レジスタ・キャッシュ18に書き込み後、ソース・レジスタ11と同様に扱う。また、初めて▲1▼から▲6▼の工程を行うとき、キャッシュ復元制御回路20は▲3▼と▲4▼を同時に行うように制御する。▲2▼において、命令およびアドレスを同時に発行せず、アドレスのみを先に発行しても良い。
【0025】
▲2▼から▲6▼の工程は、任意の回数繰り返してもよい。▲2▼から▲6▼の工程を繰り返したとき、A.キャッシュ復元制御回路20は、▲3▼や▲6▼の工程によってレジスタ・キャッシュ18に実行ユニット16で使用されるソース・レジスタ11が存在する場合、レジスタ・キャッシュ18のソース・レジスタ11を実行ユニット16へ転送するように制御する。B.レジスタ・キャッシュ18に実行ユニット16で使用するソース・レジスタ11がない場合、キャッシュ復元制御回路20は、▲3▼および▲4▼の工程を同時に行うように制御する。キャッシュ復元制御回路20は、選択回路28、レジスタ・キャッシュ18、およびレジスタ・ファイル12を制御することによって、上記A,Bが可能となる。
【0026】
また、▲6▼の工程で、宛先レジスタをレジスタ・キャッシュ18に書き込むと同時に、その宛先レジスタをレジスタ・ファイル12に書き込んでも良い。
【0027】
さらに、▲2▼の工程で処理がストップした場合、レジスタ・キャッシュ18に復元されていないソース・レジスタ11またはソース・レジスタ11の処理結果として宛先レジスタとしてレジスタ・キャッシュ18に書き込まれていないレジスタ値を、レジスタ・キャッシュ18に復元する。
【0028】
以上の工程において、キャッシュ復元制御回路20の動作を図2で具体的に説明する。なお、図2の処理は、従来技術の図6で示した命令と同じ命令による処理である。タスク切り替えによってコンテキスト・ポインタ38の値CPがCP1からCP2に変更される。レジスタ・キャッシュ18の内容が無効になる。このとき、キャッシュ復元制御回路20のフラグ26の値も全て「0」(無効)にセットされる(状態1)。
【0029】
命令▲1▼が発行される前に、命令▲1▼のソース・レジスタR3のアドレス“3”と宛先レジスタR4のアドレス“4”が命令制御・発行ユニット14よりキャッシュ復元制御回路20に転送される(状態2)。キャッシュ復元制御回路20では、ソース・レジスタR3のアドレス“3”がキュー22に送られ、宛先レジスタR4のアドレス“4”に対応するフラグ26が「1」(有効)にセットされる。
【0030】
命令▲1▼に関して上記の操作が終了すると、命令▲1▼の発行いかんにかかわらず、命令▲2▼に対して同様の操作が行われる。図2においては、ソース・レジスタR0,R1のアドレス“0”、“1”をキュー22に送り、宛先レジスタR5のアドレス“5”に対応するフラグ26を「1」にセットする(状態3)。図2において、命令▲3▼以降も同様の操作が繰り返される(状態4以降)。
【0031】
キュー22は命令制御・発行ユニット14より転送されるソース・レジスタ11のアドレスを格納していくが、その際、対応するフラグ26を参照し、フラグ26が「1」にセットされていれば、キュー22に格納しない。
【0032】
復元を制御する手段24は、キュー22の順序に従い該当ソース・レジスタ11の復元を制御するが、該当ソース・レジスタ11が実行ユニット16の要求するものであれば、同時に実行ユニット16に転送するように制御する。
【0033】
復元が終了すれば、そのソース・レジスタ11のアドレスに対応するフラグ26を「1」にセットする。
【0034】
キュー22が空の場合、レジスタ値R0よりフラグ26を参照し、フラグ26が「0」のレジスタ値を復元し、フラグ26を「1」にセットする。
【0035】
以上の操作によって全てのフラグ26が「1」にセットされれば、レジスタ・キャッシュ26への復元操作は終了する。
【0036】
上記の実施形態によれば、例えば、図3に示すように命令▲2▼、▲3▼またはそれ以降の命令の発行、完了は、図6に示す要求データ先送り手法と比較して、不要な復元がないため、早くできる。なお、図3は図2や図6で示す命令と同じ命令による処理である。ソース・レジスタ11の復元と実行ユニット16のソース・レジスタ11の読み出しを同じサイクルにすることができ、また、宛先レジスタに対応するレジスタ値の復元を省略することが可能であるため、ソース・レジスタ11の復元を短時間で行うことができる。
【0037】
図4に本発明の他の構成を示す。このマイクロプロセッサ40は、レジスタ・キャッシュ18が複数にしている。各レジスタ・キャッシュ18をバンクとして扱うと、マイクロプロセッサ40はバンク方式で動作する。タスク切り替え時にバンクを切り替えることによって、すぐに復元作業を始めることができる。すなわち、あるレジスタ・キャッシュ18に復元されたソース・レジスタ11を退避せずに、他のレジスタ・キャッシュ18にソース・レジスタ11の復元を行う。また、復元を行っているときに過去に使用されたレジスタ・キャッシュ18に復元されたソース・レジスタ11を退避することができる。したがって、図1の構成と同様に、プログラムの実行性能を落とすことなくソース・レジスタ11の処理を行うことができる。
【0038】
以上、本発明の実施の形態について説明したが、本発明は上記の実施形態に限定されることはない。その他、本発明は、主旨を逸脱しない範囲で当業者の知識に基づき種々の改良、修正、変更を加えた態様で実施できるものである。
【0039】
【発明の効果】
本発明によれば、タスク切り替え後、レジスタ・キャッシュの復元完了を待つことなくプログラムの実行を開始できる。また、マイクロプロセッサの要求するソース・レジスタの順番に依存することなく、プログラムの連続実行が可能である。レジスタ・キャッシュ全体の復元サイクルも短縮できるため、プログラムの実行性能の向上が可能である。
【図面の簡単な説明】
【図1】本願発明のマイクロプロセッサの回路構成を示す図である。
【図2】キャッシュ復元制御回路におけるソース・レジスタの制御を示す図である。
【図3】キャッシュ・レジスタにおけるソース・レジスタの復元状態を示す図である。
【図4】マイクロプロセッサの他の実施形態を示す図であり、レジスタ・キャッシュを複数にした図である。
【図5】従来技術のマイクロプロセッサの回路構成を示す図である。
【図6】図5のマイクロプロセッサにおけるソース・レジスタの復元状態を示す図である。
【符号の説明】
10,40,50:マイクロプロセッサ
11:ソース・レジスタ
12:レジスタ・ファイル
14:命令制御・発行ユニット
16:実行ユニット
18:レジスタ・キャッシュ
20:キャッシュ復元制御回路
21:アドレスを送るバス
22:キュー
24:制御する手段
26:フラグ
28:選択回路
30:読み出しバス
32:復元用バス
34,34a,34b:ソース・レジスタバス
36,36b:宛先レジスタバス
38:コンテキスト・ポインタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microprocessor having a register cache that caches contents (hereinafter referred to as register values) stored in a register file (register group), and saving (saving) register values between the register file and the register cache. ) And restoration (restore).
[0002]
[Prior art]
Generally, a microprocessor is provided with a register file. The register file stores a plurality of register values. Among the register values, a register value used for an operation in the execution unit of the microprocessor is called a source register.
[0003]
As the source registers used in the instruction set increase, the register file becomes larger. An instruction set is a set of instructions used in a microprocessor. The register file needs to be multi-ported due to the performance requirements of the execution unit. There is a problem of cost increase and performance degradation due to the large register file.
[0004]
As a means for solving this problem, a microprocessor is known in which a register file is reduced in number of ports and a part of the port is restored to a multi-port register cache. Note that the port is the number of source registers that can be simultaneously read and written by some means of the microprocessor.
[0005]
As shown in FIG. 5, the configuration of the microprocessor 50 includes a register file 12 in which a plurality of register values including a plurality of source registers 11 are stored, an instruction, and a source An instruction control / issue unit 14 that issues the address of the register 11 and the destination register that is the result of the operation, an execution unit 16 that receives the instruction and executes the instruction, and a register cache 18 in which the source register 11 is restored And including.
[0006]
However, the task of saving / restoring the register cache occurs due to task switching due to an interrupt or the like. That is, it is necessary to save the contents of the register cache (current task context) to the register file 12. In general, these series of operations are performed after the program execution of the microprocessor 50 is stopped, so that the execution performance of the program is lowered.
[0007]
As a method of reducing a miss penalty, which is the time from saving / restoring of the source register 11 in the register cache 18 to the start of program execution, the register cache 18 from the source register 11 requested by the microprocessor 50 is changed. There is a method of requesting data first / critical data first to be restored. In this method, the source register 11 requested by the microprocessor 50 is first restored. The microprocessor 50 can start executing the program when the restoration to the register cache 18 is started.
[0008]
As shown in FIG. 6, in the request data forward method, data is sequentially restored from the source register 11 requested by the microprocessor 50. Therefore, the following problems occur.
[0009]
Since the order of the source registers 11 requested by the microprocessor 50 does not necessarily match the order of restoration to the register cache 18, the microprocessor 50 may stop again after the program execution is started. For example, there is a possibility of stopping when the source register 11 to be restored is at the end. In FIG. 6, there is a time until the restoration of the source registers R0 and R1 required by the instruction (2). , Stop until the source registers R0, R1 are restored. Further, even when writing to the register cache 18 as the destination register which is the processing result of the source register 11, since the restoration is performed once like the source registers R5 and R6 in FIG. 6, processing is wasted.
[0010]
[Problems to be solved by the invention]
An object of the present invention is to provide a microprocessor and a method for processing a source register that prevent a decrease in the execution performance of a program.
[0011]
[Means for Solving the Problems]
The gist of the microprocessor of the present invention is a register file in which a plurality of register values including a plurality of source registers are stored, an address of a source register that issues an instruction and is processed by the instruction, and processing A unit that issues an address of the destination register that results, a unit that receives the instruction and executes the instruction, a register cache from which the source register is restored, an address of the source register, And a circuit for controlling the restoration of the register and the reading of the source register to the executing unit. By controlling the restoration of the source register and the transmission to the unit to be executed by the controlling circuit, it is possible to perform an operation by an instruction without degrading the execution performance of the program.
[0012]
The source register processing method of the present invention includes a step of issuing an instruction for performing an operation using a source register, an address of a source register used in the instruction, and a destination register resulting from processing by the instruction Issuing the address of the address, restoring the source register of the address to a register cache, transferring the source register to a unit on which the instruction is executed, and executing the instruction. Including.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
The microprocessor and source register processing method of the present invention will be described with reference to the drawings. In this specification and FIGS. 1 to 4, reference numerals R0, R1, R2, R3, R4, R5, R6, and R7 indicate reference numeral 11 or a destination register, respectively.
[0014]
As shown in FIG. 1, the microprocessor 10 of the present invention is used in a register file 12 in which register values including a plurality of source registers 11 are stored, an instruction is issued, and an operation is performed by the instruction. An instruction control / issue unit 14 that issues the address of the source register 11 and the address of the destination register that is the result processed by the instruction, an execution unit 16 that receives the instruction and executes the instruction, and the source register 11 A register cache 18 to be restored and a cache restoration control circuit 20 that receives an address and controls the restoration of the source register 11 and the reading of the source register 11 to the execution unit 16.
[0015]
The source register 11 is a register value used for an operation in the execution unit 16. Also, the destination value is included in the register value.
[0016]
The register cache 18 is also written with the destination register. The destination register is handled in the same manner as the source register 11 stored in the register cache 18 and then restored in the register cache 18.
[0017]
As shown in FIG. 2, the cache restoration control circuit 20 controls a queue 22 that stores the restoration order of the source register 11, and restoration of the source register 11 and reading to the execution unit 16 according to the queue 22. Means 24 and a flag 26 for storing the state of the source register 11 to the register cache 18. The state of the source register 11 stored in the flag 26 includes the restored source register 11 and the destination register after being written.
[0018]
The instruction control / issue unit 14 is an in-order issue / in-order completion scalar processor that issues one instruction at a maximum in one cycle. The instruction control / issue unit 14 and the cache restoration control circuit 20 are connected by a plurality of buses 21. For example, the addresses of two source registers 11 and one destination register are transferred to the cache restoration control circuit 20. The destination register is a processing result in the execution unit 16.
[0019]
Furthermore, the present invention provides a selection circuit 28 for selecting the source register 11 restored in the register cache 18 and the source register 11 stored in the register file 12, and the source file from the register file 12 to the selection circuit 28. A read bus 30 for sending the register 11 and a restoration bus 32 branched from the read bus 30 and connected to the register cache 18 are included. The two registers 30 and 32 can simultaneously send the source register 11 to the selection circuit 28 and the register cache 18.
[0020]
The execution unit 16 and the register cache 18 are connected by a plurality of source register buses 34a and 34b. For example, they are connected by two source / register buses 34a and 34b, and a selection circuit 28 is interposed in one source / register bus 34b. The selection circuit 28 can select the source register 11 stored in the register file 12 or the restored source register 11 in the register cache 18 and send it to the execution unit 16. The selection of the selection circuit 28 is controlled by the cache restoration control circuit 20. Also, a plurality of source registers 11 can be sent simultaneously from the register cache 18 to the execution unit 16 via a plurality of source register buses 34a and 34b.
[0021]
In order to write destination registers to the register cache 18, a destination register bus 36 that connects the execution unit 16 and the register cache 18 is included.
[0022]
The destination register bus 36 may be branched and connected to the register file 12 by the destination register bus 36b. By branching, the destination register which is the processing result of the execution unit 16 can be written to the register cache 18 at the same time as the register file 12. Therefore, the task of saving the source register 11 of the register cache 18 to the register file 12 does not occur at the time of task switching.
[0023]
The register file 12 includes a context pointer (CP) 38 for designating the first address among consecutive register value addresses. This register value includes the source register 11 and the destination register. For example, in the figure, there are eight register values defined by the instruction set, R0 to R7. An arbitrary address indicated by the context pointer 38 is R0, and eight consecutive register values from this R0 are restored to the register cache 18. An arbitrary address indicated by the context pointer 38 is changed when the task is switched.
[0024]
Next, a processing method of the source register 11 using the microprocessor 10 of the present invention will be described. (1) After the task is switched, an address in the register file 12 is designated by the context pointer 38. (2) The instruction control / issue unit 14 issues an instruction and / or issues the address of the source register 11 processed by the instruction and the address of the destination register which is the result of processing by the instruction. (3) Restore the source register 11 of the register file 12 to the register cache 18. (4) The source register 11 of the register file 12 is transferred to the execution unit 16. (5) The execution unit 16 executes the instruction using the transferred source register 11. (6) The instruction operation result is written to the register cache 18 as a destination register. The destination register when performing step (6) is handled in the same manner as the source register 11 after writing to the register cache 18. Further, when the processes (1) to (6) are performed for the first time, the cache restoration control circuit 20 controls to perform (3) and (4) simultaneously. In {circle around (2)}, it is possible to issue only the address first without issuing the instruction and the address simultaneously.
[0025]
Steps (2) to (6) may be repeated any number of times. When the steps (2) to (6) are repeated, A. When the source register 11 used in the execution unit 16 exists in the register cache 18 by the steps (3) and (6), the cache restoration control circuit 20 uses the source register 11 of the register cache 18 as the execution unit. Control to transfer to 16. B. When there is no source register 11 used in the execution unit 16 in the register cache 18, the cache restoration control circuit 20 controls to perform the steps (3) and (4) simultaneously. The cache restoration control circuit 20 can perform the above A and B by controlling the selection circuit 28, the register cache 18, and the register file 12.
[0026]
In the step (6), the destination register may be written to the register file 12 at the same time as the destination register is written to the register cache 18.
[0027]
Further, when the processing is stopped in the step (2), the source register 11 not restored in the register cache 18 or the register value not written in the register cache 18 as the destination register as the processing result of the source register 11 Is restored to the register cache 18.
[0028]
The operation of the cache restoration control circuit 20 in the above process will be specifically described with reference to FIG. The processing in FIG. 2 is processing by the same instruction as the instruction shown in FIG. 6 of the prior art. The value CP of the context pointer 38 is changed from CP1 to CP2 by task switching. The contents of the register cache 18 become invalid. At this time, all the values of the flags 26 of the cache restoration control circuit 20 are also set to “0” (invalid) (state 1).
[0029]
Before the instruction (1) is issued, the address “3” of the source register R3 and the address “4” of the destination register R4 of the instruction (1) are transferred from the instruction control / issue unit 14 to the cache restoration control circuit 20. (State 2). In the cache restoration control circuit 20, the address “3” of the source register R3 is sent to the queue 22, and the flag 26 corresponding to the address “4” of the destination register R4 is set to “1” (valid).
[0030]
When the above operation for command (1) is completed, the same operation is performed for command (2) regardless of whether command (1) is issued. In FIG. 2, the addresses “0” and “1” of the source registers R0 and R1 are sent to the queue 22, and the flag 26 corresponding to the address “5” of the destination register R5 is set to “1” (state 3). . In FIG. 2, the same operation is repeated after the instruction (3) (state 4 and thereafter).
[0031]
The queue 22 stores the address of the source register 11 transferred from the instruction control / issue unit 14. At this time, referring to the corresponding flag 26, if the flag 26 is set to “1”, Not stored in the queue 22.
[0032]
The means 24 for controlling restoration controls restoration of the corresponding source register 11 according to the order of the queue 22. If the relevant source register 11 is requested by the execution unit 16, it is transferred to the execution unit 16 at the same time. To control.
[0033]
When the restoration is completed, the flag 26 corresponding to the address of the source register 11 is set to “1”.
[0034]
When the queue 22 is empty, the flag 26 is referred to from the register value R0, the register value with the flag 26 being “0” is restored, and the flag 26 is set to “1”.
[0035]
If all the flags 26 are set to “1” by the above operation, the restoring operation to the register cache 26 is completed.
[0036]
According to the above embodiment, for example, as shown in FIG. 3, the issue and completion of the instruction (2), (3) or the subsequent instructions are unnecessary as compared with the request data forward method shown in FIG. Because there is no restoration, it can be done quickly. Note that FIG. 3 shows processing by the same instruction as that shown in FIG. 2 or FIG. Since the restoration of the source register 11 and the reading of the source register 11 of the execution unit 16 can be performed in the same cycle, and restoration of the register value corresponding to the destination register can be omitted, the source register 11 can be restored in a short time.
[0037]
FIG. 4 shows another configuration of the present invention. This microprocessor 40 has a plurality of register caches 18. When each register cache 18 is handled as a bank, the microprocessor 40 operates in a bank manner. Restoration can be started immediately by switching banks when switching tasks. That is, the source register 11 is restored to another register cache 18 without saving the source register 11 restored to a certain register cache 18. Further, the restored source register 11 can be saved in the register cache 18 used in the past during the restoration. Therefore, similarly to the configuration of FIG. 1, the processing of the source register 11 can be performed without degrading the program execution performance.
[0038]
As mentioned above, although embodiment of this invention was described, this invention is not limited to said embodiment. In addition, the present invention can be implemented in a mode in which various improvements, modifications, and changes are made based on the knowledge of those skilled in the art without departing from the spirit of the present invention.
[0039]
【The invention's effect】
According to the present invention, after task switching, program execution can be started without waiting for completion of register cache restoration. Further, the program can be continuously executed without depending on the order of the source registers required by the microprocessor. Since the restoration cycle of the entire register cache can be shortened, the execution performance of the program can be improved.
[Brief description of the drawings]
FIG. 1 is a diagram showing a circuit configuration of a microprocessor according to the present invention.
FIG. 2 is a diagram illustrating control of a source register in a cache restoration control circuit.
FIG. 3 is a diagram illustrating a restoration state of a source register in a cash register.
FIG. 4 is a diagram showing another embodiment of the microprocessor, in which a plurality of register caches are provided.
FIG. 5 is a diagram showing a circuit configuration of a conventional microprocessor;
6 is a diagram showing a restored state of the source register in the microprocessor of FIG. 5; FIG.
[Explanation of symbols]
10, 40, 50: Microprocessor 11: Source register 12: Register file 14: Instruction control / issue unit 16: Execution unit 18: Register cache 20: Cache restoration control circuit 21: Address sending bus 22: Queue 24 : Control means 26: Flag 28: Selection circuit 30: Read bus 32: Restore buses 34, 34 a and 34 b: Source register bus 36 and 36 b: Destination register bus 38: Context pointer

Claims (14)

複数のソース・レジスタを含む複数のレジスタ値が記憶されたレジスタ・ファイルと、
命令を発行し、かつ、該命令で処理されるソース・レジスタのアドレスおよび処理された結果となる宛先レジスタのアドレスを発行するユニットと、
前記命令を受け取って、命令を実行するユニットと、
ソース・レジスタが復元されるレジスタ・キャッシュと、
前記ソース・レジスタのアドレスを受け取り、ソース・レジスタの復元、および、前記実行するユニットへのソース・レジスタの読み出しを制御する回路と
を含むマイクロプロセッサ。
A register file storing a plurality of register values including a plurality of source registers;
A unit that issues an instruction and issues an address of a source register processed by the instruction and an address of a destination register that is processed;
A unit for receiving the instruction and executing the instruction;
A register cache where the source registers are restored;
A microprocessor that receives the address of the source register, and controls the restoration of the source register and the reading of the source register to the executing unit.
前記制御する回路が、
前記ソース・レジスタの復元の順序を記憶するキューと、
前記キューにしたがってレジスタ・ファイルのソース・レジスタの復元および実行するユニットへの読み出しを制御する手段と、
前記レジスタ・キャッシュのソース・レジスタの状態を記憶するフラグと、
を含む請求項1に記載のマイクロプロセッサ。
The circuit to control is
A queue for storing the order of restoration of the source registers;
Means for controlling the restoration of the source register of the register file and reading to the executing unit according to the queue;
A flag for storing a state of a source register of the register cache;
The microprocessor of claim 1 comprising:
前記レジスタ・キャッシュのソース・レジスタとレジスタ・ファイルのソース・レジスタとを選択する回路と、
前記レジスタ・ファイルから選択する回路にソース・レジスタを送るための読み出しバスと、
前記読み出しバスから分岐し、レジスタ・キャッシュに接続される復元用バスとを含む請求項1または2に記載のマイクロプロセッサ。
A circuit for selecting a source register of the register cache and a source register of a register file;
A read bus for sending a source register to a circuit to select from the register file;
3. The microprocessor according to claim 1, further comprising a restoration bus that branches from the read bus and is connected to a register cache.
前記実行するユニットとレジスタ・キャッシュとが複数のソース・レジスタバスで接続されており、該ソース・レジスタバスの1本に前記選択する回路が介在する請求項3に記載のマイクロプロセッサ。4. The microprocessor according to claim 3, wherein the execution unit and the register cache are connected by a plurality of source register buses, and the selection circuit is interposed in one of the source register buses. 前記実行するユニットで処理されたソース・レジスタの結果である宛先レジスタをレジスタ・キャッシュに書き込むために、該実行するユニットとソース・レジスタとを接続する宛先レジスタバスを含む請求項1乃至4に記載のマイクロプロセッサ。5. A destination register bus connecting the executing unit and the source register to write a destination register resulting from the source register processed by the executing unit to a register cache. Microprocessor. 前記宛先レジスタバスが、レジスタ・キャッシュとレジスタ・ファイルに接続されるように分岐している請求項5に記載のマイクロプロセッサ。6. The microprocessor of claim 5, wherein the destination register bus branches to connect to a register cache and a register file. 前記レジスタ・ファイルにおいて、連続したソース・レジスタのアドレスの内、最初のアドレスを指定するポインタを含む請求項1乃至6に記載のマイクロプロセッサ。7. The microprocessor according to claim 1, further comprising a pointer for designating a first address among consecutive source register addresses in the register file. 前記レジスタ・キャッシュが複数である請求項1乃至7に記載のマイクロプロセッサ。The microprocessor according to claim 1, wherein the register cache is plural. レジスタ・ファイルに記憶された複数のソース・レジスタを処理する方法であって、
前記ソース・レジスタを処理するための命令を発行するステップと、
前記命令で処理されるソース・レジスタのアドレスおよび処理された結果となる宛先レジスタのアドレスを発行するステップと、
発行された前記命令で処理されるソース・レジスタのアドレスを受け取り、該アドレスのソース・レジスタをレジスタ・キャッシュへ復元するステップと、
発行された前記命令で処理されるソース・レジスタのアドレスを受け取り、命令が実行されるユニットへ該アドレスのソース・レジスタを転送するステップと、
前記命令を実行するステップと
を含む処理方法。
A method for processing a plurality of source registers stored in a register file comprising:
Issuing an instruction to process the source register;
Issuing the address of the source register processed by the instruction and the address of the destination register resulting from the processing;
Receiving an address of a source register to be processed by the issued instruction and restoring the source register at the address to a register cache;
Receiving the address of the source register processed by the issued instruction and transferring the source register at that address to the unit on which the instruction is executed;
Executing the instructions.
前記復元するステップと転送するステップは同時に実行される請求項9に記載の処理方法。The processing method according to claim 9, wherein the restoring step and the transferring step are executed simultaneously. 前記復元するステップによって復元されたソース・レジスタを前記命令が実行されるユニットへ転送するステップを含む請求項9または10に記載の処理方法。11. The processing method according to claim 9, further comprising the step of transferring the source register restored by the restoring step to a unit in which the instruction is executed. 前記実行するステップによって処理された結果をレジスタ・キャッシュに書き込むステップを含む請求項9乃至11に記載の処理方法。The processing method according to claim 9, further comprising a step of writing a result processed by the executing step into a register cache. 前記書き込むステップと同時に、前記結果をレジスタ・ファイルに書き込む請求項12に記載の処理方法。The processing method according to claim 12, wherein the result is written to a register file simultaneously with the writing step. 前記レジスタ・ファイルにおいて、連続したソース・レジスタのアドレスの内、最初のアドレスを指定するステップを含む請求項9乃至13に記載の処理方法。The processing method according to claim 9, further comprising a step of designating a first address among consecutive source register addresses in the register file.
JP2002218774A 2002-07-26 2002-07-26 Microprocessor and processing method thereof Expired - Fee Related JP3659941B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002218774A JP3659941B2 (en) 2002-07-26 2002-07-26 Microprocessor and processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002218774A JP3659941B2 (en) 2002-07-26 2002-07-26 Microprocessor and processing method thereof

Publications (2)

Publication Number Publication Date
JP2004062449A JP2004062449A (en) 2004-02-26
JP3659941B2 true JP3659941B2 (en) 2005-06-15

Family

ID=31939869

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002218774A Expired - Fee Related JP3659941B2 (en) 2002-07-26 2002-07-26 Microprocessor and processing method thereof

Country Status (1)

Country Link
JP (1) JP3659941B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7284092B2 (en) * 2004-06-24 2007-10-16 International Business Machines Corporation Digital data processing apparatus having multi-level register file
JP5181127B2 (en) * 2008-11-05 2013-04-10 亮太 塩谷 Semiconductor integrated circuit
JP5589169B2 (en) * 2012-10-03 2014-09-17 亮太 塩谷 Semiconductor integrated circuit

Also Published As

Publication number Publication date
JP2004062449A (en) 2004-02-26

Similar Documents

Publication Publication Date Title
US5553293A (en) Interprocessor interrupt processing system
JP3659941B2 (en) Microprocessor and processing method thereof
EP0902360A2 (en) Apparatus for read/write-access to registers in a central processing unit
JPH0640316B2 (en) Method of realizing data wait on arithmetic register
JP2000330791A (en) Computer system and its operating method
US6134642A (en) Direct memory access (DMA) data transfer requiring no processor DMA support
JP2568017B2 (en) Microprocessor and data processing system using the same
JPH05165641A (en) Single chip microcomputer
JP2002312302A (en) Peripheral device
JP2001184259A (en) Arithmetic processor and data transferring method in the device
JP3940701B2 (en) Disk array device and cache matching control method applied to the same
JP3456770B2 (en) Information processing device
JPH0250259A (en) Method and apparatus for handling exception of non-synchronous memory control with vector processor
JPH0656611B2 (en) Vector processor
JPS6352240A (en) Data processor
JP3168845B2 (en) Digital signal processor
JP2806690B2 (en) Microprocessor
JPH02183342A (en) Interruption controller
JP2003345515A (en) Disk controller, storage system, and method for controlling the same
JPS62125437A (en) Control method for additional processor
JP4311087B2 (en) Processor and exception handling method
JPH04302352A (en) Multi processor system
JPH0447350A (en) Main storage read/response control
JPH03182945A (en) Transfer system for data in main storage
JPS60123944A (en) Buffer memory controlling system of information processor

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041102

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20041110

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050131

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: 20050308

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050315

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20090325

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees