JP4060960B2 - Cache storage - Google Patents
Cache storage Download PDFInfo
- Publication number
- JP4060960B2 JP4060960B2 JP26555098A JP26555098A JP4060960B2 JP 4060960 B2 JP4060960 B2 JP 4060960B2 JP 26555098 A JP26555098 A JP 26555098A JP 26555098 A JP26555098 A JP 26555098A JP 4060960 B2 JP4060960 B2 JP 4060960B2
- Authority
- JP
- Japan
- Prior art keywords
- vector
- data
- vector register
- storage device
- processing
- 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
Links
Images
Landscapes
- Complex Calculations (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Description
【0001】
(目次)
発明の属する技術分野
従来の技術
発明が解決しようとする課題
課題を解決するための手段
発明の実施の形態
・(a)本発明のアスペクト説明(図1〜図8)
・(b)一実施形態の説明(図9〜図20)
発明の効果
【0002】
【発明の属する技術分野】
本発明は、高性能な電子計算機にそなえられるキャッシュ記憶装置に関し、特に、高スループット演算を実現するためのベクトル処理機能を含むキャッシュ記憶装置に関するものである。
キャッシュ記憶装置は、プログラムを実行して処理を行なう際に参照する各種データの局所性に基づき、処理の高速化を実現するための高速,少容量の一時記憶装置である。
【0003】
一方、ベクトル処理方式は、多数のデータを組にしてベクトル処理データとし、それに対して同一の演算(ベクトル演算)を施すことにより、処理の高速化を実現するものである。
【0004】
【従来の技術】
従来より、データ処理の高速化を可能とするデータ処理方式として、ベクトル処理方式がある。
初期のベクトル処理装置は、主記憶装置(メモリ)に記憶されるベクトル処理データに対するメモリ−メモリ間での演算を基本とした命令体系を有していたが、このベクトル処理装置には、メモリアクセスに付随する遅延のため、命令の発行から実際に演算が開始されるまでの遅延時間が長いという課題があった。
【0005】
そこで、現在のベクトル処理装置においては、主記憶装置からベクトル処理データをベクトルレジスタに読み出し、レジスタ−レジスタ間でのベクトル処理を行なった後に、処理結果を主記憶装置に書き戻すロード・ストア方式が主流となっている。
一方、ベクトル演算以外の汎用演算であるスカラ演算(スカラ処理) を高速に行なうために、キャッシュ記憶装置が用いられている。
【0006】
ここで、キャッシュ記憶装置は、演算に必要な各種データ(命令データやオペランド等)を保持しうる高速,少容量の一時記憶装置であり、主記憶装置へのアクセス時間を短縮するためのものである。
従って、処理対象データのうち、並列処理可能なデータについてはベクトル処理を施し、それ以外のデータについてはスカラ処理を施せば、処理の高速化を更に図ることができるため、キャッシュ記憶装置を有するスカラ処理装置とベクトル処理装置とを組み合わせて使用することがより好ましい。
【0007】
そして、従来は、以下のようにして、スカラ処理装置とベクトル処理装置とを組み合わせて使用していた。
(1)スカラ処理装置とベクトル処理装置とは、それぞれ独立に主記憶装置にアクセスするようにする。そして、ベクトル処理装置は、主記憶装置から読み出したベクトル処理データをベクトルレジスタに格納し、このベクトルレジスタとの間で、直接ベクトル処理データのやりとりを行なう。
(2)ベクトル処理装置は、スカラ処理装置用のキャッシュ記憶装置を介して主記憶装置にアクセスするようにする。ここで、主記憶装置へのアクセスはキャッシュ記憶装置が行ない、ベクトル処理装置は、キャッシュ記憶装置が主記憶装置から読み出したベクトル処理データをベクトルレジスタに格納し、このベクトルレジスタとの間で、ベクトル処理データのやりとりを行なう。
【0008】
【発明が解決しようとする課題】
しかしながら、上記(1)の方法では、主記憶装置からのデータ転送路として、スカラ処理装置用のデータ転送路とベクトル処理装置用のデータ転送路とが多重化して設けられているため、データ転送路として使用される物理的な信号線の数が多くなり、スカラ処理装置とベクトル処理装置とを1つのチップ上に集積することが困難になるという課題がある。
【0009】
また、上記(2)の方法では、連続領域にないベクトル処理データに対してベクトル処理を行なう際に、ベクトル処理データがキャッシュ記憶装置上に疎に展開されることがあり、このときには、キャッシュ記憶装置における有効データの格納率が著しく低下するため、スカラ処理の効率が大きく低下するという課題がある。なお、従来の高速なスカラ処理装置が単独でベクトル処理に相当する計算を行なう場合でも、連続領域に配置されていないベクトル処理データに対しては、やはり同様にキャッシュ記憶装置を有効に利用することはできない。
【0010】
さらに、上記(1),(2)いずれの場合にも、キャッシュ記憶装置及びベクトルレジスタという二種類の記憶装置をそれぞれ別個に必要とするため、これら記憶装置及びその周辺装置の占有面積が大きくなり、やはりスカラ処理装置及びベクトル処理装置の集積化が困難になるという課題がある。
本発明は、このような課題に鑑み創案されたもので、キャッシュ記憶装置における有効データの格納率を低下させることなく、スカラ処理装置とベクトル処理装置とを1つのチップ上に集積化できるようにした、キャッシュ記憶装置を提供することを目的とする。
【0011】
【課題を解決するための手段】
このため、本発明のキャッシュ記憶装置は、一つの命令で一つ又は一対のデータを処理するスカラ処理装置及び一つの命令で同一の演算を多数要素からなるデータの組に施すベクトル処理装置と各種データを記憶する主記憶装置との間に介装され、該主記憶装置に記憶された前記データをコピーして格納する記憶部を有してなるキャッシュ記憶装置であって、該記憶部が、該スカラ処理装置用のスカラ処理データを格納するとともに、該ベクトル処理装置用のベクトル処理データを格納するためのベクトルレジスタとしての機能を有し、該ベクトルレジスタの領域の始点を示す始点情報と、該ベクトルレジスタの領域を形成する要素の配置間隔を示すインターリーブ・ファクターと、該ベクトルレジスタの長さを示す長さ情報と、該ベクトルレジスタの型情報またはバリッド情報を示すコントロール・ビットとを割当情報として保持するテーブルを更にそなえ、該テーブルを参照し該割当情報に基づき、クロスバースイッチを規則的に順次切り替えて、該記憶部に、該ベクトルレジスタとして用いられる領域の配置を規則的に分散して割り当て、該記憶部に分散して割り当てた該ベクトルレジスタの領域に、該ベクトル処理データを格納するように制御する制御部をそなえて構成されたことを特徴としている(請求項1)。
【0012】
このとき、該記憶部において該ベクトルレジスタの領域を動的に割り当ててもよい(請求項2)。
【0013】
また、該記憶部において該ベクトルレジスタとして割り当てられた領域以外の領域を、該スカラ処理データを格納する領域として割り当てることができる(請求項3)。
さらに、該記憶部における該ベクトルレジスタと該ベクトル処理装置との間でベクトル処理データの送受を行なう(請求項4)。
【0014】
また、該ベクトルレジスタを用いた該ベクトル処理装置による処理を終了すると、該制御部が、該記憶部において該ベクトルレジスタとして割り当てられた領域を解放してもよい(請求項5)。
具体的には、該ベクトルレジスタを用いた該ベクトル処理装置による処理を終了すると、該制御部が、該テーブルに保持された前記割当情報を無効化することにより、該記憶部において該ベクトルレジスタとして割り当てられた領域を解放してもよい(請求項6)。
【0015】
【発明の実施の形態】
(a)本発明のアスペクト説明
まず、図面を参照して本発明のアスペクトを説明する。
図1は本発明のキャッシュ記憶装置の構成のアスペクトを示すブロック図である。
【0016】
本発明のキャッシュ記憶装置1Aは、図1に示すように、一つの命令(スカラ処理命令)を実行して一つ又は一対のデータを処理するスカラ処理装置10及び演算器群(ベクトル処理装置;Vector Pipeline )3と、各種データを記憶する主記憶装置9との間に介装されている。
なお、図1には、キャッシュ記憶装置1A及び演算器群3が、1つのチップ1上に集積化された例が示されている。
また、図1では図示していないが、キャッシュ記憶装置1Aと主記憶装置9との間に、下位のキャッシュ記憶装置(2次キャッシュ記憶装置や3次キャッシュ記憶装置等)を介装してもよい。
【0017】
そして、このキャッシュ記憶装置1Aは、図1に示すように、データメモリ(記憶部;N-way Set-associative Cache Data Array)2,ベクトルアクセス制御装置(制御部)4,マッピングテーブル5,外部アクセス制御装置(External Data-Array Access Controller )7及びインタフェース部8をそなえて構成されている。
【0018】
ここで、中核となるのは、データメモリ2,演算器群3,マッピングテーブル5,ベクトルアクセス制御装置4,データメモリ2と演算器群3を結合する結合網である。
演算器群3は、複数の演算器3aからなり、これら演算器3aを用いて、一つの命令(ベクトル処理命令)を実行して、同一の演算を多数要素からなるデータの組(ベクトル処理データ)に施すベクトル処理(ベクトル演算)を行なうものである。
【0019】
また、データメモリ2は、複数のバンク2aからなり、主記憶装置9に記憶された前記データをコピーして格納するものである。なお、図1に示すキャッシュ記憶装置1Aでは、データメモリ2として、バンク2a当たり1リードポート,1ライトポートを持つものを用いているが、ポート数が多いバンクからなるデータメモリを用いることもできる。
【0020】
そして、データメモリ2は、スカラ処理装置10が処理を行なう際に必要となるデータ(スカラ処理データ)を格納する機能を有するとともに、演算器群3が処理を行なう際に必要となるデータ(ベクトル処理データ)を格納するための仮想的なベクトルレジスタ(以下、単にベクトルレジスタということがある)としての機能を有するものである。
【0021】
即ち、データメモリ2は、ベクトル処理を行なう際に用いるベクトルレジスタとスカラ処理を行なう際に用いるキャッシュとが統合された、キャッシュ兼用のデータメモリとして構成されている。
ここで、ベクトルレジスタは、例えば図2に示すように、ウェイ(way )及びライン(line)を使用したインターリーブ方式によって、データメモリ2のバンク2aの管理単位(ライン)上に割り当てられている。
【0022】
ここで、図2は、ウェイ数5,ライン数8のバンク2a上に仮想的に割り当てられたベクトルレジスタを示すものであり、この図2には、ベクトルレジスタの一例として、要素(演算要素)VR0−0,VR0−1,…,VR0−4からなる要素数5のベクトルレジスタVR0と、要素VR1−0,VR1−1,…,VR1−3からなる要素数4のベクトルレジスタVR1とが示されている。なお、以下では、ベクトルレジスタをVR,V,VVRと表記することがある。
【0023】
さらに、マッピングテーブル5は、データメモリ2のバンク2aにおいて、ベクトルレジスタとして機能させる領域(以下、ベクトルレジスタの領域という)の位置を指定するためのマッピング情報(割当情報)を保持するものである。
ここで、マッピング情報は、例えば各ベクトルレジスタ毎に記述され、この場合には以下の(1)〜(4)に示すような情報から構成されている。なお、これらの情報は、エントリあたり32〜64ビットあれば表現が可能である。
(1)始点情報〔ウェイ−ライン〕
各ベクトルレジスタの領域の始点を示す情報である。例えば、図2に示す例では、ベクトルレジスタVR0の場合には、要素VR0−0の位置を示す〔0−0〕が始点情報に相当し、ベクトルレジスタVR1の場合には、要素VR1−0の位置を示す〔1−3〕が始点情報に相当する。
(2)インタリーブ・ファクター(増分情報)〔ウェイ−ライン〕
各ベクトルレジスタの領域を形成する要素の配置間隔を示す情報であり、上記ベクトルレジスタVR0,VR1ともに、各要素の配置間隔〔1−1〕がインタリーブ・ファクターに相当する。
(3)長さ情報
各ベクトルレジスタの長さを示す情報であり、上記ベクトルレジスタVR0の場合には、〔5〕が長さ情報に相当し、ベクトルレジスタVR1の場合には、〔4〕が長さ情報に相当する。
(4)コントロール・ビット
各ベクトルレジスタの型情報〔精度(Precision )〕や、バリッド(Valid )情報等を示す情報である。なお、型情報はどの精度の情報を格納するかを示すものであり、バリッド情報はマッピング情報が有効か否かを示すものである。
【0024】
ここで、ベクトル処理を行なう場合には、スカラ処理装置10のプロセッサ(図示せず)が、演算に必要となるベクトルレジスタの数に応じ、当該ベクトルレジスタについてのマッピング情報をマッピングテーブル5へ書き込むようになっている。
なお、各ベクトルレジスタに対応したマッピングテーブル5を動的且つ柔軟に管理すれば、データメモリ2においてベクトルレジスタを動的且つ柔軟に割り当てることができる。
【0025】
また、ベクトルアクセス制御装置4は、マッピングテーブル5を参照し、前記マッピング情報に基づいて、データメモリ2に、ベクトルレジスタとして用いられる領域を分散して割り当て、データメモリ2に分散して割り当てた当該ベクトルレジスタの領域に、上記ベクトル処理データを格納するように制御するものである。
【0026】
そして、データメモリ2においては、当該ベクトルレジスタとして割り当てられた領域以外の領域は、スカラ処理データを格納する領域として割り当てられるようになっている。
さらに、ベクトルアクセス制御装置4は、ベクトルレジスタを用いた演算器群3による処理を終了すると、マッピングテーブル5に保持された前記マッピング情報を無効化する(具体的には、前記バリッド情報をOFFにする)ことにより、データメモリ2においてベクトルレジスタとして割り当てられた領域を解放する機能を有している。
【0027】
また、このベクトルアクセス制御装置4は、データメモリ2と演算器群3とを結合する結合網中に存在し、データメモリ2におけるベクトルレジスタと演算器群3との間でベクトル処理データの送受を行なえるようにするために、当該結合網を動的に切替えて、データメモリ2と各演算器3aとの間のベクトル処理データの流れを生成する機能も有している。
【0028】
このとき、ベクトルアクセス制御装置4では、クロスバースイッチ(又は多段スイッチ) の結合を動的に切替えて〔即ち、マッピング情報を利用して、例えばクロスバースイッチを切り替えて演算器3aとデータメモリ2との接続を規則的に制御して〕、効率良くベクトル処理データの流れを生成するようになっている。
ここで、クロスバー結合は、M個の入力ポートとN個の出力ポートとをつなぐ方式の一つであり、例えば、M本の横線とN本の縦線を格子状に交わらせて、M×N個の格子点のそれぞれにスイッチを配置したものと考えることができる。そして、入力ポートは一つのスイッチを経由して出力ポートに到達するようになっている。
【0029】
また、多段結合は、このような回線交換器を多段でつなぐものであり、入力ポートは複数のスイッチを経由して出力ポートに到達するようになっている。
ある演算を実行するときに、演算器群3の入力側では、M本の入力ポートがデータメモリ2のバンク2aのリードポートに接続され(即ち、ウエイ数が5ならM=5)、N本の出力ポートがそれぞれの演算器3aの入力ポートに接続される。
【0030】
ここで、V1+V2→V3の演算を実行するとき(図4参照)、図5に示すように、V1とV2の始点はそれぞれウェイ−1とウェイ−4になっているから、まず、演算器3aとウェイ−1/ウェイ−4をつなぐ。V1/V2の次の要素はウェイ−2とウェイ−0にあるから、次の接続は、ウェイ−2/ウェイ−0である。
【0031】
さらに、同様にして、ウェイ−3/ウェイ−1との接続で3番目の要素を読みだし、ウェイ−4/ウェイ−2で4番目の要素を読みだす。なお、図5には示していないが、ウェイ−0/ウェイ−3で5番目を読みだし、その後、6番目の要素はウェイ−1/ウェイ−4との接続に戻る。
このように、ベクトルレジスタ領域の配置が規則的であるため、スイッチを規則的に順次切り替えていくことにより、演算器3aとデータメモリ2のリードポート及びライトポートとの接続を制御することができる。
【0032】
なお、ベクトルアクセス制御装置4は、ベクトル処理の際に必要となる定数や別のオペランド等を格納するスカラオペランド/マスクレジスタ6をそなえている。
さらに、外部アクセス制御装置7は、主記憶装置9へのアクセスを制御するものであり、インタフェース部8は、スカラ処理装置10との間で命令及びデータの送受を行なうものである。
【0033】
上述の構成により、本発明のキャッシュ記憶装置1Aにおいては、以下で説明するような動作が行なわれる。なお、図6〜図8は、ベクトル演算処理を説明するためのフローチャートである。
まず、キャッシュ記憶装置1Aのマッピングテーブル5に有効な情報が格納されていない場合には、スカラ処理装置10によりスカラ演算が行なわれる。なお、このときキャッシュ記憶装置1Aでは、通常のキャッシュと同様の動作が行なわれる。
【0034】
一方、ベクトル処理を行なう場合には、スカラ処理装置10のプロセッサ(図示せず)により、マッピングテーブル5が設定される。
ここで、マッピングテーブル5の設定は、スカラ処理装置10のプロセッサが、演算に必要となるベクトルレジスタの数に応じ、オペランドのベクトルレジスタについてのマッピング情報を、キャッシュ記憶装置1Aのマッピングテーブル5に書き込むことにより行なわれる〔図6のステップS1(詳細には図7のステップA1〜A8参照)〕。
【0035】
そして、スカラ処理装置10のプロセッサによりベクトル演算命令が発行されると、キャッシュ記憶装置1Aでは、ベクトルアクセス制御装置4によりこのベクトル演算命令が処理される。
具体的には、ベクトルアクセス制御装置4は、設定されたマッピングテーブル5を参照し、命令で指定されたオペランドのベクトルレジスタについてのマッピング情報に基づいてデータメモリ2にベクトル処理データを分散して格納する一方、当該マッピング情報に応じて、演算器群3の演算器3aとデータメモリ2のベクトルレジスタの領域とを順次接続する。
【0036】
続いて、演算器群3では、ベクトルレジスタに格納されたベクトル処理データを参照して実際に演算が行なわれ、演算結果がバンク2aに書き戻される(図6のステップS2)。
ここで、典型的なベクトル演算の一例として、図3,図4に示すようなDAXPY演算(倍精度のAX+Y演算)を行なう場合について説明すると、図5に示すように4本の仮想的なベクトルレジスタVR0′〜VR3′が使用される。
【0037】
ここで、各ベクトルレジスタは、各要素がそれぞれ、ウェイ方向,ライン方向ともに1つづつ増加するように配置されている。つまり、インタリーブ・ファクターが〔1−1〕である。
なお、図5に示すように、ベクトルレジスタVR0′は要素VR0−0,VR0−1,…,VR0−3からなり、ベクトルレジスタVR1′は要素VR1−0,VR1−1,…,VR1−3からなり、ベクトルレジスタVR2′は要素VR2−0,VR2−1,…,VR2−3からなり、ベクトルレジスタVR3′は要素VR3−0,VR3−1,…,VR3−3からなる。
【0038】
最初のロード命令(LV)では、ベクトルレジスタVR0′に格納すべきベクトル処理データが主記憶装置9から読み込まれる。ここで、ベクトルレジスタVR0′の領域に有効なデータが既にキャッシュされているときには、この時点で必要に応じて当該データの無効化又は主記憶装置9への書き戻しが行なわれる。あるいは、ベクトルレジスタについてのマッピング情報を設定した時点で、ベクトルレジスタの領域を走査し、その領域に有効なデータが既にキャッシュされていることが検出できた時点で、当該データの無効化又は主記憶装置9への書き戻しを行なってもよい。
【0039】
そして、同様にして、乗算命令(MULTSV),ロード命令(LV),加算命令(ADDV),ストア命令(SV)を実行した後に、ベクトル処理が終了する。
なお、ベクトル処理を続ける必要がなければ、処理が終了した時点で、マッピングテーブル5におけるマッピング情報を無効化することにより、ベクトルレジスタとして割り当てられた領域が解放される〔図6のステップS3(詳細には図8のステップB1〜B4参照)〕。
【0040】
そして、解放された領域は、再びスカラ処理データを格納するキャッシュとして使用される。
このように、本発明のキャッシュ記憶装置1Aによれば、データメモリ2に、ベクトルレジスタとして用いられる領域を分散して割り当て、このベクトルレジスタの領域にベクトル処理データを格納するように制御しているので、キャッシュ記憶装置1Aにおける有効データの格納率を低下させることなくハードウエア量を削減することができ、ひいては、スカラ処理装置10と演算器群3とを1つのチップ上に集積化することができる。
【0041】
また、クロスバースイッチ(又は多段スイッチ) の結合を動的に切替えて、効率良くベクトル処理データの流れを生成しているため、データメモリ2のバンク2aをマルチポート化する必要がなくなり、集積化を容易にすることができる。
さらに、データメモリ2においてベクトルレジスタの領域を動的に割り当てることができるので、演算器群3の並行処理とチェイニングとを可能にすることができるほか、従来の技術において説明した(2)の方法と比較して、スカラ処理を行なう際に、特定アドレスのキャッシュのヒット率が下がらないようにデータ配置を調整することができる。
【0042】
また、従来の技術において説明した(1)の方法と比較すると、専用のインタフェースを設ける必要がないため、ハードウエア量を削減することができる。
さらに、スカラ処理装置10に設けられたキャッシュのコヒーレンス制御についても、本発明による方法によればデータをバイパスするための付加的なパスを設ける必要がなく、集積化を容易にすることができる。
【0043】
なお、コンパイラによる解析により、データメモリ2におけるベクトルレジスタの領域の割り当ての柔軟さは、以下のような特徴に結び付く。
即ち、インターリーブ値をウェイ数やライン数と互いに素とすることにより、ベクトル長の長いデータについても対応できるようになる。ただし、その場合には、構造ハザードが発生する可能性が増すため、同時に稼働可能なパイプライン数が減少することになる。
【0044】
また、各ベクトルレジスタの領域の始点をずらすことにより、繰り返し(Recurrence)演算に対応することができる。
さらに、タグ・ビットを拡張すれば、パイプラインのフローコントロールなどを可能にすることができる。
(b)一実施形態の説明
以下、図面を参照して本発明の実施の形態を説明する。
【0045】
図9は本発明の一実施形態にかかるキャッシュ記憶装置の構成を示すブロック図である。
このキャッシュ記憶装置11は、図9に示すように、スカラ処理命令を実行する例えばSPARC用の整数ユニット(スカラ処理装置;Integer Unit)20及び演算器群(ベクトル処理装置;Vector Pipeline )13と、各種データを記憶する主記憶装置23との間に介装されている。
【0046】
なお、図9には、キャッシュ記憶装置11,演算器群13及び整数ユニット20が、1つのチップ22上に集積化された例が示されている。
また、整数ユニット20には、整数レジスタ(Integer Registers )21が設けられている。
そして、このキャッシュ記憶装置11は、図9に示すように、データキャッシュ(記憶部;8-way Set-associative Data Cache)12,ベクトルアクセス制御装置(制御部;VCC)14,命令キャッシュ(Instruction Cache )18及びアドレス変換/ロード・ストア部(Address Translation /Load Store Unit )19をそなえて構成されている。
【0047】
ここで、演算器群13は、前述した演算器群3(図1参照)と同様に、複数の演算器13aからなり、これら演算器13aを用いて例えばSPARC用のベクトル処理命令〔ベクトル演算;具体的には、FP(Floating Point)加算命令(FP Add),FP乗算命令(FP Mul. ),FP除算命令(FP Div. ),グラフィック命令(Graphics),マスク命令(Mask)等〕を実行してベクトル処理を行なうものである。
【0048】
また、命令キャッシュ18は、主記憶装置23に記憶された命令データをコピーして格納するものであり、データキャッシュ12は、前述したデータメモリ2(図1参照)と同様に、複数のバンク12aからなり、主記憶装置23に記憶されたデータをコピーして格納するものである。
そして、データキャッシュ12は、整数ユニット20が処理を行なう際に必要となるデータ(スカラ処理データ)を格納する機能を有するとともに、演算器群13が処理を行なう際に必要となるデータ(ベクトル処理データ)を格納するための仮想的なベクトルレジスタとしての機能を有するものである。
【0049】
このベクトルレジスタも、前述したデータメモリ2におけるものと同様に、ウェイ及びラインを使用したインターリーブ方式によって、データキャッシュ12のバンク12aの管理単位(ライン)上に割り当てられている。
なお、命令キャッシュ18及びデータキャッシュ12について、現在の技術で実現可能であると思われる諸元を図10に示す。
【0050】
さらに、ベクトルアクセス制御装置14は、ベクトル処理を行なう際に、演算器群13とデータキャッシュ12とを制御するものであり、マッピングテーブル15,マスクレジスタ16及びスカラオペランド格納部17をそなえて構成されている。
ここで、マッピングテーブル15は、データキャッシュ12のバンク12aにおいて、ベクトルレジスタとして機能させる領域(以下、ベクトルレジスタの領域という)の位置を指定するためのマッピング情報(割当情報)を保持するものである。なお、マッピングテーブル15及びベクトルレジスタの具体例については、後述にて説明する。
【0051】
つまり、ベクトルアクセス制御装置14は、マッピングテーブル15を参照し、前記マッピング情報に基づいて、データキャッシュ12に、ベクトルレジスタとして用いられる領域を分散して割り当て、データキャッシュ12に分散して割り当てた当該ベクトルレジスタの領域に、上記ベクトル処理データを格納するように制御するものである。
【0052】
そして、データキャッシュ12においては、当該ベクトルレジスタとして割り当てられた領域以外の領域は、スカラ処理データを格納する領域として割り当てられるようになっている。
なお、ベクトルアクセス制御装置14は、ベクトルレジスタの割り当て状況を、後述するSPARC命令セット上から可視的なレジスタとして扱うようになっている。即ち、後述するように、マッピングテーブル15に格納すべき情報を、コプロセッサレジスタとして定義し(図12に示す%c0〜%c29)、可視的なレジスタとして、命令セット上で直接扱うようになっている。
【0053】
また、マスクレジスタ16は、ベクトルデータ中の複数の要素のうちマスク演算を施す一部の要素を指定するためのものであり(図12に示す%c30,%c31がマスクレジスタとして使用される)、スカラオペランド格納部17は、ベクトル処理に必要となる定数(スカラオペランド;図3に示す例ではC1)を格納するものである。
さらに、アドレス変換/ロード・ストア部19は、ベクトルアクセス制御装置14及び命令キャッシュ18からの要求を受けて、主記憶装置23へのアクセスを制御するものである。
【0054】
ここで、前述したマッピングテーブル15及びベクトルレジスタの具体例について説明する。
(1)第1の具体例
ウェイ数が8,セット数(ウェイ毎のライン数)が8であるデータキャッシュ12があり、それぞれのラインは演算要素(例えば、倍精度浮動小数点データ)を8個を格納できるものとする。
【0055】
データキャッシュ12上のデータは、ウェイ番号(x),ライン番号(y),ライン内位置(z)の3つのアドレスによって特定され、以下では、これをAx−y−zと表すことにする。
ここで、仮想ベクトルレジスタをVRnとし、それぞれのベクトルレジスタVRnが64個の演算要素VRn−mを持つときには、各演算要素VRn−mは、8ライン分のメモリに格納されることになる。
【0056】
例として、3つの仮想ベクトルレジスタを定義する場合について説明すると、各ベクトルレジスタから物理アドレス情報を作るためのマッピングテーブル15は、図13に示すように、VR番号に対応して、バリッド情報〔有効(Yes)/無効(No)〕,始点情報(始点),増分情報(増分,増分間隔),長さ(要素数),型情報からなる。
【0057】
ここで、始点,増分,増分間隔の3つ組の値は、それぞれウェイ,ライン,オフセットの3次元のアドレスに相当するものであり、増分間隔は、何個めの要素毎にそれぞれのアドレスに増分を加えるかを表すものである。
なお、型情報として示しているようなデータ型についての情報は、図13に示すようにマッピングテーブル15に置かず、命令により演算命令実行時に明示的に与えてもよい。
【0058】
そして、始点(Sx,Sy,Sz),増分(Ix,Iy,Iz),増分間隔(Dx,Dy,Dz)とすると、ベクトルレジスタのn番目の要素は、以下のアドレスに対応する。
A〔Sx+Ix* (n/Dx),Sy+Iy* (n/Dy),Sz+Iz* (n/Dz)〕 …(1)
ただし、式(1)中の除算は、整数除算による小数点以下を切り捨て、演算結果は、それぞれウェイ数,ライン数,ライン内要素数での剰余をとったものである。
【0059】
このとき、図13に示すマッピングテーブル15におけるベクトルレジスタVR0の各演算要素は、図14(a)に示すようになる。また、ベクトルレジスタVR1の各演算要素,ベクトルレジスタVR2 の各演算要素は、それぞれ図14(b),図14(c)に示すようになる。
従って、ベクトルレジスタVR0 ,VR1 ,VR2 のデータキャッシュ12上での領域は、それぞれ図15に示すようになる。なお、ベクトルレジスタVR0を例にあげると、各領域(VR0a−VR0h)とそこに格納されている要素との対応は、図16に示すようになる。
(2)第2の具体例
上述の第1の具体例では、ベクトルレジスタの隣接する演算要素が分散して配置される場合、即ち、演算要素VR0−0,VR0−1がそれぞれ領域VR0a,VR0bにある場合について説明したが、これらを同じ領域に置くこともできる。
【0060】
この場合には、マッピングテーブル15は図17に示すようになる。
この例では、ベクトルレジスタVR0のデータキャッシュ12上での領域は上述の第1の具体例の場合と同様であるが、各領域とそこに格納されている演算要素との対応が異なる(図18,図19参照)。
(3)第3の具体例
上述の第1,第2の具体例では、マッピングテーブル15は、各演算要素のデータキャッシュ12上でのアドレス情報を逐次に計算していくための情報を格納していたが、アドレス情報そのものを格納してもよい(図20参照)。
【0061】
この場合、領域内のオフセットについては、仮想ベクトルレジスタ内の演算要素番号から計算するようにすれば、マッピングテーブル15のサイズを小さくすることができる。
例えば、n番目の演算要素は領域(n/8)の(n mod 8)番目である、あるいは、逆に、領域(n mod 8)のn/8番目であるとすると、第1の具体例のマッピングテーブル15は、図20に示すように表すことができる。
【0062】
この方法では、ベクトルデータの長さに応じてマッピングテーブル15のサイズが大きくなるものの、より柔軟なマッピングが可能となる利点がある。
上述の構成により、本発明の一実施形態にかかるキャッシュ記憶装置11においては、前述したキャッシュ記憶装置1Aにおける動作と同様の動作が行なわれる(図6〜図8参照)。
【0063】
特に、以下では、SPARC命令セット中のコプロセッサ(Coprocessor )命令とFP命令に注目して、SPARC命令セットと仮想ベクトル処理との統合が自然に行なえることを説明する。
(1)命令流
整数ユニット20は、FP命令(FP Instructions ), ベクトル処理命令(VP Instructions )を含む全ての命令(All Instructions)を、命令キャッシュ18からフェッチする。
【0064】
ここで、ベクトル処理命令は、SPARC命令セット中のコプロセッサ命令を用いて実現されている。
また、整数ユニット20が独自に処理可能な整数演算命令などは、整数ユニット20で処理される。FP命令とベクトル処理命令は、データキャッシュ12へのストアと同じパス(メモリ・ストア・パス;図9ではMSPで示す)を利用して、整数ユニット20からベクトルアクセス制御装置14に送られる。このとき、必要ならば、整数ユニット20中の実行ステージで、実効アドレスが計算される。
【0065】
このとき、整数ユニット20とベクトルアクセス制御装置14間のメモリ・ストア・パスには、命令とデータを区別する若干の信号線を付加するだけで良い。
そして、ベクトルアクセス制御装置14に送られた命令は、内部でデコードされた後、そのタイプに応じて処理される。
(2)スカラオペランドとベクトルオペランド
FP命令のオペランド格納用として使用されるFPレジスタは、一部のVP命令におけるスカラオペランド格納用としても使用される。
【0066】
ここで、FP命令は、ベクトル処理用の演算パイプラインを利用して処理される。
また、VP命令のオペランドは、直接的には、マッピングテーブル15のエントリか、マスクレジスタ16を指している。
演算命令のオペランドも同様であるが、実際には、計算は、そのエントリに記述された仮想ベクトルレジスタを対象として行なわれる。
【0067】
SPARC命令セットでは、コプロセッサ用のロード/ストア命令のオペランドとなるレジスタサイズを32ビット又は64ビットと仮定しているが、マッピングテーブル15のエントリを直接オペランドとする方式は、この仮定には反しない。
つまり、SPARC(Version 8)のコプロセッサ命令フォーマットは、図11に示すようになっており、一般的なコプロセッサレジスタは、基本的にはシングルワードを扱い、場合によってはダブルワードを扱うようになっているが、前述のごとく、マッピングテーブル15に格納すべき情報はこの簡単なアーキテクチャ上では32ビットあれば表現が可能である。
【0068】
そこで、マッピングテーブル15に格納すべき情報を、図12に示すようにコプロセッサレジスタとして定義し、可視的なレジスタとして、命令セット上で直接扱えるようにしておく。
これは、ベクトルレジスタの割り当て状況を示すマッピングテーブル15が、コプロセッサレジスタ〔図12に示す%c0〜%c29がコプロセッサレジスタに相当する。ここで、各%cn(n=0〜31)は32ビットのレジスタである。〕として、命令セット上、ソフトウエアから直接見えていることを指している。
【0069】
即ち、コプロセッサレジスタ(図12に示す%c0〜%c29)のそれぞれが、VVR0〜VVR29のマッピング情報を格納するのであり、例えばVVR0を定義する場合には、%c0にVVR0のマッピング情報を書き込めばよい。
つまり、マッピングテーブル15の設定は、コプロセッサレジスタへ値の書き込むことにより行ない、このコプロセッサレジスタから値を読み出すことにより、現在のマッピング情報を取り出すようにする。
【0070】
なお、図12に示すものは一例であるが、後は、CPop命令(コプロセッサ命令)の中に、仮想ベクトルレジスタの中身を操作するための若干の命令〔通常のベクトル演算命令(ベクトルロード命令,ベクトルストア命令,ベクトル加算/乗算/減算/除算命令,グラフィックス命令等)〕を定義しておけば、SPARC命令セットの中に十分おさめることができる。
【0071】
即ち、SPARC(Version 8)のCPop命令(コプロセッサ命令)には、演算の種類を示す情報を格納するためのフィールドがあり、そのフィールドを使って通常のベクトル演算命令を定義しておけば、SPARCの命令セットの中に十分おさめることができる。
このような本発明の一実施形態にかかるキャッシュ記憶装置11によっても、前述したキャッシュ記憶装置1Aと同様の利点を得ることができる。
【0072】
【発明の効果】
以上詳述したように、本発明のキャッシュ記憶装置によれば、記憶部に、ベクトルレジスタとして用いられる領域を分散して割り当て、分散して割り当てたベクトルレジスタの領域にベクトル処理データを格納するように制御しているので、キャッシュ記憶装置における有効データの格納率を低下させることなくハードウエア量を削減することができ、ひいては、スカラ処理装置とベクトル処理装置とを1つのチップ上に集積化することができる利点がある(請求項1,3〜6)。
【0073】
また、記憶部においてベクトルレジスタの領域を動的に割り当てることができるので、ベクトル処理装置での並行処理とチェイニングとを可能にすることができるほか、スカラ処理を行なう際に、特定アドレスのキャッシュのヒット率が下がらないようにデータ配置を調整することができる利点がある(請求項2)。
【図面の簡単な説明】
【図1】本発明のキャッシュ記憶装置の構成のアスペクトを示すブロック図である。
【図2】本発明における仮想的なベクトルレジスタについて説明するための図である。
【図3】ベクトル演算の一例について説明するための図である。
【図4】ベクトル演算の一例について説明するための図である。
【図5】本発明における仮想的なベクトルレジスタについて説明するための図である。
【図6】本発明のキャッシュ記憶装置におけるベクトル演算処理の手順を示すためのフローチャートである。
【図7】本発明のキャッシュ記憶装置におけるベクトル演算処理の手順を示すためのフローチャートである。
【図8】本発明のキャッシュ記憶装置におけるベクトル演算処理の手順を示すためのフローチャートである。
【図9】本発明の一実施形態にかかるキャッシュ記憶装置の構成を示すブロック図である。
【図10】命令キャッシュ及びデータキャッシュについて説明するための図である。
【図11】SPARCのコプロセッサ命令フォーマットを示す図である。
【図12】コプロセッサレジスタについて説明するための図である。
【図13】マッピングテーブル及びベクトルレジスタの第1の具体例について説明するための図である。
【図14】(a)〜(c)は、いずれもマッピングテーブル及びベクトルレジスタの第1の具体例について説明するための図である。
【図15】マッピングテーブル及びベクトルレジスタの第1の具体例について説明するための図である。
【図16】マッピングテーブル及びベクトルレジスタの第1の具体例について説明するための図である。
【図17】マッピングテーブル及びベクトルレジスタの第2の具体例について説明するための図である。
【図18】マッピングテーブル及びベクトルレジスタの第2の具体例について説明するための図である。
【図19】マッピングテーブル及びベクトルレジスタの第2の具体例について説明するための図である。
【図20】マッピングテーブル及びベクトルレジスタの第3の具体例について説明するための図である。
【符号の説明】
1 チップ
1A キャッシュ記憶装置
2 データメモリ(記憶部)
2a バンク
3 演算器群(ベクトル処理装置)
3a 演算器
4 ベクトルアクセス制御装置(制御部)
5 マッピングテーブル
6 スカラオペランド/マスクレジスタ
7 外部アクセス制御装置
8 インタフェース部
9 主記憶装置
10 スカラ処理装置
11 キャッシュ記憶装置
12 データキャッシュ(記憶部)
12a バンク
13 演算器群(ベクトル処理装置)
13a 演算器
14 ベクトルアクセス制御装置(制御部)
15 マッピングテーブル
16 マスクレジスタ
17 スカラオペランド格納部
18 命令キャッシュ
19 アドレス変換/ロード・ストア部
20 整数ユニット(スカラ処理装置)
21 整数レジスタ
22 チップ
23 主記憶装置[0001]
(table of contents)
TECHNICAL FIELD OF THE INVENTION
Conventional technology
Problems to be solved by the invention
Means for solving the problem
BEST MODE FOR CARRYING OUT THE INVENTION
(A) Aspect description of the present invention (FIGS. 1 to 8)
(B) Description of one embodiment (FIGS. 9 to 20)
The invention's effect
[0002]
BACKGROUND OF THE INVENTION
The present invention relates to a cache storage device provided in a high-performance electronic computer, and more particularly to a cache storage device including a vector processing function for realizing a high-throughput operation.
The cache storage device is a high-speed, small-capacity temporary storage device for realizing high-speed processing based on the locality of various data referred to when executing processing by executing a program.
[0003]
On the other hand, the vector processing method realizes high-speed processing by combining a large number of data into vector processing data and performing the same operation (vector operation) on the data.
[0004]
[Prior art]
Conventionally, there is a vector processing method as a data processing method that enables high-speed data processing.
Early vector processing devices had an instruction system based on operations between memory and memory for vector processing data stored in a main memory (memory). Due to the delay associated with the operation, there is a problem that the delay time from the issue of the instruction to the actual start of the operation is long.
[0005]
Therefore, in the current vector processing device, there is a load / store method in which vector processing data is read from the main storage device to the vector register, the vector processing is performed between the register and the register, and the processing result is written back to the main storage device. It has become mainstream.
On the other hand, a cache storage device is used to perform a scalar operation (scalar processing), which is a general-purpose operation other than vector operations, at high speed.
[0006]
Here, the cache storage device is a high-speed, small-capacity temporary storage device that can hold various data (instruction data, operands, etc.) necessary for the operation, and is intended to shorten the access time to the main storage device. is there.
Therefore, if data that can be processed in parallel among the data to be processed is subjected to vector processing and scalar processing is performed on other data, the processing speed can be further increased. Therefore, a scalar having a cache storage device can be obtained. More preferably, the processing device and the vector processing device are used in combination.
[0007]
Conventionally, a scalar processing device and a vector processing device are used in combination as follows.
(1) The scalar processing device and the vector processing device each access the main storage device independently. The vector processing device stores the vector processing data read from the main storage device in the vector register, and directly exchanges the vector processing data with the vector register.
(2) The vector processing device accesses the main storage device via the cache storage device for the scalar processing device. Here, access to the main storage device is performed by the cache storage device, and the vector processing device stores vector processing data read from the main storage device by the cache storage device in the vector register, and a vector is transferred to and from this vector register. Exchange processing data.
[0008]
[Problems to be solved by the invention]
However, in the method (1), since the data transfer path for the scalar processing device and the data transfer path for the vector processing device are multiplexed as the data transfer path from the main storage device, the data transfer There is a problem that the number of physical signal lines used as paths increases and it becomes difficult to integrate the scalar processing device and the vector processing device on one chip.
[0009]
In the method (2), when vector processing is performed on vector processing data not in a continuous area, the vector processing data may be sparsely expanded on the cache storage device. Since the storage rate of effective data in the apparatus is significantly reduced, there is a problem that the efficiency of scalar processing is greatly reduced. Even when a conventional high-speed scalar processor alone performs a calculation corresponding to vector processing, the cache storage device should be used effectively in the same manner for vector processing data not arranged in a continuous area. I can't.
[0010]
Further, in both cases (1) and (2), two types of storage devices, a cache storage device and a vector register, are separately required, and the area occupied by these storage devices and their peripheral devices increases. Also, there is a problem that integration of the scalar processing device and the vector processing device becomes difficult.
The present invention has been devised in view of such problems, so that the scalar processing device and the vector processing device can be integrated on one chip without reducing the storage rate of valid data in the cache storage device. It is an object of the present invention to provide a cache storage device.
[0011]
[Means for Solving the Problems]
For this reason, the cache storage device of the present invention includes a scalar processing device that processes one or a pair of data with one instruction, a vector processing device that performs the same operation on a data set consisting of multiple elements with one instruction, and various types. A cache storage device interposed between a main storage device for storing data and having a storage unit for copying and storing the data stored in the main storage device, the storage unit comprising: Stores scalar processing data for the scalar processing device and has a function as a vector register for storing vector processing data for the vector processing device, The Vector register area Starting point information indicating the starting point of the vector register, an interleave factor indicating the arrangement interval of elements forming the area of the vector register, length information indicating the length of the vector register, type information or valid information of the vector register Control bit indicating Allocation information As A table to be held is further provided, the crossbar switch is regularly switched sequentially based on the allocation information with reference to the table, and the arrangement of the areas used as the vector registers is regularly distributed in the storage unit. The control unit is configured to control to store the vector processing data in the area of the vector register allocated and distributed to the storage unit (claim 1).
[0012]
This In this case, the vector register area may be dynamically allocated in the storage unit. 2 ).
[0013]
An area other than the area allocated as the vector register in the storage unit can be allocated as an area for storing the scalar processing data. 3 ).
Furthermore, transmission and reception of vector processing data is performed between the vector register and the vector processing device in the storage unit (claim). 4 ).
[0014]
Further, when the processing by the vector processing device using the vector register is finished, the control unit may release an area allocated as the vector register in the storage unit (claim). 5 ).
Specifically, when the processing by the vector processing device using the vector register ends, the control unit invalidates the allocation information held in the table, so that the storage unit stores the vector register as the vector register. The allocated space may be freed (claims) 6 ).
[0015]
DETAILED DESCRIPTION OF THE INVENTION
(A) Aspect description of the present invention
First, aspects of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing an aspect of the configuration of the cache storage device of the present invention.
[0016]
As shown in FIG. 1, the
FIG. 1 shows an example in which the
Although not shown in FIG. 1, a lower-level cache storage device (secondary cache storage device, tertiary cache storage device, etc.) may be interposed between the
[0017]
As shown in FIG. 1, the
[0018]
Here, the core is a
The
[0019]
The
[0020]
The
[0021]
In other words, the
Here, for example, as shown in FIG. 2, the vector register is allocated on the management unit (line) of the bank 2a of the
[0022]
Here, FIG. 2 shows a vector register virtually allocated on the bank 2a having the number of
[0023]
Further, the mapping table 5 holds mapping information (allocation information) for designating the position of an area functioning as a vector register (hereinafter referred to as a vector register area) in the bank 2a of the
Here, the mapping information is described for each vector register, for example. In this case, the mapping information is composed of information as shown in the following (1) to (4). Such information can be expressed by 32 to 64 bits per entry.
(1) Start point information [way-line]
This is information indicating the starting point of each vector register area. For example, in the example shown in FIG. 2, in the case of the vector register VR0, [0-0] indicating the position of the element VR0-0 corresponds to the start point information, and in the case of the vector register VR1, the element VR1-0 is stored. [1-3] indicating the position corresponds to the starting point information.
(2) Interleave factor (incremental information) [way-line]
This is information indicating the arrangement interval of the elements forming the area of each vector register. In both the vector registers VR0 and VR1, the arrangement interval [1-1] of each element corresponds to the interleave factor.
(3) Length information
Information indicating the length of each vector register. In the case of the vector register VR0, [5] corresponds to length information, and in the case of the vector register VR1, [4] corresponds to length information. .
(4) Control bit
This is information indicating the type information [Precision] of each vector register, valid information, and the like. The type information indicates what precision information is stored, and the valid information indicates whether the mapping information is valid.
[0024]
Here, when performing vector processing, a processor (not shown) of the
If the mapping table 5 corresponding to each vector register is managed dynamically and flexibly, the vector register can be dynamically and flexibly allocated in the
[0025]
Further, the vector
[0026]
In the
Further, the vector
[0027]
The vector
[0028]
At this time, the vector
Here, the crossbar coupling is one of a method of connecting M input ports and N output ports. For example, M horizontal lines and N vertical lines are crossed in a grid pattern, and M It can be considered that a switch is arranged at each of the × N lattice points. The input port reaches the output port via one switch.
[0029]
In addition, multistage coupling connects such circuit switches in multiple stages, and an input port reaches an output port via a plurality of switches.
When executing a certain operation, on the input side of the
[0030]
Here, when the calculation of V1 + V2 → V3 is executed (see FIG. 4), the start points of V1 and V2 are respectively way-1 and way-4 as shown in FIG. And way-1 / way-4. Since the next element of V1 / V2 is in way-2 and way-0, the next connection is way-2 / way-0.
[0031]
Similarly, the third element is read by connection with way-3 / way-1, and the fourth element is read by way-4 / way-2. Although not shown in FIG. 5, the fifth is read by way-0 / way-3, and then the sixth element returns to the connection with way-1 / way-4.
As described above, since the arrangement of the vector register areas is regular, the connection between the
[0032]
The vector
Further, the external
[0033]
With the above-described configuration, the
First, when valid information is not stored in the mapping table 5 of the
[0034]
On the other hand, when performing vector processing, the mapping table 5 is set by a processor (not shown) of the
Here, the mapping table 5 is set in such a manner that the processor of the
[0035]
When a vector operation instruction is issued by the processor of the
Specifically, the vector
[0036]
Subsequently, in the
Here, as an example of a typical vector operation, a case of performing a DAXPY operation (double-precision AX + Y operation) as shown in FIGS. 3 and 4 will be described. As shown in FIG. 5, four virtual vectors are used. Registers VR0 'to VR3' are used.
[0037]
Here, each vector register is arranged so that each element increases by one in both the way direction and the line direction. That is, the interleave factor is [1-1].
As shown in FIG. 5, the vector register VR0 ′ is composed of elements VR0-0, VR0-1,..., VR0-3, and the vector register VR1 ′ is composed of elements VR1-0, VR1-1,. The vector register VR2 'is composed of elements VR2-0, VR2-1, ..., VR2-3, and the vector register VR3' is composed of elements VR3-0, VR3-1, ..., VR3-3.
[0038]
In the first load instruction (LV), vector processing data to be stored in the vector register VR0 ′ is read from the
[0039]
Similarly, after executing the multiplication instruction (MULTSV), the load instruction (LV), the addition instruction (ADDV), and the store instruction (SV), the vector processing ends.
If it is not necessary to continue the vector processing, the mapping information in the mapping table 5 is invalidated when the processing is completed, and the area allocated as the vector register is released [Step S3 in FIG. 6 (Details). (See Steps B1 to B4 in FIG. 8)].
[0040]
The released area is used again as a cache for storing scalar processing data.
As described above, according to the
[0041]
In addition, since the crossover switch (or multistage switch) coupling is dynamically switched to efficiently generate the vector processing data flow, the bank 2a of the
Furthermore, since the vector register area can be dynamically allocated in the
[0042]
Further, compared with the method (1) described in the prior art, it is not necessary to provide a dedicated interface, so that the amount of hardware can be reduced.
Further, with respect to the cache coherence control provided in the
[0043]
It should be noted that the flexibility of the allocation of the vector register area in the
That is, by making the interleave value relatively prime with the number of ways and the number of lines, it is possible to cope with data having a long vector length. In this case, however, the possibility of structural hazards increases, and the number of pipelines that can be operated simultaneously decreases.
[0044]
Further, it is possible to cope with a recursion operation by shifting the starting point of each vector register area.
Furthermore, if the tag bit is expanded, pipeline flow control can be realized.
(B) Description of one embodiment
Embodiments of the present invention will be described below with reference to the drawings.
[0045]
FIG. 9 is a block diagram showing the configuration of the cache storage device according to the embodiment of the present invention.
As shown in FIG. 9, the
[0046]
FIG. 9 shows an example in which the
The
As shown in FIG. 9, the
[0047]
Here, the
[0048]
The
The
[0049]
This vector register is also allocated on the management unit (line) of the
Note that, for the
[0050]
Further, the vector
Here, the mapping table 15 holds mapping information (allocation information) for designating the position of an area functioning as a vector register (hereinafter referred to as a vector register area) in the
[0051]
That is, the vector
[0052]
In the
The vector
[0053]
The
Further, the address translation / load /
[0054]
Here, specific examples of the mapping table 15 and the vector register described above will be described.
(1) First specific example
It is assumed that there is a
[0055]
The data on the
Here, when the virtual vector register is VRn and each vector register VRn has 64 operation elements VRn-m, each operation element VRn-m is stored in the memory for 8 lines.
[0056]
As an example, a case where three virtual vector registers are defined will be described. As shown in FIG. 13, a mapping table 15 for creating physical address information from each vector register has valid information [valid (Yes) / invalid (No)], start point information (start point), increment information (increment, increment interval), length (number of elements), and type information.
[0057]
Here, the triplet values of the start point, increment, and increment interval correspond to the three-dimensional addresses of way, line, and offset, respectively, and the increment interval is set to each address for every number of elements. Indicates whether to add an increment.
Information about the data type as shown as type information may not be placed in the mapping table 15 as shown in FIG.
[0058]
Then, assuming that the start point (Sx, Sy, Sz), the increment (Ix, Iy, Iz), and the increment interval (Dx, Dy, Dz), the nth element of the vector register corresponds to the following address.
A [Sx + Ix * (n / Dx), Sy + Iy * (n / Dy), Sz + Iz * (n / Dz)] (1)
However, the division in the expression (1) is performed by rounding down the fractional part by integer division, and the calculation result is obtained by taking the remainder in the number of ways, the number of lines, and the number of elements in the line, respectively.
[0059]
At this time, each operation element of the vector register VR0 in the mapping table 15 shown in FIG. 13 is as shown in FIG. Further, each operation element of the vector register VR1 and each operation element of the vector register VR2 are as shown in FIGS. 14 (b) and 14 (c), respectively.
Accordingly, the areas of the vector registers VR0, VR1, VR2 on the
(2) Second specific example
In the first specific example described above, the case where the calculation elements adjacent to each other in the vector register are distributed, that is, the case where the calculation elements VR0-0 and VR0-1 are in the areas VR0a and VR0b, respectively, has been described. They can also be placed in the same area.
[0060]
In this case, the mapping table 15 is as shown in FIG.
In this example, the area of the vector register VR0 on the
(3) Third specific example
In the first and second specific examples described above, the mapping table 15 stores information for sequentially calculating the address information on the
[0061]
In this case, the size of the mapping table 15 can be reduced by calculating the offset in the area from the operation element number in the virtual vector register.
For example, if the nth arithmetic element is the (n mod 8) th of the area (n / 8), or conversely, the n th arithmetic element is the n / 8 th of the area (n mod 8), the first specific example The mapping table 15 can be expressed as shown in FIG.
[0062]
Although this method increases the size of the mapping table 15 in accordance with the length of the vector data, there is an advantage that more flexible mapping is possible.
With the above-described configuration, the
[0063]
In particular, in the following, focusing on coprocessor instructions and FP instructions in the SPARC instruction set, it will be described that the SPARC instruction set and virtual vector processing can be naturally integrated.
(1) Instruction flow
The
[0064]
Here, the vector processing instruction is realized by using a coprocessor instruction in the SPARC instruction set.
In addition, an integer operation instruction that can be independently processed by the
[0065]
At this time, it is only necessary to add a few signal lines for distinguishing instructions and data to the memory store path between the
Then, the instruction sent to the vector
(2) Scalar operand and vector operand
The FP register used for storing operands of the FP instruction is also used for storing scalar operands in some VP instructions.
[0066]
Here, the FP instruction is processed using an arithmetic pipeline for vector processing.
The operand of the VP instruction directly points to the entry of the mapping table 15 or the
The same applies to the operand of the operation instruction, but actually, the calculation is performed on the virtual vector register described in the entry.
[0067]
In the SPARC instruction set, the register size used as the operand of the load / store instruction for the coprocessor is assumed to be 32 bits or 64 bits. However, the method in which the entry of the mapping table 15 is the direct operand is contrary to this assumption. do not do.
In other words, the coprocessor instruction format of SPARC (Version 8) is as shown in FIG. 11, and a general coprocessor register basically handles a single word and in some cases handles a double word. However, as described above, the information to be stored in the mapping table 15 can be expressed by 32 bits on this simple architecture.
[0068]
Therefore, the information to be stored in the mapping table 15 is defined as a coprocessor register as shown in FIG. 12, and can be directly handled on the instruction set as a visible register.
This is because the mapping table 15 indicating the allocation status of the vector register corresponds to the coprocessor register [% c0 to% c29 shown in FIG. 12 corresponds to the coprocessor register. Here, each% cn (n = 0 to 31) is a 32-bit register. ] Indicates that it is directly visible from the software on the instruction set.
[0069]
That is, each of the coprocessor registers (% c0 to% c29 shown in FIG. 12) stores the mapping information of VVR0 to VVR29. For example, when defining VVR0, the mapping information of VVR0 can be written to% c0. That's fine.
That is, the mapping table 15 is set by writing a value to the coprocessor register, and reading the value from the coprocessor register to extract the current mapping information.
[0070]
The example shown in FIG. 12 is an example, but after that, some instructions for manipulating the contents of the virtual vector register in the CPop instruction (coprocessor instruction) [ordinary vector operation instructions (vector load instructions) , Vector store instructions, vector addition / multiplication / subtraction / division instructions, graphics instructions, etc.)] can be sufficiently included in the SPARC instruction set.
[0071]
That is, the SPARC (Version 8) CPop instruction (coprocessor instruction) has a field for storing information indicating the type of operation. If a normal vector operation instruction is defined using this field, It can fit in the SPARC instruction set.
The
[0072]
【The invention's effect】
As described above in detail, according to the cache storage device of the present invention, the area used as the vector register is distributed and allocated to the storage unit, and the vector processing data is stored in the area of the distributed and allocated vector register. Therefore, it is possible to reduce the amount of hardware without lowering the storage rate of valid data in the cache storage device. As a result, the scalar processing device and the vector processing device are integrated on one chip. There is an advantage that can be 3-6 ).
[0073]
In addition, since the vector register area can be dynamically allocated in the storage unit, parallel processing and chaining can be performed in the vector processing device, and a cache of a specific address can be used when performing scalar processing. There is an advantage that the data arrangement can be adjusted so that the hit rate does not decrease. 2 ).
[Brief description of the drawings]
FIG. 1 is a block diagram showing an aspect of a configuration of a cache storage device of the present invention.
FIG. 2 is a diagram for explaining a virtual vector register in the present invention.
FIG. 3 is a diagram for explaining an example of vector calculation;
FIG. 4 is a diagram for explaining an example of vector calculation;
FIG. 5 is a diagram for explaining a virtual vector register in the present invention.
FIG. 6 is a flowchart for illustrating a procedure of vector operation processing in the cache storage device of the present invention.
FIG. 7 is a flowchart for showing a procedure of vector operation processing in the cache storage device of the present invention;
FIG. 8 is a flowchart for illustrating a procedure of vector operation processing in the cache storage device of the present invention.
FIG. 9 is a block diagram showing a configuration of a cache storage device according to an embodiment of the present invention.
FIG. 10 is a diagram for explaining an instruction cache and a data cache;
FIG. 11 is a diagram illustrating a SPARC coprocessor instruction format;
FIG. 12 is a diagram for explaining a coprocessor register;
FIG. 13 is a diagram for describing a first specific example of a mapping table and a vector register;
FIGS. 14A to 14C are diagrams for explaining a first specific example of a mapping table and a vector register. FIG.
FIG. 15 is a diagram for describing a first specific example of a mapping table and a vector register;
FIG. 16 is a diagram for describing a first specific example of a mapping table and a vector register;
FIG. 17 is a diagram for describing a second specific example of a mapping table and a vector register;
FIG. 18 is a diagram for describing a second specific example of a mapping table and a vector register;
FIG. 19 is a diagram for describing a second specific example of a mapping table and a vector register;
FIG. 20 is a diagram for explaining a third specific example of the mapping table and the vector register;
[Explanation of symbols]
1 chip
1A Cache storage device
2 Data memory (storage unit)
2a bank
3 arithmetic unit group (vector processing unit)
3a arithmetic unit
4. Vector access control device (control unit)
5 Mapping table
6 Scalar operand / mask register
7 External access control device
8 Interface section
9 Main memory
10 SCARA processing equipment
11 Cache storage device
12 Data cache (storage unit)
12a bank
13 arithmetic unit group (vector processing device)
13a arithmetic unit
14 Vector access control device (control unit)
15 Mapping table
16 Mask register
17 Scalar operand storage
18 Instruction cache
19 Address conversion / load / store section
20 integer unit (scalar processor)
21 Integer register
22 chips
23 Main memory
Claims (6)
該記憶部が、該スカラ処理装置用のスカラ処理データを格納するとともに、該ベクトル処理装置用のベクトル処理データを格納するためのベクトルレジスタとしての機能を有し、
該ベクトルレジスタの領域の始点を示す始点情報と、該ベクトルレジスタの領域を形成する要素の配置間隔を示すインターリーブ・ファクターと、該ベクトルレジスタの長さを示す長さ情報と、該ベクトルレジスタの型情報またはバリッド情報を示すコントロール・ビットとを割当情報として保持するテーブルを更にそなえ、
該テーブルを参照し該割当情報に基づき、クロスバースイッチを規則的に順次切り替えて、該記憶部に、該ベクトルレジスタとして用いられる領域の配置を規則的に分散して割り当て、該記憶部に分散して割り当てた該ベクトルレジスタの領域に、該ベクトル処理データを格納するように制御する制御部をそなえて構成されたことを特徴とする、キャッシュ記憶装置。Between a scalar processing device that processes one or a pair of data with one instruction and a vector processing device that performs the same operation on a data set consisting of multiple elements with one instruction, and a main storage device that stores various data A cache storage device having a storage unit for interpolating and storing the data stored in the main storage device;
The storage unit stores scalar processing data for the scalar processing device and has a function as a vector register for storing vector processing data for the vector processing device,
Start point information indicating the start point of the area of the vector register, an interleave factor indicating an arrangement interval of elements forming the area of the vector register, length information indicating the length of the vector register, and the type of the vector register further comprising a table for holding the control bit indicating information or valid information as assignment information,
Based on the allocation information with reference to the table, the crossbar switches are regularly switched sequentially, and the allocation of the areas used as the vector registers is regularly distributed and allocated to the storage unit, and distributed to the storage unit A cache storage device comprising a control unit that controls to store the vector processing data in the area of the vector register allocated in this manner.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP26555098A JP4060960B2 (en) | 1998-09-18 | 1998-09-18 | Cache storage |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP26555098A JP4060960B2 (en) | 1998-09-18 | 1998-09-18 | Cache storage |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000099496A JP2000099496A (en) | 2000-04-07 |
| JP4060960B2 true JP4060960B2 (en) | 2008-03-12 |
Family
ID=17418678
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP26555098A Expired - Fee Related JP4060960B2 (en) | 1998-09-18 | 1998-09-18 | Cache storage |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4060960B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011033862A1 (en) * | 2009-09-15 | 2011-03-24 | 日本電気株式会社 | Information processing device and data transfer method |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4687729B2 (en) * | 2008-03-04 | 2011-05-25 | 日本電気株式会社 | Cache memory, vector processing apparatus, and vector data alignment method |
| JP5419134B2 (en) * | 2009-03-04 | 2014-02-19 | エヌイーシーコンピュータテクノ株式会社 | Vector processor and vector instruction issuing method |
| US8836709B2 (en) | 2011-08-18 | 2014-09-16 | International Business Machines Corporation | Vector register file caching of context data structure for maintaining state data in a multithreaded image processing pipeline |
-
1998
- 1998-09-18 JP JP26555098A patent/JP4060960B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011033862A1 (en) * | 2009-09-15 | 2011-03-24 | 日本電気株式会社 | Information processing device and data transfer method |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000099496A (en) | 2000-04-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12086074B2 (en) | Method and apparatus for permuting streamed data elements | |
| US12204905B2 (en) | Inserting predefined pad values into a stream of vectors | |
| US12045617B2 (en) | Two-dimensional zero padding in a stream of matrix elements | |
| US12530196B2 (en) | Inserting null vectors into a stream of vectors | |
| US11681526B2 (en) | Method and apparatus for vector based finite impulse response (FIR) filtering | |
| US12118358B2 (en) | One-dimensional zero padding in a stream of matrix elements | |
| JPH02501599A (en) | Virtual processing techniques and virtual processors in multiprocessor arrays | |
| CN102640127A (en) | Configurable cache for multiple clients | |
| KR20010031192A (en) | Data processing system for logically adjacent data samples such as image data in a machine vision system | |
| JP4060960B2 (en) | Cache storage | |
| CN113853591A (en) | Inserting predefined padding values into a vector stream | |
| US20040268080A1 (en) | Surface computer and computing method using the same | |
| US12019561B2 (en) | Pseudo-first in, first out (FIFO) tag line replacement | |
| JPH10116191A (en) | Processor with buffer for compressed instructions | |
| JPH0496155A (en) | Storage control method and data processing device | |
| JPH06162068A (en) | Vector processor | |
| JPH03259338A (en) | Information processor | |
| JPH03197945A (en) | Semiconductor mask data conversion processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050811 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070531 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070626 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070827 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20071002 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071116 |
|
| 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: 20071211 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20071221 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101228 Year of fee payment: 3 |
|
| 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: 20111228 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111228 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121228 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121228 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131228 Year of fee payment: 6 |
|
| LAPS | Cancellation because of no payment of annual fees |