JP2759952B2 - Cache memory - Google Patents

Cache memory

Info

Publication number
JP2759952B2
JP2759952B2 JP63033595A JP3359588A JP2759952B2 JP 2759952 B2 JP2759952 B2 JP 2759952B2 JP 63033595 A JP63033595 A JP 63033595A JP 3359588 A JP3359588 A JP 3359588A JP 2759952 B2 JP2759952 B2 JP 2759952B2
Authority
JP
Japan
Prior art keywords
data
address
signal
cache
output
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 - Lifetime
Application number
JP63033595A
Other languages
Japanese (ja)
Other versions
JPH01207858A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co 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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP63033595A priority Critical patent/JP2759952B2/en
Publication of JPH01207858A publication Critical patent/JPH01207858A/en
Application granted granted Critical
Publication of JP2759952B2 publication Critical patent/JP2759952B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はキャッシュメモリに関するものであり、特
に、キャッシュメモリに対するCPUのアクセスがヒット
しなかった場合、CPUのアクセスアドレスと、キャッシ
ュメモリのタグアドレスとを比較し、その結果によって
キャッシュメモリの記憶内容を更新するかどうかを決定
するキャッシュメモリ(以下、単にキャッシュという)
に関するものである。
Description: BACKGROUND OF THE INVENTION The present invention relates to a cache memory, and in particular, when a CPU access to a cache memory does not hit, an access address of the CPU and a tag address of the cache memory. And a cache memory (hereinafter simply referred to as a cache) that determines whether to update the storage content of the cache memory based on the result.
It is about.

(従来の技術) データ処理装置において命令の処理速度を向上させる
ために、主記憶装置の記憶内容の一部をCPU内部に設け
たキャッシュにコピーし、大部分のメモリ参照をこのキ
ャッシュに対して行うようにする方式が用いられてい
る。
(Prior Art) In order to increase the processing speed of instructions in a data processing device, a part of the storage content of a main storage device is copied to a cache provided inside a CPU, and most of memory references are made to this cache. A method of doing so is used.

第5図にキャッシュを有する上記データ処理方式のブ
ロック図を示す。同図において、CPU1はアドレスバス2
およびデータバス3によって、該バス2および3上に接
続された主記憶装置4およびキャッシュ5をアクセスす
る。
FIG. 5 is a block diagram of the data processing system having a cache. In the figure, CPU 1 is address bus 2
And the data bus 3 accesses the main storage device 4 and the cache 5 connected to the buses 2 and 3.

CPU1が前記バス2および3を介して、主記憶装置4お
よびキャッシュ5をアクセスするとき、CPU1からメモリ
アクセス信号6がキャッシュ5に出力される。該アクセ
ス信号で指定されたアドレスと、キャッシュ5のタグア
ドレスとが一致(ヒット)した場合、キャッシュ5はデ
ータバス2にデータを出力し、アクノリッジ信号7をア
クティブにしてアクセス完了をCPU1に知らせる。
When the CPU 1 accesses the main storage device 4 and the cache 5 via the buses 2 and 3, the CPU 1 outputs a memory access signal 6 to the cache 5. When the address specified by the access signal matches the tag address of the cache 5 (hit), the cache 5 outputs data to the data bus 2 and activates the acknowledge signal 7 to notify the CPU 1 of access completion.

一方、CPU1からのアクセスによって要求されたデータ
がキャッシュ5内になかった(ミスヒット)場合、キャ
ッシュ5は動作信号8を主記憶装置4に出力し、該主記
憶装置4を動作させる。主記憶装置4はCPU1からのアク
セスに対する動作完了時にアクノリッジ信号7をアクテ
ィブにして、アクセス完了をCPU1およびキャッシュ5に
知らせる。主記憶装置4およびキャッシュ5に対するCP
U1のアクセスには、読み出しおよび書き込みがあり、こ
の区別はCPU1から出力されるリード/ライト信号9によ
って主記憶装置4およびキャッシュ5に知らされる。
On the other hand, when the data requested by the access from the CPU 1 is not in the cache 5 (miss hit), the cache 5 outputs an operation signal 8 to the main storage device 4 to operate the main storage device 4. The main storage device 4 activates the acknowledge signal 7 when the operation for the access from the CPU 1 is completed, and notifies the CPU 1 and the cache 5 of the completion of the access. CP for main memory 4 and cache 5
U1 access includes read and write, and this distinction is notified to the main storage device 4 and the cache 5 by a read / write signal 9 output from the CPU 1.

第6図は主記憶装置4およびキャッシュメモリ5にお
ける記憶情報のマッピング例である。同図に示すよう
に、主記憶装置4の記憶情報はブロックを単位としてマ
ッピングされていて、該ブロックは複数のカラム4a〜4h
に分割されている。一方、キャッシュ5のデータメモリ
11およびタグメモリ10も、前記カラム4a〜4hに対応する
同数のカラムに分割されている。
FIG. 6 is an example of mapping of storage information in the main storage device 4 and the cache memory 5. As shown in the figure, the storage information of the main storage device 4 is mapped in units of blocks, and the blocks are stored in a plurality of columns 4a to 4h.
Is divided into On the other hand, the data memory of the cache 5
11 and the tag memory 10 are also divided into the same number of columns corresponding to the columns 4a to 4h.

主記憶装置4の各カラムに存在するメモリブロックの
内の1つが、キャッシュ5の対応するカラムのデータメ
モリ11にコピーされている。主記憶装置4の同一カラム
のブロックが、同時に2つ以上キャッシュ上にコピーさ
れることはない。前記タグメモリ10にはデータメモリ11
にコピーされているブロックのアドレスが保持されてい
る。
One of the memory blocks existing in each column of the main storage device 4 is copied to the data memory 11 of the corresponding column of the cache 5. No two or more blocks in the same column of the main storage device 4 are simultaneously copied on the cache. The tag memory 10 has a data memory 11
Holds the address of the block being copied.

上述のようにマッピングされている主記憶装置4およ
びキャッシュ5において、CPU1からのアドレスバスの下
位データ2aによって、前記カラムのいずれか1つが選択
される。そして選択されたキャッシュ5のタグメモリ10
からタグアドレスが比較器12aに呼び出され、該タグア
ドレスとCPU1からのアドレスバスの上位2bのデータとが
比較される。前記アドレス上位2bのデータとタグアドレ
スとがヒットすれば、前記選択されたカラムのデータメ
モリ11からデータがCPU1に出力される。
In the main storage device 4 and the cache 5 mapped as described above, one of the columns is selected by the lower data 2a of the address bus from the CPU 1. And the tag memory 10 of the selected cache 5
, The tag address is called by the comparator 12a, and the tag address is compared with the data of the upper 2b of the address bus from the CPU 1. When the data of the upper address 2b and the tag address hit, the data is output from the data memory 11 of the selected column to the CPU 1.

前記アドレス上位2bのデータとタグアドレスとがヒッ
トしなかった場合には、主記憶装置4からデータがCPU1
に出力され、それと同時にキャッシュ5のデータも前記
主記憶装置4からCPUに出力されたデータに更新され
る。
When the data of the upper address 2b and the tag address are not hit, the data is transferred from the main storage device 4 to the CPU 1.
At the same time, the data in the cache 5 is also updated to the data output from the main storage device 4 to the CPU.

例えばアドレスバスの下位2aによって、カラム4aが選
択された場合、タグメモリ10のタグアドレスはブロック
“0"を表すアドレスであり、この時のアドレスバスの上
位2bのデータが、ブロック“0"を表すアドレスデータと
異なる場合はミスヒットである。したがって、アドレス
バスの上位2bのデータと一致するアドレスで表されるブ
ロック(例えば“16")のデータが主記憶装置4からCPU
に出力され、これと同時にキャッシュ5のデータメモリ
11にもブロック“16"が転送されデータが更新される。
For example, when the column 4a is selected by the lower 2a of the address bus, the tag address of the tag memory 10 is an address representing the block "0", and the data of the upper 2b of the address bus at this time is the block "0". If the address data is different from the address data, it is a mishit. Therefore, the data of the block (for example, “16”) represented by the address corresponding to the data of the upper 2b of the address bus is transferred from the main storage device 4 to the CPU.
And at the same time, the data memory of the cache 5
Block "16" is also transferred to 11, and the data is updated.

上記構成のようなデータ処理装置では、一般にCPUの
内部処理速度に比べて、主記憶装置へのアクセス速度は
数倍〜十数倍も遅い。したがって、大部分のメモリ参照
を前記キャッシュに対して行うようにすればCPUのマシ
ンサイクルと同等の処理速度が得られる。
In a data processing device having the above configuration, the access speed to the main storage device is generally several times to ten and several times slower than the internal processing speed of the CPU. Therefore, if most of the memory reference is made to the cache, a processing speed equivalent to a machine cycle of the CPU can be obtained.

従来のキャッシュでは、CPUからのアクセスがミスヒ
ットした場合、上述のようにCPUは主記憶装置から必要
なデータを参照すると同時に、前記必要なデータを含む
数十バイトのデータをキャッシュを転送してキャッシュ
内のデータがリプレースされるようになっている。
In the conventional cache, when the access from the CPU is mishit, the CPU refers to the necessary data from the main storage device as described above, and simultaneously transfers several tens of bytes of data including the necessary data to the cache. The data in the cache is replaced.

(発明が解決しようとする課題) 上記した従来の技術は、次のような問題点を有してい
た。
(Problems to be Solved by the Invention) The above-described conventional technology has the following problems.

上述のように従来のキャッシュでは、CPUのアクセス
がミスヒットすると必ずキャッシュ内のデータが主記憶
装置の別のデータに更新されていた。しかし、キャッシ
ュ内に先に保持されていたデータの方が、更新後のデー
タより使用頻度が高い場合も有り得る。このような場合
にはデータが更新されることにより、かえってCPUから
のアクセス回数に対する、必要とされるデータがキャッ
シュに存在する回数(ヒット率)が下がってしまうこと
になる。
As described above, in the conventional cache, data in the cache is always updated to another data in the main storage device whenever a CPU access mishits. However, the data held earlier in the cache may be more frequently used than the updated data. In such a case, by updating the data, the number of times that the required data exists in the cache (the hit rate) with respect to the number of accesses from the CPU decreases.

前記ヒット率が低下すると、主記憶装置からデータを
参照することが多くなり、結局キャッシュを設けている
にもかかわらず処理速度を大幅には向上できないという
問題点が生じてくる。したがって、使用頻度の高いメモ
リブロックが主記憶装置からキャッシュにコピーされて
いることが望ましい。
When the hit ratio is reduced, the data is often referred to from the main storage device. As a result, there is a problem that the processing speed cannot be significantly improved despite the provision of the cache. Therefore, it is desirable that frequently used memory blocks be copied from the main storage device to the cache.

本発明は、前述の問題点を解決するためになされたも
のである。
The present invention has been made to solve the above problems.

(課題を解決するための手段および作用) 前記の問題点を解決するために本発明は、CPUのアク
セスに対して必要なデータがなかった場合、CPUのアク
セスアドレスおよびキャッシュに保持されているデータ
のタグアドレスの上下関係を比較する手段と、前記両ア
ドレスの相対距離を判断する手段と、該比較および判断
の結果によってデータの更新要求を主記憶装置に出力す
る手段とを具備した点に特徴がある。
(Means and Actions for Solving the Problems) In order to solve the above-described problems, the present invention provides a method for accessing data stored in a cache and a CPU access address when there is no data necessary for CPU access. Means for comparing the upper and lower relationship of the tag addresses, means for determining the relative distance between the two addresses, and means for outputting a data update request to the main storage device based on the result of the comparison and determination. There is.

上記構成による本発明では、CPUからのアクセスがヒ
ットしなかった場合には、該アクセスアドレスとキャッ
シュ内のデータのタグアドレスとが比較され、キャッシ
ュ内のデータの方が該アクセスによって要求されたデー
タよりも使用頻度が高いと判断されれば、キャッシュ内
の現記憶データは更新されない。したがって、データを
更新することによってヒット率が低下するという前記問
題点が解消され、データ処理装置における命令処理速度
を従来のキャッシュより向上することができる。
According to the present invention having the above structure, when an access from the CPU does not hit, the access address is compared with the tag address of the data in the cache, and the data in the cache is compared with the data requested by the access. If it is determined that the usage frequency is higher than the usage frequency, the current storage data in the cache is not updated. Therefore, the problem that the hit rate is reduced by updating the data is solved, and the instruction processing speed in the data processing device can be improved as compared with the conventional cache.

(実施例) 以下に図面を参照して、本発明を詳細に説明する。(Example) Hereinafter, the present invention will be described in detail with reference to the drawings.

まず主記憶装置に格納されているメモリブロックの、
望ましい展開例について説明する。第3図はある一連の
プログラムの呼び出し関係を示す図であり、第4図は該
プログラムを主記憶装置の前記カラムの内の1つに展開
した例を示す。ここに、第3図の点数矢印は呼び出し回
数を示す。
First, of the memory blocks stored in the main storage device,
A desirable development example will be described. FIG. 3 is a diagram showing the calling relationship of a certain series of programs, and FIG. 4 shows an example in which the programs are developed in one of the columns of the main storage device. Here, the pointed arrows in FIG. 3 indicate the number of calls.

第3図に示したプログラムの呼び出し関係では、プロ
グラムが7つのブロックA〜Gから構成されている。同
図に示されるようにブロックAのプログラムは該プログ
ラム中でブロックBを2回、ブロックEを1回呼び出し
ている。さらにブロックBはブロックCを3回とブロッ
クDを1回呼び出し、ブロックEはブロックFを2回と
ブロックGを1回呼び出している。
In the calling relation of the program shown in FIG. 3, the program is composed of seven blocks A to G. As shown in the figure, the program of block A calls block B twice and block E once in the program. Further, block B calls block C three times and block D once, and block E calls block F twice and block G once.

このような呼び出し関係になっていることは、プログ
ラムのコンパイル時やリンク時に知ることができるの
で、前記ブロックA〜Gをその呼び出し頻度の高い順に
主記憶装置の下位アドレスからマッピングするようにす
る。
Since such a calling relationship can be known at the time of compiling or linking a program, the blocks A to G are mapped from the lower address of the main storage device in descending order of the calling frequency.

前記ブロックA〜Gは、その呼び出し関係からブロッ
クB〜Dで構成される機能グループと、ブロックE〜G
で構成される機能グループとに分かれていると認識され
る。したがって、ブロックB〜DおよびブロックE〜G
は近接したアドレスで、かつ呼び出し頻度の高い順序に
配置しておく。上記順序に従って主記憶装置へ前記ブロ
ックを展開した結果が第4図に示す図である。
The blocks A to G include a function group composed of blocks B to D based on the calling relationship, and blocks EG.
It is recognized that it is divided into a functional group composed of Therefore, blocks BD and blocks EG
Are arranged in close proximity to each other and in the order of higher calling frequency. FIG. 4 is a diagram showing a result of expanding the blocks in the main storage device in the order described above.

以上の説明のように主記憶装置上のブロックの配置
を、該ブロックの呼び出し頻度と、呼び出し関係とによ
って調整して行うことによって、アドレスの小さいもの
の方が使用頻度が高く、また、アドレスの近接したメモ
リアクセスは一連の機能を実行している確率が高いとい
う状態を主記憶装置の1つのカラム上に設定することが
できる。
As described above, by arranging the blocks on the main storage device in accordance with the calling frequency of the blocks and the calling relationship, the one having the smaller address is used more frequently, The state that the probability of executing a series of functions in the memory access performed is high can be set on one column of the main storage device.

第1図は本発明の一実施例のブロック図である。同図
において、第5図および第6図と同一の符号は同一また
は同等部分を示す。
FIG. 1 is a block diagram of one embodiment of the present invention. 5, the same reference numerals as those in FIGS. 5 and 6 denote the same or equivalent parts.

同図において、タグメモリ10およびデータメモリ11は
複数個に分割されたカラムが集合的に表わされている。
アドレスバス2の下位2aはタグメモリ10に接続されてい
て、該アドレスバス2の下位2aのデータによって、キャ
ッシュ5内のタグメモリ10およびデータメモリ11のカラ
ムが決定される。演算器12にはアドレスバス2の上位2b
と、タグメモリ10のタグデータ出力ライン14とが接続さ
れている。そして該演算器12において、前記アドレスバ
ス2の上位2bのデータとタグメモリ10のタグアドレスと
の比較等の演算が行われる。また、タグメモリ10の更新
のためのゲート13の一方には前記アドレスバス2の上位
2bが接続され、他方にはタグメモリ10のタグデータ出力
ライン14が接続されている。
In FIG. 1, the tag memory 10 and the data memory 11 collectively represent a plurality of divided columns.
The lower 2a of the address bus 2 is connected to the tag memory 10, and the columns of the tag memory 10 and the data memory 11 in the cache 5 are determined by the data of the lower 2a of the address bus 2. The arithmetic unit 12 has the upper 2b of the address bus 2
And the tag data output line 14 of the tag memory 10 are connected. The arithmetic unit 12 performs an operation such as a comparison between the data of the upper 2b of the address bus 2 and the tag address of the tag memory 10. One of the gates 13 for updating the tag memory 10 has an upper
2b is connected, and the other end is connected to the tag data output line 14 of the tag memory 10.

演算器12において、前記アドレスバス2の上位2bのデ
ータ(以下、バス上位データ2bという)と、前記アドレ
スバス下位データ2aによってエントリが決定されたカラ
ムのタグアドレスとが比較され、該両データの値が等し
い場合はHit信号15が出力され、タグアドレスよりもバ
ス上位データ2bの方が小さい値の場合にはLow信号16が
出力される。また、タグアドレスよりもバス上位データ
2bの方が大きく、かつその差があらかじめ定められた値
よりも大きい場合には、Far信号17が出力されるように
構成されている。
The arithmetic unit 12 compares the upper 2b data of the address bus 2 (hereinafter referred to as bus upper data 2b) with the tag address of the column whose entry is determined by the address bus lower data 2a. If the values are equal, a Hit signal 15 is output, and if the value of the bus upper data 2b is smaller than the tag address, a Low signal 16 is output. Also, bus higher data than tag address
When 2b is larger and the difference is larger than a predetermined value, a Far signal 17 is output.

これらのHit信号15、Low信号16、Far信号17はコント
ローラ18に入力され、キャッシュ5への入出力動作およ
びデータの更新動作などは、該各信号の出力に応答して
行われる。
The Hit signal 15, the Low signal 16, and the Far signal 17 are input to the controller 18, and the input / output operation to the cache 5 and the data update operation are performed in response to the output of each signal.

コントローラ18にはCPU1からのアクセス信号6、リー
ド/ライト信号9、アクリノッジ信号7が入力され、該
コントローラ18からは主記憶装置4への動作信号8が出
力される。また、コントローラ18からはタグメモリ10お
よびゲート13には、タグデータ更新のためのタグ更新信
号19が出力される。該更新信号19が出力されると、ゲー
ト13が開かれ、タグメモリ10内にバス上位データが書き
込まれて新しいタグアドレスとして格納される。
The controller 18 receives an access signal 6, a read / write signal 9, and an acknowledge signal 7 from the CPU 1, and outputs an operation signal 8 to the main storage device 4 from the controller 18. Further, a tag update signal 19 for updating tag data is output from the controller 18 to the tag memory 10 and the gate 13. When the update signal 19 is output, the gate 13 is opened, bus upper data is written in the tag memory 10 and stored as a new tag address.

データメモリ11のデータ入出力バス20は、ゲート21を
介してCPU1のデータバス3に接続される。ゲート21はコ
ントローラ18から出力される制御信号22によって制御さ
れる。また、コントローラ18からはデータメモリ11にデ
ータ更新信号23が出力される。該データ更新信号23が出
力され、制御信号22によってゲート21が開かれるとデー
タ入出力バスを介してデータメモリ11のデータは新しい
データに置き換えられる。
The data input / output bus 20 of the data memory 11 is connected to the data bus 3 of the CPU 1 via the gate 21. Gate 21 is controlled by control signal 22 output from controller 18. Further, the data update signal 23 is output from the controller 18 to the data memory 11. When the data update signal 23 is output and the gate 21 is opened by the control signal 22, the data in the data memory 11 is replaced with new data via the data input / output bus.

次に、上記構成による本実施例の動作を図面を参照し
て説明する。第2図はコントローラ18の動作を示したフ
ローチャートである。
Next, the operation of this embodiment having the above configuration will be described with reference to the drawings. FIG. 2 is a flowchart showing the operation of the controller 18.

同図において、まずステップS1でCPU1からメモリアク
セス信号6が来たか否かの判断がされる。アクセスがな
ければ判断は否定となって該ステップS1の処理を繰り返
すが、アクセスがあれば判断は肯定となってステップS2
に進む。ステップS2ではリード/ライト信号9によって
前記アクセスが書き込みか否かの判断を行う。書き込み
サイクルであれば該ステップS2の判断は肯定となりステ
ップS3に移る。
In the figure, first, in step S1, it is determined whether or not the memory access signal 6 has been received from the CPU 1. If there is no access, the determination is negative and the process of step S1 is repeated. However, if there is access, the determination is positive and step S2 is performed.
Proceed to. In step S2, it is determined based on the read / write signal 9 whether or not the access is a write. If it is a write cycle, the determination in step S2 becomes affirmative, and the routine goes to step S3.

ステップS3では動作信号8を出力して主記憶装置4に
動作要求を行う。主記憶装置4では該動作要求に応答し
て、CPU1から出力されたデータを記憶する。
In step S3, the operation signal 8 is output and an operation request is issued to the main storage device 4. The main storage device 4 stores the data output from the CPU 1 in response to the operation request.

ステップS4において、CPU1から出力されたバス上位デ
ータとタグアドレスが一致したか否かが判断され、一致
した(ヒット)場合は、ステップS5に進んで制御信号22
によってゲート21を入力側にすると同時に、データ更新
信号23を出力してCPU1から出力されたデータをデータメ
モリ11に取り込む、いわゆるライトスルー動作を行う。
データメモリ11に新しいデータを取り込むと共に、タグ
更新信号19を出力してゲート13を開き、タグアドレスも
更新する。ヒットしなかった場合はステップS4の判断は
否定となってステップS5はスキップされ、データメモリ
11のデータは更新されさないで、主記憶装置4から動作
終了を知らせるアクノリッジ信号7がCPU1に出力され
る。データがデータメモリ11に取り込まれるとステップ
S1に戻る。
At step S4, it is determined whether or not the bus upper data output from the CPU 1 matches the tag address. If the tag address matches (hit), the process proceeds to step S5, where the control signal 22 is output.
At the same time, the gate 21 is set to the input side, and at the same time, the data update signal 23 is output, and the data output from the CPU 1 is taken into the data memory 11, that is, a so-called write-through operation is performed.
The new data is taken into the data memory 11 and the tag update signal 19 is output to open the gate 13 to update the tag address. If there is no hit, the determination in step S4 is negative and step S5 is skipped, and the data memory
The data of 11 is not updated, and an acknowledgment signal 7 indicating the end of the operation is output from the main storage device 4 to the CPU 1. Step when data is loaded into data memory 11
Return to S1.

また、前記ステップS2において、リード/ライト信号
9が読み出し信号であれば、該ステップS2の判断は、否
定となってステップS6に移行する。ステップS6におい
て、バス上位データ2bがヒットしたか否かが判断され
る。ヒットしていればHit信号15が検出され該ステップS
6の判断は肯定となり、ステップS7に移ってデータメモ
リ11内のデータをCPU1に出力する。データがCPU1に出力
されると、CPU1に対して出力完了を知らせるアクノリッ
ジ信号7が出力され(ステップS8)、ステップS1に戻
る。
In step S2, if the read / write signal 9 is a read signal, the determination in step S2 is negative and the process proceeds to step S6. In step S6, it is determined whether or not the bus upper data 2b has been hit. If hit, Hit signal 15 is detected and step S
The determination at 6 is affirmative, and the process proceeds to step S7 to output the data in the data memory 11 to the CPU 1. When the data is output to the CPU 1, an acknowledgment signal 7 for notifying the CPU 1 of the completion of the output is output (step S8), and the process returns to the step S1.

バス上位データ2bがヒットしなかった場合、ステップ
S6の判断は否定となってステップS9に進む。ステップS9
ではタグアドレスよりバス上位データ2bの方が小さいか
否か、すなわち演算器12からLow信号16が出力されたか
否かが判断される。Low信号16が出力されていれば、該
ステップS9の判断は肯定となりステップS10に移行す
る。Low信号16が出力された場合は、現在キャッシュ5
内に保持されているアドレスのデータよりアクセス頻度
の高いデータが記憶されているアドレス、すなわち前記
第4図における下位アドレスがアクセスされたものとみ
なされ、ステップS10で主記憶装置4に動作要求信号8
が出力される。ステップS11では主記憶装置4からアク
ノリッジ信号が出力されたか否かが判断される。主記憶
装置4が前記動作要求信号8に応答して、データをCPU1
に出力し終わりアクノリッジ信号7が出力されれば、該
ステップS11の判断は肯定となってステップS12に進む。
ステップS12では、主記憶装置4からCPU1に出力された
データと同データがキャッシュ内のデータメモリ11に取
り込まれ、当該アクセス以前にアドレスバス2の下位デ
ータ2aで指定されたカラムに格納されていたデータが更
新される。
If bus upper data 2b is not hit, step
The determination in S6 is negative and the process proceeds to step S9. Step S9
In, it is determined whether or not the bus upper data 2b is smaller than the tag address, that is, whether or not the arithmetic unit 12 has output the Low signal 16. If the Low signal 16 has been output, the determination in step S9 becomes affirmative, and the process proceeds to step S10. When the Low signal 16 is output, the current cache 5
It is considered that an address in which data whose access frequency is higher than that of the address held therein, that is, the lower address in FIG. 4 is accessed, and an operation request signal is sent to the main storage device 4 in step S10. 8
Is output. In step S11, it is determined whether an acknowledgment signal has been output from the main storage device 4. The main storage device 4 responds to the operation request signal 8 and stores the data in the CPU 1.
When the acknowledge signal 7 is output, the determination in step S11 becomes affirmative, and the process proceeds to step S12.
In step S12, the same data as the data output from the main storage device 4 to the CPU 1 is taken into the data memory 11 in the cache, and stored in the column specified by the lower data 2a of the address bus 2 before the access. The data is updated.

データメモリ11内へのデータの取り込みが完了する
と、アクノリッジ信号7がCPU1に出力される。データメ
モリ11への新しいデータの取り込みが完了すると、ステ
ップS1に戻る。
When the loading of the data into the data memory 11 is completed, the acknowledge signal 7 is output to the CPU 1. When the fetching of new data into the data memory 11 is completed, the process returns to step S1.

前記ステップS9において演算器12からLow信号16が出
力されなかった場合は、該ステップS9の判断は否定とな
ってステップS13に進む。ステップS13においては、演算
器12からFar信号17が出力されたか否かが判断される。F
ar信号17が出力されていればステップS13の判断は肯定
となってステップS10に移行する。Far信号が出力された
場合は、現在キャッシュ5に格納されているデータとは
異なった機能グループへのアクセス、例えば前記第4図
に示した、グループ(B,D,C)からグループ(F,G,E)へ
のアクセス開始されたとみなし、上述したステップS9に
おいてLow信号16が出力されたと判断された場合と同様
に、ステップS10〜S12の処理が実行される。
If the low signal 16 is not output from the computing unit 12 in step S9, the determination in step S9 is negative and the process proceeds to step S13. In step S13, it is determined whether the Far signal 17 has been output from the arithmetic unit 12. F
If the ar signal 17 has been output, the determination in step S13 is affirmative, and the process proceeds to step S10. When the Far signal is output, access to a function group different from the data currently stored in the cache 5, for example, from the group (B, D, C) to the group (F, G, E), the processes of steps S10 to S12 are executed in the same manner as when it is determined that the Low signal 16 has been output in step S9 described above.

Far信号17が出力されない場合は、ステップS13におけ
る判断は否定となりステップS14に移る。ステップS13が
否定の場合は現在キャッシュ5に格納されている内容の
方が、CPU1からアクセスされたアドレスの記憶内容より
アクセス頻度が高い、すなわちCPU1からアクセスされた
アドレスの方が、現在キャッシュ5に格納されているタ
グアドレスより前記第4図において上位であると判断
し、ステップS14では主記憶装置4に動作要求信号8が
出力される。
If the far signal 17 is not output, the determination in step S13 is negative, and the process proceeds to step S14. If the determination in step S13 is negative, the content stored in the cache 5 has a higher access frequency than the storage content of the address accessed from the CPU 1, that is, the address accessed from the CPU 1 is stored in the cache 5 now. It is determined from the stored tag address that it is higher in FIG. 4, and an operation request signal 8 is output to the main storage device 4 in step S14.

主記憶装置4では該動作要求信号8に応答してCPU1に
データを出力し、該データの出力が完了するとアクノリ
ッジ信号7をCPU1に出力する。主記憶装置4に動作要求
を出力し終わるとステップS1に戻る。
The main storage device 4 outputs data to the CPU 1 in response to the operation request signal 8, and outputs an acknowledge signal 7 to the CPU 1 when the output of the data is completed. When the operation request has been output to the main storage device 4, the process returns to step S1.

本実施例では上述の説明のように、バス上位データ2b
とタグアドレスとを比較して該両データのアドレスの上
下関係によってHit信号、Low信号、Far信号の3種類の
信号が得るようにしている。そして、該信号の内のいず
れが出力されたかによってキャッシュ内のデータを更新
するか否かを決定するようにしている。したがって使用
頻度の高いとみなされたデータは更新されることがない
のでヒット率を向上できる。
In this embodiment, as described above, the bus upper data 2b
And a tag address, and three types of signals, a Hit signal, a Low signal, and a Far signal, are obtained according to the upper / lower relationship between the addresses of the two data. Then, it is determined whether or not to update the data in the cache according to which of the signals is output. Therefore, the data considered to be frequently used is not updated, so that the hit rate can be improved.

なお、Far信号17を出力させるための基準となる、バ
ス上位データ2bとタグアドレスとの偏差は、前記近接し
て配置したブロックの各機能グループのアドレス幅(第
3図L1およびL2)の平均値を目安に設定すると良い。
It should be noted that the deviation between the bus upper data 2b and the tag address, which is a reference for outputting the Far signal 17, is the average of the address widths (L1 and L2 in FIG. 3) of each functional group of the blocks arranged close to each other. Set the value as a guide.

なお、本実施例ではプログラムのコンパイル時やリン
ク時に前記ブロックの主記憶装置上における配置を決定
する例を示したが、一度配置されたプログラムを数回実
行して、その時のデータ処理速度の動特性情報によって
再度ブロックの配置をやり直すことによって更にデータ
の処理速度は向上できる。同様に前記アドレス幅を目安
として設定したバス上位データ2bとタグアドレスとの偏
差も調整できる。
In this embodiment, an example has been described in which the arrangement of the blocks on the main storage device is determined at the time of compiling or linking the program. However, once the allocated program is executed several times, the data processing speed at that time is changed. The data processing speed can be further improved by rearranging the blocks again according to the characteristic information. Similarly, the deviation between the tag address and the bus upper data 2b set using the address width as a guide can be adjusted.

(発明の効果) 以上の説明から明らかなように、本発明によれば、ヒ
ット率の高いキャッシュを実現できるので、従来のキャ
ッシュを使用した場合よりもデータ処理装置における命
令処理速度を大幅に向上することができる。
(Effects of the Invention) As is clear from the above description, according to the present invention, a cache with a high hit rate can be realized, so that the instruction processing speed in the data processing device is greatly improved as compared with the case where a conventional cache is used. can do.

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

第1図は本発明の実施例を示すブロック図、第2図はコ
ントローラの動作を示すフローチャート、第3図はプロ
グラムの呼び出し関係の一例を示す図、第4図はプログ
ラムの主記憶装置上への展開例を示す図、第5図はキャ
ッシュを有する情報処理方式のブロック図、第6図はデ
ータのマッピング例を示す図である。 1…CPU、2…アドレスバス、3…データバス、4…主
記憶装置、5…キャッシュメモリ、6…アクセス信号、
7…アクノリッジ信号、8…動作要求信号、9…リード
/ライト信号、10…タグメモリ、11…データメモリ、12
…演算器、15…Hit信号、16…Low信号、17…Far信号、1
8…コントローラ
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a flowchart showing the operation of a controller, FIG. 3 is a diagram showing an example of a program calling relationship, and FIG. FIG. 5 is a block diagram of an information processing system having a cache, and FIG. 6 is a diagram showing an example of data mapping. DESCRIPTION OF SYMBOLS 1 ... CPU, 2 ... Address bus, 3 ... Data bus, 4 ... Main memory, 5 ... Cache memory, 6 ... Access signal,
7 acknowledgment signal, 8 operation request signal, 9 read / write signal, 10 tag memory, 11 data memory, 12
... Calculator, 15 Hit signal, 16 Low signal, 17 Far signal, 1
8… Controller

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】それぞれが複数のブロックを含んでいる複
数の機能グループから構成されたプログラムについて、
前記各機能グループを予定のアドレス空間をあけてマッ
ピングし、かつ同一機能グループ内における前記各ブロ
ックを呼び出し回数の多い順に下位アドレスからマッピ
ングした主記憶装置の記憶内容の一部の写しを保持する
キャッシュメモリにおいて、 タグアドレスに対するCPUのアクセスアドレスの差を演
算し、アクセスアドレスとタグアドレスとが一致した時
にはHit信号を出力し、アクセスアドレスがタグアドレ
スより下位にある時にはLow信号を出力し、アクセスア
ドレスがタグアドレスよりあらかじめ設定された所定の
差以上上位にある時にはFar信号を出力する演算手段
と、 該演算手段のLow信号及びFar信号のいずれかの出力を検
知した時に、CPUのアクセスアドレスによって決定され
たキャッシュメモリのカラムに属するデータメモリの内
容を、主記憶装置内の前記アクセスアドレスのデータに
更新する動作を要求する信号を出力するコントローラと
を具備したことを特徴とするキャッシュメモリ。
1. A program comprising a plurality of function groups each including a plurality of blocks,
A cache that maps each of the function groups with a predetermined address space and maps each of the blocks in the same function group from a lower address in descending order of the number of calls, and holds a copy of a part of the storage content of the main storage device In the memory, the difference between the tag address and the access address of the CPU is calculated, a Hit signal is output when the access address matches the tag address, and a Low signal is output when the access address is lower than the tag address. Means for outputting a Far signal when the signal is higher than the tag address by a predetermined difference or more, and is determined by the access address of the CPU when detecting the output of either the Low signal or the Far signal of the arithmetic means. Of the data memory belonging to the column of the cache memory Cache memory, characterized in that volume, and equipped with a controller for outputting a signal for requesting operation of updating the data of the access address in the main storage device.
JP63033595A 1988-02-16 1988-02-16 Cache memory Expired - Lifetime JP2759952B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63033595A JP2759952B2 (en) 1988-02-16 1988-02-16 Cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63033595A JP2759952B2 (en) 1988-02-16 1988-02-16 Cache memory

Publications (2)

Publication Number Publication Date
JPH01207858A JPH01207858A (en) 1989-08-21
JP2759952B2 true JP2759952B2 (en) 1998-05-28

Family

ID=12390845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63033595A Expired - Lifetime JP2759952B2 (en) 1988-02-16 1988-02-16 Cache memory

Country Status (1)

Country Link
JP (1) JP2759952B2 (en)

Also Published As

Publication number Publication date
JPH01207858A (en) 1989-08-21

Similar Documents

Publication Publication Date Title
US4593354A (en) Disk cache system
US4937738A (en) Data processing system which selectively bypasses a cache memory in fetching information based upon bit information of an instruction
JPS58102381A (en) Buffer memory
US6941308B1 (en) Methods and apparatus for accessing a doubly linked list in a data storage system
US4658356A (en) Control system for updating a change bit
JPH05210589A (en) High-speed buffer copying method
EP0021097B1 (en) Method of increasing the speed of a computer system and a computer system for high speed operation
JP2002032264A (en) Cache memory device and central processing unit using the same
JP2759952B2 (en) Cache memory
US5012410A (en) Data processor with instruction cache memory
US4628450A (en) Data processing system having a local memory which does not use a directory device with distributed resident programs and a method therefor
JPS644214B2 (en)
JPH01288940A (en) Logical address cache control system
JPH0830568A (en) Cache control system for distributed memory type parallel computer
JP2703255B2 (en) Cache memory writing device
JPH06149669A (en) System and device for transferring cache data
JP3061818B2 (en) Access monitor device for microprocessor
JPH01266643A (en) Cache control system
JP2988048B2 (en) Dictionary information resident access device
JPH04264641A (en) Cache memory system
JPS6010336B2 (en) Address comparison method
JPH0546477A (en) Cathe memory control method
JPH05265942A (en) Data inputting and outputting method for dma control part
JPS61208153A (en) Page history memory device
JPS6036618B2 (en) information processing system