JPH07281957A - Cache storage and access instruction generation method - Google Patents

Cache storage and access instruction generation method

Info

Publication number
JPH07281957A
JPH07281957A JP6076814A JP7681494A JPH07281957A JP H07281957 A JPH07281957 A JP H07281957A JP 6076814 A JP6076814 A JP 6076814A JP 7681494 A JP7681494 A JP 7681494A JP H07281957 A JPH07281957 A JP H07281957A
Authority
JP
Japan
Prior art keywords
access
history information
update
cache
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.)
Pending
Application number
JP6076814A
Other languages
Japanese (ja)
Inventor
Shinji Fujiwara
真二 藤原
Osamu Nishii
修 西井
Kunio Uchiyama
邦男 内山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP6076814A priority Critical patent/JPH07281957A/en
Publication of JPH07281957A publication Critical patent/JPH07281957A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To reduce the cache mistake frequency in caculation of a matrix, etc., by preventing the updating of the access history information on a cache line based on the access instruction given from a processor. CONSTITUTION:A cache 10 contains a memory cell part 11 including the address and data arrays, a hit/miss deciding circuit 12 of access data, a data/tag/Iru (access history information) control circuit 13, a selection wait control circuit 14, an Iru bit cell 15 which holds the Iru, a selector circuit 16 which selects true Iru updating data and a data/tag selector circuit 17. The cell 15 functions to control the Iru on each line and can forcibly suppress the updating of the Iru by an Iru updating suppression circuit. Therefore it is possible to make the data not desired to be driven out reside temporarily in the cache 10 based on the access instruction given from a processor to suppress the updating of the Iru.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、情報処理装置のキャッ
シュ記憶装置に係わり、特に、アクセス履歴情報の更新
を抑止する機能を有するキャッシュ記憶装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache storage device of an information processing device, and more particularly to a cache storage device having a function of suppressing update of access history information.

【0002】[0002]

【従来の技術】情報処理装置のキャッシュメモリについ
ては、コンピュータ・サーベイ第14巻3号473−5
30ページ(Computer Surveys, Vol.14, No.3, pp.473
-530)で詳しく論じらている。
2. Description of the Related Art Computer Survey, Volume 14, No. 3, 473-5
30 pages (Computer Surveys, Vol.14, No.3, pp.473
-530).

【0003】キャッシュメモリは、プロセッサのアクセ
スを高速に行なうためのものであり、主記憶に比べ容量
は小さいが、高速のアクセス(読み書き)が可能なメモ
リであり、そして、プロセッサのごく近くに置かれる。
The cache memory is for accessing the processor at a high speed, has a smaller capacity than the main memory, but is a memory that can be accessed (read / written) at a high speed, and is placed very close to the processor. Get burned.

【0004】主記憶とプロセッサの間のデータの転送時
間は、プロセッサの内部処理時間の数倍になるため、デ
ータを実行のつど読み出していたのでは、処理の高速化
は望めない。
Since the data transfer time between the main memory and the processor is several times as long as the internal processing time of the processor, if the data is read every time it is executed, the processing speed cannot be increased.

【0005】一方、プロセッサは、主記憶全体をアクセ
スの対象としているが、ごく短時間の間では、そのうち
のごく一部にアクセスが集中している。
On the other hand, the processor targets the entire main memory for access, but in a very short time, access is concentrated in a very small part thereof.

【0006】そこで、主記憶の情報の一部をキャッシュ
メモリにコピーし、プロセッサのアクセスのほとんどを
キャッシュメモリとの間で行なうようにすると、平均的
にアクセス時間を短縮することが可能となる。
Therefore, if a part of the information in the main memory is copied to the cache memory and most of the processor access is performed with the cache memory, the access time can be shortened on average.

【0007】また、キャッシュメモリは、記憶される情
報をブロックという適当な大きさを単位にして管理して
おり、各ブロックは、それぞれ主記憶のある箇所と対応
し、その箇所のデータの移しを保持している。この記憶
される情報をデータアレイと呼ぶ。
Further, the cache memory manages the information to be stored in units of an appropriate size called a block, and each block corresponds to a location in the main memory and transfers data at that location. keeping. This stored information is called a data array.

【0008】加えて各ブロックが主記憶のどの箇所に対
応しているかはもちろん動的に変化することが可能であ
り、その情報もキャッシュメモリに保持されている。こ
の記憶部分をアドレスアレイと呼ぶ。
In addition, it is of course possible to dynamically change which part of the main memory each block corresponds to, and the information is also held in the cache memory. This storage portion is called an address array.

【0009】プロセッサがアクセスしたいデータが、キ
ャッシュにあるかどうかは、アクセスしたいアドレス
と、キャッシュのアドレスアレイを比較することにより
判定することが出来る。
Whether or not the data to be accessed by the processor is in the cache can be determined by comparing the address to be accessed with the address array of the cache.

【0010】キャッシュの任意のブロックに、主記憶の
任意の箇所のデータを保持することが可能である場合に
は、キャッシュの全アドレスアレイと、アクセスしたい
アドレスを比較する。
When it is possible to hold data at any location in the main memory in any block of the cache, the entire address array of the cache is compared with the address to be accessed.

【0011】このような方式を、フル・アソシアティブ
方式のキャッシュメモリという。
Such a method is called a full associative method cache memory.

【0012】この方式だと、全てのアドレスアレイと、
アクセスしたいアドレスを比較する必要があるため、比
較回路が複雑になり、ハードウェア量が増大し、かつ、
アクセスに要する時間が長くなってしまうという欠点が
ある。
In this system, all address arrays are
Since it is necessary to compare the addresses to be accessed, the comparison circuit becomes complicated, the amount of hardware increases, and
There is a drawback that the access time becomes long.

【0013】前記方式を改善したキャッシュメモリとし
て、セット・アソシアティブ方式のキャッシュメモリが
ある。
A cache memory of the set associative system is a cache memory that is an improvement of the above system.

【0014】図13は、前記セット・アソシアティブ方
式のキャッシュメモリの概要を示す図である。
FIG. 13 is a diagram showing an outline of the set associative cache memory.

【0015】本方式では、キャッシュメモリをn行m列
のブロックに分割する。
In this method, the cache memory is divided into blocks of n rows and m columns.

【0016】ここで、キャッシュメモリの各行のことを
ラインとよび、各列のことをウェイと呼ぶ。
Here, each row of the cache memory is called a line and each column is called a way.

【0017】アクセスアドレスxで示される主記憶のデ
ータは、アクセスアドレスの中のkビットをインデクス
としてアクセスできる1ラインにあるmブロックの何れ
かの箇所に保持される(ここで、n=2のk乗であ
る)。
The data in the main memory indicated by the access address x is held in any part of the m block on one line which can be accessed by using k bits in the access address as an index (where n = 2). It is the k-th power).

【0018】例えば、アドレスアレイの該kビットがi
の時には、Block(i,0)からBlock(i,m-1)の何れかのBloc
kにデータが保持される。
For example, if the k bits of the address array are i
, The Bloc of any of Block (i, 0) to Block (i, m-1)
The data is held in k.

【0019】この方式では、アクセスアドレスとキャッ
シュのアドレスアレイ1ライン分を比較するだけで、ア
クセスしたいデータがキャッシュにあるかどうかを判定
することが可能である。
In this method, it is possible to determine whether or not the data to be accessed is in the cache only by comparing the access address and one line of the address array of the cache.

【0020】プロセッサが、ほとんどキャッシュメモリ
との間でアクセスを行なうようにするためには、最近頻
繁にアクセスされたデータをキャッシュ内に置いておく
必要があり、その反対に最近全くアクセスされていない
データは、必ずしもキャッシュ内に置いておく必要がな
い。
In order for the processor to access the cache memory mostly, it is necessary to keep recently accessed data in the cache and vice versa. The data does not necessarily have to be in the cache.

【0021】そのため、キャッシュメモリは、前記した
要求を満たすように制御を行ない、その制御方法のこと
を追い出しアルゴリズムと呼ぶ。
Therefore, the cache memory controls so as to satisfy the above-mentioned request, and the control method is called a eviction algorithm.

【0022】以下に代表的な追い出しアルゴリズムであ
るLRU(Last Recentry used) アルゴリズムを読み出し時
を例にとって説明する。
The LRU (Last Recent used) algorithm, which is a typical eviction algorithm, will be described below with reference to the reading operation.

【0023】キャッシュ内のデータをアクセスしたとき
には、そのデータの属するブロックを保持し続け、キャ
ッシュ内にないデータをアクセスしたときには、主記憶
上でそのデータを含む1ブロックをキャッシュ内に転送
し、そのかわりに、キャッシュ内で最近使われていない
1ブロックを追い出す。
When the data in the cache is accessed, the block to which the data belongs continues to be held, and when the data that is not in the cache is accessed, one block containing the data in the main memory is transferred to the cache, and Instead, it flushes a block that has not been used recently in the cache.

【0024】前記処理を行なうためには、キャッシュ内
でどのブロックが最近アクセスされていないかを示す情
報を保持する必要がある。
In order to perform the above processing, it is necessary to hold information indicating which block has not been accessed recently in the cache.

【0025】セット・アソシアティブ方式のキャッシュ
メモリでは、各ライン毎にアクセス履歴情報を保持して
おり、キャッシュにデータをアクセスするたびにこの情
報を更新する。
In the set associative cache memory, access history information is held for each line, and this information is updated each time data is accessed in the cache.

【0026】即ち、キャッシュに存在するデータをアク
セスした場合には、そのウェイのアクセス履歴情報を最
新とし、また、キャッシュにないデータをアクセスした
場合には、最も古いアクセス履歴情報を持つウェイの1
ブロックを追い出して、主記憶からアクセスデータを含
む1ブロックをキャッシュに転送し、該ウェイのアクセ
ス履歴情報を最新にする。
That is, when the data existing in the cache is accessed, the access history information of the way is updated, and when the data not in the cache is accessed, the way 1 having the oldest access history information is accessed.
The block is expelled, one block including access data is transferred from the main memory to the cache, and the access history information of the way is updated.

【0027】[0027]

【発明が解決しようとする課題】しかしながら、前記し
たLRUアルゴリズムでは、最も最近アクセスされたデー
タが追い出されないようにキャッシュメモリを制御する
ため、行列演算等では逆に性能が低下することがある。
However, in the above-mentioned LRU algorithm, the cache memory is controlled so that the most recently accessed data is not evicted, so that the performance may deteriorate in the matrix operation or the like.

【0028】以下に、キャッシュの1ブロックがデータ
1つ分の容量と等しいと仮定し、かつ、2ウェイのセッ
ト・アソシアティブ方式のキャッシュメモリを例に挙げ
て、前記した性能低下について説明する。
The above-mentioned performance degradation will be described below, assuming that one block of the cache is equal to the capacity of one data, and taking a 2-way set associative cache memory as an example.

【0029】図14は、2ウェイ・セット・アソシアテ
ィブ方式のキャッシュメモリで、追い出し制御方法とし
てLRUアルゴリズムを採用した場合に性能が低下するプ
ログラム例を示す図である。
FIG. 14 is a diagram showing an example of a program in which the performance deteriorates in the 2-way set associative cache memory when the LRU algorithm is adopted as the eviction control method.

【0030】図14に示すプログラムにおいて、行列
A、Dの各行及び行列B、Cの各列はキャッシュの同一
ラインに格納されるものと仮定する。
In the program shown in FIG. 14, it is assumed that each row of the matrices A and D and each column of the matrices B and C are stored in the same line of the cache.

【0031】図14に示すプログラムの行列の計算で
は、B、C、Dの各行列の要素が1回ずつアクセスされ
るのに対して、行列Aの各要素は、n回繰り返して参照
される。
In the matrix calculation of the program shown in FIG. 14, the elements of the B, C, and D matrices are accessed once, while the elements of the matrix A are repeatedly referenced n times. .

【0032】したがって、行列Aの各要素をキャッシュ
メモリに置いておくことにより、この行列演算を高速に
実行することが可能となる。
Therefore, by placing each element of the matrix A in the cache memory, the matrix calculation can be executed at high speed.

【0033】ところが、図の(Load B)命令と(Load C)命
令を実行すると、該当ラインに格納されていた行列Aの
データのアクセス履歴情報が最も古くなり、キャッシュ
から必ず追い出される。
However, when the (Load B) instruction and the (Load C) instruction in the figure are executed, the access history information of the data of the matrix A stored in the corresponding line becomes the oldest and is always ejected from the cache.

【0034】LRUアルゴリズムを採用した場合に、プロ
セッサがアクセスするデータがキャッシュに存在しない
(これをキャッシュ・ミスと呼ぶ)回数は、各行列A,
B,Cが、内側のループでn回キャッシュ・ミスを起こ
し、さらに、外側のループでn回、各行列A,B,Cで
3×n×n回、また、行列Dが、外側のループでn回キ
ャッシュ・ミスを起こすので、下記式1で表現できる。
When the LRU algorithm is adopted, the number of times that the data accessed by the processor does not exist in the cache (this is called a cache miss) is determined by each matrix A,
B and C cause cache misses n times in the inner loop, and further n times in the outer loop, 3 × n × n times in each matrix A, B, and C, and matrix D is the outer loop. Since a cache miss occurs n times, it can be expressed by the following formula 1.

【0035】[0035]

【数式1】 3×n×n+n (回) …(式1) 一方、もし、キャッシュの中に行列Aを常駐させること
ができるならば、キャッシュ・ミスの回数は、各行列
B,Cが、内側のループでn回キャッシュ・ミスを起こ
し、さらに、外側のループでn回、各行列B,Cで2×
n×n回、また、行列A,Dが、外側のループでn回キ
ャッシュ・ミスを起こすので、下記式2で表現できる。
3 × n × n + n (times) (Equation 1) On the other hand, if the matrix A can be made resident in the cache, the number of cache misses is as follows: Cache misses occur n times in the inner loop, and n times in the outer loop, 2 × for each matrix B, C.
Since the cache misses occur n × n times and the matrices A and D n times in the outer loop, they can be expressed by the following expression 2.

【0036】[0036]

【数式2】 2×(n×n+n) (回) …(式2) (但し、ここではループの制御変数等は全てレジスタに
格納できるものとし、それらのアクセスに伴うキャッシ
ュ・ミスは考慮していない)。
[Formula 2] 2 × (n × n + n) (times) (Formula 2) (However, here, it is assumed that all control variables of the loop can be stored in registers, and cache misses due to their access are taken into consideration. Absent).

【0037】n=64の場合のキャッシュ・ミスの回数
は、それぞれ12352回、及び、8320回となり、従来のLRU
アルゴリズムを採用した制御方法では、理想的な場合の
約1.5倍のキャッシュ・ミスを発生する。
When n = 64, the number of cache misses is 12352 and 8320, respectively.
The control method that employs the algorithm causes about 1.5 times as many cache misses as the ideal case.

【0038】以上の議論では、キャッシュの1ブロック
が行列の各要素のデータ1つ分の容量と等しい場合につ
いて述べたが、キャッシュの1ブロックの容量がデータ
のサイズよりも大きい場合には、処理プログラムの最内
側ループを部分的に展開して、1ループで処理するデー
タ量がキャッシュの1ブロック分となるようにすること
で、同様の議論が成立する。
In the above discussion, the case where one block of the cache is equal to the capacity of one data of each element of the matrix has been described, but when the capacity of one block of the cache is larger than the size of the data, the processing is performed. The same argument holds when the innermost loop of the program is partially expanded so that the amount of data processed in one loop corresponds to one block of the cache.

【0039】また、キャッシュのウェイ数を2と仮定し
たが、ウェイ数が3以上の場合には、行列の計算式の右
辺の括弧内の加算すべき行列の数を増やすことで全く同
様の議論をすることができる。
Although the number of ways in the cache is assumed to be two, if the number of ways is three or more, the same argument can be obtained by increasing the number of matrices to be added in parentheses on the right side of the matrix calculation formula. You can

【0040】本発明は、前記従来技術の問題点を解決す
るためになされたものであり、本発明の目的は、行列演
算等におけるキャッシュミスの回数を低減することが可
能なキャッシュメモリを提供することにある。
The present invention has been made to solve the above-mentioned problems of the prior art, and an object of the present invention is to provide a cache memory capable of reducing the number of cache misses in matrix operations and the like. Especially.

【0041】また、本発明の他の目的は、メモリに対す
る新しいアクセス命令の生成方法を提供することにあ
る。
Another object of the present invention is to provide a method of generating a new access instruction for a memory.

【0042】本発明の前記目的並びにその他の目的及び
新規な特徴は、本明細書の記載及び添付図面によって明
らかにする。
The above and other objects and novel features of the present invention will become apparent from the description of this specification and the accompanying drawings.

【0043】[0043]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば、下
記通りである。
The outline of the representative ones of the inventions disclosed in the present application will be briefly described as follows.

【0044】(1)データとタグを保持するメモリセル
部と、アクセスデータのヒット/ミス判定回路と、各キ
ャッシュライン毎のアクセス履歴情報を更新・保持する
保持手段と、メモリ部と保持手段とを制御する制御回路
とを少なくとも具備し、前記アクセス履歴情報に基づい
てキャッシュラインの追い出し制御を行うセット・アソ
シアティブ方式のキャッシュ記憶装置において、プロセ
ッサからの、アクセス履歴情報の更新を抑止するアクセ
ス命令に基づいて、アクセスされたキャッシュラインの
アクセス履歴情報の更新を抑止する抑止回路を具備する
ことを特徴とする。
(1) A memory cell unit for holding data and a tag, a hit / miss judgment circuit for access data, a holding unit for updating / holding access history information for each cache line, a memory unit and a holding unit. In a set-associative cache memory device for controlling the flushing of a cache line based on the access history information, the access instruction for suppressing the update of the access history information from the processor. On the basis of the above, it is characterized in that a suppression circuit for suppressing the update of the access history information of the accessed cache line is provided.

【0045】(2)アクセス履歴情報の更新を抑止する
アクセス命令の生成方法において、データの依存関係の
解析を行い全ての変数の参照または代入の依存関係を求
め、メモリまたはキャッシュへのデータアクセス命令に
対して、前記命令がアクセス処理で参照または代入する
変数に対する最後のアクセスであるか否かを判断し、命
令がアクセス処理で参照または代入する変数に対する最
後のアクセスであった場合に、前記アクセス命令にアク
セス履歴情報の更新の抑止を示すフラグを付加すること
を特徴とする。
(2) In the method of generating an access instruction for suppressing the update of access history information, the data dependency analysis is performed to obtain the reference or assignment dependency of all variables, and the data access instruction to the memory or the cache. With respect to the instruction, it is determined whether or not the instruction is the last access to the variable to be referenced or assigned in the access processing, and if the instruction is the last access to the variable to be referenced or assigned in the access processing, the access is performed. It is characterized in that a flag is added to the instruction to indicate that the update of the access history information is suppressed.

【0046】(3)アクセス履歴情報の更新を抑止する
アクセス命令の生成方法において、データの依存関係の
解析を行い全ての変数の参照または代入の依存関係を求
め、変数をインキャッシュ化したいかどうかを判定し、
インキャッシュ化したい変数変数の最初のアクセス命令
にアクセス履歴情報の更新の抑止を示すフラグを付加
し、また、前記変数の最後のアクセス命令にアクセス履
歴情報の更新の抑止の解除を示すフラグを付加すること
を特徴とする。
(3) In the method of generating an access instruction for suppressing the update of access history information, whether or not it is desired to analyze variables of data and obtain dependency of reference or substitution of all variables and to make variables in-cache Is judged,
Variable to be in-cached Add a flag to the first access instruction of the variable to indicate the inhibition of the update of access history information, and add a flag to the last access instruction of the variable to indicate to release the inhibition of the update of access history information. It is characterized by doing.

【0047】[0047]

【作用】前記第1項の手段によれば、アクセス履歴情報
に基づいてキャッシュラインの追い出し制御を行なって
いるセット・アソシアティブ方式のキャッシュ記憶装置
において、プロセッサからの、アクセス履歴情報の更新
を抑止するアクセス命令に基づいて、アクセスされたキ
ャッシュラインのアクセス履歴情報の更新を抑止するよ
うにしたので、追い出したくないデータを一時的にキャ
ッシュに常駐させることができ、行列演算等におけるキ
ャッシュ・ミスの回数を大幅に削減することが可能とな
る。
According to the means of the first aspect, in the set associative cache storage device which controls the flushing of the cache line based on the access history information, the update of the access history information from the processor is suppressed. Since the update of the access history information of the accessed cache line is suppressed based on the access command, the data that you do not want to evict can be temporarily made resident in the cache, and the number of cache misses in matrix operations etc. Can be significantly reduced.

【0048】前記第2項の手段によれば、アクセス履歴
情報の更新を抑止するアクセス命令として、データの依
存関係の解析を行い全ての変数の参照または代入の依存
関係を求め、命令がアクセス処理で参照または代入する
変数に対する最後のアクセスであった場合に、前記アク
セス命令にアクセス履歴情報の更新の抑止を示すフラグ
を付加するようにしたので、キャッシュの追い出し制御
を、命令レベルから制御することが可能となる。
According to the means of the second item, as the access instruction for suppressing the update of the access history information, the dependency relationship of data is analyzed and the dependency relationship of reference or assignment of all variables is obtained, and the instruction performs the access processing. In the case of the last access to the variable to be referred to or substituted in, the access instruction is added with a flag indicating suppression of update of access history information. Therefore, cache eviction control should be controlled from the instruction level. Is possible.

【0049】前記第3項の手段によれば、アクセス履歴
情報の更新を抑止するアクセス命令として、データの依
存関係の解析を行い全ての変数の参照または代入の依存
関係を求め、インキャッシュ化したい変数変数の最初の
アクセス命令にアクセス履歴情報の更新の抑止を示すフ
ラグを付加し、また、前記変数の最後のアクセス命令に
アクセス履歴情報の更新の抑止の解除を示すフラグを付
加するようにしたので、キャッシュの追い出し制御を、
命令レベルから制御することが可能となる。
According to the means of the third item, as an access instruction for suppressing the update of the access history information, it is desired to analyze the dependency relation of the data and obtain the dependency relation of reference or substitution of all variables and make it in-cache. Variable A flag indicating that the update of access history information is suppressed is added to the first access instruction of the variable, and a flag indicating that the suppression of update of access history information is released is added to the last access instruction of the variable. So the cache eviction control,
It becomes possible to control from the command level.

【0050】[0050]

【実施例】以下、図面を参照して本発明の実施例を詳細
に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0051】なお、実施例を説明するための全図におい
て、同一機能を有するものは同一符号を付け、その繰り
返しの説明は省略する。
In all the drawings for explaining the embodiments, parts having the same function are designated by the same reference numerals, and the repeated description thereof will be omitted.

【0052】(実施例1)図1は、本発明の一実施例
(実施例1)であるャッシュ記憶装置(以下、キャッシ
ュと称す)の概略構成を示す図である。
(Embodiment 1) FIG. 1 is a diagram showing a schematic configuration of a cache storage device (hereinafter referred to as a cache) which is an embodiment (embodiment 1) of the present invention.

【0053】本実施例1のキャッシュ10は、アドレス
アレイおよびデータアレイで構成されるメモリセル部1
1と、アクセスデータのヒット/ミス判定回路12と、
データ/タグ/lru制御回路13と、選択ウェイ制御回
路14と、アクセス履歴情報(以下、lruと称す)を保持
するlruビットセル15、lru更新データを選択するセレ
クタ回路16、データ及びタグ選択回路17とを有す
る。
The cache 10 of the first embodiment includes a memory cell section 1 composed of an address array and a data array.
1, an access data hit / miss determination circuit 12,
Data / tag / lru control circuit 13, selected way control circuit 14, lru bit cell 15 for holding access history information (hereinafter referred to as lru), selector circuit 16 for selecting lru update data, data and tag selection circuit 17 Have and.

【0054】本実施例1では、説明を簡単にするために
2ウェイ・セットアソシアティブキャッシュに本発明を
適用した場合について説明するが、3ウェイ以上のキャ
ッシュ10に本発明を適用することも可能である。
In the first embodiment, the case where the present invention is applied to a 2-way set associative cache will be described for the sake of simplicity. However, the present invention can also be applied to a cache 10 having 3 or more ways. is there.

【0055】メモリセル部11は、主記憶のデータを保
持するデータアレイと、キャッシュ10の各ブロックの
タグを保持するアドレスアレイ部とで構成される。
The memory cell section 11 is composed of a data array holding the data of the main memory and an address array section holding the tags of each block of the cache 10.

【0056】タグは、キャッシュ10の各ブロックのア
ドレス情報及び各ブロックの有効フラグ、および、各ブ
ロックのデータの変更フラグ等を保持する。
The tag holds address information of each block of the cache 10, a valid flag of each block, a data change flag of each block, and the like.

【0057】メモリセル部11は、アクセスするデータ
アドレスのある定められた複数のビットをインデックス
として該メモリセルの1ラインのデータ及びタグを同時
に読み出すことができる。
The memory cell section 11 can simultaneously read the data of one line of the memory cell and the tag by using a plurality of predetermined bits of the data address to be accessed as an index.

【0058】また、データ/タグ/lru制御回路13か
らのデータ/タグ更新信号を受けて、任意の1ブロック
のデータ及びタグを更新することができる。
Further, upon receiving the data / tag update signal from the data / tag / lru control circuit 13, it is possible to update the data and the tag of any one block.

【0059】図2は、図1に示すヒット/ミス判定回路
12の内部の構成を示す図である。
FIG. 2 is a diagram showing an internal configuration of the hit / miss determination circuit 12 shown in FIG.

【0060】ヒット/ミス判定回路12には、アクセス
するデータアドレスと、メモリセル部11が読み出した
各ウェイのタグのアドレス情報とが入力される。
The data address to be accessed and the address information of the tag of each way read by the memory cell section 11 are input to the hit / miss determination circuit 12.

【0061】ヒット/ミス判定回路12では、各ウェイ
のタグのアドレス情報と、アクセスしたいデータアドレ
スとの比較を、比較器123および124で同時に行な
う。
In the hit / miss judgment circuit 12, the comparators 123 and 124 simultaneously compare the address information of the tags of each way and the data address to be accessed.

【0062】各比較器(123,124)は、データア
ドレスとタグのアドレス情報が一致したときにのみ1を
出力する。
Each comparator (123, 124) outputs 1 only when the data address and the address information of the tag match.

【0063】アクセスしたいデータが、キャッシュ10
に存在していた場合のことをキャッシュにヒットしたと
呼び、この場合、何れかの比較器(123,124)の
出力が1になる。
The data to be accessed is the cache 10
When it is present in the cache, the cache is hit. In this case, the output of one of the comparators (123, 124) becomes 1.

【0064】従って、それぞれの比較器(123,12
4)の出力をOR回路122で論理和をとることにより
ヒット(hit)信号を生成する。
Therefore, the respective comparators (123, 12)
The output of 4) is ORed by the OR circuit 122 to generate a hit signal.

【0065】また、AND回路121で、比較記124
の出力とヒット(hit)信号との論理積をとることによ
り、どのウェイにデータがあるかを知らせるヒットウェ
イ(hit way)信号を生成する。
Further, in the AND circuit 121, comparison 124
And the hit signal is generated by the logical product of the output and the hit signal.

【0066】ヒットウェイ信号は、ヒット信号が1の時
にのみ有効であり、ヒットしたウェイを示す。
The hit way signal is valid only when the hit signal is 1, and indicates the way that has been hit.

【0067】本実施例1では、2ウェイのキャッシュ1
0を用いて説明しているため、ヒットウェイ信号は、0
あるいは1となり、それぞれウェイ0およびウェイ1に
それぞれヒットしたことを示す。
In the first embodiment, the 2-way cache 1
Since the description is made using 0, the hit way signal is 0
Alternatively, the value becomes 1, which means that the way 0 and the way 1 are respectively hit.

【0068】図3は、図1に示すデータ/タグ/lru制
御回路13の内部の構成を示す図である。
FIG. 3 is a diagram showing an internal configuration of the data / tag / lru control circuit 13 shown in FIG.

【0069】メモリセル部11のアドレスアレイ、およ
び、メモリセル部11のデータを読み出す際には、タグ
読み出し信号、および、データ読み出し信号を1とし、
同時にAND回路とOR回路からなる回路131によ
り、ヒットしたときのlru更新信号も1とする。
When reading the address array of the memory cell section 11 and the data of the memory cell section 11, the tag read signal and the data read signal are set to 1,
At the same time, the lru update signal at the time of hit is also set to 1 by the circuit 131 including the AND circuit and the OR circuit.

【0070】これにより、読み出しデータが、キャッシ
ュにヒットした場合のlruの自動更新を行う。
As a result, the lru is automatically updated when the read data hits the cache.

【0071】一方、メモリセル部11のアドレスアレイ
のみを読み出す場合には、タグ読み出し信号のみを1す
る。
On the other hand, when reading only the address array of the memory cell portion 11, only the tag read signal is set to 1.

【0072】この場合には、lru更新信号は1とならな
いため、lruビットセル15の自動更新は行われない。
In this case, since the lru update signal is not 1, the lru bit cell 15 is not automatically updated.

【0073】また、データ更新信号やタグ更新信号を1
とし、更新したいウェイをlru入力信号に設定すること
により、メモリセル部11のアドレスアレイ又はデータ
アレイの更新信号132を生成する。
In addition, the data update signal and the tag update signal are set to 1
Then, by setting the way to be updated to the lru input signal, the update signal 132 of the address array or the data array of the memory cell section 11 is generated.

【0074】図4は、図1に示す選択ウェイ制御回路1
4の内部の構成を示す図である。
FIG. 4 shows the selection way control circuit 1 shown in FIG.
4 is a diagram showing an internal configuration of FIG.

【0075】選択ウェイ制御回路14は、lru信号から
最も古いアクセス履歴情報を持つウェイの信号を生成す
る回路142と、キャッシュのヒット及びミスに応じ
て、ヒットウェイ信号、および、回路142で生成され
た最も古いアクセス履歴情報を持つウェイの信号をそれ
ぞれ選択する回路141とで構成される。
The selected way control circuit 14 generates the signal of the way having the oldest access history information from the lru signal, and the hit way signal and the circuit 142 in response to cache hits and misses. And a circuit 141 for selecting a signal of a way having the oldest access history information.

【0076】本実施例1は、2ウェイ構成であるため、
回路142は否定回路となる。
Since the first embodiment has a 2-way configuration,
The circuit 142 becomes a negative circuit.

【0077】図5は、図1に示すlruビットセル15の
内部の構成を示す図である。
FIG. 5 is a diagram showing the internal structure of the lru bit cell 15 shown in FIG.

【0078】lruビットセル15は、各ラインのアクセ
ス履歴情報を制御するセルであり、lru更新回路15
1、lru更新クロック生成回路152、lru更新クロック
抑止回路153、lru読み出しクロック生成回路15
4、lru読み出し回路155とで構成される。
The lru bit cell 15 is a cell for controlling the access history information of each line, and the lru update circuit 15
1, lru update clock generation circuit 152, lru update clock suppression circuit 153, lru read clock generation circuit 15
4 and the lru reading circuit 155.

【0079】本実施例1では、lru更新抑止回路153
を設けたことが特徴であり、この回路により、lruの更
新を強制的に抑止することが可能となる。
In the first embodiment, the lru update inhibiting circuit 153
The feature is that the update of lru can be forcibly suppressed by this circuit.

【0080】次に、本実施例におけるデータのアクセス
方法について図1から図5を用いて説明する。
Next, a data access method in this embodiment will be described with reference to FIGS. 1 to 5.

【0081】始めに、通常の読み出し命令(Load命令)の
処理方法について説明する。
First, a method of processing a normal read command (Load command) will be described.

【0082】Load命令が発行されると、プロセッサの命
令実行制御部は、データ及びタグの読み出し信号を共に
1にして、同時にアクセスするデータアドレスを供給す
る。
When the Load instruction is issued, the instruction execution control unit of the processor sets both the data and tag read signals to 1 and supplies the data addresses to be accessed simultaneously.

【0083】これらの読み出し信号は、データ/タグ/
lru制御回路13を経て、メモリセル部11に供給さ
れ、当該ラインの全てのブロックのデータとタグが読み
だされる。
These read signals are data / tag /
It is supplied to the memory cell unit 11 via the lru control circuit 13, and the data and tags of all the blocks on the relevant line are read out.

【0084】また、同時に、lruビットセル15の当該
ラインのlruビットの値も同時に読みだされる。
At the same time, the value of the lru bit of the relevant line of the lru bit cell 15 is also read out at the same time.

【0085】次に、ヒット/ミス判定回路12におい
て、当該ラインにアクセスしたいデータが有るかどうか
を判定する。
Next, the hit / miss determination circuit 12 determines whether or not there is data to access the line.

【0086】ヒット/ミス判定回路12では、図2に示
すように各ウェイのタグのアドレス情報と、アクセスす
るデータアドレスとを比較し、いずれかのウェイのアド
レス情報がデータアドレスと一致した場合にヒット信号
を1にする。
In the hit / miss determination circuit 12, as shown in FIG. 2, the address information of the tag of each way is compared with the data address to be accessed, and if the address information of one of the ways matches the data address. Set the hit signal to 1.

【0087】さらに、ヒットしたウェイをヒットウェイ
信号により選択ウェイ制御回路14に通知する。
Further, the selected way control circuit 14 is notified of the hit way by the hit way signal.

【0088】選択ウェイ制御回路14では、ヒット信号
が1の時には、ヒットウェイ信号を選択ウェイとして出
力する。
When the hit signal is 1, the selected way control circuit 14 outputs the hit way signal as the selected way.

【0089】この選択ウェイ信号は、lru更新データ選
択回路16を通って、lruビットセル15に入力され
る。
This selection way signal is input to the lru bit cell 15 through the lru update data selection circuit 16.

【0090】通常のLoad命令が、キャッシュにヒットし
たときはlru更新クロックが入力されるため、lru更新回
路151が起動されて、lruの更新が行われる。
When the normal Load instruction hits the cache, the lru update clock is input. Therefore, the lru update circuit 151 is activated to update the lru.

【0091】通常のLoad命令が、キャッシュにミスした
場合には、ヒット/ミス判定回路12のヒット信号の値
が0となり、プロセッサに対してキャッシュミスしたこ
とを通知する。
When a normal Load instruction makes a miss in the cache, the value of the hit signal of the hit / miss determination circuit 12 becomes 0, notifying the processor of the cache miss.

【0092】さらに、選択ウェイ制御回路14により、
最も古いアクセス履歴情報を持つウェイの信号を選択ウ
ェイ信号として出力し、該ウェイのデータ及びタグを読
み出しデータ及びタグとして出力する。
Further, by the selection way control circuit 14,
The signal of the way having the oldest access history information is output as the selected way signal, and the data and the tag of the way are output as the read data and the tag.

【0093】プロセッサは、これらのデータ及びタグを
用いて、追い出されるウェイのデータを主記憶装置にコ
ピーバックするかどうかを決定し、コピーバックする必
要がある場合には、キャッシュ10から主記憶に該デー
タを転送する。
The processor uses these data and tags to determine whether to copy back the data of the way to be evicted to the main storage device, and when it is necessary to copy back the data, the cache 10 transfers it to the main storage. Transfer the data.

【0094】そして、ミスしたデータを主記憶からキャ
ッシュ10に転送し、追い出したウェイに書き込み、ア
クセス履歴情報を更新して処理を終了する。
Then, the missed data is transferred from the main memory to the cache 10, written in the way out, the access history information is updated, and the process is terminated.

【0095】次に、通常の書き込み命令(Store命令)の
処理方法について述べる。
Next, a method of processing a normal write command (Store command) will be described.

【0096】Store命令が発行されると、プロセッサの
命令実行制御部は、タグの読み出し信号を1にして、同
時にアクセスするデータアドレスを供給する。
When the Store instruction is issued, the instruction execution control unit of the processor sets the read signal of the tag to 1 and supplies the data address to be accessed at the same time.

【0097】そして、書き込むデータが、キャッシュ1
0に存在するかどうかのヒット判定のみを行う。
The data to be written is cache 1
Only the hit judgment whether it exists in 0 is performed.

【0098】この場合、データの読み出しは行われない
ので、キャッシュ10のlruビットの更新は発生しな
い。
In this case, since the data is not read, the lru bit of the cache 10 is not updated.

【0099】キャッシュにヒットした場合には、ヒット
ウェイ信号にヒットしたウェイが出力されるので、この
信号を次のサイクルにlru入力信号として、かつ、デー
タ更新信号及を1にして、アクセスするデータアドレス
を供給して、Storeするデータを更新データにセットし
てデータをキャッシュ10に書き込む。
When the cache is hit, the way that hits the hit way signal is output. Therefore, this signal is used as the lru input signal in the next cycle, and the data update signal and 1 are set to the data to be accessed. The address is supplied, the data to be stored is set as the update data, and the data is written in the cache 10.

【0100】この時、lru更新信号も同時に1して、ア
クセスを行ったラインのlruビットを更新する。
At this time, the lru update signal is also set to 1 at the same time to update the lru bit of the accessed line.

【0101】Store命令がキャッシュにミスした場合に
は、Load命令がキャッシュにミスしたときと同様の手順
で、追い出すウェイを決定し、必要があれば主記憶にコ
ピーバックを行い、その後、該ウェイにストアするデー
タを書き込む。
When the Store instruction misses in the cache, the way to be ejected is determined by the same procedure as when the Load instruction misses in the cache, and if necessary, copy back is performed to the main memory, and then the way is deleted. Write the data to be stored in.

【0102】以上、通常のLoad/Store命令では、アクセ
スされたデータを保持するウェイのアクセス履歴情報が
最新となるようにlru更新クロックを入力している。
As described above, in the normal Load / Store instruction, the lru update clock is input so that the access history information of the way holding the accessed data becomes the latest.

【0103】本実施例1では、図5に示す回路153に
よって、lru更新クロックを抑止する機能を有するとこ
ろに特徴がある。
The first embodiment is characterized in that the circuit 153 shown in FIG. 5 has a function of suppressing the lru update clock.

【0104】lru更新クロックを抑止する信号を、lru更
新抑止信号と呼ぶ。
A signal that suppresses the lru update clock is called an lru update suppression signal.

【0105】lru更新抑止信号が1の時には、lru更新ク
ロックが0固定となるため、lru更新回路151が動作
しない。
When the lru update inhibit signal is 1, the lru update clock is fixed to 0, and the lru update circuit 151 does not operate.

【0106】したがって、Load/Store命令実行時にlru
更新抑止信号を1にする機構を付加することにより、lr
uの更新を抑止したLoad/Store命令を実行することが可
能である。
Therefore, when executing the Load / Store instruction, lru
By adding a mechanism that sets the update suppression signal to 1, lr
It is possible to execute a Load / Store instruction that suppresses the update of u.

【0107】本実施例1では、キャッシュ10を制御す
るその他の回路の修正を必要としないため、本機能を従
来の制御回路に実装することは容易である。
In the first embodiment, since it is not necessary to modify other circuits for controlling the cache 10, it is easy to implement this function in the conventional control circuit.

【0108】図6は、lruビットセル15のlru更新回路
151周辺の信号のタイミングチャートを示す図であ
る。
FIG. 6 is a diagram showing a timing chart of signals around the lru updating circuit 151 of the lru bit cell 15.

【0109】図6では、更新データL3及び更新データL6
のタイミングでlru更新抑止信号が1となり、それぞれ
のlru更新が抑止されているのが分かる。
In FIG. 6, update data L3 and update data L6
At the timing of, the lru update suppression signal becomes 1, and it can be seen that each lru update is suppressed.

【0110】本機能を命令レベルから制御するために
は、通常のLoad/Store命令に加えて、lru更新抑止制御
付きLoad/Store命令が新たに必要となる。
In order to control this function from the instruction level, a Load / Store instruction with lru update suppression control is newly required in addition to the normal Load / Store instruction.

【0111】例えば、通常のLoad系の命令がLoad
addr1, gr1と定義されているならば、lru更新抑止
制御付きのLoad系の命令をLoad, lfix addr1, gr1の
ように定義する。
For example, a normal Load instruction is Load
If it is defined as addr1 and gr1, the Load type instruction with lru update suppression control is defined as Load, lfix addr1 and gr1.

【0112】ここで、addr1はアクセスする主記憶のア
ドレスを示し、gr1はデータを取り込む汎用レジスタを
示す。
Here, addr1 indicates the address of the main memory to be accessed, and gr1 indicates a general-purpose register for fetching data.

【0113】命令語のフォーマットとしては、Load命令
の命令語の一部にlfixオプション付きでLoad命令である
ことを示すフラグを1ビット設ける。
As the format of the instruction word, one bit is provided with a flag indicating that it is a Load instruction with the lfix option in a part of the instruction word of the Load instruction.

【0114】このようにすることで、命令デコーダにお
いてlru更新抑止信号を生成することが容易に可能とな
り、かつ、高級言語で記述されたプログラムからアセン
ブル命令列を生成するコンパイラ等も最小限の変更で本
機能を利用することが可能となる。
By doing so, the instruction decoder can easily generate the lru update inhibition signal, and the compiler etc. for generating the assemble instruction sequence from the program written in the high-level language are minimally changed. This function can be used with.

【0115】図14に示すプログラムの行列の計算を、
lru更新抑止制御付きLoad/Store命令を用いて実現する
と以下のようになる。
Calculation of the matrix of the program shown in FIG.
The following is the implementation using the Load / Store command with lru update suppression control.

【0116】 for (i=0; i<n; i++) { SUB r6 , r6 , r6 for (j=0; j<n; j++){ Load , lfix B[i,j] , r1 /* キャッシュミス, C又はDが追い 出される */ Load , lfix C[i,j] , r2 /* キャッシュミス, Bが追い出され る */ Load A[j] , r3 /*1回目のみキャッシュミス、それ 以降はヒット*/ ADD r1 , r2 , r4 MUL r3 , r4 , r5 ADD r5 , r6 , r6 } Store , lfix r6 , D[i] /* キャッシュミス, Cが追い出され る */ } 以上の命令列では、(Load A)のみがキャッシュ10のlr
uを更新することができる。
For (i = 0; i <n; i ++) {SUB r6, r6, r6 for (j = 0; j <n; j ++) {Load, lfix B [i, j], r1 / * cache miss , C or D is evicted * / Load, lfix C [i, j], r2 / * cache miss, B is evicted * / Load A [j], r3 / * Only the first cache miss, and thereafter Is a hit * / ADD r1, r2, r4 MUL r3, r4, r5 ADD r5, r6, r6} Store, lfix r6, D [i] / * Cache miss, C is evicted * /} , (Load A) only lr of cache 10
u can be updated.

【0117】従って、キャッシュ10のアクセス履歴情
報は常に行列Aのデータが最新となるため、キャッシュ
10から追い出されることはない。
Therefore, the access history information of the cache 10 is always the latest in the data of the matrix A, so that it is not evicted from the cache 10.

【0118】キャッシュ10の1ブロックにデータ1つ
を格納することができ、かつ、キャッシュ10のライン
数がnである場合には、キャッシュのミス回数は、行列
Aがn回、行列B、Cが(n×n)回、行列Dがn回と
なり、理想的な状態と同じキャッシュミス回数となる。
When one data can be stored in one block of the cache 10 and the number of lines in the cache 10 is n, the number of cache misses is such that the matrix A is n times, the matrices B and C are Is (n × n) times and the matrix D is n times, which is the same number of cache misses as in the ideal state.

【0119】キャッシュ10の1ブロックに4個のデー
タが格納できる場合には、上記命令列を以下のように部
分展開することによりキャッシュミスの回数を削減する
ことができる(命令列を簡単にする為、nは4の倍数で
あると仮定する)。
When four data can be stored in one block of the cache 10, the number of cache misses can be reduced by partially expanding the above-mentioned instruction sequence as follows (the instruction sequence can be simplified. Therefore, it is assumed that n is a multiple of 4).

【0120】 for (i=0; i<n; i++) { SUB r21 , r21 , r21 for (j=0; j<n; j=j+4){ Load , lfix B[i,j] , r1 /* キャッシュミス, C又はDが追い 出される */ Load , lfix B[i,j+1] , r2 /*キャッシュヒット*/ Load , lfix B[i,j+2] , r3 /*キャッシュヒット*/ Load , lfix B[i,j+3] , r4 /*キャッシュヒット*/ Load , lfix C[i,j] , r5 /* キャッシュミス, Bが追い出され る */ Load , lfix C[i,j+1] , r6 /*キャッシュヒット*/ Load , lfix C[i,j+2] , r7 /*キャッシュヒット*/ Load , lfix C[i,j+3] , r8 /*キャッシュヒット*/ Load A[j] , r9 /*1回目のみキャッシュミス、それ 以降はヒット*/ Load A[j+1] , r10 /*キャッシュヒット*/ Load A[j+2] , r11 /*キャッシュヒット*/ Load A[j+3] , r12 /*キャッシュヒット*/ ADD r1 , r5 , r13 ADD r2 , r6 , r14 ADD r3 , r7 , r15 ADD r4 , r8 , r16 MUL r9 , r14 , r17 MUL r10 , r13 , r18 MUL r11 , r15 , r19 MUL r12 , r16 , r20 ADD r17 , r21 , r21 ADD r18 , r21 , r21 ADD r19 , r21 , r21 ADD r20 , r21 , r21 } switch (i & 3) { case 0: COPY r21 , r22 break; case 1: COPY r21 , r23 break; case 2: COPY r21 , r24 break; case 3: Store , lfix r22 , D[i-3] /* キャッシュアクセスミス , Cが追い出される */ Store , lfix r23 , D[i-2] /*キャッシュヒット*/ Store , lfix r24 , D[i-1] /*キャッシュヒット*/ Store , lfix r21 , D[i] /*キャッシュヒット*/ break; } } 上記展開を行うことにより、キャッシュミス回数は、下
記数式3で表すことができ、キャッシュミス回数を4分
の1に削減することが可能となる。
For (i = 0; i <n; i ++) {SUB r21, r21, r21 for (j = 0; j <n; j = j + 4) {Load, lfix B [i, j], r1 / * Cache miss, C or D is evicted * / Load, lfix B [i, j + 1], r2 / * Cache hit * / Load, lfix B [i, j + 2], r3 / * Cache hit * / Load, lfix B [i, j + 3], r4 / * Cache hit * / Load, lfix C [i, j], r5 / * Cache miss, B is evicted * / Load, lfix C [i , j + 1], r6 / * cache hit * / Load, lfix C [i, j + 2], r7 / * cache hit * / Load, lfix C [i, j + 3], r8 / * cache hit * / Load A [j], r9 / * Cache miss only for the first time, hit after that * / Load A [j + 1], r10 / * cache hit * / Load A [j + 2], r11 / * cache hit * / Load A [j + 3], r12 / * Cache hit * / ADD r1, r5, r13 ADD r2, r6, r14 ADD r3, r7, r15 ADD r4, r8, r16 MUL r9, r14, r17 MUL r10, r13, r18 MUL r11, r15, r19 MUL r12, r16, r20 ADD r17, r21, r21 ADD r18, r21, r21 ADD r19 , r21, r21 ADD r20, r21, r21} switch (i & 3) {case 0: COPY r21, r22 break; case 1: COPY r21, r23 break; case 2: COPY r21, r24 break; case 3: Store, lfix r22, D [i-3] / * Cache access miss, C is purged * / Store, lfix r23, D [i-2] / * Cache hit * / Store, lfix r24, D [i-1] / * Cache hit * / Store, lfix r21, D [i] / * Cache hit * / break; It is possible to reduce it to one-half.

【0121】[0121]

【数式3】 (n×n+n)/2 (回) …(式3) 一般に、キャッシュ10の1ブロックにp個の配列デー
タを格納できる場合には、ループ展開によりキャッシュ
ミス回数をp分の1に削減することが可能となる。
## EQU00003 ## (n.times.n + n) / 2 (times) (Equation 3) Generally, when p array data can be stored in one block of the cache 10, the number of cache misses is reduced to 1 / p by loop expansion. Can be reduced to.

【0122】次に、前記lru更新抑止制御付きLoad/Stor
e命令等のアクセス命令を使用するオブジェクトコード
の生成方法について説明する。
Next, the Load / Stor with the lru update suppression control
A method of generating an object code using an access instruction such as an e instruction will be described.

【0123】図7は、ソースプログラムから実行形式の
ロードモジュールを作成する一般的な処理を流れを示す
図である。
FIG. 7 is a diagram showing the flow of a general process for creating a load module in the execution format from a source program.

【0124】図7に示すように、実行形式のロードモジ
ュール74は、ソースプログラム70をコンパイルして
生成されるオブジェクトプログラム72をリンカ73で
結合して生成される。
As shown in FIG. 7, the load module 74 of the executable format is generated by linking the object program 72 generated by compiling the source program 70 with the linker 73.

【0125】コンパイラ71は、走査部711と、構文
・意味解析部712と、コード生成部713と、コード
最適化部713とから構成される。
The compiler 71 comprises a scanning unit 711, a syntax / semantic analysis unit 712, a code generation unit 713, and a code optimization unit 713.

【0126】コンパイラ71は、始めに、ソースプログ
ラム70を走査部711で走査し、構文・意味解析部7
12でソースプログラム70の構文および意味を解析す
る。
The compiler 71 first scans the source program 70 by the scanning unit 711, and then the syntax / semantic analysis unit 7
At 12, the syntax and meaning of the source program 70 are analyzed.

【0127】次に、コード生成部713で、構文・意味
解析部712での解析結果から、目的コードを生成し、
さらに、コード最適化部713で最適化を施して、オブ
ジェクトプログラム72を生成する。
Next, the code generation unit 713 generates the object code from the analysis result of the syntax / semantic analysis unit 712,
Further, the code optimizing unit 713 performs optimization to generate the object program 72.

【0128】本実施例1における、lru更新抑止制御付
きLoad/Store命令等のアクセス命令は、この中のコード
最適化部713において生成され、オブジェクトプログ
ラムの中に取り込まれる。
The access instructions such as Load / Store instructions with lru update suppression control in the first embodiment are generated in the code optimizing unit 713 therein and taken into the object program.

【0129】図8は、lru更新抑止制御付きLoad/Store
命令等のアクセス命令を生成する本実施例1の最適化の
アルゴリズムを示すフローチャートである。
FIG. 8 shows Load / Store with lru update suppression control.
7 is a flowchart showing an optimization algorithm of the first embodiment for generating an access instruction such as an instruction.

【0130】本実施例1の最適化アルゴリズムは、従来
の最適化処理を行った後で適用される。
The optimization algorithm of the first embodiment is applied after performing the conventional optimization processing.

【0131】次に、図8を用いて、本実施例1の最適化
アルゴリズムについて説明する。
Next, the optimization algorithm of the first embodiment will be described with reference to FIG.

【0132】本実施例1の最適化アルゴリズムでは、始
めに、データの依存関係の解析を行い全ての変数の参照
または代入の依存関係を求める(ステップ901)。
In the optimization algorithm of the first embodiment, first, the dependence relationship of data is analyzed and the dependence relationship of reference or substitution of all variables is obtained (step 901).

【0133】次に、メモリまたはキャッシュ10へのデ
ータアクセス命令に対して、当該命令が該アクセス処理
で参照または代入する変数に対する最後のアクセスであ
るか否かを判断し(ステップ903)、当該命令が該ア
クセス処理で参照または代入する変数に対する最後のア
クセスであった場合には、当該アクセス命令にlfixオプ
ションを付加した命令コードを生成する(ステップ90
4)。
Next, with respect to the data access instruction to the memory or the cache 10, it is judged whether or not the instruction is the last access to the variable referred to or substituted in the access processing (step 903), and the instruction is concerned. Is the last access to the variable to be referenced or substituted in the access processing, an instruction code in which the lfix option is added to the access instruction is generated (step 90).
4).

【0134】また、前記ステップ903、904の処理
を、全てのメモリまたはキャッシュ10へのデータアク
セス命令に対して行う(ステップ902、ステップ90
5)。
The processing of steps 903 and 904 is performed for all memory or cache 10 data access instructions (steps 902 and 90).
5).

【0135】lfixオプションを付加したデータアクセス
命令で参照または代入されたデータは、lru情報が更新
されないため、該データを保持するキャッシュラインに
対するキャッシュミスが発生したときに同一キャッシュ
ライン上の他のデータよりも先に追い出される可能性が
ある。
Since the lru information is not updated for the data referenced or substituted by the data access instruction with the lfix option added, when a cache miss occurs in the cache line holding the data, other data on the same cache line It may be kicked out before.

【0136】この結果、繰り返してアクセスされる可能
性がある同一キャッシュライン上の他のデータが追い出
されてしまうことを抑止することが可能となった。
As a result, it is possible to prevent the other data on the same cache line that may be repeatedly accessed from being evicted.

【0137】以上説明したように、本実施例1では、各
ライン毎にアクセス履歴情報を有し、該アクセス履歴情
報に基づいてキャッシュラインの追い出し制御をおこな
っているセット・アソシアティブ方式のキャッシュ記憶
装置10において、該キャッシュ記憶装置10のアクセ
ス履歴情報の更新を抑止する機能を付加している。
As described above, in the first embodiment, the cache memory device of the set associative system has the access history information for each line, and the cache line eviction control is performed based on the access history information. 10, a function for suppressing the update of access history information of the cache storage device 10 is added.

【0138】また、該キャッシュ記憶装置10のアクセ
ス履歴情報の更新を抑止する機能を付加した主記憶また
はキャッシュアクセス命令を生成するようにしている。
Further, the main memory or cache access instruction to which the function of suppressing the update of the access history information of the cache memory device 10 is added is generated.

【0139】この新しい命令を用いると、該アクセス命
令によるキャッシュ記憶装置10のアクセス履歴情報の
更新を抑止し、該アクセス命令による追い出しウェイの
変更を抑止することが可能となる。
By using this new instruction, it is possible to prevent the access history information of the cache memory device 10 from being updated by the access instruction and prevent the change of the eviction way by the access instruction.

【0140】即ち、図14に示すプログラムの例では、
(Load B)や(Load C)等の命令を、キャッシュのアクセス
履歴情報の更新を抑止する機能を付加したLoad命令で実
行する。
That is, in the example of the program shown in FIG.
Execute commands such as (Load B) and (Load C) with the Load command that has the function to suppress the update of cache access history information.

【0141】BやCのデータはキャッシュ10内にはな
いため、必ずキャッシュ・ミスを起こし、キャッシュ1
0内のアクセス履歴情報が最も古いウェイに取り込まれ
る。
Since the data of B and C are not in the cache 10, a cache miss always occurs and the cache 1
The access history information in 0 is taken into the oldest way.

【0142】そのとき、当該ラインのアクセス履歴情報
の更新を抑止すると、BやCのデータのアクセス履歴情
報は、最も古いままとなり、そのため、次の追い出し処
理が発生したときには、直ちにキャッシュ10から追い
出される。
At that time, if the update of the access history information of the line is suppressed, the access history information of the data of B and C remains the oldest, and therefore, when the next eviction processing occurs, it is immediately evicted from the cache 10. Be done.

【0143】これにより、キャッシュ10内に既に取り
込まれている行列Aのデータの追い出しを抑止すること
が可能となる。
As a result, it is possible to prevent the data of the matrix A already fetched in the cache 10 from being expelled.

【0144】(実施例2)図9は、本発明の他の実施例
(実施例2)でキャッシュ記憶装置(以下、キャッシュ
と称す)の概略構成を示すブロック図である。
(Embodiment 2) FIG. 9 is a block diagram showing a schematic structure of a cache storage device (hereinafter referred to as cache) in another embodiment (Embodiment 2) of the present invention.

【0145】本実施例2のキャッシュ20は、アドレス
アレイおよびデータアレイで構成されるメモリセル部1
1と、アクセスデータのヒット/ミス判定回路12と、
データ/タグ/lru制御回路13と、選択ウェイ制御回
路14と、アクセス履歴情報(以下、lruと称す)を保持
するlruビットセル15、lru更新データを選択するセレ
クタ回路16、データ及びタグ選択回路17、lru更新
抑止フラグ18とを有する。
The cache 20 according to the second embodiment is a memory cell unit 1 including an address array and a data array.
1, an access data hit / miss determination circuit 12,
Data / tag / lru control circuit 13, selected way control circuit 14, lru bit cell 15 for holding access history information (hereinafter referred to as lru), selector circuit 16 for selecting lru update data, data and tag selection circuit 17 , Lru update suppression flag 18.

【0146】本実施例2は、lru更新抑止フラグ(以
下、lfixフラグと称す)18を有することを特徴とす
る。
The second embodiment is characterized by having an lru update suppression flag (hereinafter, referred to as lfix flag) 18.

【0147】lfixフラグ18は、lfix更新データ、lfix
更新信号、および、lfixクリア信号により制御され、lr
uビットセル15の更新を抑止するlru更新抑止信号を生
成する。
The lfix flag 18 is the lfix update data, lfix
Controlled by update signal and lfix clear signal, lr
An lru update inhibit signal for inhibiting the update of the u bit cell 15 is generated.

【0148】図10は、図9に示すlfixフラグ18の内
部の構成を示す図である。
FIG. 10 is a diagram showing the internal structure of the lfix flag 18 shown in FIG.

【0149】lfixフラグ18は、lfixビットセル181
と、lfix更新クロック生成回路182と、lru更新抑止
信号生成回路183とで構成される。
The lfix flag 18 is the lfix bit cell 181.
And an lfix update clock generation circuit 182 and an lru update suppression signal generation circuit 183.

【0150】lfixビットセル181は、キャッシュ20
の各ラインのlruビットの更新を抑止するか否かを示す
フラグを保持する1ビットのメモリセルである。
The lfix bit cell 181 is the cache 20.
It is a 1-bit memory cell that holds a flag indicating whether or not the update of the lru bit of each line is suppressed.

【0151】lfixビットセル181は、lfix更新クロッ
クが入力されたときのlfix更新データの値にセットされ
る。
The lfix bit cell 181 is set to the value of the lfix update data when the lfix update clock is input.

【0152】また、lfixクリア信号が入力されるとただ
ちに0にリセットされる。
When the lfix clear signal is input, it is reset to 0 immediately.

【0153】lfix更新クロックは、lfix更新信号と、li
ne選択信号ならびに更新マスタクロックから生成され
る。
The lfix update clock is the lfix update signal and li.
It is generated from the ne select signal as well as the updated master clock.

【0154】また、lru更新抑止信号生成回路183
は、lfixビット181の出力と、lfix更新信号とから、
lru更新抑止信号を生成する。
Also, the lru update suppression signal generation circuit 183
From the output of lfix bit 181 and the lfix update signal,
lru Generate update inhibit signal.

【0155】lfixフラグ18およびlruビットセル15
の動作を、図11のタイミングチャートを用いて説明す
る。
Lfix flag 18 and lru bit cell 15
The operation will be described with reference to the timing chart of FIG.

【0156】以下の説明では、簡単のため当該ラインの
キャッシュ20に毎回アクセスが起こると仮定する。
In the following description, for the sake of simplicity, it is assumed that the cache 20 of the relevant line is accessed every time.

【0157】即ち、通常時では、毎回lruビットの更新
が行われるとする。
That is, it is assumed that in normal time, the lru bit is updated every time.

【0158】lfixビットセル181は、通常動作時には
0にリセットされている。
The lfix bit cell 181 is reset to 0 during normal operation.

【0159】したがって、lru更新抑止信号生成回路1
83により、lru更新抑止信号がディスエーブルされる
ため、キャッシュアクセス時にlru更新が行われる(図
9のlru更新データがL1のサイクルを参照)。
Therefore, the lru update suppression signal generation circuit 1
Since the lru update inhibition signal is disabled by 83, the lru update is performed at the time of cache access (see the cycle in which the lru update data is L1 in FIG. 9).

【0160】lfixビットセル181にセットするために
は、lfix更新信号を1にして、かつ、lfix更新データを
1にセットすると、lfix更新クロックが生成されて、lf
ixビットセル181からのlfix出力信号が1となる。
In order to set the lfix bit cell 181, when the lfix update signal is set to 1 and the lfix update data is set to 1, the lfix update clock is generated and lf is updated.
The lfix output signal from the ix bit cell 181 becomes 1.

【0161】ただし、このサイクルのlru抑止信号は、l
fix更新信号によりディスエーブルされるため、同サイ
クルのlru更新は実行され、lru出力信号はL2となる。
However, the lru suppression signal of this cycle is
Since it is disabled by the fix update signal, the lru update in the same cycle is executed and the lru output signal becomes L2.

【0162】このサイクルのことをlfixセットサイクル
と呼ぶ。
This cycle is called an lfix set cycle.

【0163】lfixセットサイクルの後続のサイクルで
は、lfix出力信号により、lru更新抑止信号がアサート
されるので、lruの更新が行われない(図9のlru更新デ
ータのL3及びL4サイクルにlru出力信号が変化しな
い)。
In the subsequent cycle of the lfix set cycle, the lru output inhibit signal is asserted by the lfix output signal, so that the lru update is not performed (the lru output signal in the L3 and L4 cycles of the lru update data in FIG. 9). Does not change).

【0164】lfixビットセル181を0にリセットする
ためには、lfix更新信号を1にして、かつ、lfix更新デ
ータを0にすると、lfix更新クロックが生成されて、lf
ix信号が0にリセットされる。
To reset the lfix bit cell 181 to 0, if the lfix update signal is set to 1 and the lfix update data is set to 0, the lfix update clock is generated, and the lfix update clock is generated.
The ix signal is reset to 0.

【0165】このサイクルをlfixリセットサイクルと呼
ぶ。
This cycle is called an lfix reset cycle.

【0166】lfixリセットサイクルでは、lfix更新信号
によりlru更新抑止信号がディスエーブルされるため、
同サイクルのlru更新は行われる。
In the lfix reset cycle, the lru update inhibit signal is disabled by the lfix update signal.
The lru update of the same cycle will be performed.

【0167】lfixリセットサイクルの後続のサイクルで
は、lfix出力信号が0となるため、lru更新抑止信号は
0となり、lruの更新は毎サイクル行なわれる。
In the subsequent cycle of the lfix reset cycle, the lfix output signal becomes 0, the lru update inhibition signal becomes 0, and lru is updated every cycle.

【0168】本機能を命令レベルから制御するために
は、通常のLoad/Store命令に加えて、lfixフラグセット
付きLoad/Store命令やlfixフラグリセット付きLoad/Sto
re命令が新たに必要となる。
In order to control this function from the instruction level, in addition to the normal Load / Store instruction, the Load / Store instruction with lfix flag set and Load / Sto with lfix flag reset are set.
A new re command is required.

【0169】例えば、通常のLoad系の命令が Load addr1, gr1 と定義されているならば、lfixフラグセット付きLoad命
令およびlfixフラグリセット付きLoad命令はそれぞれ、 Load, lset addr1, gr1 Load, lreset addr1, gr1 のように定義する。
For example, if normal Load-type instructions are defined as Load addr1 and gr1, Load instruction with lfix flag set and Load instruction with lfix flag reset are Load, lset addr1, gr1 Load, and lreset addr1 respectively. , gr1 is defined.

【0170】ここで、addr1はアクセスする主記憶のア
ドレスを示し、gr1はデータを取り込む汎用レジスタを
示す。
Here, addr1 indicates the address of the main memory to be accessed, and gr1 indicates a general-purpose register for fetching data.

【0171】命令語のフォーマットとしては、Load命令
の命令語の一部にlsetまたはlresetオプション付きLoad
命令であることを示すフラグを2ビット設ける。
As the format of the command word, a part of the command word of the Load command is loaded with the lset or lreset option.
Two bits are provided to indicate that the flag is an instruction.

【0172】このようにすることで、命令デコーダにお
いて容易にlfix更新信号並びにlfix更新データを生成す
ることが可能となる。
By doing so, the instruction decoder can easily generate the lfix update signal and the lfix update data.

【0173】Store命令に関しても全く同様の方法で新
しい命令を追加する。
With respect to the Store instruction, a new instruction is added in exactly the same way.

【0174】また、lfix出力信号はlfixフラグリセット
付きFlush/Purge命令でも同様にリセットすることがで
きる。
Further, the lfix output signal can be similarly reset by the Flush / Purge instruction with lfix flag reset.

【0175】これらの命令もLoad命令と同様に命令語の
フォーマットにlresetオプション付きであることを示す
フラグを設けることにより、実現することができる。
Similar to the Load instruction, these instructions can be realized by providing a flag indicating that the lreset option is added to the instruction word format.

【0176】また、lreset付き命令を発行した際には、
キャッシュ20の全ラインのlfix出力信号を解除するこ
とも可能である。
When an instruction with lreset is issued,
It is also possible to cancel the lfix output signals of all the lines of the cache 20.

【0177】この場合には、lfix更新信号ではなく、lf
ixクリア信号を1にすることで、全ラインのlifx出力信
号を1サイクルでクリアすることが可能である。
In this case, it is not the lfix update signal but lf
By setting the ix clear signal to 1, it is possible to clear the lifx output signals of all lines in one cycle.

【0178】さらに、割り込み発生時ならびに割り込み
復帰命令実行時にも同様にキャッシュ20の全ラインの
lfix出力信号をクリアすることも可能である。
Furthermore, when an interrupt occurs and an interrupt return instruction is executed, all lines of the cache 20 are similarly
It is also possible to clear the lfix output signal.

【0179】図14の行列の演算を上記命令を用いて実
現すると以下のようになる。
The operation of the matrix shown in FIG. 14 is realized by using the above instruction as follows.

【0180】 for (i=0; i<n; i++) { SUB r6 , r6 , r6 for (j=0; j<n; j++){ Load B[i,j] , r1 /* キャッシュミス, C又はDが追い 出される */ Load C[i,j] , r2 /* キャッシュミス, Bが追い出され る */ Load , lset A[j] , r3 /*1回目のみキャッシュミス、それ 以降はヒット*/ ADD r1 , r2 , r4 MUL r3 , r4 , r5 ADD r5 , r6 , r6 } Store r6 , D[i] /* キャッシュミス, Cが追い出される */ Flush , lreset D[n] /*D[n]をメモリにフラッシュかつ全ラインのlf ixビットをクリア*/ 以上の命令列では、(Load A)を実行したときの当該ライ
ンのlfix出力信号が固定されるため、以降のLoad/Store
命令によりこのデータが追い出されることはない。
For (i = 0; i <n; i ++) {SUB r6, r6, r6 for (j = 0; j <n; j ++) {Load B [i, j], r1 / * cache miss, C Or D is evicted * / Load C [i, j], r2 / * cache miss, B is evicted * / Load, lset A [j], r3 / * First cache miss, hit after that * / ADD r1, r2, r4 MUL r3, r4, r5 ADD r5, r6, r6} Store r6, D [i] / * Cache miss, C is evicted * / Flush, lreset D [n] / * D [ [n] is flushed to memory and the lf ix bits of all lines are cleared * / In the above instruction sequence, the lfix output signal of the relevant line when (Load A) is executed is fixed, so the subsequent Load / Store
The instruction does not drive this data out.

【0181】キャッシュ20の1ブロックにデータ1つ
を格納することができ、かつキャッシュ20のライン数
がnである場合には、キャッシュのミス回数は、下記数
式4で表すことができ、理想的な状態と同じキャッシュ
ミス回数となる。
When one data can be stored in one block of the cache 20 and the number of lines of the cache 20 is n, the number of cache misses can be expressed by the following equation 4, The number of cache misses is the same as that of the normal state.

【0182】[0182]

【数式4】 2×(n×n+n) (回) …(式4) 次に、前記lfixフラグセット付きLoad/Store命令および
lfixフラグセット付きLoad/Store命令等のアクセス命令
を使用するオブジェクトコードの生成方法について説明
する。
[Formula 4] 2 × (n × n + n) (times) (Formula 4) Next, the load / store instruction with the lfix flag set and
A method of generating an object code using an access instruction such as a Load / Store instruction with an lfix flag set will be described.

【0183】ソースプログラムから実行形式のロードモ
ジュールを作成する方法は、前記7に示した方法と同じ
である。
The method for creating an executable load module from the source program is the same as the method described in 7 above.

【0184】本実施例2で示したlfixフラグセット/リ
セット付きLoad/Store命令等のアクセス命令は、この中
のコード最適化部713において生成され、オブジェク
トプログラムの中に取り込まれる。
Access instructions such as the Load / Store instruction with lfix flag set / reset shown in the second embodiment are generated in the code optimizing unit 713 therein and taken into the object program.

【0185】図12は、lfixフラグセット/リセット付
きLoad/Store命令等のアクセス命令を生成する本実施例
2の最適化のアルゴリズムを示すフローチャートであ
る。
FIG. 12 is a flow chart showing an optimization algorithm of the second embodiment for generating an access instruction such as Load / Store instruction with lfix flag set / reset.

【0186】本実施例2の最適化アルゴリズムは、従来
の最適化処理を行った後で適用される。
The optimization algorithm of the second embodiment is applied after performing conventional optimization processing.

【0187】次に、図12を用いて、本実施例2の最適
化アルゴリズムについて説明する。
Next, the optimization algorithm of the second embodiment will be described with reference to FIG.

【0188】本実施例2の最適化アルゴリズムでは、始
めに、データの依存関係の解析を行い全ての変数の参照
または代入の依存関係を求める(ステップ951)。
In the optimization algorithm of the second embodiment, first, the dependency relationship of data is analyzed and the dependency relationship of reference or substitution of all variables is obtained (step 951).

【0189】次に、変数の参照回数等から該変数をイン
キャッシュ化したいかどうかを判定し(ステップ95
3)、インキャッシュ化したいのであれば、当該変数の
最初のアクセス命令にlsetオプションを付加し(ステッ
プ954)、当該変数の最後のアクセス命令にlrelease
tオプションを付加した命令コードを生成する(ステッ
プ955)。
Next, it is judged whether the variable is to be in-cached or not based on the number of times the variable is referenced (step 95).
3) If it is desired to be in-cached, add the lset option to the first access instruction of the variable (step 954) and lrelease to the last access instruction of the variable.
An instruction code with the t option added is generated (step 955).

【0190】また、前記ステップ953、954、95
5の処理を、全ての変数に対して行う(ステップ95
2、ステップ956)。
In addition, the steps 953, 954 and 95
Process 5 is performed for all variables (step 95).
2, step 956).

【0191】lsetオプションで参照されたデータは、キ
ャッシュ20内で最新のデータとなる一方、該キャッシ
ュラインのlru更新をそれ以降抑止することで、当該変
数に対応するデータがキャッシュ20から追い出される
のを抑止し、当該変数に対する最後のアクセス時までイ
ンキャッシュ20の状態を保つことが可能となる。
The data referred to by the lset option becomes the latest data in the cache 20, while the lru update of the cache line is suppressed thereafter, so that the data corresponding to the variable is flushed from the cache 20. Can be suppressed, and the state of the in-cache 20 can be maintained until the last access to the variable.

【0192】なお、同一キャッシュラインに対してlfix
フラグセット付きLoad/Store命令が複数回発行された場
合には、後で発行された命令が有効となる。
It should be noted that lfix is applied to the same cache line.
When the Load / Store instruction with flag set is issued multiple times, the instruction issued later becomes valid.

【0193】以上説明したように、本実施例2によれ
ば、各ライン毎にアクセス履歴情報を有し、該アクセス
履歴情報に基づいてキャッシュラインの追い出し制御を
おこなっているセット・アソシアティブ方式のキャッシ
ュ記憶装置20において、キャッシュメモリの各ライン
毎にアクセス履歴情報の更新を抑止するフラグ18を設
け、該フラグ18が1の時には、当該ラインのアクセス
履歴情報の更新を強制的に抑止する制御機構を設けてい
る。
As described above, according to the second embodiment, the cache of the set associative system, which has the access history information for each line, and performs the cache line eviction control based on the access history information. In the storage device 20, a flag 18 for suppressing the update of the access history information is provided for each line of the cache memory, and when the flag 18 is 1, a control mechanism for forcibly suppressing the update of the access history information of the line is provided. It is provided.

【0194】また、これらのフラグ18を制御するため
のアクセス履歴情報抑止フラグ制御付きLoad/Store命令
等を生成する。
Further, a load / store instruction with an access history information suppression flag control for controlling these flags 18 is generated.

【0195】アクセス履歴情報の更新を抑止することに
より、それ以降のデータの追い出しは、常に更新が抑止
された時点においてアクセス履歴情報が最も古いブロッ
クに対して行なわれる。
By suppressing the update of the access history information, subsequent data eviction is always performed on the block having the oldest access history information at the time when the update is suppressed.

【0196】この新しい制御機構を設けることによっ
て、追い出したくないデータを意図的にキャッシュ20
内にとどめておくことが可能となる。
By providing this new control mechanism, the data which is not desired to be ejected is intentionally cached.
It is possible to keep it inside.

【0197】本実施例2では、図14の(Load A)命令を
アクセス履歴情報抑止フラグセット付きLoad命令とする
ことで、(Load A)命令で取り込まれたデータが追い出さ
れることを抑止する。
In the second embodiment, by making the (Load A) instruction of FIG. 14 a load instruction with an access history information suppression flag set, it is possible to prevent the data fetched by the (Load A) instruction from being evicted.

【0198】即ち、(Load A)命令で行列Aのデータをキ
ャッシュ20内に取り込み、当該ラインのアクセス履歴
情報を更新して、Aのデータを保持するブロックのアク
セス履歴情報を最新にした後、アクセス履歴情報更新抑
止フラグ18を1にする。
That is, after the data of the matrix A is fetched into the cache 20 by the (Load A) instruction, the access history information of the relevant line is updated, and the access history information of the block holding the data of A is updated, The access history information update suppression flag 18 is set to 1.

【0199】これにより、以降のアクセス命令による当
該ラインのアクセス履歴情報の更新を抑止し、常に行列
Aのデータのアクセス履歴情報が最新のまま凍結され
る。
As a result, the update of the access history information of the line by the subsequent access command is suppressed, and the access history information of the data of the matrix A is always frozen as it is.

【0200】そして、行列の計算が終了したときにアク
セス履歴情報更新抑止フラグ18をリセットする命令を
発行する。
Then, when the matrix calculation is completed, an instruction for resetting the access history information update suppression flag 18 is issued.

【0201】以上、本発明を実施例に基づき具体的に説
明したが、本発明は、前記実施例に限定されるものでは
なく、その要旨を逸脱しない範囲で種々変更し得ること
は言うまでもない。
Although the present invention has been specifically described based on the embodiments, it is needless to say that the present invention is not limited to the above embodiments and various modifications can be made without departing from the scope of the invention.

【0202】[0202]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば、下
記の通りである。
The effects obtained by the typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0203】(1)アクセス履歴情報に基づいてキャッ
シュラインの追い出し制御を行なっているセット・アソ
シアティブ方式のキャッシュ記憶装置において、プロセ
ッサからの、アクセス履歴情報の更新を抑止するアクセ
ス命令に基づいて、アクセスされたキャッシュラインの
アクセス履歴情報の更新を抑止するようにしたので、追
い出したくないデータを一時的にキャッシュに常駐させ
ることが可能となる。
(1) In a set-associative cache memory device that controls cache line eviction based on access history information, access is performed based on an access instruction from the processor that suppresses update of access history information. Since the update of the access history information of the cache line that has been deleted is suppressed, it becomes possible to temporarily make the data that should not be evicted remain resident in the cache.

【0204】これにより、行列演算等におけるキャッシ
ュ・ミスの回数を大幅に削減することが可能となり、図
14に示す従来例と比較して、キャッシュ・ミスの回数
を約33%削減することができる。
This makes it possible to significantly reduce the number of cache misses in matrix operations and the like, and to reduce the number of cache misses by about 33% as compared with the conventional example shown in FIG. .

【0205】(2)アクセス履歴情報の更新を抑止する
アクセス命令として、データの依存関係の解析を行い全
ての変数の参照または代入の依存関係を求め、命令がア
クセス処理で参照または代入する変数に対する最後のア
クセスであった場合に、前記アクセス命令にアクセス履
歴情報の更新の抑止を示すフラグを付加するようにした
ので、キャッシュの追い出し制御を、命令レベルから制
御することが可能となる。
(2) As an access instruction for suppressing the update of the access history information, the dependency relationship of data is analyzed, the dependency relationship of reference or substitution of all variables is obtained, and the instruction refers to the variable referred to or substituted in the access processing. In the case of the last access, the access instruction is provided with a flag indicating suppression of update of the access history information, so that cache eviction control can be controlled from the instruction level.

【0206】(3)アクセス履歴情報の更新を抑止する
アクセス命令として、データの依存関係の解析を行い全
ての変数の参照または代入の依存関係を求め、インキャ
ッシュ化したい変数変数の最初のアクセス命令にアクセ
ス履歴情報の更新の抑止を示すフラグを付加し、また、
前記変数の最後のアクセス命令にアクセス履歴情報の更
新の抑止の解除を示すフラグを付加するようにしたの
で、キャッシュの追い出し制御を、命令レベルから制御
することが可能となる。
(3) As the access instruction for suppressing the update of the access history information, the first access instruction of the variable that is to be in-cached by analyzing the data dependency and obtaining the reference or assignment dependency of all variables Add a flag to suppress the update of access history information to
Since the flag indicating that the suppression of the update of the access history information is released is added to the last access instruction of the variable, the cache eviction control can be controlled from the instruction level.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例(実施例1)であるキャッシ
ュ記憶装置の概略構成を示すブロック図である。
FIG. 1 is a block diagram showing a schematic configuration of a cache storage device that is an embodiment (embodiment 1) of the present invention.

【図2】図1に示すヒットまたはミス判定回路の内部の
構成を示す図である。
FIG. 2 is a diagram showing an internal configuration of a hit or miss determination circuit shown in FIG.

【図3】図1に示すデータまたはタグまたはlru制御回
路の内部の構成を示す図である。
FIG. 3 is a diagram showing an internal configuration of a data or tag shown in FIG. 1 or an lru control circuit.

【図4】図1に示す選択ウェイ制御回路の内部の構成を
示す図である。
FIG. 4 is a diagram showing an internal configuration of a selection way control circuit shown in FIG.

【図5】図1に示すlruビットセルの内部の構成を示す
図である。
5 is a diagram showing an internal configuration of the lru bit cell shown in FIG. 1. FIG.

【図6】本実施例における、lru更新のタイミングチャ
ートを示す図である。
FIG. 6 is a diagram showing a timing chart of lru update in the present embodiment.

【図7】ソースプログラムから実行形式のロードモジュ
ールを作成する一般的な処理を流れを示す図である。
FIG. 7 is a diagram showing the flow of general processing for creating an execution-type load module from a source program.

【図8】lru更新抑止制御付きLoad/Store命令等のアク
セス命令を生成する本実施例1の最適化のアルゴリズム
を示すフローチャートである。
FIG. 8 is a flowchart showing an optimization algorithm for generating an access instruction such as a Load / Store instruction with lru update suppression control according to the first embodiment.

【図9】本発明の他の実施例(実施例2)であるキャッ
シュ記憶装置の概略構成を示すブロック図である。
FIG. 9 is a block diagram showing a schematic configuration of a cache storage device according to another embodiment (second embodiment) of the present invention.

【図10】図9に示すlru更新抑止フラグの内部の構成
を示す図である。
10 is a diagram showing an internal configuration of an lru update suppression flag shown in FIG.

【図11】第2の実施例における、lru更新のタイミン
グチャートを示す図である。
FIG. 11 is a diagram showing a timing chart of lru update in the second embodiment.

【図12】lfixフラグセット付きLoad/Store命令等のア
クセス命令を生成する本実施例2の最適化のアルゴリズ
ムを示すフローチャートである。
FIG. 12 is a flowchart showing an optimization algorithm for generating an access instruction such as a Load / Store instruction with an lfix flag set according to the second embodiment.

【図13】従来例のセット・アソシアティブ・キャッシ
ュメモリの概略構成を示すブロック図である。
FIG. 13 is a block diagram showing a schematic configuration of a conventional set associative cache memory.

【図14】従来例のセット・アソシアティブ・キャッシ
ュメモリで、追い出し制御方法としてLRUアルゴリズム
を採用した場合に性能が低下するプログラム例を示す図
である。
FIG. 14 is a diagram showing a program example in which performance deteriorates in the conventional set associative cache memory when the LRU algorithm is adopted as the eviction control method.

【符号の説明】[Explanation of symbols]

10,20…キャッシュ記憶装置、11…メモリセル
部、12…ヒット/ミス判定回路、13…データ/タグ
/lru制御回路、14…選択ウェイ制御回路、15…lru
ビットセル、16…lru更新データ選択回路、17…デ
ータ/タグ選択回路、18…lru更新抑止フラグ、12
1…ヒットウェイ信号生成回路、122…ヒット信号生
成回路、123,124…アドレス比較器、131…lr
u更新信号生成回路、132…データ/タグ更新信号、
141…ウェイ選択回路、142…追い出しウェイ信号
生成回路、151…lru更新回路、152…lru更新クロ
ック生成回路、153…lru更新クロック抑止回路、1
54…lru読み出しクロック生成回路、155…lru読み
出し回路、181…lfixビットセル、182…lfix更新
クロック生成回路、183…lru更新抑止信号生成回
路。
10, 20 ... Cache storage device, 11 ... Memory cell section, 12 ... Hit / miss determination circuit, 13 ... Data / tag / lru control circuit, 14 ... Select way control circuit, 15 ... Lru
Bit cell, 16 ... Lru update data selection circuit, 17 ... Data / tag selection circuit, 18 ... Lru update inhibition flag, 12
1 ... Hit way signal generation circuit, 122 ... Hit signal generation circuit, 123, 124 ... Address comparator, 131 ... Lr
u update signal generation circuit, 132 ... Data / tag update signal,
141 ... Way selection circuit, 142 ... Ejection way signal generation circuit, 151 ... Lru update circuit, 152 ... Lru update clock generation circuit, 153 ... Lru update clock inhibition circuit, 1
54 ... lru read clock generation circuit, 155 ... lru read circuit, 181, ... lfix bit cell, 182 ... lfix update clock generation circuit, 183 ... lru update inhibition signal generation circuit.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 データとタグを保持するメモリセル部
と、アクセスデータのヒット/ミス判定回路と、各キャ
ッシュライン毎のアクセス履歴情報を更新・保持する保
持手段と、メモリ部と保持手段とを制御する制御回路と
を少なくとも具備し、前記アクセス履歴情報に基づいて
キャッシュラインの追い出し制御を行うセット・アソシ
アティブ方式のキャッシュ記憶装置において、 プロセッサからの、アクセス履歴情報の更新を抑止する
アクセス命令に基づいて、アクセスされたキャッシュラ
インのアクセス履歴情報の更新を抑止する抑止回路を具
備することを特徴とするキャッシュ記憶装置。
1. A memory cell unit for holding data and a tag, a hit / miss determination circuit for access data, a holding unit for updating / holding access history information for each cache line, a memory unit and a holding unit. A cache memory device of a set associative system, which comprises at least a control circuit for controlling, and performs cache line eviction control based on the access history information, wherein A cache storage device comprising: a suppressor circuit for suppressing update of access history information of an accessed cache line.
【請求項2】 請求項1に記載されたキャッシュ記憶装
置において、 前記アクセス履歴情報の更新を抑止するアクセス命令
が、アクセス履歴情報の更新の抑止を示すフラグが付加
されたアクセス命令であり、 さらに、前記抑止回路が、アクセス履歴情報の更新の抑
止を示すフラグが付加されたアクセス命令に基づくアク
セス履歴情報更新抑止信号により、アクセスされたキャ
ッシュラインの保持手段内のアクセス履歴情報更新回路
の動作を抑止する回路であることを特徴とするキャッシ
ュ記憶装置。
2. The cache storage device according to claim 1, wherein the access instruction for suppressing updating of the access history information is an access instruction to which a flag indicating suppression of updating of access history information is added. , The operation of the access history information update circuit in the holding means of the accessed cache line by the access history information update inhibition signal based on the access instruction to which the flag indicating the inhibition of the update of the access history information is added. A cache storage device characterized by being a circuit for inhibiting.
【請求項3】 請求項1に記載されたキャッシュ記憶装
置において、 前記アクセス履歴情報の更新を抑止するアクセス命令
が、アクセス履歴情報の更新の抑止、あるいは、アクセ
ス履歴情報の更新の抑止の解除を示すフラグが付加され
たアクセス命令であり、 さらに、前記抑止回路が、アクセス履歴情報の更新の抑
止を示すフラグが付加されたアクセス命令に基づき、そ
れ以降アクセス履歴情報更新抑止信号を出力し、アクセ
ス履歴情報の更新の抑止の解除を示すフラグが付加され
たアクセス命令に基づき、アクセス履歴情報更新抑止信
号の出力を停止するアクセス履歴情報更新抑止フラグ
と、前記アクセス履歴情報更新抑止フラグからの前記ア
クセス履歴情報更新抑止信号により、アクセスされたキ
ャッシュラインの保持手段内のアクセス履歴情報更新回
路の動作を抑止する回路であることを特徴とするキャッ
シュ記憶装置。
3. The cache storage device according to claim 1, wherein an access command for suppressing the update of the access history information suppresses the update of the access history information or releases the suppression of the update of the access history information. The access instruction further includes a flag indicating that the access circuit further outputs an access history information update inhibit signal based on the access instruction to which the flag indicating the inhibition of update of the access history information is added. An access history information update suppression flag for stopping output of an access history information update suppression signal based on an access command to which a flag indicating cancellation of suppression of history information update is added, and the access from the access history information update suppression flag Access within the holding means of the accessed cache line by the history information update inhibit signal Cache storage device, characterized in that the circuit for suppressing the operation of gravel information update circuit.
【請求項4】 アクセス履歴情報の更新を抑止するアク
セス命令の生成方法において、 データの依存関係の解析を行い全ての変数の参照または
代入の依存関係を求め、メモリまたはキャッシュへのデ
ータアクセス命令に対して、前記命令がアクセス処理で
参照または代入する変数に対する最後のアクセスである
か否かを判断し、命令がアクセス処理で参照または代入
する変数に対する最後のアクセスであった場合に、前記
アクセス命令にアクセス履歴情報の更新の抑止を示すフ
ラグを付加することを特徴とするアクセス履歴情報の更
新を抑止するアクセス命令の生成方法。
4. In a method of generating an access instruction for suppressing updating of access history information, a data dependency analysis is performed to obtain a reference or assignment dependency of all variables, and a data access instruction to a memory or a cache is obtained. On the other hand, it is determined whether or not the instruction is the last access to the variable to be referenced or assigned in the access processing, and when the instruction is the last access to the variable to be referenced or assigned in the access processing, the access instruction A method of generating an access command for suppressing the update of access history information, characterized in that a flag indicating that the update of access history information is suppressed is added to.
【請求項5】 アクセス履歴情報の更新を抑止するアク
セス命令の生成方法において、 データの依存関係の解析を行い全ての変数の参照または
代入の依存関係を求め、変数をインキャッシュ化したい
かどうかを判定し、インキャッシュ化したい変数変数の
最初のアクセス命令にアクセス履歴情報の更新の抑止を
示すフラグを付加し、また、前記変数の最後のアクセス
命令にアクセス履歴情報の更新の抑止の解除を示すフラ
グを付加することを特徴とするアクセス履歴情報の更新
を抑止するアクセス命令の生成方法。
5. In a method of generating an access instruction for suppressing the update of access history information, a data dependency analysis is performed to determine the reference or assignment dependency of all variables, and whether or not the variables are to be in-cached is determined. Variable to be judged and in-cached A flag indicating the inhibition of updating the access history information is added to the first access instruction of the variable, and the inhibition of updating the access history information is released to the last access instruction of the variable. A method of generating an access command for suppressing update of access history information, which is characterized by adding a flag.
JP6076814A 1994-04-15 1994-04-15 Cache storage and access instruction generation method Pending JPH07281957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6076814A JPH07281957A (en) 1994-04-15 1994-04-15 Cache storage and access instruction generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6076814A JPH07281957A (en) 1994-04-15 1994-04-15 Cache storage and access instruction generation method

Publications (1)

Publication Number Publication Date
JPH07281957A true JPH07281957A (en) 1995-10-27

Family

ID=13616147

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6076814A Pending JPH07281957A (en) 1994-04-15 1994-04-15 Cache storage and access instruction generation method

Country Status (1)

Country Link
JP (1) JPH07281957A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002510085A (en) * 1998-03-31 2002-04-02 インテル・コーポレーション Shared cache structure for temporary and non-temporary instructions
US6560676B1 (en) 2000-01-13 2003-05-06 Hitachi, Ltd. Cache memory system having a replace way limitation circuit and a processor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002510085A (en) * 1998-03-31 2002-04-02 インテル・コーポレーション Shared cache structure for temporary and non-temporary instructions
US6560676B1 (en) 2000-01-13 2003-05-06 Hitachi, Ltd. Cache memory system having a replace way limitation circuit and a processor

Similar Documents

Publication Publication Date Title
JP2505086B2 (en) Address generation mechanism and pre-fetch method of data
EP0996891B1 (en) Data processing circuit with cache memory
JP4486750B2 (en) Shared cache structure for temporary and non-temporary instructions
US7099999B2 (en) Apparatus and method for pre-fetching data to cached memory using persistent historical page table data
US8725987B2 (en) Cache memory system including selectively accessible pre-fetch memory for pre-fetch of variable size data
US6240488B1 (en) Prefetching hints
US6161166A (en) Instruction cache for multithreaded processor
US7765360B2 (en) Performing useful computations while waiting for a line in a system with a software implemented cache
EP0612013A1 (en) Combination prefetch buffer and instruction cache cross references to related applications
JPH07200399A (en) Microprocessor and method for access to memory in microprocessor
JPH06348595A (en) Cache device
JPH0863393A (en) Write method of new word segment due to generation of cache mistake at inside of multilevel cache
JPH04324546A (en) Computer system
JPH08272682A (en) Tag separated at inside of load/store unit provided with load buffer and method for access to data array as well as apparatus provided with said array
JP2006516168A (en) How to use a cache miss pattern to address the stride prediction table
JP2005533295A (en) Method and apparatus for decoupling tag and data access in cache memory
JP2001195304A (en) Cache storage device
US6434670B1 (en) Method and apparatus for efficiently managing caches with non-power-of-two congruence classes
JP3431878B2 (en) Instruction cache for multithreaded processors
GB2347765A (en) Cache memory addressing system
US20040073753A1 (en) Directoryless L0 cache for stall reduction
JPH0743671B2 (en) Cache memory control method
JPH07281957A (en) Cache storage and access instruction generation method
US7467260B2 (en) Method and apparatus to purge remote node cache lines to support hot node replace in a computing system
KR100481943B1 (en) Flash memory system for improving temporal locality and spatial locality and for reducing data access time and data access method using the same