JP5704012B2 - Processor and control method of processor - Google Patents
Processor and control method of processor Download PDFInfo
- Publication number
- JP5704012B2 JP5704012B2 JP2011168522A JP2011168522A JP5704012B2 JP 5704012 B2 JP5704012 B2 JP 5704012B2 JP 2011168522 A JP2011168522 A JP 2011168522A JP 2011168522 A JP2011168522 A JP 2011168522A JP 5704012 B2 JP5704012 B2 JP 5704012B2
- Authority
- JP
- Japan
- Prior art keywords
- access order
- register
- bank
- processing unit
- data
- 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.)
- Active
Links
Images
Landscapes
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
- Complex Calculations (AREA)
Description
本発明は、プロセッサ、及びプロセッサの制御方法に関する。 The present invention relates to a processor and a method for controlling the processor.
ベクトルプロセッサは、データメモリからデータを読み出すロード・ストア命令や、読み出したデータに対する演算処理命令を複数のパイプラインにより並列で実行し、高速なベクトル演算を行う。複数のロード・ストア命令において、同一メモリへのアクセス競合を回避するための方法が提案されている。メモリアクセスの競合回避に関し、たとえば、特許文献1〜3に記載されている。一例では、メモリバンクへのアクセスは、バンクインターリーブ方式で制御される。バンクインターリーブ方式では、連続するアドレスを有する記憶領域を複数のバンクに分割し、連続するアドレスへのアクセスが、バンクごとに時間をずらして行われる。
The vector processor executes a load / store instruction for reading data from the data memory and an operation processing instruction for the read data in parallel by a plurality of pipelines to perform high-speed vector operations. A method for avoiding access conflict to the same memory in a plurality of load / store instructions has been proposed. For example,
しかし、バンクインターリーブ方式を採用したとしても、複数のロード・ストア命令において、同一のバンクへのアクセスが競合するバンク競合が発生する。よって、バンク競合を回避するために、競合する命令のうちいずれかの発行を遅らせる(ストールする)ことでバンク競合を回避する方法が提案されている。 However, even if the bank interleaving method is adopted, bank conflicts occur in which a plurality of load / store instructions compete for access to the same bank. Therefore, in order to avoid bank conflict, a method for avoiding bank conflict by delaying (stalling) issuance of any of the competing instructions has been proposed.
しかしながら、ストールが頻繁に生じると、処理効率が低下するので問題となる。 However, frequent stalls are problematic because processing efficiency is reduced.
そこで、本発明の目的は、複数のパイプラインを有するプロセッサであって、処理効率を低下させることなくバンク競合を回避できるプロセッサ、及びその制御方法を提供することにある。 Accordingly, an object of the present invention is to provide a processor having a plurality of pipelines, which can avoid bank conflicts without reducing processing efficiency, and a control method therefor.
上記の目的を達成するための一実施形態におけるプロセッサは、メモリの複数のバンクに第1のバンクアクセス順序でアクセスする第1の処理部と、前記第1の処理部のアクセスの開始に続いて第2のバンクアクセス順序で前記複数のバンクにアクセスを開始する第2の処理部と、前記第1の処理部及び前記第2の処理部による前記複数のバンクへのアクセスが競合する場合に、前記第2のバンクアクセス順序を前記競合が生じない第3のバンクアクセス順序に並べ替えて前記第2の処理部を前記複数のバンクにアクセスさせる制御部とを備える。 In one embodiment for achieving the above object, a processor includes: a first processing unit that accesses a plurality of banks of memory in a first bank access order; and a start of access of the first processing unit. When a second processing unit that starts accessing the plurality of banks in a second bank access order and access to the plurality of banks by the first processing unit and the second processing unit compete with each other, A control unit that rearranges the second bank access order into a third bank access order that does not cause the contention and causes the second processing unit to access the plurality of banks.
以下に説明する実施形態によれば、複数のパイプラインを有するプロセッサにおいて、処理効率を低下させることなくバンク競合を回避できる。 According to the embodiment described below, bank contention can be avoided without reducing processing efficiency in a processor having a plurality of pipelines.
以下、図面にしたがって本発明の実施の形態について説明する。但し、本発明の技術的範囲はこれらの実施の形態に限定されず、特許請求の範囲に記載された事項とその均等物まで及ぶものである。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the technical scope of the present invention is not limited to these embodiments, but extends to the matters described in the claims and equivalents thereof.
図1は、本実施形態におけるプロセッサの構成を説明するための図である。本実施形態におけるプロセッサの例として、ベクトルプロセッサ100の構成が示される。ベクトルプロセッサ100では、命令メモリ102に格納された命令に従って、ベクトルパイプライン104がデータメモリ106に格納されるデータを読み出して各種演算を行う。
FIG. 1 is a diagram for explaining a configuration of a processor in the present embodiment. As an example of the processor in the present embodiment, the configuration of the
ベクトルプロセッサ100は、命令メモリ102、ベクトルパイプライン104、データメモリ106のほかに、デコーダ108、ベクトルレジスタ110、スカラレジスタ112、バンク競合検出部113、及び制御部114を有する。ベクトルプロセッサ100は、たとえば、信号処理用LSI(Large Scale Integrated circuit)である。データメモリ106は、ベクトルプロセッサ100の外部に設けてもよい。
The
命令メモリ102は、ベクトルパイプライン104に対する各種命令を格納する。各種命令は、データメモリ106からデータをベクトルレジスタ110に読み出すロード・ストア命令や、ベクトルレジスタ110に格納されるデータに対し算術演算などを行う演算命令などである。命令メモリ102は、たとえばSRAM(Static Random Access Memory)である。
The instruction memory 102 stores various instructions for the
デコーダ108は、命令メモリ102から命令を読み出してデコードし、デコードした命令をベクトルパイプライン104に入力するとともに、ロード・ストア命令でアクセスするデータメモリ106のアドレスをスカラレジスタ112から読み出し、ベクトルパイプライン104に入力する。
The
データメモリ106は、たとえばDRAM(Dynamic Random Access Memory)などの大容量メモリである。データメモリ106は、記憶領域に連続したアドレスが割り当てられる。記憶領域は、それぞれ入出力ポートを有する複数のバンクに分割される。データメモリ106では、バンクインターリーブにより記憶領域にアクセスがなされる。
The
ベクトルパイプライン104は、それぞれロード・ストア命令や演算命令をパイプラインにより実行するスロット1040、1041、1042、及び1043を有する。スロット1040〜1043は、それぞれ、シーケンサseq0〜seq3と、演算器prc0〜prc3を有する。スロット1040〜1043では、それぞれ、シーケンサseq0〜seq3による制御のもと、演算器prc0〜prc3が命令を実行する。各スロットが実行する命令と、その実行タイミングは、各命令に応じてシーケンサseq0〜seq3により決定される。スロット1040〜1043が、本実施形態における処理部の例である。
The
ベクトルプロセッサ100は、たとえば、命令のフェッチ「IF」、命令のデコード「ID」、命令の実行「EX」、メモリアクセス「MEM」、及び実行結果のレジスタ書込み「WB」のステージにより、命令が実行される。IF、IDステージは、同一サイクルで実行される。IDステージで、デコードされた命令がスロット1040〜1043のシーケンサseq0〜seq3に入力される。また、EX〜WBの各ステージでは、ベクトルパイプライン104のスロット1040〜1043により、命令に応じた処理が実行される。EXステージでシーケンサseq0〜3から演算器prc0〜prc3に命令が転送され、演算器prc0〜prc3が各命令に応じた処理を実行する。
In the
たとえば、ロード・ストア命令の場合、IFステージで、命令メモリ102からロード・ストア命令が読み出される。そして、IDステージで、デコーダ108がロード・ストア命令をデコードして、スロット1040〜1043に入力する。各スロットは、EXステージでデータメモリ106にアクセスし、MEMステージでデータメモリ106からデータ要素を読み出し、そして、読み出したデータ要素をWBステージでベクトルレジスタ110に書き込む。また、演算命令の場合、IFステージで、命令メモリ102から演算命令が読み出され、IDステージで演算命令がデコードされてベクトルパイプライン1040〜1043に入力される。各スロットは、EXステージでベクトルレジスタ110からデータ要素を読み出して演算を実行し、WBステージで演算結果をベクトルレジスタ110に書き込む。
For example, in the case of a load / store instruction, the load / store instruction is read from the instruction memory 102 in the IF stage. At the ID stage, the
図2には、データメモリ106の構成が模式的に示される。データメモリ106は、連続したアドレスが行方向及び列方向に割り当てられた記憶領域1060を有する。記憶領域1060の各マス目は、16ビットごとのデータの格納領域を示す。16ビットごとのデータがデータ要素である。マス目の中の数字は、データ要素の順番を示す。記憶領域1060は、それぞれ入出力ポートを有する4個のバンクBK0〜BK3に分割される。以下、4個のバンクを例に説明がなされるが、バンク数は4個以外であってもよい。各バンクは、8個のデータ要素に対応する128ビットのバンク幅を有する。たとえば、行R1には、バンクBK0に「0」番目〜「7」番目の、バンクBK1に「8」番目〜「15」番目の、バンクBK1に「16」番目〜「23」番目の、そして、バンクBK2に「24」番目〜「31」番目のデータ要素が格納される。バンクBK0〜BK3からは、読出しアドレスが入力される1アクセスで、それぞれ8個のデータ要素が読み出される。
FIG. 2 schematically shows the configuration of the
図3は、ベクトルレジスタ110について説明する図である。ベクトルレジスタ110には、スロット1040〜1043が演算処理するためのデータメモリ106から読み出されたデータ要素が、一時的に格納される。図3(A)に示すように、ベクトルレジスタ110の記憶領域1100は128ビットの幅を有し、1つの行アドレスに8個のデータ要素が格納される。記憶領域1100における各マス目は16ビット長の格納領域を示し、マス目の中の数字はデータ要素の番号を示す。
FIG. 3 is a diagram for explaining the
図3(B)には、ベクトルレジスタ110における論理ベクトルレジスタ(VR)番号と物理ベクトルレジスタ(VR)番号の例が示される。論理ベクトルレジスタ番号は、ロード・ストア命令や演算命令におけるベクトルレジスタ110のデータの位置を示す。一方、物理ベクトルレジスタ番号は、ベクトルレジスタ110における物理的なデータの位置を示す。論理ベクトルレジスタ番号は、vr0、vr1、vr2、・・・と表わされる。また、それぞれの論理ベクトルレジスタ番号に対応する物理ベクトルレジスタ番号は、vr[0]、vr[1]、vr[2]、・・・と表わされる。物理ベクトルレジスタ番号は、たとえば、図3(A)のデータ要素の番号に対応しており、本実施形態における複数のレジスタの例である。
FIG. 3B shows an example of a logical vector register (VR) number and a physical vector register (VR) number in the
図4は、ロード・ストア命令を実行するベクトルパイプライン104の動作を説明するための図である。図4(A)には、データメモリ106におけるアドレス配置が示される。左から右へ、上から下へアドレスが増加する。バンクBK0において、各行のベースアドレスは、0x00、0x40、0x80、0xC0、・・・である。また、バンクBK1〜BK3の先頭におけるベースアドレスからのオフセット値は、それぞれ、0x10、0x20、0x30である。
FIG. 4 is a diagram for explaining the operation of the
図4(B)には、ロード・ストア命令の処理シーケンスが示される。ここでは、横軸を処理サイクルC1、C2、C3,・・・として、2個のスロットが実行するロード・ストア命令の例が示される。たとえば、ロード・ストア命令LS1は、スロット1040により実行される。この命令は、「vldh sr2,vr0」であり、データメモリ106の論理アドレス「sr2」(たとえばバンクBK0の「0x00」)から順次、論理ベクトルレジスタ番号vr0にデータの読み出しを指示する命令である。また、ロード・ストア命令LS2は、スロット1041により実行される。この命令は、「vldh sr3,vr1」であり、データメモリ106の論理アドレス「sr3」(たとえば、たとえばバンクBK1の「0x110」から、論理ベクトルレジスタ番号vr1にデータの読み出しを指示する命令である。図4(B)では、各処理サイクルにおいてアクセスするバンクとアドレスとが示される。また、各処理サイクルは図1で示したパイプラインにおける「EX」ステージに対応する。なお、ここでは、4つの処理サイクルが1つの命令サイクルに対応する(以下、同様)。
FIG. 4B shows a load / store instruction processing sequence. Here, an example of a load / store instruction executed by two slots is shown with the horizontal axis as the processing cycles C1, C2, C3,. For example, the load / store instruction LS1 is executed by the
ロード・ストア命令LS1は、たとえば、処理サイクルC1から実行される。まず、スロット1040は、サイクルC1でバンクBK0のアドレス「0x00」に、サイクルC2でバンクBK1のアドレス「0x10」に、サイクルC3でバンクBK2のアドレス「0x20」に、そして、サイクルC4でバンクBK3のアドレス「0x30」にアクセスする。これに引き続いて、さらに、スロット1040は、サイクルC5でバンクBK0のアドレス「0x40」に、サイクルC6でバンクBK1のアドレス「0x50」に、サイクルC7でバンクBK2のアドレス「0x60」に、そして、サイクルC8でバンクBK3のアドレス「0x70」にアクセスする。なお、スロット1040がアクセスするデータメモリ106のアドレスは、図4(A)で、斜線「/」により示される。
The load / store instruction LS1 is executed, for example, from the processing cycle C1. First, the
一方、ロード・ストア命令LS2は、処理サイクルC2から実行される。スロット1041は、サイクルC2でバンクBK0のアドレス「0x100」に、サイクルC3でバンクBK1のアドレス「0x110」に、サイクルC4でバンクBK2のアドレス「0x120」に、そして、サイクルC5でバンクBK3のアドレス「0x130」にアクセスする。これに引き続いて、さらに、スロット1041は、サイクルC6でバンクBK0のアドレス「0x140」に、サイクルC7でバンクBK1のアドレス「0x150」に、サイクルC8バンクBK2のアドレス「0x160」に、そして、サイクルC9でバンクBK3のアドレス「0x170」にアクセスする。なお、スロット1041がアクセスするデータメモリ106のアドレスは、図4(A)で、斜線「\」により示される。
On the other hand, the load / store instruction LS2 is executed from the processing cycle C2. The
図4(B)では、スロット1040、1041が同じサイクルで同じバンクにアクセスすることがない。よって、この場合、バンク競合は生じない。しかし、スロット1040、1041が同じサイクルで同じバンクにアクセスすると、バンク競合が生じる。かかる場合、制御部114が命令の並べ替えを行うことで、処理効率を低下させることなくバンク競合を回避する。
In FIG. 4B,
図5は、バンク競合が生じる場合を示す。図5(A)には、図4(A)と同じデータメモリ106のアドレスが示される。また、図5(B)〜(D)には、ロード・ストア処理のシーケンスが示される。なお、図5(B)〜(D)においてロード・ストア命令LS1、LS2によりアクセスされるメモリ106のアドレスは、図5(A)においてそれぞれ斜線「/」、「\」で示される。
FIG. 5 shows a case where bank contention occurs. FIG. 5A shows the same address of the
図5(B)では、スロット1041が実行するロード・ストア命令LS2において、データメモリ106におけるアクセスの開始アドレスが、図4(B)の場合と異なる。たとえば、スロット1041は、サイクルC2でバンクBK1のアドレス「0x110」へのアクセスを開始し、サイクルごとに、バンクBK2のアドレス「0x120」、バンクBK3のアドレス「0x130」にアクセスし、さらに引き続き、バンクBK0のアドレス「0x140」、バンクBK1のアドレス「0x150」、バンクBK2のアドレス「0x160」、BK3のアドレス「0x170」、そしてバンクBK0のアドレス「0x180」にアクセスする。すなわち、いわゆるラップ(折り返し)パターンでアクセスが行われる。すると、サイクルC2〜C8においてバンク競合が発生する。
5B, in the load / store instruction LS2 executed by the
ここで、バンク競合をストールにより回避しようとすると、図5(C)に示すようになる。図5(C)に示すように、ロード・ストア命令LS2を1サイクル分ストールすることにより、バンク競合が回避される。しかし、これにより、ロード・ストア命令LS2の終了がサイクルC10まで遅延する。 Here, an attempt to avoid bank conflict by stalling is as shown in FIG. As shown in FIG. 5C, bank contention is avoided by stalling the load / store instruction LS2 for one cycle. However, this delays the end of the load / store instruction LS2 until the cycle C10.
そこで、本実施形態では、制御部114が、第1の処理部であるスロット1040が第1のロード・ストア命令LS1の実行を開始した後に第2の処理部であるスロット1041が第2のロード・ストア命令LS2の実行を開始するとき、第2の命令における複数のバンクBK0〜BK3へのバンクアクセス順序を、スロット1040、1041のバンクへのアクセスが競合しないようなバンクアクセス順序(以下、競合回避バンクアクセス順序という)に並べ替えて、スロット1041に第2のロード・ストア命令LS2を実行させる。
Therefore, in the present embodiment, the
具体的には、図5(D)に示すように、図5(A)でサイクルC5に対応していたバンクBK0のアドレス「0x140」へのアクセスをサイクルC2で実行し(矢印51)、サイクルC2〜C4に対応していたBK1のアドレス「0x110」、バンクBK2のアドレス「0x120」、バンクBK3のアドレス「0x130」へのアクセスを、それぞれ1サイクル遅らせる。また、同様に、図5(A)でサイクルC9に対応していたバンクBK0のアドレス「0x180」へのアクセスをサイクルC6で実行し(矢印52)、サイクルC6〜C8に対応していたBK2のアドレス「0x150」、バンクBK2のアドレス「0x160」、バンクBK3のアドレス「0x170」へのアクセスを、それぞれ1サイクル遅らせる。そうすることで、4つのサイクルのうち、第1〜第3サイクルを1サイクル分ストールさせ、第4サイクルを最初に実行することと等価になる。よって、バンク競合が回避される。このように並べ替えられた競合回避バンクアクセス順序で、ロード・ストア命令LS2が実行される。このようにして、たとえば図5(B)との比較において示されるように、ロード・ストア命令LS2をストールすることなく、すなわち処理効率を低下させることなく、バンク競合を回避することができる。 Specifically, as shown in FIG. 5D, the access to the address “0x140” of the bank BK0 corresponding to the cycle C5 in FIG. 5A is executed in the cycle C2 (arrow 51). Access to the address “0x110” of BK1, the address “0x120” of bank BK2, and the address “0x130” of bank BK3 corresponding to C2 to C4 are each delayed by one cycle. Similarly, access to the address “0x180” of the bank BK0 corresponding to the cycle C9 in FIG. 5A is executed in the cycle C6 (arrow 52), and the address of BK2 corresponding to the cycles C6 to C8 is executed. Access to the address “0x150”, the address “0x160” of the bank BK2, and the address “0x170” of the bank BK3 are each delayed by one cycle. By doing so, it is equivalent to stalling the first to third cycles by one cycle among the four cycles and executing the fourth cycle first. Thus, bank contention is avoided. The load / store instruction LS2 is executed in the rearranged contention avoidance bank access order. In this way, as shown in, for example, comparison with FIG. 5B, bank contention can be avoided without stalling the load / store instruction LS2, that is, without reducing processing efficiency.
図1に戻り、さらに図6を参照しつつ、上記の制御を行う制御部114について説明する。制御部114は、依存関係検出部1142と、並べ替え制御部1144と、並べ替えアドレス生成部1146とを有する。また、並べ替え制御部1144は、図6に示すように、アクセス順序制御部602、レジスタ管理部604、発行タイミング検出部606、並べ替え管理フラグ608、610、612、614、及び、レジスタ管理フラグ616、618、620、622を有する。図1、図6に示す構成のうち、まず、バンクアクセス順序の並べ替えに関する構成の動作について説明する。
Returning to FIG. 1, the
制御部114には、デコーダ108からデコードされたロード・ストア命令LS1、LS2が入力される。また、バンク競合検出部113には、デコードされたロード・ストア命令LS1、LS2でアクセスするデータメモリ106のアドレスが、スカラレジスタ112から入力される。バンク競合検出部113は、ロード・ストア命令LS1、LS2のバンクアクセス順序を解析し、ロード・ストア命令LS1、LS2におけるバンク競合を検出する。バンク競合は、各ロード・ストア命令がそれぞれ予定されるタイミングで実行された場合に、各ロード・ストア命令に同じサイクルで同じバンクにアクセスする命令が含まれているときに検出される。バンク競合検出部113は、バンク競合を検出すると、これを並べ替え制御部1144に通知する。これに応答して、並べ替え制御部1144は、ロード・ストア命令LS2のバンクアクセス順序を、競合回避バンクアクセス順序に並べ替える。
The
並べ替え制御部1144では、アクセス順序制御部602が、ロード・ストア命令LS1、LS2のバンクアクセス順序を判定する。ロード・ストア命令LS1、LS2は、たとえば図7(A)に示すような、データメモリ106のアドレスへの、処理サイクルごとのアクセス順序(以下、メモリアクセス順序という)を有する。ここでは、メモリアクセス順序が、各バンクの先頭のベースアドレスからのオフセット値で示される。たとえば、メモリアクセス順序MA1は、バンクBK0の「0x0」、バンクBK1の「0x10」、バンクBK2の「0x20」、そしてバンクBK3の「0x30」の順序である。また、メモリアクセス順序MA2は、「0x10」、「0x20」、「0x30」、「0x0」の順序である。さらに、メモリアクセス順序MA3は、「0x20」、「0x30」、「0x0」、「0x10」の順序である。そして、メモリアクセス順序MA4は、「0x30」、「0x0」、「0x10」、「0x20」の順序である。アクセス順序制御部602は、このようなメモリアクセス順序MA1〜MA4から、図7(B)に示すようなバンクアクセス順序を判定する。たとえば、メモリアクセス順序MA1に対応するバンクアクセス順序BA1は、バンクBK0、BK1、BK2、BK3の順序である。また、メモリアクセス順序MA2に対応するバンクアクセス順序BA2は、バンクBK1、BK2、BK3、BK0の順序である。さらに、メモリアクセス順序MA3に対応するバンクアクセス順序BA3は、バンクBK2、BK3、BK0、BK1の順序である。そして、メモリアクセス順序MA4に対応するバンクアクセス順序BA4は、バンクBK3、BK0、BK1、BK2の順序である。
In the
たとえば、図5(B)の例では、ロード・ストア命令LS1のバンクアクセス順序はBA1と判定される。また、ロード・ストア命令LS2のバンクアクセス順序は、BA2と判定される。よって、アクセス順序制御部602は、ロード・ストア命令LS2のバンクアクセス順序BA2を、ロード・ストア命令LS1とバンク競合が生じないような競合回避アクセス順序に並べ替える。競合回避アクセス順序は、最後にアクセスされるバンクを最初にアクセスするように並べ替えた順序である。ここでは、競合回避アクセス順序は、ロード・ストア命令LS1と同じバンクアクセス順序BK1になる。そして、アクセス順序制御部602は、ロード・ストア命令LS1と、バンクアクセス順序が並べ替えられたLS2を並べ替えアドレス生成部1146に転送する。並べ替えアドレス生成部1146は、ロード・ストア命令LS1、LS2に基づいて、データメモリ106のアクセスされるアドレスを生成して、スロット1140、1141にそれぞれ入力する。すると、スロット1140、1141は、ロード・ストア命令LS1、LS2に従って、図5(D)で示したように、それぞれバンクBK0〜BK3に順次アクセスする。
For example, in the example of FIG. 5B, the bank access order of the load / store instruction LS1 is determined to be BA1. The bank access order of the load / store instruction LS2 is determined to be BA2. Therefore, the access
また、アクセス順序制御部602は、各ロード・ストア命令の並べ替え前及び後のバンクアクセス順序を、並べ替え管理フラグ608〜614に書き込む。たとえば、並べ替え管理フラグ608〜614には、スロット1040〜1043で実行されるロード・ストア命令のバンクアクセス順序が書き込まれる。よって、ロード・ストア命令LS1のバンクアクセス順序BA1は、並べ替え管理フラグ608に書き込まれる。また、ロード・ストア命令LS2の並べ替え前のバンクアクセス順序BA1と並べ替え後のバンクアクセス順序BA2は、並べ替え管理フラグ610に書き込まれる。
The access
さらに、レジスタ管理部604には、デコーダ108からロード・ストア命令の実行状態が入力される。命令の実行状態には、「EX」、「MEM」、「WB」などのステージごとに、対応する命令がデコードされたことを示す情報が含まれる。レジスタ管理部604は、命令の実行状態をレジスタ管理フラグ616〜622に記録して管理する。この動作については後に詳述する。
Further, the execution state of the load / store instruction is input from the
図8は、バンクアクセス順序の並べ替え手順を示すフローチャート図である。図8に示す手順は、たとえば、1命令サイクル分の命令がフェッチされるごとに実行される。まず、デコーダ108がロード・ストア命令をデコードする(S802)。そして、バンク競合検出部113が、バンク競合の有無を判定する(S804)。
FIG. 8 is a flowchart showing the bank access order rearrangement procedure. The procedure shown in FIG. 8 is executed each time an instruction for one instruction cycle is fetched, for example. First, the
バンク競合が検出されない場合(S804のNo)、ロード・ストア命令がベクトルパイプライン104で実行される(S812)。たとえば、ロード・ストア命令LS1は、先行の命令との間でバンク競合が生じない。よって、並べ替えアドレス生成部1146が生成するアドレスに対し、ロード・ストア命令LS1がスロット1040により実行される。そして、並べ替え制御部1144が、データが書き込まれたベクトルレジスタ110のレジスタを管理する(S814)。たとえば、スロット1040がロード・ストア命令LS1のWBステージが完了したときに、そのことを示す情報がレジスタ管理フラグ616〜622のうち616に書き込まれる。詳しくは後述するが、ロード・ストア命令LS1では書き込み先のレジスタが指定されているので、WBステージの完了を把握することで、そのレジスタへの処理完了が管理される。
If no bank conflict is detected (No in S804), a load / store instruction is executed in the vector pipeline 104 (S812). For example, the load / store instruction LS1 does not cause a bank conflict with the preceding instruction. Therefore, the load / store instruction LS1 is executed by the
一方、バンク競合が検出された場合(S804のYes)、並べ替え制御部1142が、競合回避バンクアクセス順序を決定する(S806)。たとえば、ロード・ストア命令LS2の場合、ロード・ストア命令LS1との間でバンク競合が検出される。よって、アクセス順序制御部602により、ロード・ストア命令LS2の競合回避バンクアクセス順序BA1が決定される。そして、並べ替えアドレス生成部1146が、競合回避バンクアクセス順序に対応する並べ替えアドレスを生成する(S808)。そして、アクセス順序制御部602が、バンクアクセス順序を管理する(S810)。たとえば、ロード・ストア命令LS2の並べ替え前と後のバンクアクセス順序が、並べ替え管理フラグ610〜622のうち610に書き込まれる。そして、ロード・ストア命令がベクトルパイプライン104で実行される(S812)。たとえば、ロード・ストア命令LS2がスロット1041により実行される。そして、並べ替え制御部1144が、データが書き込まれたレジスタを管理する(S814)。
On the other hand, when bank conflict is detected (Yes in S804), the reordering control unit 1142 determines the conflict avoidance bank access order (S806). For example, in the case of the load / store instruction LS2, a bank conflict is detected with the load / store instruction LS1. Therefore, the access
上記のような手順によれば、ストールにより処理効率を低下させることなく、バンク競合を回避できる。 According to the above procedure, bank contention can be avoided without reducing processing efficiency due to stall.
図9は、4個のスロットによりロード・ストア命令が実行される例を示す。図9(A)〜(C)には、スロット1040〜1043によるロード・ストア処理LS1〜LS4のシーケンスが示される。
FIG. 9 shows an example in which a load / store instruction is executed by four slots. 9A to 9C show a sequence of load / store processing LS1 to LS4 by
図9(A)は、バンク競合が生じる場合のシーケンスを示す。スロット1040、1041によるロード・ストア命令LS1、LS2のシーケンスは、図5(B)と同じである。すなわち、ロード・ストア命令LS1を処理するスロット1040は、バンクアクセス順序BA1(BK0、BK1、BK2、BK3の順序)でデータメモリ106にアクセスしてデータの読み出しを行う。また、ロード・ストア命令LS2を処理するスロット1041は、バンクアクセス順序BA2(BK1、BK2、BK3、BK0の順序)でデータメモリ106にアクセスしてデータの読み出しを行う。
FIG. 9A shows a sequence when bank conflict occurs. The sequence of the load / store instructions LS1 and LS2 by the
これに加え、スロット1042は、ロード・ストア命令LS3を実行する。ロード・ストア命令LS3は、「vldh sr4,vr2」であり、データメモリ106の論理アドレス「sr4」(たとえばバンクBK3の「0x230」)から順次、論理ベクトルレジスタ番号vr2にデータの読み出しを指示する命令である。これに従いスロット1042は、バンクアクセス順序BA4(BK3、BK0、BK1、BK2の順序)でデータメモリ106にアクセスする。すなわち、スロット1042は、サイクルC3でバンクBK3のアドレス「0x230」に、サイクルC4でバンクBK0のアドレス「0x240」に、サイクルC5でバンクBK1のアドレス「0x250」に、そして、サイクルC6でバンクBK2のアドレス「0x260」にアクセスする。さらに、スロット1042は、サイクルC7でバンクBK3のアドレス「0x270」に、サイクルC8でバンクBK0のアドレス「0x280」に、サイクルC9でバンクBK1のアドレス「0x290」に、そして、サイクルC10でバンクBK2のアドレス「0x2A0」にアクセスする。
In addition, the
また、スロット1043は、ロード・ストア命令LS4を実行する。ロード・ストア命令LS4は、「vldh sr5,vr3」であり、データメモリ106の論理アドレス「sr5」(たとえばバンクBK2の「0x320」)から順次、論理ベクトルレジスタ番号vr3にデータの読み出しを指示する命令である。これに従いスロット1043は、バンクアクセス順序BA3(BK2、BK3、BK0、BK1の順序)でデータメモリ106にアクセスする。たとえば、サイクルC4でバンクBK2のアドレス「0x320」に、サイクルC5でバンクBK3のアドレス「0x330」に、サイクルC6でバンクBK0のアドレス「0x340」に、そして、サイクルC7でバンクBK1のアドレス「0x350」にアクセスし、さらに引き続いて、サイクルC8でバンクBK2のアドレス「0x360」に、サイクルC9でバンクBK3のアドレス「0x370」に、サイクルC10でバンクBK0のアドレス「0x380」に、サイクルC11でバンクBK1のアドレス「0x390」にアクセスする。
The
図9(A)では、サイクルC2〜C8で、スロット1040、1041においてバンク競合が発生している。ここで、ロード・ストア命令LS2〜LS4を順次、先のロード・ストア命令とのバンク競合が回避されるまでストールさせると、図9(B)のようになる。
In FIG. 9A, bank conflicts occur in
図9(B)に示すように、ロード・ストア命令LS2が1サイクル、ロード・ストア命令LS3が3命令サイクル、そして、ロード・ストア命令LS4が6命令サイクルストールされることで、バンク競合が回避される。しかし、そうすることにより、ロード・ストア命令LS1〜LS4の終了するタイミングが、サイクルC17まで遅延する。 As shown in FIG. 9B, the bank conflict is avoided by stalling the load / store instruction LS2 for one cycle, the load / store instruction LS3 for three instruction cycles, and the load / store instruction LS4 for six instruction cycles. Is done. However, by doing so, the end timing of the load / store instructions LS1 to LS4 is delayed until the cycle C17.
そこで、本実施形態では、図9(C)に示すように、スロット1040がロード・ストア命令LS1の実行を開始した後にスロット1041がロード・ストア命令LS2の実行を開始するとき、制御部114は、スロット1040、1041のバンクへのアクセスが競合しないような競合回避バンクアクセス順序に並べ替えて(矢印91、92)、スロット1041にロード・ストア命令LS2を実行させる。競合回避アクセス順序は、最後にアクセスされるバンクが最初にアクセスされるような順序である。たとえば、バンクアクセス順序BA2において最後にアクセスされるバンクBK0が最初にアクセスされるバンクアクセス順序BA1である。すなわち、ここでは、ロード・ストア命令LS1と同じバンクアクセス順序になる。ここにおいて、スロット1040、1041、及び1042におけるバンク競合が回避される。
Therefore, in the present embodiment, as shown in FIG. 9C, when the
さらに、スロット1042がロード・ストア命令LS3の実行を開始した後にスロット1043がロード・ストア命令LS4の実行を開始するとき、制御部114は、ロード・ストア命令LS4におけるバンクアクセス順序BA3を、スロット1042、1043のバンクへのアクセスが競合しないようなバンクアクセス順序、すなわち競合回避バンクアクセス順序に並べ替えて(矢印93、94)、スロット1043にロード・ストア命令LS4を実行させる。競合回避アクセス順序は、最後にアクセスされるバンクを最初にアクセスするような順序である。たとえば、バンクアクセス順序BA4において最後にアクセスされるバンクBK1が最初にアクセスされるようなバンクアクセス順序BA2である。ここにおいて、スロット1040〜1043におけるバンク競合が回避される。
Further, when the
図9(C)では、ロード・ストア命令LS1〜LS4が、サイクルC11で終了する。図9(B)との比較において、6サイクル分、処理を高速化できる。 In FIG. 9C, the load / store instructions LS1 to LS4 end in the cycle C11. In comparison with FIG. 9B, the processing speed can be increased by 6 cycles.
このように、本実施形態によれば、複数のスロットにおいて、処理効率を低下させることなくバンク競合を回避することができる。 Thus, according to the present embodiment, bank contention can be avoided in a plurality of slots without reducing processing efficiency.
ところで、各ロード・ストア命令では、データメモリ106から読み出されるデータを書き込むベクトルレジスタ110のレジスタが指定される。たとえば、図9(A)〜(C)におけるロード・ストア命令LS1は、論理ベクトルレジスタ番号vr0を指定し、データメモリ106から読み出されるデータ要素を、論理ベクトルレジスタ番号vr0に対応する物理ベクトルレジスタ番号vr[0]〜vr[63]に書き込むための命令である。また、ロード・ストア命令LS2は、論理ベクトルレジスタ番号vr1を指定し、データメモリ106から読み出されるデータ要素を論理ベクトルレジスタ番号vr1に対応する物理ベクトルレジスタ番号vr[64]〜vr[127]に書き込むための命令である。さらに、ロード・ストア命令LS3は、論理ベクトルレジスタ番号vr2を指定し、データメモリ106から読み出されるデータ要素を論理ベクトルレジスタ番号vr2に対応する物理ベクトルレジスタ番号vr[128]〜vr[191]に書き込むための命令である。そして、ロード・ストア命令LS4は、論理ベクトルレジスタ番号vr3を指定し、データメモリ106から読み出されるデータ要素を論理ベクトルレジスタ番号vr3に対応する物理ベクトルレジスタ番号vr[192]〜vr[255]に書き込むための命令である。すると、上記のようにしてロード・ストア命令におけるバンクアクセス順序を並べ替えたときに、ベクトルレジスタ110におけるデータ書込みレジスタのアクセス順序が変更される。このことは、ベクトルレジスタ110からデータを読み出して演算を行う演算命令の開始タイミングに影響を与える。
By the way, in each load / store instruction, a register of the
そこで、本実施形態における制御部114は、ベクトルレジスタ110の複数のレジスタにスロット1041によるレジスタアクセス順序とは異なるレジスタアクセス順序でアクセスし、スロット1041により書き込まれたデータを読出す演算命令をスロット1042が実行する場合において、スロット1042によるレジスタアクセス順序を、読出しデータのスロット1041による書き込みが終了したレジスタから順にアクセスされるようなレジスタアクセス順序に並べ替えて、スロット1042に演算命令を実行させる。
Therefore, the
図10は、レジスタアクセス順序の並べ替えについて説明する図である。図10(A)には、スロット1040、1041、及び1042が、ロード・ストア命令LS1、LS2、及び演算命令AL3を実行する場合のシーケンスが示される。スロット1040、1041は、ロード・ストア命令LS1、LS2を実行して、ベクトルレジスタ110にデータ要素を書き込む。スロット1042は、スロット1041によりベクトルレジスタ110に書き込まれたデータを読み出す演算命令AL3を実行する。演算命令AL3は、「vaddh vr1,vr2,vr3」であり、論理ベクトルレジスタ番号vr1、vr2に書き込まれたデータ要素を加算して、加算結果のvr3への書き込みを指示する命令である。
FIG. 10 is a diagram for explaining the rearrangement of the register access order. FIG. 10A shows a sequence when the
ロード・ストア命令LS1、LS2のシーケンスにおいて、スロット1040、1041によりアクセスされるバンクと、読み出されたデータ要素を書き込むベクトルレジスタ110の物理ベクトルレジスタ番号が示される。ここでは、スロット1040、1041におけるバンク競合を回避するために、ロード・ストア命令LS2が競合回避バンクアクセス順序に並べ変えられた状態が示される。
In the sequence of the load / store instructions LS1 and LS2, the bank accessed by the
たとえば、スロット1040は、サイクルC1でバンクBK0にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[0]−[7]に、サイクルC2でバンクBK1にアクセスして読み出したデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[8]−[15]に、サイクルC3でバンクBK2にアクセスして読み出したデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[16]−[23]に、そして、サイクルC4でバンクBK3にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[24]−[31]に書き込む。一方、スロット1041は、サイクルC2でバンクBK0にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[88]−[95]に、サイクルC3でバンクBK1にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[64]−[71]に、サイクルC4でバンクBK2にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[72]−[79]に、そして、サイクルC5でバンクBK3にアクセスして読み出すデータをベクトルレジスタ110の物理ベクトルレジスタ番号vr[80]−[87]に書き込む。
For example, in the
また、演算命令AL3のシーケンスにおいて、スロット1042がデータを読み出すためにアクセスする、ベクトルレジスタ110の物理ベクトルレジスタ番号が示される。演算命令AL3では、ベクトルレジスタ110において物理ベクトルレジスタ番号の小さい順にアクセスが行われる。よって、ロード・ストア命令LS2によりアクセスされてデータが書き込まれるベクトルレジスタ110の物理ベクトルレジスタ番号vr[64]−[71]、vr [72]−[79]、vr [80]−[87]、及びvr [88]−[95]に対し、順にアクセスされる。このレジスタアクセス順序は、バンクアクセス順序変更前のロード・ストア命令LS2におけるレジスタアクセス順序に対応する。
In addition, in the sequence of the arithmetic instruction AL3, the physical vector register number of the
ところで、ロード・ストア命令LS2におけるデータメモリ106へのアクセスは、図1で示した「EX」ステージで実行される。そして、データメモリ106からのデータ読み出しは「MEM」ステージで実行され、ベクトルレジスタ110への書き込みは「WB」ステージで実行される。よって、図10(A)において、ロード・ストア命令LS2によるベクトルレジスタ110へのデータ書き込みは、データメモリ106へのアクセスが実行されるサイクルから2サイクル後に終了する。よって、このデータのベクトルレジスタ110からの読み出しは、3サイクル後から可能になる。たとえば、物理ベクトルレジスタ番号vr[64]−[71]からのデータの読み出しは、サイクルC3の3サイクル後のサイクルC6から可能になる。よって、演算命令AL3によれば、スロット1042は、サイクルC6でベクトルレジスタ110の物理ベクトルレジスタ番号vr[64]−[71]から、サイクルC7でベクトルレジスタ110の物理ベクトルレジスタ番号vr[72]−[79]から、サイクルC8でベクトルレジスタ110の物理ベクトルレジスタ番号vr[80]−[87]から、そしてサイクルC9でベクトルレジスタ110の物理ベクトルレジスタ番号vr[88]−[95]からデータ要素を読み出す。よって、演算命令AL3は、サイクルC9で終了する。
Incidentally, the access to the
ここで、ベクトルレジスタ110の物理ベクトルレジスタ番号vr[88]−[95]からのデータ要素の読み出しに着目すると、ロード・ストア命令LS2のバンクアクセス順序が並べ替えられたことにより、物理ベクトルレジスタ番号vr[88]−[95]へのデータ要素の書込みは、サイクルC4で終了する。よって、物理ベクトルレジスタ番号vr[88]−[95]からのデータ要素の読出しは、サイクルC5から可能になる。そこで、本実施形態では、図10(B)に示されるように、制御部114は、演算命令AL3におけるレジスタアクセス順序を、読出しデータのロード・ストア命令LS2による書き込みが終了したレジスタから順にアクセスされるようなレジスタアクセス順序、たとえば物理ベクトルレジスタ番号vr[88]−[95]へのアクセスが最初に行われるような順序に並べ替える(矢印1000)。このようにすることで、演算命令AL3は、サイクルC8で終了する。よって、処理時間が短縮される。
Here, paying attention to reading of data elements from the physical vector register numbers vr [88]-[95] of the
図10(C)には、ベクトルレジスタ110へのデータ要素の書込みが終了する前に読み出しを行うことにより処理が破綻することを回避する例として、ロード・ストア命令LS2におけるバンクアクセス順序の並べ替えを管理せずに、演算命令AL3をストールする場合が示される。ここでは、ロード・ストア命令LS2の最後の処理サイクルC5でアクセスされるデータの書き込みが終了してから、すなわちサイクルC8から、演算命令AL3の実行が開始される。よって、演算命令AL3の終了は、サイクルC11になる。本実施形態によれば、このような図10(C)との比較において、図10(B)に示すように、3サイクル処理の終了が早くなる。
FIG. 10C shows an example of rearranging the bank access order in the load / store instruction LS2 as an example of avoiding the processing failure by performing the reading before the writing of the data element to the
ここで、再び図1、及び図6を参照して、レジスタアクセス順序の並べ替えを行う制御部114の動作について説明する。
Here, the operation of the
制御部114では、依存関係検出部1142に、命令メモリ102からロード・ストア命令LS2と演算命令AL3が入力される。依存関係検出部1142は、ロード・ストア命令LS2と演算命令AL3とを解析して、ロード・ストア命令LS2に対する演算命令AL3の依存関係を検出する。依存関係は、ロード・ストア命令LS2によりデータを書き込む論理ベクトルレジスタ番号と、演算命令AL3によりデータを読み出す論理ベクトルレジスタ番号が重複するときに検出される。
In the
依存関係検出部1142は、検出結果を並べ替え制御部1144に転送する。並べ替え制御部1144は、依存関係が検出された場合、上述したロード・ストア命令LS2のバンクアクセス順序の並べ替えに加え、演算命令AL3におけるレジスタアクセス順序の並べ替えを行う。さらに、並べ替え制御部1144は、レジスタアクセス順序を並べ替えた演算命令AL3の発行タイミングを決定する。
The dependency relationship detection unit 1142 transfers the detection result to the
並べ替え制御部1144では、アクセス順序制御部602に、ロード・ストア命令LS2と、演算命令AL3が入力される。そして、アクセス順序制御部602は、ロード・ストア命令LS2の並べ替え前のバンクアクセス順序と、並べ替え後のバンクアクセス順序とに基づき、演算命令AL3におけるレジスタアクセス順序の並べ替えを行う。ロード・ストア命令LS2の並べ替え前のバンクアクセス順序と、並べ替え後のバンクアクセス順序とは、並べ替え管理フラグ610から取得される。
In the
図11は、アクセス順序制御部602の動作を説明するための図である。図11(A)のテーブルには、並べ替え前のバンクアクセス順序と並べ替え後のバンクアクセス順序に対応するレジスタアクセス順序が示される。たとえば、ロード・ストア命令LS2の並べ替え前のバンクアクセス順序はBA2であり、並べ替え後のバンクアクセス順序はBA1である。よって、これに対応するレジスタアクセス順序は、RA4である。
FIG. 11 is a diagram for explaining the operation of the access
図11(B)には、ベクトルレジスタ110におけるレジスタアクセス順序が示される。図11(B)では、論理ベクトルレジスタ番号vr0における物理ベクトルレジスタ番号vr[0]−[31]を例として、8個のデータ要素ずつデータ書込みを行うときの物理ベクトルレジスタ番号のアクセス順序が示される。たとえば、レジスタアクセス順序RA1は、vr[0]−[7]、vr[8]−[15]、vr[16]−[23]、vr[24]−[31]の順序である。また、レジスタアクセス順序RA2は、vr[8]−[15]、vr[16]−[23]、vr[24]−[31]、 vr[0]−[7]の順序である。さらに、レジスタアクセス順序RA3は、vr[16]−[23]、vr[24]−[31]、 vr[0]−[7]、vr[8]−[15]の順序である。そして、レジスタアクセス順序RA4は、vr[24]−[31]、 vr[0]−[7]、vr[8]−[15]、 vr[16]−[23]の順序である。図11(B)によると、たとえば、演算命令AL3の並べ替えられるレジスタアクセス順序RA4は、物理ベクトルレジスタ番号vr[64]−[95]において、vr[88]−[95]、vr[64]−[71]、 vr[72]−[79]、vr[80]−[87]の順序である。
FIG. 11B shows the register access order in the
アクセス順序制御部602は、図11(A)、(B)の情報をマップデータ等として予め内部のROM(Read Only Memory)などに記憶する。そして、アクセス順序制御部602は、図11(A)、(B)の情報を用いて、ロード・ストア命令LS2の並べ替え前後のバンクアクセス順序から、演算命令AL3におけるレジスタアクセス順序を決定し、その並べ替えを行う。
The access
そして、アクセス順序制御部602は、並べ替えたレジスタアクセス順序を並べ替えアドレス生成部1146に転送する。並べ替えアドレス生成部1146は、レジスタアクセス順序に対応するベクトルレジスタ110のアドレスを生成し、演算命令AL3を実行するスロット1142に転送する。
Then, the access
図12は、並べ替え管理フラグ608〜614に書き込まれる値の例を示す。図12(A)は、図10(B)で示したシーケンス図である。図12(B)には、図12(A)のシーケンス図に対応して、ロード・ストア命令LS1を実行するスロット1040用の並べ替え管理フラグ608、ロード・ストア命令LS2を実行するスロット1041用の並べ替え管理フラグ610、及び、演算命令AL3を実行するスロット1042用の並べ替え管理フラグ612の例が示される。ロード・ストア命令LS1はバンクアクセス順序BA1を有するので、ロード・ストア命令LS1が実行されるサイクルC1〜C4において、並べ替え管理フラグ608にはバンクアクセス順序「BA1」が書き込まれる。また、ロード・ストア命令LS2は、バンクアクセス順序がBA2からBA1に変更される。よって、ロード・ストア命令LS2が実行されるサイクルC2〜C5において、並べ替え管理フラグ608には、変更前のバンクアクセス順序「BA2」と変更後の競合回避バンクアクセス順序「BA1」が書き込まれる。
FIG. 12 shows an example of values written in the
そして、サイクルC1の時点で、並べ替え管理フラグ608が有するバンクアクセス順序「BA1」と、並べ替え管理フラグ610が有する競合回避バンクアクセス順序「BA1」とに基づき、演算命令AL3のレジスタアクセス順序がRA1からRA4に変更される。よって、並べ替え管理フラグ612にはレジスタアクセス順序「RA4」が書き込まれる。そして、演算命令AL3が実行されるサイクルC5〜C8において、並べ替え管理フラグ612の値は、レジスタアクセス順序「RA4」に維持される。
At the time of cycle C1, the register access order of the arithmetic instruction AL3 is based on the bank access order “BA1” included in the
図1、図6に戻る。 Returning to FIG. 1 and FIG.
並べ替え制御部1144は、レジスタアクセス順序を並べ替えた演算命令AL3の発行タイミングを決定する。レジスタ管理部604に、デコーダ108からロード・ストア命令の実行状態が入力される。実行状態は、「EX」ステージ、「MEM」ステージ、「WB」ステージのいずれのステージが実行されたかを示す。レジスタ管理部604は、実行状態をレジスタ管理フラグ616〜622に書き込んで記録する。たとえば、ロード・ストア命令LS2を実行するスロット1041の実行状態は、レジスタ管理フラグ616〜622のうち618に書き込まれる。処理レジスタ管理部604は、レジスタ管理フラグ616〜622の値を、発行タイミング検出部606に通知する。そして、発行タイミング検出部606は、レジスタ管理フラグ616〜622の値に基づき、演算命令AL3の発行タイミングを検出する。
The
図13は、発行タイミング検出について説明する図である。図13(A)は、図10(B)と同じシーケンス図である。ここでは、ロード・ストア命令LS1のバンクアクセス順序に応じてロード・ストア命令LS2のバンクアクセス順序が並べ替えられ、さらに、ロード・ストア命令LS2のレジスタアクセス順序に応じて演算命令AL3のレジスタアクセス順序が並べ替えられた状態が示される。 FIG. 13 is a diagram illustrating issue timing detection. FIG. 13A is the same sequence diagram as FIG. Here, the bank access order of the load / store instruction LS2 is rearranged according to the bank access order of the load / store instruction LS1, and further, the register access order of the arithmetic instruction AL3 according to the register access order of the load / store instruction LS2 The state where is rearranged is shown.
図13(B)には、上記の並べ替えが行われるときの、レジスタ管理フラグの例が示される。ここでは、ロード・ストア命令LS2を実行するスロット1041用のレジスタ管理フラグ618が示される。レジスタ管理フラグ618は、さらに、ベクトルレジスタ110の物理ベクトルレジスタ番号順に、レジスタ管理フラグ618−1、618−2、618−3、及び618−4を有する。レジスタ管理フラグ618−1は物理ベクトルレジスタ番号vr[64]−[71]に対する処理に、レジスタ管理フラグ618−2は物理ベクトルレジスタ番号vr[72]−[79]に対する処理に、レジスタ管理フラグ618−3は物理ベクトルレジスタ番号vr[80]−[87]に対する処理に、そして、レジスタ管理フラグ618−4は物理ベクトルレジスタ番号vr[88]−[95]に対する処理に、それぞれ対応する。レジスタ管理フラグ618−1〜618−4は、初期値が「OFF」である。そして、レジスタ管理フラグ618−1〜618−4は、それぞれ対応する物理ベクトルレジスタ番号vrへのデータ要素の書き込みが終了したときに「ON」が書き込まれる。
FIG. 13B shows an example of the register management flag when the above rearrangement is performed. Here, a
図13(A)に示すように、ロード・ストア命令LS2では、サイクルC2で物理ベクトルレジスタ番号vr[88]−[95]へのデータ読出しのためのバンクアクセスが実行される。すると、2サイクル後のサイクルC4のときに「WB」ステージが実行されてデータがベクトルレジスタ110に書き込まれる。よって、サイクルC4のときにレジスタ管理フラグ618−4は「ON」になる。同様にして、サイクルC3で物理ベクトルレジスタ番号vr[64]−[71]へのデータ読出しのためのバンクアクセスが実行され、2サイクル後のサイクルC5のときにデータがベクトルレジスタ110に書き込まれる。よって、サイクルC5でレジスタ管理フラグ618−1は「ON」になる。また、サイクルC4で物理ベクトルレジスタ番号vr[72]−[79]へのデータ読出しのためのバンクアクセスが実行され、2サイクル後のサイクルC6のときにデータがベクトルレジスタ110に書き込まれる。よって、サイクルC6でレジスタ管理フラグ618−2は「ON」になる。そして、サイクルC5で物理ベクトルレジスタ番号vr[80]−[87]へのデータ読出しのためのバンクアクセスが実行され、2サイクル後のサイクルC7のときにデータがベクトルレジスタ110に書き込まれる。よって、サイクルC7でレジスタ管理フラグ618−3は「ON」になる。
As shown in FIG. 13A, in the load / store instruction LS2, bank access for data reading to the physical vector register numbers vr [88]-[95] is executed in cycle C2. Then, the “WB” stage is executed at
レジスタ管理部604は、発行タイミング検出部606に、レジスタ管理フラグ616〜622の値を転送する。そして、発行タイミング検出部606は、レジスタ管理フラグ616〜622の値が示すロード・ストア命令LS1およびLS2の実行状態に基づき、発行タイミングを検出する。たとえば、図13(B)に示したように、サイクルC4でレジスタ管理フラグ618−4が「ON」になると、次のサイクルから演算命令AL3が実行可能になる。よって、発行タイミング検出部606は、サイクルC4のときに、発行タイミングを検出する。そして、発行タイミング検出部606は、デコーダ108に演算命令AL3の発行を指示する制御信号を伝送する。これに応答して、デコーダ108は、サイクルC5から実行されるように、スロット1042に演算命令AL3を発行する。
The
次に、複数のロード・ストア命令に演算命令が依存する例を示す。 Next, an example in which an operation instruction depends on a plurality of load / store instructions is shown.
図14は、2つのロード・ストア命令に演算命令が依存する場合のシーケンスを示す。図14(A)には、ロード・ストア命令LS1、LS2、及びLS3がスロット1040、1041、及び1042により実行され、スロット1041、1042によりベクトルレジスタ110に書き込まれたデータを、演算命令AL4を実行するスロット1043が読み出す場合のシーケンスが示される。ここでは、ロード・ストア命令LS1〜LS3を実行するスロット1040〜1042におけるバンク競合を回避するために、ロード・ストア命令LS2、LS3がストールされた状態が示される。
FIG. 14 shows a sequence when an operation instruction depends on two load / store instructions. In FIG. 14A, the load / store instructions LS1, LS2, and LS3 are executed by the
ロード・ストア命令LS1では、バンクアクセス順序BA1でデータメモリ106にアクセスが行われ、ベクトルレジスタ110に、レジスタアクセス順序RA1でデータが書き込まれる。また、ロード・ストア命令LS2では、バンクアクセス順序BA2でデータメモリ106にアクセスが行われ、ベクトルレジスタ110に、レジスタアクセス順序RA1でデータが書き込まれる。そして、ロード・ストア命令LS3では、バンクアクセス順序BA3でデータメモリ106にアクセスが行われ、ベクトルレジスタ110に、レジスタアクセス順序RA1でデータが書き込まれる。ここでは、ロード・ストア命令LS2が1サイクル分ストールされている。また、ロード・ストア命令LS3が2サイクル分ストールされている。
In the load / store instruction LS1, the
また、演算命令AL4は、「vaddh vr0,vr1,vr2」であり、論理ベクトルレジスタ番号vr0、vr1に書き込まれたデータ要素を加算して、加算結果のvr2への書き込みを指示する命令である。これに従い、スロット1043は、ベクトルレジスタ110にレジスタアクセス順序RA1でアクセスしてデータを読み出し、演算を行う。たとえば、最初のサイクルでは、物理ベクトルレジスタ番号vr[0]、[63]にアクセスが行われる。物理ベクトルレジスタ番号vr[0]に書き込まれるデータへのアクセスは、ロード・ストア命令LS3においてサイクルC5で行われる。よって、書込みが終了するのは2サイクル後のC7である。一方、物理ベクトルレジスタ番号vr[64]に書き込まれるデータへのアクセスは、ロード・ストア命令LS2においてサイクルC3で行われる。よって、書込みが終了するのは2サイクル後のC5である。よって、この場合、演算命令AL4は、遅い方のサイクルC7の次のC8から開始される。
The arithmetic instruction AL4 is “vaddh vr0, vr1, vr2,” and is an instruction for adding the data elements written in the logical vector register numbers vr0 and vr1 and instructing writing of the addition result to vr2. In accordance with this, the
次に、本実施形態によるシーケンスが、図14(B)に示される。図14(B)では、ロード・ストア命令LS2、LS3が、それぞれ競合回避バンクアクセス順序に並べ替えられた状態が示される。ロード・ストア命令LS2における競合回避バンクアクセス順序は、当初のバンクアクセス順序BA2において、最後にアクセスされるバンクBK0が最初にアクセスされるようにする。よって、バンクアクセス順序BA1になる。また、ロード・ストア命令LS3における競合回避バンクアクセス順序は、まず、当初のバンクアクセス順序BA3において、最後にアクセスされるバンクBK1が最初にアクセスされるようにする。すると、並べ替え後のロード・ストア命令LS2との間でバンク競合が生じる。よって、同様の並べ替えが繰り返される。最終的に、競合回避バンクアクセス順序BA1になる。このように、最後にアクセスされるバンクが最初にアクセスされるようにする処理を繰り返すことで、競合回避バンクアクセス順序が求められる。 Next, a sequence according to the present embodiment is shown in FIG. FIG. 14B shows a state in which the load / store instructions LS2 and LS3 are rearranged in the conflict avoidance bank access order. The conflict avoidance bank access order in the load / store instruction LS2 is such that the bank BK0 accessed last is accessed first in the initial bank access order BA2. Therefore, the bank access order BA1 is obtained. In the conflict avoidance bank access order in the load / store instruction LS3, the bank BK1 that is accessed last is first accessed in the initial bank access order BA3. Then, a bank conflict occurs with the rearranged load / store instruction LS2. Therefore, the same rearrangement is repeated. Finally, the contention avoidance bank access order BA1 is obtained. In this way, the contention avoidance bank access order is obtained by repeating the process of making the bank accessed last be accessed first.
次に、レジスタアクセス順序の並べ替えについて説明する。演算命令AL4は2つのロード・ストア命令に依存する。複数のロード・ストア命令に演算命令が依存する場合は、並べ替え制御部1144の動作が、図10、図11において説明した内容とは異なる。この場合、レジスタ管理フラグ616〜622により、依存するロード・ストア命令の実行状態が管理される。図14(C)に、具体例が示される。
Next, rearrangement of the register access order will be described. The arithmetic instruction AL4 depends on two load / store instructions. When an operation instruction depends on a plurality of load / store instructions, the operation of the
図14(C)では、ロード・ストア命令LS2を実行するスロット1041用のレジスタ管理フラグ618−0〜618−3と、ロード・ストア命令LS3を実行するスロット1042用のレジスタ管理フラグ620−0〜620−3とが示される。ここでは、レジスタ管理フラグ618−0は物理ベクトルレジスタ番号vr[64]−[71]に対する処理に、レジスタ管理フラグ618−1は物理ベクトルレジスタ番号vr[72]−[79]に対する処理に、レジスタ管理フラグ618−2は物理ベクトルレジスタ番号vr[80]−[87]に対する処理に、そして、レジスタ管理フラグ618−3は物理ベクトルレジスタ番号vr[88]−[95]に対する処理に、それぞれ対応する。また、レジスタ管理フラグ620−0は物理ベクトルレジスタ番号vr[0]−[7]に対する処理に、レジスタ管理フラグ620−1は物理ベクトルレジスタ番号vr[8]−[15]に対する処理に、レジスタ管理フラグ620−2は物理ベクトルレジスタ番号vr[16]−[23]に対する処理に、そして、レジスタ管理フラグ620−3は物理ベクトルレジスタ番号vr[24]−[31]に対する処理に、それぞれ対応する。レジスタ管理フラグ618−0〜618−3、620−0〜620−3は、それぞれ対応する物理ベクトルレジスタ番号に対するデータ要素の書き込みが終了するサイクルで、レジスタ管理部604により「ON」が書き込まれる。たとえば、レジスタ管理フラグ618−3はサイクルC4で、レジスタ管理フラグ618−0はサイクルC5で、レジスタ管理フラグ618はサイクルC6で、そして、レジスタ管理フラグ618−2はサイクルC7で、それぞれ「ON」になる。また、レジスタ管理フラグ620−2はサイクルC5で、レジスタ管理フラグ620−3はサイクルC6で、レジスタ管理フラグ620−0はサイクルC7で、そして、レジスタ管理フラグ620−1はサイクルC8で、それぞれ「ON」になる。
In FIG. 14C, register management flags 618-0 to 618-3 for the
一方、演算命令AL4の各サイクルでは、物理ベクトルレジスタ番号vr[0]とvr[64]、vr[8]とvr[72]、vr[16]とvr[80]、・・・というように、「64」間隔が離れた物理ベクトルレジスタ番号にアクセスされる。これらの物理ベクトルレジスタ番号のペアは、それぞれレジスタ管理フラグのペア618−0、620−0、ペア618−1、620−1、ペア618−2、620−2、及び、ペア618−3、620−3のいずれかに対応する。よって、レジスタ管理部604は、レジスタ管理フラグのペア618−0、620−0、ペア618−1、620−1、ペア618−2、620−2、及び、ペア618−3、620−3のうちいずれかにおいて、両方とも「ON」になったときに、演算命令AL4におけるレジスタアクセス順序を決定する。たとえば、サイクルC6でペア618−3、620−3が、サイクルC7でペア618−0、620−0とペア618−2、620−2が、そして、サイクルC8でペア618−1、620−1が、それぞれ両方とも「ON」になる。よって、このなかでもっとも早いサイクルC6で、レジスタ管理部604は、ペア618−3、620−3に対応する物理ベクトルレジスタ番号へのアクセスを開始するように、レジスタアクセス順序を並べ替える。そして、次のサイクルC7から、並べ替えられた演算命令AL4が開始される。このときの状態が、図14(B)に示される。
On the other hand, in each cycle of the arithmetic instruction AL4, physical vector register numbers vr [0] and vr [64], vr [8] and vr [72], vr [16] and vr [80], and so on. , The physical vector register numbers separated by “64” intervals are accessed. These physical vector register number pairs include register management flag pairs 618-0 and 620-0, pairs 618-1 and 620-1, pairs 618-2 and 620-2, and pairs 618-3 and 620, respectively. -3. Therefore, the
レジスタ管理部604は、並べ替えたレジスタアクセス順序に対応するベクトルレジスタ110のアドレスの生成を、並べ替えアドレス生成部1146に指示する信号を出力する。すると、並べ替えアドレス生成部1146は、アクセスすべきアドレスを生成して、演算命令AL4を実行するスロット1043に送る。また、レジスタ管理部604は、演算命令AL4の発行を指示する信号を、発行タイミング検出部606に伝送する。すると、発行タイミング検出部606は、これをデコーダ108に転送する。そして、デコーダ108は、演算命令AL4をデコードしてスロット1043に送る。これにより、スロット1043は、図14(B)に示されるタイミングで、演算命令AL4を実行する。
The
図15は、レジスタアクセス順序の並べ替えの動作手順を示すフローチャート図である。 FIG. 15 is a flowchart showing an operation procedure for rearranging the register access order.
図15に示す手順は、たとえば、1命令サイクル分の命令がフェッチされるごとに実行される。まず、デコーダ108が演算命令をデコードする(S1500)。そして、依存関係検出部1142が、先行するロード・ストア命令との依存関係を検出する(S1502)。
The procedure shown in FIG. 15 is executed each time an instruction for one instruction cycle is fetched, for example. First, the
依存関係が検出されない場合(S1504のNo)、演算命令がベクトルパイプライン104で実行される(S1520)。一方、依存関係が検出された場合であって(S1504のYes)、依存する先行命令が1つの場合(S1506のYes)、アクセス順序制御部602は、先行するロード・ストア命令のバンクアクセス順序を参照し(S1508)、演算命令のレジスタアクセス順序を制御する(S1510)。たとえば、アクセス順序制御部602がレジスタアクセス順序を並べ替え、レジスタ管理部604が処理レジスタ管理フラグ616〜622に実行状態を書き込む。そして、演算命令が実行される(S1520)。
When the dependency relationship is not detected (No in S1504), the operation instruction is executed in the vector pipeline 104 (S1520). On the other hand, if a dependency relationship is detected (Yes in S1504) and there is one dependent preceding instruction (Yes in S1506), the access
また、依存関係が検出された場合であって(S1504のYes)、依存する先行命令が2つの場合(S1506のNo、S1512のYes)、レジスタ管理部604は、処理レジスタ管理フラグ616〜622により処理完了レジスタを監視し(S1514)、レジスタアクセス順序を決定する(S1516)。そして、レジスタ管理部604は、レジスタアクセスの完了状況を処理レジスタ管理フラグ616〜622に書き込んで管理する(S1518)。そして、演算命令が実行される(S1520)。
If the dependency relationship is detected (Yes in S1504) and there are two dependent preceding instructions (No in S1506, Yes in S1512), the
このようにして、1つ、または2つのロード・ストア命令に演算命令が依存するときであっても、処理が破綻することなく、処理効率低下を回避できる。 In this way, even when the operation instruction depends on one or two load / store instructions, the processing efficiency can be avoided and the processing efficiency can be avoided.
以上の実施の形態をまとめると、次の付記のとおりである。 The above embodiment is summarized as follows.
(付記1)
メモリの複数のバンクに第1のバンクアクセス順序でアクセスする第1の処理部と、
前記第1の処理部のアクセスの開始に続いて第2のバンクアクセス順序で前記複数のバンクにアクセスを開始する第2の処理部と、
前記第1の処理部及び前記第2の処理部による前記複数のバンクへのアクセスが競合する場合に、前記第2のバンクアクセス順序を前記競合が生じない第3のバンクアクセス順序に並べ替えて前記第2の処理部を前記複数のバンクにアクセスさせる制御部とを備えることを特徴とするプロセッサ。
(Appendix 1)
A first processing unit that accesses a plurality of banks of the memory in a first bank access order;
A second processing unit that starts accessing the plurality of banks in a second bank access order following the start of access of the first processing unit;
When access to the plurality of banks by the first processing unit and the second processing unit competes, the second bank access order is rearranged to a third bank access order that does not cause the conflict. And a control unit that causes the second processing unit to access the plurality of banks.
(付記2)
付記1において、
前記制御部は、前記第3のバンクアクセス順序による前記第2の処理部の前記複数のバンクへのアクセスの開始タイミングを、前記第1の処理部の前記複数のバンクへのアクセスの開始タイミングから1サイクル後に制御することを特徴とするプロセッサ。
(Appendix 2)
In
The control unit determines a start timing of access to the plurality of banks of the second processing unit according to the third bank access order from a start timing of access to the plurality of banks of the first processing unit. A processor which is controlled after one cycle.
(付記3)
付記1または2において、
前記第2の処理部は、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記複数のレジスタに第2のレジスタアクセス順序でアクセスし、前記書き込まれたデータを読み出す第3の処理部をさらに有し、
前記制御部は、前記第2のレジスタアクセス順序を、前記第1のレジスタアクセス順序による書き込みが終了したレジスタから順にアクセスするように制御することを特徴とするプロセッサ。
(Appendix 3)
In
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the first register access order,
A third processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The control unit controls the second register access order so that the second register access order is accessed sequentially from a register for which writing in the first register access order has been completed.
(付記4)
付記3において、
前記制御部は、前記第2のバンクアクセス順序と前記第3のバンクアクセス順序とに基づいて前記第2のレジスタアクセス順序を並べ替えることを特徴とするプロセッサ。
(Appendix 4)
In
The processor is characterized in that the second register access order is rearranged based on the second bank access order and the third bank access order.
(付記5)
付記1または2において、
前記第1の処理部は、前記第1のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記第2の処理部は、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを前記複数のレジスタに第2のレジスタアクセス順序でアクセスして書き込み、
前記複数のレジスタに第3のレジスタアクセス順序でアクセスし、前記第1及び第2の処理部により書き込まれたデータを読出す第3の処理部をさらに有し、
前記制御部は、前記第3のレジスタアクセス順序を、前記第1及び第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御することを特徴とするプロセッサ。
(Appendix 5)
In
The first processing unit accesses and writes data read by accessing the memory in the first bank access order to a plurality of registers in the first register access order,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the second register access order,
A third processing unit for accessing the plurality of registers in a third register access order and reading data written by the first and second processing units;
The processor is configured to control the third register access order so that the third register access order is accessed sequentially from a register in which writing by the first and second processing units is completed.
(付記6)
付記5において、
前記制御部は、前記第1、第2の処理部それぞれの前記複数のレジスタへのアクセスを記録し、当該記録に基づいて前記第3のレジスタアクセス順序を決定するプロセッサ。
(Appendix 6)
In Appendix 5,
The control unit is a processor that records accesses to the plurality of registers of the first and second processing units and determines the third register access order based on the records.
(付記7)
付記1乃至6のいずれかにおいて、
前記第3のバンクアクセス順序では、前記第2のバンクアクセス順序で最後にアクセスされるバンクが他の前記バンクより先にアクセスされるプロセッサ。
(Appendix 7)
In any one of
In the third bank access order, the processor that is accessed last in the second bank access order is accessed earlier than the other banks.
(付記8)
複数のレジスタに第1のレジスタアクセス順序でアクセスしてデータを書き込む第1の処理部と、
前記複数のレジスタに第2のレジスタアクセス順序でアクセスして前記書き込まれたデータを読出す第2の処理部と、
前記第2のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1の処理部による書き込みが終了したレジスタから順にアクセスされる第3のレジスタアクセス順序に並べ替えて、前記第2の処理部に前記複数のレジスタへアクセスさせる制御部とを有するプロセッサ。
(Appendix 8)
A first processing unit that accesses a plurality of registers in a first register access order and writes data;
A second processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The second register access order is rearranged to a third register access order in which the data to be read is sequentially accessed from the register in which the writing of the read data by the first processing unit is completed, among the plurality of registers. And a control unit that causes the processing unit to access the plurality of registers.
(付記9)
複数のレジスタに第1のレジスタアクセス順序でアクセスしてデータを書き込む第1の処理部と、
前記複数のレジスタに第2のレジスタアクセス順序でアクセスしてデータを書き込む第2の処理部と、
前記複数のレジスタに第3のレジスタアクセス順序でアクセスして前記第1、第2の処理部により書き込まれたデータを読出す第3の処理部と、
前記第3のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1、第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御する制御部とを有するプロセッサ。
(Appendix 9)
A first processing unit that accesses a plurality of registers in a first register access order and writes data;
A second processing unit for writing data by accessing the plurality of registers in a second register access order;
A third processing unit that accesses the plurality of registers in a third register access order and reads data written by the first and second processing units;
And a control unit that controls the third register access order so as to sequentially access the data to be read from the register in which the writing by the first and second processing units of the plurality of registers is completed.
(付記10)
付記9において、
前記制御部は、前記第1、第2の処理部それぞれの前記複数のレジスタへのアクセスを記録し、当該記録に基づいて前記第3のレジスタアクセス順序を決定するプロセッサ。
(Appendix 10)
In
The control unit is a processor that records accesses to the plurality of registers of the first and second processing units and determines the third register access order based on the records.
(付記11)
メモリの複数のバンクに第1のバンクアクセス順序でアクセスする第1の処理部と、前記第1の処理部のアクセスの開始に続いて第2のバンクアクセス順序で前記複数のバンクにアクセスを開始する第2の処理部とを有するプロセッサの制御方法であって、
前記第1の処理部及び前記第2の処理部による前記複数のバンクへのアクセスが競合する場合に、前記第2のバンクアクセス順序を前記競合が生じない第3のバンクアクセス順序に並べ替えて前記第2の処理部を前記複数のバンクにアクセスさせる、
プロセッサの制御方法
(付記12)
付記11において、
前記第2の処理部が、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記プロセッサが、前記複数のレジスタに第2のレジスタアクセス順序でアクセスして前記書き込まれたデータを読み出す第3の処理部をさらに有し、
前記第2のレジスタアクセス順序を、前記第1のレジスタアクセス順序による書き込みが終了したレジスタから順にアクセスするように制御する、
プロセッサの制御方法。
(Appendix 11)
A first processing unit that accesses a plurality of banks of the memory in a first bank access order, and an access to the plurality of banks in a second bank access order is started following the start of access of the first processing unit. And a second processing unit for controlling a processor,
When access to the plurality of banks by the first processing unit and the second processing unit competes, the second bank access order is rearranged to a third bank access order that does not cause the conflict. Allowing the second processing unit to access the plurality of banks;
Processor control method (Appendix 12)
In
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the first register access order,
The processor further includes a third processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The second register access order is controlled so as to be accessed sequentially from the register in which writing according to the first register access order is completed.
How to control the processor.
(付記13)
付記11において、
前記第1の処理部が、前記第1のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記第2の処理部が、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを前記複数のレジスタに第2のレジスタアクセス順序でアクセスして書き込み、
前記プロセッサが、前記複数のレジスタに第3のレジスタアクセス順序でアクセスして前記第1及び第2の処理部により書き込まれたデータを読出す第3の処理部をさらに有し、
前記第3のレジスタアクセス順序を、前記第1及び第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御する、
プロセッサの制御方法。
(Appendix 13)
In
The first processing unit accesses and writes the data read by accessing the memory in the first bank access order to a plurality of registers in the first register access order,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the second register access order;
The processor further includes a third processing unit that accesses the plurality of registers in a third register access order and reads data written by the first and second processing units;
The third register access order is controlled so as to be accessed in order from the register in which writing by the first and second processing units is completed.
How to control the processor.
(付記14)
複数のレジスタに第1のレジスタアクセス順序でアクセスしてデータを書き込む第1の処理部と、前記複数のレジスタに第2のレジスタアクセス順序でアクセスして前記書き込まれたデータを読出す第2の処理部とを有するプロセッサの制御方法であって、
前記第2のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1の処理部による書き込みが終了したレジスタから順にアクセスされるような第3のレジスタアクセス順序に並べ替えて、前記第2の処理部に前記複数のレジスタへのアクセスを実行させる、
プロセッサの制御方法。
(Appendix 14)
A first processing unit that accesses a plurality of registers in a first register access order and writes data; and a second processing unit that accesses the plurality of registers in a second register access order and reads the written data. A control method of a processor having a processing unit,
The second register access order is rearranged in a third register access order in which the data to be read is sequentially accessed from the register in which writing by the first processing unit is completed, among the plurality of registers, Causing the second processing unit to access the plurality of registers;
How to control the processor.
(付記15)
複数のレジスタに第1のレジスタアクセス順序でアクセスしてデータを書き込む第1の処理部と、前記複数のレジスタに第2のレジスタアクセス順序でアクセスしてデータを書き込む第2の処理部と、前記複数のレジスタに第3のレジスタアクセス順序でアクセスして前記第1、第2の処理部により書き込まれたデータを読出す第3の処理部とを有するプロセッサの制御方法であって、
前記第3のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1、第2の処理部による書き込みが終了したレジスタから順にアクセスされるような第4のレジスタアクセス順序に並べ替えて、前記第3の処理部に前記複数のレジスタへのアクセスを実行させる、
プロセッサの制御方法。
(Appendix 15)
A first processing unit that accesses a plurality of registers in a first register access order and writes data; a second processing unit that accesses the plurality of registers in a second register access order and writes data; And a third processing unit that accesses a plurality of registers in a third register access order and reads data written by the first and second processing units.
The third register access order is rearranged into a fourth register access order in which the data to be read is sequentially accessed from the register in which the writing of the read data by the first and second processing units is completed among the plurality of registers. And causing the third processing unit to access the plurality of registers,
How to control the processor.
100:ベクトルプロセッサ、 106:データメモリ、BK0〜BK3:バンク、
110:ベクトルレジスタ、 114:制御部、 1040〜1043:スロット、
1142:依存関係検出部、 1144:並べ替え制御部
100: Vector processor, 106: Data memory, BK0 to BK3: Bank,
110: Vector register 114: Control unit 1040-1043: Slot
1142: Dependency detection unit, 1144: Rearrangement control unit
Claims (10)
前記第1の処理部のアクセスの開始に続いて第2のバンクアクセス順序で前記複数のバンクにアクセスを開始する第2の処理部と、
前記第1の処理部及び前記第2の処理部による前記複数のバンクへのアクセスが競合する場合に、前記第2のバンクアクセス順序を前記競合が生じない第3のバンクアクセス順序に並べ替えて前記第2の処理部を前記複数のバンクにアクセスさせる制御部とを備えることを特徴とするプロセッサ。 A first processing unit that accesses a plurality of banks of the memory in a first bank access order;
A second processing unit that starts accessing the plurality of banks in a second bank access order following the start of access of the first processing unit;
When access to the plurality of banks by the first processing unit and the second processing unit competes, the second bank access order is rearranged to a third bank access order that does not cause the conflict. And a control unit that causes the second processing unit to access the plurality of banks.
前記制御部は、前記第3のバンクアクセス順序による前記第2の処理部の前記複数のバンクへのアクセスの開始タイミングを、前記第1の処理部の前記複数のバンクへのアクセスの開始タイミングから1サイクル後に制御することを特徴とするプロセッサ。 In claim 1,
The control unit determines a start timing of access to the plurality of banks of the second processing unit according to the third bank access order from a start timing of access to the plurality of banks of the first processing unit. A processor which is controlled after one cycle.
前記第2の処理部は、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記複数のレジスタに第2のレジスタアクセス順序でアクセスし、前記書き込まれたデータを読み出す第3の処理部をさらに有し、
前記制御部は、前記第2のレジスタアクセス順序を、前記第1のレジスタアクセス順序による書き込みが終了したレジスタから順にアクセスするように制御することを特徴とするプロセッサ。 In claim 1 or 2,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the first register access order,
A third processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The control unit controls the second register access order so that the second register access order is accessed sequentially from a register for which writing in the first register access order has been completed.
前記制御部は、前記第2のバンクアクセス順序と前記第3のバンクアクセス順序とに基づいて前記第2のレジスタアクセス順序を並べ替えることを特徴とするプロセッサ。 In claim 3,
The processor is characterized in that the second register access order is rearranged based on the second bank access order and the third bank access order.
前記第1の処理部は、前記第1のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記第2の処理部は、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを前記複数のレジスタに第2のレジスタアクセス順序でアクセスして書き込み、
前記複数のレジスタに第3のレジスタアクセス順序でアクセスし、前記第1及び第2の処理部により書き込まれたデータを読出す第3の処理部をさらに有し、
前記制御部は、前記第3のレジスタアクセス順序を、前記第1及び第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御することを特徴とするプロセッサ。 In claim 1 or 2,
The first processing unit accesses and writes data read by accessing the memory in the first bank access order to a plurality of registers in the first register access order,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the second register access order,
A third processing unit for accessing the plurality of registers in a third register access order and reading data written by the first and second processing units;
The processor is configured to control the third register access order so that the third register access order is accessed sequentially from a register in which writing by the first and second processing units is completed.
前記複数のレジスタに第2のレジスタアクセス順序でアクセスして前記書き込まれたデータを読出す第2の処理部と、
前記第2のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1の処理部による書き込みが終了したレジスタから順にアクセスされる第3のレジスタアクセス順序に並べ替えて、前記第2の処理部に前記複数のレジスタへアクセスさせる制御部とを有するプロセッサ。 A first processing unit that accesses a plurality of registers in a first register access order and writes data;
A second processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The second register access order is rearranged to a third register access order in which the data to be read is sequentially accessed from the register in which the writing of the read data by the first processing unit is completed, among the plurality of registers. And a control unit that causes the processing unit to access the plurality of registers.
前記複数のレジスタに第2のレジスタアクセス順序でアクセスしてデータを書き込む第2の処理部と、
前記複数のレジスタに第3のレジスタアクセス順序でアクセスして前記第1、第2の処理部により書き込まれたデータを読出す第3の処理部と、
前記第3のレジスタアクセス順序を、前記複数のレジスタのうち、読み出すデータの前記第1、第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御する制御部とを有するプロセッサ。 A first processing unit that accesses a plurality of registers in a first register access order and writes data;
A second processing unit for writing data by accessing the plurality of registers in a second register access order;
A third processing unit that accesses the plurality of registers in a third register access order and reads data written by the first and second processing units;
And a control unit that controls the third register access order so as to sequentially access the data to be read from the register in which the writing by the first and second processing units of the plurality of registers is completed.
前記第1の処理部及び前記第2の処理部による前記複数のバンクへのアクセスが競合する場合に、前記第2のバンクアクセス順序を前記競合が生じない第3のバンクアクセス順序に並べ替えて前記第2の処理部を前記複数のバンクにアクセスさせる、
プロセッサの制御方法。 A first processing unit that accesses a plurality of banks of the memory in a first bank access order, and an access to the plurality of banks in a second bank access order is started following the start of access of the first processing unit. And a second processing unit for controlling a processor,
When access to the plurality of banks by the first processing unit and the second processing unit competes, the second bank access order is rearranged to a third bank access order that does not cause the conflict. Allowing the second processing unit to access the plurality of banks;
How to control the processor.
前記第2の処理部が、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記プロセッサが、前記複数のレジスタに第2のレジスタアクセス順序でアクセスして前記書き込まれたデータを読み出す第3の処理部をさらに有し、
前記第2のレジスタアクセス順序を、前記第1のレジスタアクセス順序による書き込みが終了したレジスタから順にアクセスするように制御する、
プロセッサの制御方法。 In claim 8,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the first register access order,
The processor further includes a third processing unit that accesses the plurality of registers in a second register access order and reads the written data;
The second register access order is controlled so as to be accessed sequentially from the register in which writing according to the first register access order is completed.
How to control the processor.
前記第1の処理部が、前記第1のバンクアクセス順序により前記メモリにアクセスして読み出したデータを複数のレジスタに第1のレジスタアクセス順序でアクセスして書き込み、
前記第2の処理部が、前記第3のバンクアクセス順序により前記メモリにアクセスして読み出したデータを前記複数のレジスタに第2のレジスタアクセス順序でアクセスして書き込み、
前記プロセッサが、前記複数のレジスタに第3のレジスタアクセス順序でアクセスして前記第1及び第2の処理部により書き込まれたデータを読出す第3の処理部をさらに有し、
前記第3のレジスタアクセス順序を、前記第1及び第2の処理部による書き込みが終了したレジスタから順にアクセスするように制御する、
プロセッサの制御方法。 In claim 8,
The first processing unit accesses and writes the data read by accessing the memory in the first bank access order to a plurality of registers in the first register access order,
The second processing unit accesses and writes the data read by accessing the memory in the third bank access order to the plurality of registers in the second register access order;
The processor further includes a third processing unit that accesses the plurality of registers in a third register access order and reads data written by the first and second processing units;
The third register access order is controlled so as to be accessed in order from the register in which writing by the first and second processing units is completed.
How to control the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011168522A JP5704012B2 (en) | 2011-08-01 | 2011-08-01 | Processor and control method of processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011168522A JP5704012B2 (en) | 2011-08-01 | 2011-08-01 | Processor and control method of processor |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013033350A JP2013033350A (en) | 2013-02-14 |
JP5704012B2 true JP5704012B2 (en) | 2015-04-22 |
Family
ID=47789195
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011168522A Active JP5704012B2 (en) | 2011-08-01 | 2011-08-01 | Processor and control method of processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5704012B2 (en) |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0660109A (en) * | 1992-08-07 | 1994-03-04 | Nec Corp | System for expressing matrix vector product function |
JPH06314264A (en) * | 1993-05-06 | 1994-11-08 | Nec Corp | Self-routing cross bar switch |
JP2908273B2 (en) * | 1995-03-29 | 1999-06-21 | 甲府日本電気株式会社 | Vector processing equipment |
JP2912609B2 (en) * | 1997-05-02 | 1999-06-28 | 松下電器産業株式会社 | Multiple address holding storage device |
JP2003186740A (en) * | 2001-12-19 | 2003-07-04 | Matsushita Electric Ind Co Ltd | Memory control device and memory control method |
US7149857B2 (en) * | 2002-05-14 | 2006-12-12 | Micron Technology, Inc. | Out of order DRAM sequencer |
US20060059320A1 (en) * | 2003-01-27 | 2006-03-16 | Mamiko Akizuki | Memory control device |
JP4820566B2 (en) * | 2005-03-25 | 2011-11-24 | パナソニック株式会社 | Memory access control circuit |
JP5623871B2 (en) * | 2010-11-04 | 2014-11-12 | Necプラットフォームズ株式会社 | Data transfer device, arithmetic device, device including the same, and data transfer method |
-
2011
- 2011-08-01 JP JP2011168522A patent/JP5704012B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013033350A (en) | 2013-02-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2650778B1 (en) | Method and apparatus for token triggered multithreading | |
US7680988B1 (en) | Single interconnect providing read and write access to a memory shared by concurrent threads | |
JP6011194B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
US8176265B2 (en) | Shared single-access memory with management of multiple parallel requests | |
EP2642392B1 (en) | Semiconductor integrated circuit device and system using the same | |
TWI733825B (en) | An apparatus and method for performing a rearrangement operation | |
EP2786245B1 (en) | A data processing apparatus and method for performing register renaming without additional registers | |
JP5834997B2 (en) | Vector processor, vector processor processing method | |
JP2006092042A (en) | Information processor and context switching method | |
JP5704012B2 (en) | Processor and control method of processor | |
JP5630281B2 (en) | Vector instruction control circuit and list vector overtaking control method | |
CN113656074B (en) | RISC architecture processor and parallel pipeline structure design method thereof | |
JP5380102B2 (en) | Microprocessor | |
WO2018138975A1 (en) | Computation processing device and information processing system | |
JP3980243B2 (en) | Information processing device | |
JP2636821B2 (en) | Parallel processing unit | |
JPH01173165A (en) | Vector data processor | |
JP2001125770A (en) | Method and device for arithmetic | |
JPH11338769A (en) | Information processor | |
JPS61194566A (en) | Vector data reference control method | |
JPH08272612A (en) | Pipeline computer simulator | |
JP2006196015A (en) | Data processor and system | |
JPS58181155A (en) | Storage device of state history | |
JPH04254985A (en) | Dram controller | |
JPH03202921A (en) | Sequence controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140430 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20141224 |
|
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: 20150127 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150209 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5704012 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |