[go: up one dir, main page]

JP2868654B2 - Cache memory control method - Google Patents

Cache memory control method

Info

Publication number
JP2868654B2
JP2868654B2 JP3304317A JP30431791A JP2868654B2 JP 2868654 B2 JP2868654 B2 JP 2868654B2 JP 3304317 A JP3304317 A JP 3304317A JP 30431791 A JP30431791 A JP 30431791A JP 2868654 B2 JP2868654 B2 JP 2868654B2
Authority
JP
Japan
Prior art keywords
data
cache
cache memory
refill
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP3304317A
Other languages
Japanese (ja)
Other versions
JPH05143456A (en
Inventor
光男 斉藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP3304317A priority Critical patent/JP2868654B2/en
Priority to US07/979,806 priority patent/US5634027A/en
Publication of JPH05143456A publication Critical patent/JPH05143456A/en
Application granted granted Critical
Publication of JP2868654B2 publication Critical patent/JP2868654B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Advance Control (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は電子計算機装置に関わ
り、特に高速化のためのキャッシュメモリ装置における
キャッシュメモリ制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an electronic computer, and more particularly to a cache memory for speeding up .
The present invention relates to a cache memory control method .

【0002】[0002]

【従来の技術】通常のキャッシュメモリに於いては、図
7のように、キャッシュミスが発生すると、必要とする
データがキャッシュに取り込まれてから実行を再開して
いた。その際はその近くのデータも必要とするケースが
多いために、通常は一定数の複数のデータを同時に取り
込んでいた。この方式は、キャッシュミスの比率が低い
ときには、うまく作動するものである。この関係を式で
表すと、以下のようになる。 Ne=(1−Km)*Ca+Km+Cc
2. Description of the Related Art In a normal cache memory, as shown in FIG. 7, when a cache miss occurs, execution is resumed after necessary data is fetched into a cache. At that time, since data in the vicinity is often required, a fixed number of plural data are usually taken at the same time. This scheme works well when the ratio of cache misses is low. This relationship is represented by the following equation. Ne = (1-Km) * Ca + Km + Cc

【0003】ちなみに、Neは、実効的なメモリのアク
セス時間で、キャッシュメモリの性能を示すものであ
る。またKmは、キャッシュメモリのミス率で、この値
は、キャッシュメモリの大きさ、問題の性質などによ
り、変化するものである。またCaは、キャッシュメモ
リがヒットした場合のアクセス時間で、Ccはキャッシ
ュメモリを入れ換えるのに必要な時間である。通常のケ
ースでは、時間をクロックのサイクル数で測ると、Ca
は1、Ccは10程度、Kmは、1%〜5%程度なの
で、Neは、1.1〜1.5程度になる。この値は、通
常キャッシュメモリを使用しない場合の2〜3程度に比
較して十分小さい値であるので、キャッシュメモリを使
用する効果があることになる。しかし問題によっては、
キャッシュミス率が極めて高くなるケースが存在する。
このようなケースでは、キャッシュメモリは、その効果
がなくなり、かえって悪くなることも有り得る。このよ
うなケースは、問題を解くために使用するデータ量が多
くなるとともに、キャッシュメモリまで含んだマイクロ
プロセサを開発するためにキャッシュメモリのサイズが
それほど大きくとれないことから、顕著になってきてい
る。またたとえ、一定数のデータを連続してリフィルし
てミスの率を多少減らしたとしても、命令キャッシュに
関しては、データ(命令の)がない限り実行が不可能な
ため、リフェル中に処理が中断してしまうという問題は
解決しなかった。
[0005] Incidentally, Ne is an effective memory access time and indicates the performance of a cache memory. Km is the cache memory miss rate, and this value varies depending on the size of the cache memory, the nature of the problem, and the like. Ca is the access time when the cache memory hits, and Cc is the time required to replace the cache memory. In the normal case, measuring time in clock cycles gives Ca
Is about 1, Cc is about 10, and Km is about 1% to 5%, so Ne is about 1.1 to 1.5. This value is sufficiently smaller than the value of about 2 to 3 when the normal cache memory is not used, so that there is an effect of using the cache memory. But depending on the problem,
There are cases where the cache miss rate becomes extremely high.
In such a case, the cache memory loses its effect and may be worse. Such a case is becoming more prominent because the amount of data used to solve the problem increases and the size of the cache memory cannot be so large to develop a microprocessor including the cache memory. . Even if a certain number of data is continuously refilled and the miss rate is slightly reduced, the instruction cache cannot be executed unless there is data (of the instruction), so the processing is interrupted during the refel. The problem of doing so was not solved.

【0004】[0004]

【発明が解決しようとする課題】上述したように従来の
キャッシュメモリシステムでは、リフィル中に計算が停
止してしまうために、ミス率の増大が即ちキャッシュメ
モリの性能の低下を意味し、大きな問題に対して無力で
あるばかりでなくかえって害になるケースもあり、特に
1チップにキャッシュメモリを取り込んだマイクロプロ
セサの性能向上を妨げていた。
As described above, in the conventional cache memory system, since the calculation is stopped during refilling, an increase in the miss rate means a decrease in the performance of the cache memory, which is a serious problem. In some cases, the microprocessor is not only helpless but also harmful, and in particular has hindered the performance improvement of a microprocessor incorporating a cache memory in one chip.

【0005】本発明はこのような事情を鑑みてなされた
もので、その目的とするところは、1回のミスで、連続
して使用される領域を全てリフィルして、ミスの率を減
らし、またリフィル中も停止することなく計算を続行
し、高い性能を得ることのできるキャッシュメモリ装置
を提供することにある。
The present invention has been made in view of such circumstances, and a purpose of the present invention is to reduce the error rate by refilling all the continuously used areas with one error. Another object of the present invention is to provide a cache memory device which can continue calculation without stopping even during refilling and can obtain high performance.

【0006】[0006]

【課題を解決するための手段】本発明に係るキャッシュ
メモリ装置におけるキャッシュメモリ制御方法は、電子
計算機が必要とするデータが上位のキャッシュメモリに
存在しなかった場合に、より下位のキャッシュメモリま
たはメインメモリから前記目的のデータを入れ換える手
段を備えたキャッシュメモリ装置であって、前記メイン
メモリに格納された予めデータの入れ換えの終了条件を
設定したプログラムにより設定されたデータを記憶する
終了パターンレジスタを設け、データキャッシュにおい
て、より下位のキャッシュまたはメインメモリからのデ
ータの入れ換えは、目的のデータが存在しなかった場合
にこのデータを指定するアドレスから開始し、前記デー
タを指定するアドレスを増加しながら前記入れ替えを継
続し、前記入れ換えの終了は、前記終了パターンレジス
タに記憶されたプログラムにより設定されたデータに基
づき、より下位のキャッシュまたはメインメモリから読
み込まれてきたデータが前記設定した終了条件と一致し
た場合に、前記入れ換えの終了を決定することを特徴と
する。
SUMMARY OF THE INVENTION A cache memory control method in a cache memory device according to the present invention provides a method for controlling a lower cache memory or a main cache memory when data required by a computer does not exist in an upper cache memory. What is claimed is: 1. A cache memory device comprising: means for exchanging said target data from a memory, provided with an end pattern register for storing data stored in said main memory and set by a program in which an end condition for exchanging data is set in advance. In the data cache, the replacement of data from the lower cache or main memory starts from the address specifying the data when the target data does not exist, and increases the address specifying the data. Continue the exchange, and Is terminated based on the data set by the program stored in the end pattern register, when the data read from the lower cache or main memory matches the set end condition, Is determined.

【0007】また、上記のキャッシュメモリ装置におけ
るキャッシュメモリ制御方法において、読み込まれてき
たデータの内容に拘らず、増加させたアドレスが既に上
位のキャッシュメモリ中に存在しているデータのアドレ
スと一致した場合に、入れ換えの終了を決定することを
特徴とするものである。
In the above cache memory device ,
Determining the end of replacement when the increased address matches the address of data already existing in the upper cache memory, irrespective of the content of the read data in the cache memory control method . It is characterized by the following.

【0008】[0008]

【0009】[0009]

【作用】ミスが発生した際のデータの入れ換えを、1回
のミスに対して固定長継続するのではなく、リフィルさ
れるデータの内容をチェックしながらリフィルを継続
し、チェックされた内容によりその終了を決定すること
により、可変長継続することができる。それにより、ミ
スの回数を減らすことができ、また不要なデータの入れ
換えも防ぐ事ができる。また、これらの入れ換えは計算
機の実行とは関わりなく独立して並行に行うことができ
るので、計算機を停止させることなく、キャッシュ中の
データの入れ換えを進めることにより、大きなブロック
を計算機を止めずにリフィルすることができる。
The data replacement when a mistake occurs is not continued for a fixed length for one mistake, but the refill is continued while checking the content of the data to be refilled. By determining the end, the variable length can be continued. Thereby, the number of mistakes can be reduced, and unnecessary data exchange can be prevented. In addition, since these exchanges can be performed independently and in parallel regardless of the execution of the computer, by exchanging data in the cache without stopping the computer, large blocks can be retained without stopping the computer. Can be refilled.

【0010】[0010]

【実施例】以下図面を参照しながら本発明の一実施例に
ついて説明する。図1は本発明の一実施例に係るキャッ
シュメモリ装置の構成を表すブロック図である。図1中
のリフィル制御部4の動作の流れを図2に示す。
An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a cache memory device according to one embodiment of the present invention. FIG. 2 shows a flow of the operation of the refill control unit 4 in FIG.

【0011】動作を簡単に説明すると、まずCPU1が
キャッシュメモリを読み出す際には、アドレスを与え
て、1stキャッシュのタグ部2とデータ部3に同時に
アクセスする。もしもそこでヒットすれば(タグ部2の
アドレスとCPU1から送られたアドレスが一致するこ
とを比較器6が検出すれば)、1stキャッシュのデー
タ部3から読み出したものは正しかったことになり、こ
の読み出したデータを使う。この場合は1クロックでデ
ータにアクセスできる。
The operation will be briefly described. First, when the CPU 1 reads the cache memory, it gives an address and simultaneously accesses the tag section 2 and the data section 3 of the first cache. If there is a hit (if the comparator 6 detects that the address of the tag unit 2 matches the address sent from the CPU 1), the data read from the data unit 3 of the first cache is correct. Use the read data. In this case, data can be accessed in one clock.

【0012】1stキャッシュでミスだった場合は、読
み出そうとするアドレスを、リフィル制御部4を通し
て、2ndキャッシュメモリ5(これはメインメモリで
もよい)にアクセスする(S2)。そこで2ndキャッ
シュの場合ヒットを確認した後、データにアクセスす
る。そこで読み出されたデータは、リフィル制御部4を
経て1stキャッシュに渡され(S3)、1stキャッ
シュのタグ部2及びデータ部3を書き換えるとともに、
CPU1にもデータを送る。
If there is a miss in the first cache, the address to be read is accessed through the refill control unit 4 to the second cache memory 5 (this may be the main memory) (S2). Therefore, in the case of the second cache, data is accessed after a hit is confirmed. The read data is passed to the first cache via the refill control unit 4 (S3), and the tag unit 2 and the data unit 3 of the first cache are rewritten.
The data is also sent to CPU1.

【0013】上記の過程で、データが2ndキャッシュ
メモリ5からリフィル制御部4へ渡される際に、分岐命
令検出器8がリフィル中のデータを監視し、ブランチ命
令かどうかを検出する(S4)。もしブランチ命令でな
い場合は(S4No)、2ndキャッシュまたはメインメ
モリに与えるアドレスを増加しながら(S9)、次々に
リフィルを続ける(S10,S3)。こうすることによ
り、一度キャッシュミスをすると、ブランチ命令までリ
フィルされるため、ブランチまではキャッシュミスをし
ないことになる。また固定長でブロック(一度にリフィ
ルを行うデータの単位)を大きくとると同様の効果はあ
るものの、使わない領域までリフィルする必要があるた
め無駄があったが、それも防げる。実際には、単にブラ
ンチを検出するだけでなく、当然既にキャッシュに登録
されている際はリフィルは無駄なので、2ndキャッシ
ュに与えるアドレスが1stキャッシュのラグ部にある
アドレスと一致した段階(S11Yes )で、リフィルを
中止する(S12)。
In the above process, when data is transferred from the second cache memory 5 to the refill control unit 4, the branch instruction detector 8 monitors the data being refilled and detects whether it is a branch instruction (S4). If the instruction is not a branch instruction (S4 No), refilling is continued one after another while increasing the address to be given to the second cache or the main memory (S9) (S10, S3). By doing so, once a cache miss is made, the branch instruction is refilled, so that no cache miss is made up to the branch. In addition, if a block (unit of data to be refilled at a time) is made large with a fixed length, the same effect is obtained, but it is necessary to refill an unused area, which is wasteful, but this can be prevented. Actually, not only is the branch detected, but refilling is of course useless when it is already registered in the cache. Therefore, when the address given to the second cache matches the address in the lag portion of the first cache (S11 Yes). The refill is stopped (S12).

【0014】キャッシュメモリの実際の作り方として
は、タグメモリの容量を減らすために、図6のように、
一つのタグに対して複数のバリッドビットを持つように
するのが効果的である。この例では、1つのタグ(アド
レス)に対して、4単位のデータ部(V0,V1,V
2,V3)を対応させている。尚図中Mというビット
は、これらのデータ部のデータのうち少なくとも1つが
無効である(書き換えられている)ことを表すためのも
のである。各バリッドビットは1回のリフィルの幅とす
れば、無駄を最小限にする事ができる。
As an actual method of making a cache memory, in order to reduce the capacity of the tag memory, as shown in FIG.
It is effective to have a plurality of valid bits for one tag. In this example, for one tag (address), the data unit (V0, V1, V1
2, V3). Note that the bit M in the figure indicates that at least one of the data in these data portions is invalid (rewritten). If each valid bit has a width of one refill, waste can be minimized.

【0015】またブランチターゲットバッファ(分岐予
測装置)を備えている場合は、ブランチでフィリルを途
ぎらせることなく、ブランチターゲットバッファの予測
先からさらに、リフィルを継続することにより、ブラン
チがあっても効果的にリフィルを継続できる。ここでブ
ランチターゲットバッファの機能を図3を用いて説明す
る。まず通常のCPUが行う命令フェッチの様子を
(a)に示す。101番地の命令がブランチ命令である
場合この分岐先が201番地であることがわかるのは命
令を実行した後であるので、この実行前のサイクルでフ
ェッチした102、103番地の命令は無駄になってし
まう。そこで、一度上記のことが起こると、101番地
の命令の分岐予測先として201番地を(b)のような
分岐予測テーブルに記憶する。そして、(c)のよう
に、CPUが101番地の命令をフェッチすると共に分
岐予測テーブルを引き、次のサイクルで201番地の命
令をフェッチすることができる。これを本実施例に適用
した場合の動作を、再度図2を用いて説明する。まず分
岐命令検出器8でリフィル中のデータが分岐命令である
ことを検出した際(S4Yes )、この検出信号でもって
分岐予測器7を起動し、リフィル制御部4より前記のデ
ータのアドレスを分岐予測器7に送り(S5)、分岐予
測テーブルに登録されているかどうかを、チェックす
る。もし分岐予測器に予測先が登録されていれば(S6
Yes )、分岐予測器7は予想される分岐先のアドレスを
リフィル制御部4に送る(S7)。リフィル制御部4で
は、その予想されるアドレスからさらにリフィルを続行
する(S8,S3)。予測先が登録されていなければ
(S6No)、データが分岐命令でなかった場合と同様、
アドレスを増加しながらリフィルを続行する。このよう
にすることにより、効果的にリフィルを継続できる。
When a branch target buffer (branch prediction device) is provided, refilling is continued from the prediction target of the branch target buffer without interrupting the filing at the branch, so that even if there is a branch, Refill can be continued effectively. Here, the function of the branch target buffer will be described with reference to FIG. First, the state of instruction fetch performed by a normal CPU is shown in FIG. If the instruction at address 101 is a branch instruction, it is known that the branch destination is at address 201 after executing the instruction. Therefore, the instructions at addresses 102 and 103 fetched in the cycle before the execution are wasted. Would. Therefore, once the above occurs, address 201 is stored in the branch prediction table as shown in FIG. Then, as shown in (c), the CPU can fetch the instruction at address 101 and look up the branch prediction table to fetch the instruction at address 201 in the next cycle. The operation when this is applied to the present embodiment will be described again with reference to FIG. First, when the branch instruction detector 8 detects that the data being refilled is a branch instruction (S4Yes), the branch predictor 7 is activated by this detection signal, and the address of the data is branched from the refill control unit 4. The result is sent to the predictor 7 (S5), and it is checked whether it is registered in the branch prediction table. If the prediction destination is registered in the branch predictor (S6
Yes), the branch predictor 7 sends the predicted branch destination address to the refill controller 4 (S7). The refill controller 4 continues refilling from the expected address (S8, S3). If the prediction destination is not registered (No in S6), similar to the case where the data is not a branch instruction,
Continue refilling while increasing the address. By doing so, refilling can be continued effectively.

【0016】この機構は、上述の例では命令のフェッチ
について説明したが、そればかりでなくデータのフェッ
チにも利用可能である。例えば、図4(b)のように、
可変長のデータで、データの終了がある特定のパターン
で示されるようなケースに有効である。終了判定のため
のパターンはプログラムにより可変である事が望まし
く、また連続リフィルの最大値もセットできる方が望ま
しいため、この場合のキャッシュメモリ装置は図4
(a)に示されるブロック図のように構成する。また、
図中のリフィル制御部4の動作の流れを図5に示す。ま
ず終了パターンレジスタ12にあらかじめプログラムで
終了パターン値をセットしておき、さらにデータにバグ
があることを考慮して、最大リフィル回数を最大回数レ
ジスタ11にセットしておく。そして、リフィルの終了
条件は、リフィル中のデータが上記の終了パターン値と
一致するか(S25)、または、連続リフィル回数が上
記の最大リフィル回数を越えたか(S27)のどちらか
一方が満たされたときに、リフィルを中止する(S3
0)ものとする。これ以外の動作は既に説明済みのもの
と同様である。
Although this mechanism has been described in the above example for fetching instructions, it can be used for fetching data as well. For example, as shown in FIG.
This is effective for variable-length data in which the end of the data is indicated by a specific pattern. It is desirable that the pattern for the end determination be variable by a program, and it is desirable that the maximum value of the continuous refill can also be set.
The configuration is as shown in the block diagram shown in FIG. Also,
FIG. 5 shows a flow of the operation of the refill control unit 4 in the figure. First, an end pattern value is set in advance in the end pattern register 12 by a program, and the maximum number of refills is set in the maximum number register 11 in consideration of a bug in data. The refill end condition satisfies either the condition that the data being refilled matches the end pattern value (S25) or the number of continuous refills exceeds the maximum number of refills (S27). The refill is stopped when the
0). Other operations are the same as those already described.

【0017】また、これらリフィルの一連の動作をCP
Uの動作と並行して行うことにより、1stキャッシュ
メモリがミスしても、最初のデータが揃った段階でCP
Uは実行を再開し処理が進むようになる。そのため、リ
フィルの速度がCPUよりも速ければ、1度のミスでブ
ランチがくるまで、分岐予測装置がついていればブラン
チ以降も、計算を停止することなく実行を継続できる。
このことを図8のタイミング図を例にとり説明する。図
8の横の一マスはクロックを表す。A1が1stキャッ
シュでミスすると、ここからリフィルを継続して行って
いる。そして、この図の場合には、Aの系列と関係のな
いBの系列についてもパイプライン的に処理を開始し、
B1が1stキャッシュでミスすると、ここからリフィ
ルをAの系列のリフィルと並行して継続している。この
パイプライン処理は、リフィル制御部4にアドレスラッ
チとデータラッチを設け、さらに、プログラムをAの系
列と関係のないBの系列を間に挟み込むよう命令を並べ
換えて最適化することにより実現できる。このパイプラ
イン処理をすれば、リフィルの速度がCPUより遅いよ
うな場合(リフィル時のタイミングが複数クロック毎で
ある場合等)であっても、計算が停止することをなくす
ことができる。つまり、クロック(8)以降はデータが
1stキャッシュに揃っているため、CPUが処理を停
止している時間はなくなり、A1、B1で継続している
リフィルを追いかけるように、リフィルされたデータを
用いた処理をCPUが行うことになる。しかもこのリフ
ィルとCPUの動作は並列に行われている。リフィルの
速度がCPUより速い場合というのは、例えばA2、A
3におけるCPU使用が複数クロックにわたる場合であ
って、このときはA2がCPUを使用している間にA3
で用いるデータのリフィルが完了しているから、リフィ
ルの開始及び継続はA1のみで十分に効果があることに
なる。
Further, a series of operations of these refills is referred to as CP
U is performed in parallel with the operation of U, so that even if the first cache memory misses,
U resumes execution and the process proceeds. Therefore, if the refilling speed is higher than that of the CPU, the execution can be continued without stopping the calculation until the branch comes with one mistake and after the branch if the branch prediction device is attached.
This will be described with reference to the timing chart of FIG. One square next to FIG. 8 represents a clock. If A1 misses in the first cache, refilling is continued from here. Then, in the case of this figure, processing is started in a pipeline manner for the sequence of B that is not related to the sequence of A,
If B1 misses in the first cache, refilling is continued from here on in parallel with refilling of the A series. This pipeline processing can be realized by providing an address latch and a data latch in the refill control unit 4, and arranging and optimizing the program so that the program is interposed between the B series, which is not related to the A series. By performing this pipeline processing, even when the refill speed is lower than that of the CPU (for example, when the refill timing is every plural clocks), it is possible to prevent the calculation from being stopped. That is, since the data is aligned in the first cache after the clock (8), there is no time during which the CPU has stopped the processing, and the refilled data is used so as to follow the refill continued at A1 and B1. The CPU performs the processing. Moreover, the refill and the operation of the CPU are performed in parallel. When the refill speed is faster than the CPU, for example, A2, A
3 is a case where the CPU usage extends over a plurality of clocks. In this case, while A2 is using the CPU,
Since the refilling of the data used in step (1) has been completed, the start and continuation of the refilling are sufficiently effective only with A1.

【0018】また上記の実施例では、1stキャッシュ
と2ndキャッシュ間のリフィルについて説明したが、
このリフィルの方式は様々なメモリ構成に適用できる。
例えば、2ndキャッシュの代わりにメインメモリのあ
る構成でも良いし、1stキャッシュ、2ndキャッシ
ュ、メインメモリがあり、1stと2nd間、2ndと
メイン間にそれぞれリフィル制御部を設け、並行してリ
フィルを行うような構成でも良い。また、CPU、1s
tキャッシュを1チップに登載し、リフィル制御部、2
ndキャッシュをチップ外に設ける構成としても良い
し、リフィル制御部をもチップ内に設けるようにして
も、あるいは、1stキャッシュがチップ外にあっても
良い。また、2ndキャッシュは、さきにタグ部を引い
てヒットかミスかを確認してから、データ部にアクセス
して引いてくる構成でも良いし、2ndキャッシュも1
stキャッシュと同様にタグとデータを同時に引く構成
にもできる。
In the above embodiment, the refill between the first cache and the second cache has been described.
This refill method can be applied to various memory configurations.
For example, a configuration having a main memory in place of the second cache may be used. Alternatively, a first cache, a second cache, and a main memory may be provided. A refill control unit may be provided between 1st and 2nd and between 2nd and main, and refills may be performed in parallel. Such a configuration may be used. CPU, 1s
t cache on one chip, refill control unit, 2
The nd cache may be provided outside the chip, the refill control unit may be provided inside the chip, or the first cache may be provided outside the chip. The second cache may be configured such that the tag portion is first checked to determine whether it is a hit or a miss, and then the data portion is accessed and pulled.
As in the case of the st cache, the tag and the data can be simultaneously drawn.

【0019】また上記の実施例では、リフィルが1系統
の場合を説明したが、これを複数系統に(図1、図4に
おける各信号線をそれぞれ2本あるいはそれ以上に)し
ても良い。
Further, in the above embodiment, the case where the refill is one system has been described. However, the refill may be made into a plurality of systems (two or more signal lines in FIGS. 1 and 4 respectively).

【0020】また上記のデータキャッシュに関する実施
例の最大リフィル回数レジスタ11を、命令キャッシュ
に適用することもできる。この場合、図1に最大回数レ
ジスタを加え、リフィル制御部4で連続リフィル回数を
カウントすると共に、CPU1からレジスタにセットし
た最大リフィル回数との比較を行い(例えば図2のS3
とS4の間で)、カウント数が最大回数を越えた時点で
リフィルを中止する。また、図2ではリフィルしようと
するアドレスが1stキャッシュに既登録ならばその時
点でリフィルを中止するようにしているが、これを既登
録が所定の回数続いたときに中止するようにしても良い
し、また、リフィルを継続している途中で、CPUから
別のフェッチが要求されそれが1stキャッシュでミス
した場合には、継続しているリフィルを中止して別のリ
フィルを優先して開始するようにすることもできる。但
し上述したようにリフィルの系統が複数あれば、継続し
ているリフィルと別の新たなリフィルとを並行して行う
こともできる。
Further, the maximum refill count register 11 of the embodiment relating to the data cache can be applied to an instruction cache. In this case, a maximum number register is added to FIG. 1 and the number of continuous refills is counted by the refill control unit 4 and compared with the maximum number of refills set in the register from the CPU 1 (for example, S3 in FIG. 2).
When the count exceeds the maximum number, the refill is stopped. In FIG. 2, if the address to be refilled is already registered in the first cache, the refilling is stopped at that point in time. However, this may be stopped when the registration is continued for a predetermined number of times. If another fetch is requested by the CPU while the refill is being performed and the fetch is missed in the first cache, the continual refill is stopped and another refill is started with priority. You can also do so. However, as described above, if there are a plurality of refill systems, the continuous refill and another new refill can be performed in parallel.

【0021】[0021]

【発明の効果】以上説明してきたように、本発明によれ
ば、キャッシュミスが発生した場合、計算を中断するこ
となく必要な分だけリフィルを継続して行うことによ
り、ミス率を減らし、小さな1stキャッシュを持った
ケースでも高性能を発揮できるキャッシュメモリ装置を
実現できる等の実用上多大なる効果が奏せられる。
As described above, according to the present invention, when a cache miss occurs, the refill is performed continuously as much as necessary without interrupting the calculation, thereby reducing the miss rate and reducing the error rate. Even in the case where the first cache is provided, a practically significant effect such as realization of a cache memory device that can exhibit high performance can be obtained.

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

【図1】 本発明の一実施例に係るキャッシュメモリ装
置の構成を示す図。
FIG. 1 is a diagram showing a configuration of a cache memory device according to one embodiment of the present invention.

【図2】 図1のリフィル制御部4の動作を表すフロー
図。
FIG. 2 is a flowchart showing an operation of a refill control unit 4 in FIG. 1;

【図3】 本実施例における分岐予測器7の機能を説明
するための図。
FIG. 3 is a diagram for explaining a function of a branch predictor 7 in the embodiment.

【図4】 (a)本発明をデータキャッシュメモリに適
用した一実施例の構成を示す図。(b)終了マークを持
つデータの例を示す図。
FIG. 4A is a diagram showing a configuration of an embodiment in which the present invention is applied to a data cache memory. (B) A diagram showing an example of data having an end mark.

【図5】 図4(a)のリフィル制御部4の動作を表す
フロー図。
FIG. 5 is a flowchart showing the operation of the refill control unit 4 of FIG.

【図6】 本実施例におけるキャッシュのタグ部の構成
例を示す図。
FIG. 6 is a diagram illustrating a configuration example of a tag unit of a cache according to the embodiment.

【図7】 従来のキャッシュメモリ装置の動作のタイミ
ングを示す図。
FIG. 7 is a diagram showing operation timing of a conventional cache memory device.

【図8】 CPUの動作とリフィル制御部の動作を並行
して行った場合の動作のタイミングの一例を示す図。
FIG. 8 is a diagram showing an example of operation timing when the operation of the CPU and the operation of the refill control unit are performed in parallel.

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

1 CPU、 2 1stキャッシュタグ部、 3 1
stキャッシュデータ部、 4 リフィル制御部、 5
2ndキャッシュメモリ、 6,13 比較器、 7
分岐予測器、 8 分岐命令検出器、 11 最大回
数レジスタ、 12 終了パターンレジスタ
1 CPU, 2 1st cache tag section, 3 1
st cache data section, 4 refill control section, 5
2nd cache memory, 6,13 comparator, 7
Branch predictor, 8 branch instruction detector, 11 maximum number register, 12 end pattern register

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 上位のキャッシュメモリに目的のデータ
が存在しなかった場合に、より下位のキャッシュメモリ
またはメインメモリから前記目的のデータを入れ換える
手段を備えたキャッシュメモリ装置において、 前記メインメモリに格納された予めデータの入れ換えの
終了条件を設定したプログラムにより設定されたデータ
を記憶する終了パターンレジスタを設け、 データキャッシュにおいて、より下位のキャッシュまた
はメインメモリからのデータの入れ換えは、目的のデー
タが存在しなかった場合にこのデータを指定するアドレ
スから開始し、前記データを指定するアドレスを増加し
ながら前記入れ替えを継続し、前記入れ換えの終了は、
前記終了パターンレジスタに記憶されたプログラムによ
り設定されたデータに基づき、より下位のキャッシュま
たはメインメモリから読み込まれてきたデータが前記設
定した終了条件と一致した場合に、前記入れ換えの終了
を決定することを特徴とするキャッシュメモリ制御方
法。
An object data is stored in an upper cache memory.
If there was no, the lower cache memory
Or replace the target data from main memory
Memory device with meansAt  Replacement of data stored in the main memory in advance
Data set by the program that sets the end condition
An end pattern register for storing the lower cache or lower cache in the data cache is provided.
Replaces the data from the main memory with the target data.
Address to specify this data if the data does not exist
From the address, and increase the address specifying the data.
While continuing the exchange, the end of the exchange,
According to a program stored in the end pattern register.
Lower-level caches based on the configured data.
Or the data read from the main memory
If the specified termination condition is met,
Cache memory characterized by determiningControl method
Law.
【請求項2】 最大リフィル回数を予め設定した最大回
数レジスタを設け、 前記終了条件は、前記プログラムにより予め設定した終
了パターン値と一致した場合か、または連続リフィル回
数が前記最大回数レジスタに予め設定した最大リフィル
回数を超えた場合のどちらか一方を満足した場合とする
ことを特徴とする請求項1記載のキャッシュメモリ制御
方法。
2. A maximum number register in which a maximum number of refills is set in advance, wherein the ending condition is when the end pattern value matches a ending pattern value set in advance by the program, or the number of continuous refills is set in the maximum number register in advance. 2. The cache memory control according to claim 1, wherein one of the cases where the maximum number of refills is exceeded is satisfied.
Method.
JP3304317A 1991-11-20 1991-11-20 Cache memory control method Expired - Fee Related JP2868654B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP3304317A JP2868654B2 (en) 1991-11-20 1991-11-20 Cache memory control method
US07/979,806 US5634027A (en) 1991-11-20 1992-11-20 Cache memory system for multiple processors with collectively arranged cache tag memories

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3304317A JP2868654B2 (en) 1991-11-20 1991-11-20 Cache memory control method

Publications (2)

Publication Number Publication Date
JPH05143456A JPH05143456A (en) 1993-06-11
JP2868654B2 true JP2868654B2 (en) 1999-03-10

Family

ID=17931575

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3304317A Expired - Fee Related JP2868654B2 (en) 1991-11-20 1991-11-20 Cache memory control method

Country Status (1)

Country Link
JP (1) JP2868654B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3264319B2 (en) * 1997-06-30 2002-03-11 日本電気株式会社 Bus bridge
JP2001273137A (en) 2000-03-28 2001-10-05 Toshiba Corp Microprocessor
US20070186049A1 (en) * 2006-02-03 2007-08-09 International Business Machines Corporation Self prefetching L2 cache mechanism for instruction lines

Also Published As

Publication number Publication date
JPH05143456A (en) 1993-06-11

Similar Documents

Publication Publication Date Title
JP4067887B2 (en) Arithmetic processing device for performing prefetch, information processing device and control method thereof
EP2095243B1 (en) Configurable cache for a microprocessor
US20050086435A1 (en) Cache memory controlling apparatus, information processing apparatus and method for control of cache memory
EP2092429B1 (en) Configurable cache for a microprocessor
JP3640355B2 (en) Instruction prefetch method and system for cache control
JPH0962572A (en) Device and method for stream filter
JPH0962573A (en) Data cache system and method
KR100234647B1 (en) Data processing system with instruction prefetch
EP2495662B1 (en) Configurable cache for a microprocessor
JPH0452741A (en) Cache memory device
US20040059854A1 (en) Dynamic priority external transaction system
EP1139222A1 (en) Prefetch for TLB cache
JPH03150659A (en) Data transfer system
JP2005524170A (en) Integrated circuit with non-volatile memory and method for fetching data from said memory
CN110737475B (en) Instruction cache filling and filtering device
JP2868654B2 (en) Cache memory control method
JP2009505178A (en) Apparatus and method for storing data and / or instructions in a computer system comprising at least two instruction execution units and at least a first storage device or storage area for data and / or instructions
JP2000047942A (en) Device and method for controlling cache memory
JP4034032B2 (en) Microcomputer with built-in cache
JP3493122B2 (en) Microprocessor and instruction cache control circuit
JP3095831B2 (en) Computer operation method and computer
JP3735373B2 (en) Microcomputer
JPH0363741A (en) Disk cache device
JP2006260378A (en) Semiconductor integrated circuit
JPH11345167A (en) Method and device for controlling cache

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071225

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20081225

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees