JPS63220341A - Cache memory device - Google Patents
Cache memory deviceInfo
- Publication number
- JPS63220341A JPS63220341A JP62054876A JP5487687A JPS63220341A JP S63220341 A JPS63220341 A JP S63220341A JP 62054876 A JP62054876 A JP 62054876A JP 5487687 A JP5487687 A JP 5487687A JP S63220341 A JPS63220341 A JP S63220341A
- Authority
- JP
- Japan
- Prior art keywords
- cache memory
- block
- data
- cache
- counter
- 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
Links
- 230000000694 effects Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000000034 method Methods 0.000 description 1
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は電子計算機に使用されるキャッシュメモリに関
し、特にキャッシュメモリのブロックリード方式に関す
る。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a cache memory used in an electronic computer, and more particularly to a block read method of a cache memory.
(従来の技術)
従来、この種のキャッシュメモリにおいてキャッシュメ
モリがヒツトしなかったときに入換え単位(一般にブロ
ックサイズ)は固定されていた。(Prior Art) Conventionally, in this type of cache memory, when the cache memory is not hit, the replacement unit (generally block size) has been fixed.
例えば、ブロックサイズが16バイトのキャッシュメモ
リでは、中央処理装置が成る入換え単位をアクセスした
とき、キャッシュメ売りがヒツトされない状態であれば
、16バイトを主記憶よシ読出してキャッシュメモリに
書込んでいた。For example, in a cache memory with a block size of 16 bytes, when the central processing unit accesses a replacement unit, if the cache meme sell is not hit, 16 bytes are read from the main memory and written to the cache memory. It was.
(発明が解決しようとする問題点)
上述した従来のキャッシュメモリではブロック長が固定
されているので、ブロックサイズが大きい場合には命令
の先読み効果はあるが、ブロックリードの完了まで、キ
ャッシュメモリの使用できない時間が長くなるという欠
点がある。(Problem to be solved by the invention) In the conventional cache memory described above, the block length is fixed, so if the block size is large, there is an effect of pre-reading instructions, but until the block read is completed, the cache memory The disadvantage is that it becomes unusable for a long time.
逆に、ブロックサイズが小さい場合にはブロックリード
の期間が短かいので、ブロックリード中のために使用で
きない時間は短かくなるが、先読みの効果はなくなると
いう欠点がある。Conversely, when the block size is small, the period of block reading is short, so the unusable time due to block reading is shortened, but there is a drawback that the effect of pre-reading is lost.
本発明の目的は、キャッシュメモリがヒツトされない状
態であるならば主記憶からキャッシュメモリにデータを
コピーする際にブロック転送量を指定し、ブロックリー
ドの後にキャツシュヒツト数をカウントすることにより
上記欠点を除去し、キャッシュメモリの使用できない時
間が短かく、先読み効果が発揮できるように構成したキ
ャッシュメモリ装置を提供することにある。An object of the present invention is to eliminate the above drawbacks by specifying the block transfer amount when copying data from the main memory to the cache memory and counting the number of cache hits after reading the block if the cache memory is not hit. However, it is an object of the present invention to provide a cache memory device configured so that the unusable time of the cache memory is shortened and a read-ahead effect can be exhibited.
(問題点を解決するための手段)
本発明によるキャッシュメモリ装置はキャッシュメモリ
と、ブロックカウンタと、ブロックレジスタと、ビット
カウンタと、カウンタセット手段とを具備して構成した
ものである。(Means for Solving the Problems) A cache memory device according to the present invention includes a cache memory, a block counter, a block register, a bit counter, and counter setting means.
キャッシュメモリは、主記憶に格納されたデータの一部
の写しを格納するためのものである。Cache memory is for storing a copy of some of the data stored in main memory.
ブロックカウンタは、キャッシュメモリがヒツトしてい
ない状態になったならば、主記憶からキャッシュメモリ
にデータをコピーするに際してデータ転送量を指定する
ためのものである。The block counter is used to specify the amount of data transferred when copying data from the main memory to the cache memory when the cache memory is not hit.
ブロックレジスタは、ブロックカウンタの初期値を保持
するためのものである。The block register is for holding the initial value of the block counter.
とットカウンタは、ブロックリード後のキャツシュヒツ
ト数をカウントするためのものである。The catch counter is for counting the number of cash hits after block reading.
カウンタセット手段は、特定命令によりブロックカウン
タに対してビットカウンタの内容値をセットするための
ものである。The counter setting means is for setting the content value of the bit counter in the block counter by a specific instruction.
(実施例) 次に、本発明について図面を参照して説明する。(Example) Next, the present invention will be explained with reference to the drawings.
第1図は、本発明によるキャッシュメモリ装置の一実施
例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of a cache memory device according to the present invention.
第1図において、1はアドレスレジスタ、2はキャッシ
ュディレクトリ、3はキャッシュメモリ、4は比較器、
5はデータドライバ/レシーバ、6はブロックアドレス
レジスタ、Tは命令レジスタ、8はデコーダ、9はフリ
ップフロップ、1oは主記憶、11はブロックレジスタ
、12はブロックカウンタ、13はORゲート、14は
データバス、15は切替え回路、16はビットカウンタ
である。In FIG. 1, 1 is an address register, 2 is a cache directory, 3 is a cache memory, 4 is a comparator,
5 is a data driver/receiver, 6 is a block address register, T is an instruction register, 8 is a decoder, 9 is a flip-flop, 1o is a main memory, 11 is a block register, 12 is a block counter, 13 is an OR gate, 14 is data 15 is a switching circuit, and 16 is a bit counter.
アドレスレジスタ1はキャッシュデータを要求するため
のアドレスを格納するためのものであり、キャッシュデ
ィレクトリ2はアドレスレジスタ1の下位部分よυアド
レスが指定されるものである。The address register 1 is for storing an address for requesting cache data, and the cache directory 2 is for specifying the υ address from the lower part of the address register 1.
比較器4は、キャッシュディレクトリ2の読出し出力と
アドレスレジスタ1の上位部分とを比較するものである
。比較器4から一致出力が得られていルトきには、デー
タバス14とキャッシュメモリ3とがデータドライバ/
レシーバ5で論理的に接続される。キャッシュメモリ3
の胱出し時に比較器4からの一致出力が得られていない
ならば、フリップ70ツブ9がセットされ、フリップ7
0ツブ9の出力によシ主記憶10からデータを読出すよ
うに要求が送出される。The comparator 4 compares the read output of the cache directory 2 with the upper part of the address register 1. When a match output is obtained from the comparator 4, the data bus 14 and the cache memory 3 are connected to the data driver/
They are logically connected at receiver 5. cache memory 3
If a matching output from the comparator 4 is not obtained when the bladder is removed, the flip 70 knob 9 is set, and the flip 7
The output of the 0 block 9 sends a request to read data from the main memory 10.
主記憶10から読出されたデータは、ブロックアドレス
レジスタ6で指定されるキャッシュアドレスに順次、書
込まれるように構成されている。Data read from the main memory 10 is configured to be sequentially written to cache addresses specified by the block address register 6.
ブロックカウンタ12は、主記憶10から読出されるデ
ータ量をカウントするものである。ブロックカウンタ1
2の初期値は、ブロックレジスタ11に格納される。The block counter 12 counts the amount of data read from the main memory 10. block counter 1
The initial value of 2 is stored in the block register 11.
命令レジスタTに格納された命令はデコーダ8で解読さ
れ、ブロックリード後のキャツシュヒツト数はビットカ
ウンタ16でカウントされる。ビットカウンタ16の値
は、デコーダ8の出力によりブロックレジスタ11にセ
ットされる。The instructions stored in the instruction register T are decoded by a decoder 8, and the number of cache hits after block reading is counted by a bit counter 16. The value of the bit counter 16 is set in the block register 11 by the output of the decoder 8.
次に、本発明の動作を詳細に説明する。Next, the operation of the present invention will be explained in detail.
キャッシュメ七り3に対してデータ要求を送出するため
アドレスレジスタ1にアドレスがセットされると、アド
レスの下位部によりキャッシュディレクトリ2からアド
レスの上位が読出される。When an address is set in the address register 1 to send a data request to the cache directory 3, the upper part of the address is read from the cache directory 2 by the lower part of the address.
上記読出しアドレスと、アドレスレジスタ1の上位部分
とを比較器4によシ比較し、キャッシュメモリ3にデー
タが格納されているか否かをチェックする。比較器4が
一致出力を送出している場合にはデータドライバ/レシ
ーバをイネーブルにし、キャッシュメモリ3のデータを
データバス14に読出す。The read address and the upper part of the address register 1 are compared by a comparator 4 to check whether data is stored in the cache memory 3 or not. If the comparator 4 is delivering a match output, the data driver/receiver is enabled and the data in the cache memory 3 is read onto the data bus 14.
比較器4が一致出力を送出していないときにはキャッシ
ュメモリ3にデータが格納されていないので、主記憶1
0よシデータを読出してキャツシユメモリ3に格納する
。キャッシュメモリ3からデータを読出したときに比較
器4が一致出力を送出していないならば、フリップフロ
ップ9をセットすると同時にブロックカウンタ12ヘブ
ロツクレジスタ11の値をセットする。When the comparator 4 is not sending out a matching output, no data is stored in the cache memory 3, so the main memory 1
0 and the data is read and stored in the cash memory 3. If the comparator 4 does not send out a coincidence output when data is read from the cache memory 3, the value of the block register 11 is set in the block counter 12 at the same time as the flip-flop 9 is set.
フリップフロップ9がセットされているときに主記憶1
0からのデータの読出しを要求し、読出しデータを順次
、キャッシュメモリ3に格納する。When flip-flop 9 is set, main memory 1
A request is made to read data from 0, and the read data is sequentially stored in the cache memory 3.
ブロックカウンタ12は読出しデータをキャッシュメモ
リ3に格納するごとにカウントダウンし、“0”になる
とORゲート13の出力が10#となってフリップフロ
ップ9をリセットし、主記憶10からの読出し動作を終
了する。The block counter 12 counts down each time read data is stored in the cache memory 3, and when it reaches "0", the output of the OR gate 13 becomes 10#, resets the flip-flop 9, and ends the read operation from the main memory 10. do.
命令レジスタTに格納された命令をデコーダ8により解
読したとき、ブロックレジスタ11の初期値を変更する
ことが可能となる。When the instruction stored in the instruction register T is decoded by the decoder 8, the initial value of the block register 11 can be changed.
プログラムの構成によりデータの並びに局所性があるた
め、先読みによる効果がある場合には命令ニよジブロッ
クレジスタ11の内容値を大きくし、逆の場合にはブロ
ックレジスタ11の内容値を小さくする。Since there is locality in the arrangement of data depending on the structure of the program, the content value of the instruction diversion block register 11 is increased if there is an effect of prefetching, and the content value of the block register 11 is decreased in the opposite case.
(発明の効果)
本発明は以上説明したように、キャッシュメモリがヒツ
トされない状態であるならば主記憶からキャッシュメモ
リにデータをコピーする際にブロック転送量を指定し、
ブロックリードの後にキャツシュヒツト数をカウントす
ることによυ、命令を高速に実行できるという効果があ
る。(Effects of the Invention) As explained above, the present invention specifies the block transfer amount when copying data from the main memory to the cache memory if the cache memory is not hit.
By counting the number of cache hits after a block read, the effect is that instructions can be executed at high speed.
第1図は、本発明によるキャッシュメモリ装置の一実施
例を示すブロック図である。
1・・・アドレスレジスタ
2・・・キャッシュディレクトリ
3・・・キャッシュメモリ
4・・・比較器
5・・・データドライバ/レシーバ
6・・・ブロックアドレスレジスタ
T・・・命令レジスタ
8・・・デコーダ
9・・伊フリップフロップ
10・・・主記憶
11・・・ブロックレジスタ
12・・噛ブロックカウンタ
13・・・ORゲート
14・・・データバス
15・・・切替え回路
16拳・・ビットカウンタ
特許出願人 日本電気株式会社
代理人 弁理士 井 ノ ロ 壽21図FIG. 1 is a block diagram showing an embodiment of a cache memory device according to the present invention. 1... Address register 2... Cache directory 3... Cache memory 4... Comparator 5... Data driver/receiver 6... Block address register T... Instruction register 8... Decoder 9... Italian flip-flop 10... Main memory 11... Block register 12... Bit block counter 13... OR gate 14... Data bus 15... Switching circuit 16... Bit counter patent application Person NEC Co., Ltd. agent Patent attorney Hisashi Inoro 21
Claims (1)
のキャッシュメモリと、前記キャッシュメモリがヒット
していない状態になったならば前記主記憶から前記キャ
ッシュメモリにデータをコピーするに際してデータ転送
量を指定するためのブロックカウンタと、前記ブロック
カウンタの初期値を保持するためのブロックレジスタと
、ブロックリード後のキャッシュヒット数をカウントす
るためのビットカウンタと、特定命令により前記ブロッ
クカウンタに対して前記ビットカウンタの内容値をセッ
トするためのカウンタセット手段とを具備して構成した
ことを特徴とするキャッシュメモリ装置。A cache memory for storing a copy of a part of the data stored in the main memory, and data transfer when copying data from the main memory to the cache memory if the cache memory is not hit. a block counter for specifying the amount; a block register for holding the initial value of the block counter; a bit counter for counting the number of cache hits after block reading; A cache memory device comprising: counter setting means for setting the content value of the bit counter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62054876A JPS63220341A (en) | 1987-03-10 | 1987-03-10 | Cache memory device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62054876A JPS63220341A (en) | 1987-03-10 | 1987-03-10 | Cache memory device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS63220341A true JPS63220341A (en) | 1988-09-13 |
Family
ID=12982790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62054876A Pending JPS63220341A (en) | 1987-03-10 | 1987-03-10 | Cache memory device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS63220341A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07506923A (en) * | 1992-06-04 | 1995-07-27 | イーエムシー コーポレーション | System and method for dynamically controlling cache management |
-
1987
- 1987-03-10 JP JP62054876A patent/JPS63220341A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07506923A (en) * | 1992-06-04 | 1995-07-27 | イーエムシー コーポレーション | System and method for dynamically controlling cache management |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4583163A (en) | Data prefetch apparatus | |
JP2003186744A (en) | Method of improving computer performance by adjusting time used for preemptive expelling of cache entry | |
CN115168259A (en) | A data access method, apparatus, device and computer-readable storage medium | |
JPS63220341A (en) | Cache memory device | |
US6938118B1 (en) | Controlling access to a primary memory | |
US6816943B2 (en) | Scratch pad memories | |
JP2580263B2 (en) | Buffer storage device | |
JPH04130551A (en) | Cache control method | |
JPH02110646A (en) | Memory advance reading device | |
GB2037466A (en) | Computer with cache memory | |
JP3081635B2 (en) | Cache memory invalidation processing apparatus and invalidation control method | |
JPS63109554A (en) | Cache memory | |
JP2595753B2 (en) | Invalidation method of cache memory | |
JPS59112327A (en) | Controlling method of ring buffer | |
JPH0644246B2 (en) | Cache memory control system | |
JPH06266612A (en) | Dma controller | |
JP2001229074A (en) | Memory controller and information processor and memory control chip | |
JPS59218692A (en) | Logical buffer storage control method | |
JPS63173146A (en) | Cache memory control system | |
JPH06110823A (en) | Bus conversion system and buffer device | |
JP3076199B2 (en) | Buffer access control circuit | |
JPS6269337A (en) | Cache control system | |
JPH0410051A (en) | Shared memory control method for multiprocessor system | |
JPH01112451A (en) | Cache memory control device | |
JPH01307849A (en) | Data access device |