JPH05241953A - Cache memory - Google Patents

Cache memory

Info

Publication number
JPH05241953A
JPH05241953A JP4042872A JP4287292A JPH05241953A JP H05241953 A JPH05241953 A JP H05241953A JP 4042872 A JP4042872 A JP 4042872A JP 4287292 A JP4287292 A JP 4287292A JP H05241953 A JPH05241953 A JP H05241953A
Authority
JP
Japan
Prior art keywords
data
memory
bus
cache
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.)
Pending
Application number
JP4042872A
Other languages
Japanese (ja)
Inventor
Tetsuya Tanaka
哲也 田中
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP4042872A priority Critical patent/JPH05241953A/en
Publication of JPH05241953A publication Critical patent/JPH05241953A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To provide cache memory in which the latency time of a memory hierarchy at the pre-stage can be reduced when the memory hierarchy at the pre-stage makes a plural number of times of access a memory hierarchy at the next stage. CONSTITUTION:While data (A0) in accordance with a first request address (a0) generating mis-cache is received from memory 99 after the decision result of the first request address (a0) from a CPU 4 is judged as mis-cache, a new second request address (b1) is received from the CPU 4 by a decision means and a data transfer request output means, and it is decided whether the request address (b1) is judged as cache-hit or mis-cache, thereby, decision as cache-hit for the second request address (b1) can be eliminated apparently.

Description

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

【0001】[0001]

【産業上の利用分野】この発明はマイクロプロセッサに
おけるメモリアクセスを高速化するキャッシュメモリに
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory which accelerates memory access in a microprocessor.

【0002】[0002]

【従来の技術】近年、キャッシュメモリは、マイクロプ
ロセッサのメモリアクセスの高速化のために使用されて
いる。これまでは、キャッシュのヒット率を上げること
によってメモリのアクセスタイムを減らしてきたが、ヒ
ット率を上げるのは限界があるので、最近、キャッシュ
ミス時のペナルティを減らすことが着目されてきてい
る。
2. Description of the Related Art In recent years, cache memories have been used for speeding up memory access of microprocessors. Up to now, the memory access time has been reduced by increasing the cache hit rate, but since there is a limit to increasing the hit rate, attention has recently been focused on reducing the penalty at the time of a cache miss.

【0003】以下、図面を参照しながら、従来のキャッ
シュメモリについて説明する。図3は従来のキャッシュ
メモリの構成を示すブロック図である。図3において、
1はタグメモリであり、過去にアクセスされたアドレス
を格納している。2はデータメモリであり、過去にアク
セスしたアドレスのデータを格納している。30は制御
部、4はCPU、8は比較回路、80,96,97,3
00はラッチ、21,93はセレクタ、98はトライス
テートバッファ、90はメモリ制御回路である。タグメ
モリ1,データメモリ2および制御部30はキャッシュ
メモリの主な構成要素である。
A conventional cache memory will be described below with reference to the drawings. FIG. 3 is a block diagram showing the configuration of a conventional cache memory. In FIG.
Reference numeral 1 is a tag memory, which stores previously accessed addresses. Reference numeral 2 is a data memory, which stores data of previously accessed addresses. 30 is a control unit, 4 is a CPU, 8 is a comparison circuit, 80, 96, 97, 3
00 is a latch, 21 and 93 are selectors, 98 is a tri-state buffer, and 90 is a memory control circuit. The tag memory 1, the data memory 2 and the control unit 30 are main constituent elements of the cache memory.

【0004】このように構成された従来のキャッシュメ
モリの動作を説明する。キャッシュメモリに対して、C
PU4は、バス51にリクエストアドレスを出力し、制
御部30にリクエスト信号60を出力する。タグメモリ
1では、バス50のリクエストアドレスによって指示さ
れたエントリからタグアドレスをバス53に読みだす。
The operation of the conventional cache memory thus configured will be described. C for cache memory
The PU 4 outputs the request address to the bus 51 and outputs the request signal 60 to the control unit 30. In the tag memory 1, the tag address is read onto the bus 53 from the entry designated by the request address on the bus 50.

【0005】比較回路8では、バス50のリクエストア
ドレスのタグ部と、バス53のタグアドレスとを比較す
る。この際、不一致の場合、すなわちキャッシュミスの
場合は、バス50のリクエストアドレスをメモリ制御回
路90に出力すると同時に制御部30によりメモリ制御
回路90にリクエスト信号62を出力する。リクエスト
信号62を入力されたメモリ制御回路90では、バス5
0のリクエストアドレスを用いてメモリ99からバス7
0にデータを読みだし、アクノレッジ信号63を制御部
30に出力する。
The comparison circuit 8 compares the tag portion of the request address of the bus 50 with the tag address of the bus 53. At this time, if there is no match, that is, if there is a cache miss, the request address of the bus 50 is output to the memory control circuit 90, and at the same time, the control unit 30 outputs a request signal 62 to the memory control circuit 90. In the memory control circuit 90 to which the request signal 62 is input, the bus 5
Bus 99 from memory 99 with a request address of 0
The data is read to 0, and the acknowledge signal 63 is output to the control unit 30.

【0006】制御部30では、アクノレッジ信号63を
受け取ると、アクノレッジ信号61をCPU4に出力す
る。また、キャッシュメモリは、バス70を介してメモ
リ制御回路90からデータを受け取り、このデータをC
PU4に転送すると同時にデータメモリ2に書き込む。
そして、メモリ制御回路90は、キャッシュラインの残
りのデータをメモリ99からバス70に読みだし、キャ
ッシュメモリに転送する。キャッシュメモリは、バス7
0のデータを受け取り、データメモリ2に書き込む。
When the control unit 30 receives the acknowledge signal 63, it outputs the acknowledge signal 61 to the CPU 4. The cache memory also receives data from the memory control circuit 90 via the bus 70, and stores this data in C
The data is written to the data memory 2 at the same time as it is transferred to the PU 4.
Then, the memory control circuit 90 reads the remaining data of the cache line from the memory 99 to the bus 70 and transfers it to the cache memory. The cache memory is bus 7
The data of 0 is received and written in the data memory 2.

【0007】その後は、以上の動作を繰り返される。After that, the above operation is repeated.

【0008】[0008]

【発明が解決しようとする課題】しかしながら、このよ
うに構成された従来のキャッシュメモリでは、CPU4
がリクエストアドレスを出した後、このリクエストアド
レスに対応したデータを受け取る前に、CPU4で新た
なリクエストアドレスが準備できていたとしても、この
新たなリクエストアドレスをキャッシュメモリは受け取
ることはできない。したがって、CPU4は、最初のリ
クエストアドレスに対応したデータを受け取るまでは、
新たなリクエストアドレスの出力を待たされるという問
題があった。
However, in the conventional cache memory thus configured, the CPU 4
Even if the CPU 4 prepares a new request address after issuing the request address and before receiving the data corresponding to the request address, the cache memory cannot receive the new request address. Therefore, until the CPU 4 receives the data corresponding to the first request address,
There was a problem of waiting for the output of a new request address.

【0009】また、一つのリクエストアドレスがキャッ
シュミスした場合には、CPU4の要求するデータのみ
でなく、CPU4に転送する必要がないデータも、キャ
ッシュメモリ内のデータメモリ2に転送する動作が発生
する。したがって、CPU4は、この不要なデータ転送
動作分、新たなリクエストアドレスの出力を待たされる
という問題があった。
When one request address causes a cache miss, an operation for transferring not only the data requested by the CPU 4 but also the data that need not be transferred to the CPU 4 to the data memory 2 in the cache memory occurs. .. Therefore, there is a problem that the CPU 4 has to wait for the output of a new request address for this unnecessary data transfer operation.

【0010】この発明の目的は上記問題点に鑑み、デー
タ転送要求を出力する前段のメモリ階層のアクセス待ち
時間を少なくすることのできるキャッシュメモリを提供
することである。
In view of the above problems, it is an object of the present invention to provide a cache memory which can reduce the access waiting time of the memory hierarchy in the preceding stage which outputs a data transfer request.

【0011】[0011]

【課題を解決するための手段】請求項1記載のキャッシ
ュメモリは、前段のメモリ階層から出力されたデータ転
送要求に対してキャッシュヒットかキャッシュミスかの
判定を行う判定手段と、データ転送要求を保持し、判定
結果がキャッシュミスの場合に、このキャッシュミスと
なったデータ転送要求を次段のメモリ階層に出力するデ
ータ転送要求出力手段と、次段のメモリ階層からキャッ
シュミスとなったデータ転送要求に対応したデータを受
け取り、このデータを前段のメモリ階層に転送するとと
もに記憶するデータ転送手段とを備えたものであり、判
定手段によるデータ転送要求の判定結果がキャッシュミ
スとなった時点から、このキャッシュミスとなったデー
タ転送要求に対応したデータを次段のメモリ階層から受
け取るまでの間に、前段のメモリ階層から新たなデータ
転送要求を受け取りこの新たなデータ転送要求に対して
判定手段およびデータ転送要求出力手段を実行するよう
にしたものである。
According to a first aspect of the present invention, there is provided a cache memory, which comprises a determining means for determining a cache hit or a cache miss for a data transfer request output from a preceding memory layer, and a data transfer request. A data transfer request output unit that holds the data and outputs the data transfer request having the cache miss to the memory hierarchy of the next stage when the determination result is the cache miss, and the data transfer having the cache miss from the memory hierarchy of the next stage. It is provided with a data transfer means for receiving data corresponding to the request, transferring this data to the preceding memory hierarchy and storing it, and from the time when the determination result of the data transfer request by the determination means is a cache miss, Until the data corresponding to the data transfer request that resulted in this cache miss is received from the next memory layer It is obtained so as to perform the determining means and the data transfer request output means with respect to receiving a new data transfer request from the preceding stage of the memory hierarchy the new data transfer request.

【0012】請求項2記載のキャッシュメモリは、デー
タ転送手段により次段のメモリ階層から前段のメモリ階
層にデータ転送を行う場合に、前段のメモリ階層に転送
する必要はないが記憶する必要のあるデータ転送要求に
対応したデータと同じキャッシュラインのデータより
も、前段のメモリ階層から出力された新たなデータ転送
要求に対応したデータを優先して転送するようにしたも
のである。
According to another aspect of the present invention, when the data transfer means transfers the data from the memory hierarchy of the next stage to the memory hierarchy of the previous stage, it is not necessary to transfer to the memory hierarchy of the previous stage, but it is necessary to store the cache memory. The data corresponding to the new data transfer request output from the previous memory hierarchy is preferentially transferred over the data of the same cache line as the data corresponding to the data transfer request.

【0013】[0013]

【作用】請求項1記載の構成によれば、判定手段による
一つ目のデータ転送要求の判定結果がキャッシュミスと
なった時点から、このキャッシュミスとなった一つ目の
データ転送要求に対応したデータを次段のメモリ階層か
ら受け取るまでの間に、判定手段およびデータ転送要求
出力手段により、前段のメモリ階層から新たな二つ目の
データ転送要求を受け取り、この二つ目のデータ転送要
求に対してキャッシュヒットかキャッシュミスかの判定
を行うことによって、二つ目のデータ転送要求に対する
前記判定を見かけ上なくすことができる。したがって、
前段のメモリ階層の待ち時間を少なくすることができ
る。
According to the structure of the first aspect, from the time when the determination result of the first data transfer request by the determination means is a cache miss, the first data transfer request that is the cache miss is handled. Until the received data is received from the memory hierarchy of the next stage, the determining means and the data transfer request output means receive a new second data transfer request from the memory hierarchy of the previous stage, and the second data transfer request It is possible to apparently eliminate the above-described determination for the second data transfer request by determining whether the cache hit or the cache miss. Therefore,
It is possible to reduce the waiting time of the preceding memory hierarchy.

【0014】請求項2記載の構成によれば、請求項1記
載の構成において、データ転送手段により次段のメモリ
階層から前段のメモリ階層にデータ転送を行う場合に、
前段のメモリ階層に転送する必要はないが記憶する必要
のある1つ目のデータ転送要求に対応したデータと同じ
キャッシュラインのデータよりも、前段のメモリ階層か
ら出力された新たな二つ目のデータ転送要求に対応した
データを優先して転送することにより、前段のメモリ階
層が要求しているデータを優先的に次段のメモリ階層か
ら前段のメモリ階層に転送することができる。したがっ
て、前段のメモリ階層の待ち時間を少なくすることがで
きる。
According to the structure of claim 2, in the structure of claim 1, when the data transfer means transfers data from the memory hierarchy of the next stage to the memory hierarchy of the preceding stage,
It is not necessary to transfer the data to the previous memory hierarchy, but rather than the data of the same cache line as the data corresponding to the first data transfer request that needs to be stored, a new second data output from the previous memory hierarchy is used. By preferentially transferring the data corresponding to the data transfer request, the data requested by the preceding memory hierarchy can be preferentially transferred from the next memory hierarchy to the preceding memory hierarchy. Therefore, the waiting time of the preceding memory hierarchy can be reduced.

【0015】[0015]

【実施例】以下、この発明の一実施例のキャッシュメモ
リについて、図面を参照しながら説明する。図1はこの
発明の一実施例のキャッシュメモリの構成を示すブロッ
ク図、図2は同キャッシュメモリの動作を説明するため
の波形図である。図1において、100はタグメモリ
1,データメモリ2,制御部3,比較回路8および保持
部200により主要構成されるキャッシュメモリ、4は
前段のメモリ階層となるCPU、99は次段のメモリ階
層となるメモリである。また、判定手段は、タグメモリ
1,制御部3および比較回路8により主要構成される。
また、データ転送要求出力手段は、制御部3および保持
部200により主要構成される。また、データ転送手段
は、制御部3,データメモリ2およびバス70により主
要構成される。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A cache memory according to an embodiment of the present invention will be described below with reference to the drawings. 1 is a block diagram showing the configuration of a cache memory according to an embodiment of the present invention, and FIG. 2 is a waveform diagram for explaining the operation of the cache memory. In FIG. 1, reference numeral 100 is a tag memory 1, data memory 2, a control unit 3, a cache memory mainly composed of a comparison circuit 8 and a holding unit 200, 4 is a CPU serving as a previous memory hierarchy, and 99 is a next memory hierarchy. Is the memory. Further, the judging means is mainly constituted by the tag memory 1, the control unit 3 and the comparison circuit 8.
The data transfer request output means is mainly composed of the control unit 3 and the holding unit 200. The data transfer means mainly comprises the control unit 3, the data memory 2 and the bus 70.

【0016】以下、図1を参照しながら、各部を詳細に
説明する。90はメモリ制御回路、5,6,7,80,
81,96および97はクロックに同期したラッチ、2
0,21,22および93はセレクタ、8は比較回路、
98はトライステートバッファである。バス51は、C
PU4のリクエストアドレス出力およびラッチ7の入力
間を接続している。
Hereinafter, each part will be described in detail with reference to FIG. 90 is a memory control circuit, 5, 6, 7, 80,
81, 96 and 97 are clock-synchronized latches, 2
0, 21, 22, and 93 are selectors, 8 is a comparison circuit,
Reference numeral 98 is a tri-state buffer. Bus 51 is C
The request address output of PU4 and the input of latch 7 are connected.

【0017】バス50は、ラッチ7の出力と、ラッチ
5,6の入力,比較回路8のデータ入力,セレクタ20
のデータ入力およびセレクタ21の制御入力との間を接
続している。バス52は、セレクタ20の出力と、タグ
メモリ1のインデックス入力およびデータメモリ2のイ
ンデックス入力との間を接続している。
The bus 50 is provided with the output of the latch 7, the inputs of the latches 5 and 6, the data input of the comparison circuit 8, and the selector 20.
And the control input of the selector 21 are connected. The bus 52 connects between the output of the selector 20 and the index input of the tag memory 1 and the index input of the data memory 2.

【0018】バス53は、タグメモリ1の出力および比
較回路8のデータ入力間を接続している。バス55は、
ラッチ5の出力およびセレクタ22のデータ入力間を接
続している。また、バス56は、ラッチ6の出力および
セレクタ22のデータ入力間を接続している。
The bus 53 connects between the output of the tag memory 1 and the data input of the comparison circuit 8. Bus 55
The output of the latch 5 and the data input of the selector 22 are connected. Further, the bus 56 connects the output of the latch 6 and the data input of the selector 22.

【0019】バス54は、セレクタ22の出力と、ラッ
チ81の入力およびメモリ制御回路90のリクエストア
ドレス入力との間を接続している。バス49は、ラッチ
81の出力と、セレクタ20のデータ入力,タグメモリ
1のデータ入力,セレクタ93のデータ入力およびイン
バータ89の入力との間を接続している。
The bus 54 connects the output of the selector 22 with the input of the latch 81 and the request address input of the memory control circuit 90. The bus 49 connects the output of the latch 81, the data input of the selector 20, the data input of the tag memory 1, the data input of the selector 93, and the input of the inverter 89.

【0020】信号線87は、インバータ89の出力およ
びセレクタ93の入力間を接続している。バス92は、
セレクタ93の出力およびデータメモリ2のエントリ選
択信号入力間を接続している。バス70は、トライステ
ートバッファ98の出力,ラッチ80の入力,CPU4
のデータ入出力およびメモリ制御回路90のデータ入出
力に接続してある。
The signal line 87 connects the output of the inverter 89 and the input of the selector 93. Bus 92
The output of the selector 93 and the entry selection signal input of the data memory 2 are connected. The bus 70 includes an output of the tri-state buffer 98, an input of the latch 80, the CPU 4
And the data input / output of the memory control circuit 90.

【0021】バス71は、ラッチ80の出力およびデー
タメモリ2のデータ入力間を接続している。バス58
は、データメモリ2のデータ出力およびセレクタ21の
データ入力間を接続している。また、バス59は、デー
タメモリ2のデータ出力およびセレクタ21のデータ入
力間を接続している。
The bus 71 connects between the output of the latch 80 and the data input of the data memory 2. Bus 58
Connects the data output of the data memory 2 and the data input of the selector 21. Further, the bus 59 connects the data output of the data memory 2 and the data input of the selector 21.

【0022】バス57は、セレクタ21の出力およびラ
ッチ96の入力間を接続し、バス48は、ラッチ96の
出力およびトライステートバッファ98のデータ入力間
を接続している。ヒット信号10は、比較回路8から制
御部3およびラッチ97に入力される。バス95は、ラ
ッチ97の出力およびトライステートバッファ98の制
御入力間を接続している。
The bus 57 connects between the output of the selector 21 and the input of the latch 96, and the bus 48 connects between the output of the latch 96 and the data input of the tri-state buffer 98. The hit signal 10 is input from the comparison circuit 8 to the control unit 3 and the latch 97. The bus 95 connects between the output of the latch 97 and the control input of the tri-state buffer 98.

【0023】リードライトイネーブル信号13は、制御
部3からセレクタ20,タグメモリ1およびデータメモ
リ2の制御端子に入力される。制御信号94は、制御部
3からセレクタ93の制御端子に入力される。ラッチイ
ネーブル信号11は、制御部3からラッチ5のイネーブ
ル入力端子に入力され、また、ラッチイネーブル信号1
2は、制御部3からラッチ6のイネーブル入力端子に入
力される。
The read / write enable signal 13 is input from the control section 3 to the control terminals of the selector 20, the tag memory 1 and the data memory 2. The control signal 94 is input from the control unit 3 to the control terminal of the selector 93. The latch enable signal 11 is input from the control unit 3 to the enable input terminal of the latch 5, and the latch enable signal 1
2 is input from the control unit 3 to the enable input terminal of the latch 6.

【0024】制御信号19は、制御部3からセレクタ2
2の制御端子に入力され、また、制御信号94は、制御
部3からセレクタ93の制御端子に入力される。リクエ
スト信号60は、CPU4から制御部3に入力され、ま
た、アクノレッジ信号61は、制御部3からCPU4に
入力され、リクエスト信号62は、制御部3からメモリ
制御回路90に入力される。また、アクノレッジ信号6
3は、メモリ制御回路90から制御部3に入力される。
また、データリクエスト信号64は、制御部3からメモ
リ制御回路90に入力され、データリクエスト信号65
は、制御部3からメモリ制御回路90に入力される。
The control signal 19 is sent from the control unit 3 to the selector 2
2 is input to the control terminal of the selector 93, and the control signal 94 is input from the control unit 3 to the control terminal of the selector 93. The request signal 60 is input from the CPU 4 to the control unit 3, the acknowledge signal 61 is input from the control unit 3 to the CPU 4, and the request signal 62 is input from the control unit 3 to the memory control circuit 90. Also, acknowledge signal 6
3 is input to the control unit 3 from the memory control circuit 90.
Further, the data request signal 64 is input from the control unit 3 to the memory control circuit 90, and the data request signal 65 is input.
Is input to the memory control circuit 90 from the control unit 3.

【0025】ここで、バス70において一回のバス転送
で転送できるデータを「A0」,「A1」,「B0」お
よび「B1」とする。この場合、データ「A0」とデー
タ「A1」のバス転送で一つのキャッシュラインの転送
が完了する。同様に、データ「B0」とデータ「B1」
のバス転送で一つのキャッシュラインの転送が完了す
る。
Here, the data which can be transferred by one bus transfer on the bus 70 are "A0", "A1", "B0" and "B1". In this case, the transfer of one cache line is completed by the bus transfer of the data “A0” and the data “A1”. Similarly, data "B0" and data "B1"
The bus transfer completes the transfer of one cache line.

【0026】また、各データ「A0」,「A1」,「B
0」および「B1」に対応する各アドレスをそれぞれア
ドレス「a0」,「a1」,「b0」および「b1」と
する。なお、実施例ではデータ「A0」およびデータ
「B1」をCPU4が要求するデータとする。メモリ制
御回路90は、リクエストアドレスに対応するデータを
メモリ99から読みだす。キャッシュラインの転送を完
了するには、二回のデータ転送を行なうこととなる。メ
モリ制御回路90は、二つのリクエストアドレスを受け
とることができ、二つのリクエストアドレスを受けた場
合は、制御部3から出力されるデータリクエスト信号6
4およびデータリクエスト信号65に従ってデータを転
送する。即ち、データリクエスト信号64がハイレベル
のときは、一つ目のリクエストアドレスに対応するデー
タを転送し、データリクエスト信号65がハイレベルの
ときは二つ目のリクエストアドレスに対応するデータを
転送する。
Further, each data "A0", "A1", "B"
Addresses corresponding to "0" and "B1" are referred to as addresses "a0", "a1", "b0" and "b1", respectively. In the embodiment, the data “A0” and the data “B1” are data requested by the CPU 4. The memory control circuit 90 reads the data corresponding to the request address from the memory 99. Two data transfers are required to complete the transfer of the cache line. The memory control circuit 90 can receive two request addresses, and when receiving the two request addresses, the data request signal 6 output from the control unit 3
4 and data request signal 65 to transfer data. That is, when the data request signal 64 is at the high level, the data corresponding to the first request address is transferred, and when the data request signal 65 is at the high level, the data corresponding to the second request address is transferred. ..

【0027】また、キャッシュメモリをアクセスするた
めのアドレスは、三つの部分に分けられる。この三つの
部分をそれぞれタグ部,セレクト部およびオフセット部
とする。また、タグメモリ1は複数のエントリを有して
おり、それぞれのエントリにキャッシュラインのアドレ
スのタグ部が格納される。このタグメモリ1に格納する
アドレスをタグアドレスとする。
The address for accessing the cache memory is divided into three parts. These three parts are the tag part, the select part, and the offset part, respectively. Further, the tag memory 1 has a plurality of entries, and the tag portion of the address of the cache line is stored in each entry. The address stored in the tag memory 1 is the tag address.

【0028】また、データメモリ2はタグメモリ1と同
数のエントリを有しており、それぞれのエントリにキャ
ッシュラインのデータを格納する。各エントリは二つの
部分からなっており、それぞれエントリ0aおよびエン
トリ1aとする。例えば、キャッシュラインのアドレス
をアドレス「a0」もしくはアドレス「a1」とする
と、エントリ0aにデータ「A0」を格納し、エントリ
1aにデータ「A1」を格納する。また、制御部3は二
つのステートマシンを持ち、それぞれステートマシンM
0およびステートマシンM1とする。ステートマシンM
0およびステートマシンM1はそれぞれS0,S1,S
2およびS3の状態を持つ。
Further, the data memory 2 has the same number of entries as the tag memory 1, and each entry stores the data of the cache line. Each entry is composed of two parts, which are referred to as entry 0a and entry 1a, respectively. For example, assuming that the address of the cache line is the address "a0" or the address "a1", the data "A0" is stored in the entry 0a and the data "A1" is stored in the entry 1a. The control unit 3 has two state machines, each of which is a state machine M.
0 and state machine M1. State machine M
0 and state machine M1 are S0, S1 and S, respectively.
It has the states of 2 and S3.

【0029】以上のように構成したキャッシュメモリは
次のように動作する。CPU4からアドレス「a0」の
リクエストアドレスを受け取り、キャッシュヒットの判
定を行い、キャッシュミスの場合にはメモリ制御回路9
0にアドレス「a0」のキャッシュラインのデータ「A
0」,「A1」を要求する。この間、CPU4からアド
レス「b1」のリクエストアドレスも受け取り、キャッ
シュヒットの判定を行い、キャッシュミスの場合にはメ
モリ制御回路90にアドレス「b1」のキャッシュライ
ンのデータ「B0」,「B1」を要求する。これによ
り、キャッシュメモリは、アドレス「a0」のデータ
「A0」をメモリ制御回路90から受け取り、CPU4
に転送すると同時にデータメモリ2に書き込み、アドレ
ス「b1」のデータ「B1」をメモリ制御回路90に要
求する。そして、アドレス「b1」のデータ「B1」を
受け取り、CPU4に転送すると同時にデータメモリ2
に書き込む。その後に、アドレス「a1」のデータ「A
1」およびアドレス「b0」のデータ「B0」を順次受
け取り、データメモリ2に書き込む。
The cache memory configured as described above operates as follows. The request address of the address "a0" is received from the CPU 4, the cache hit is judged, and in the case of a cache miss, the memory control circuit 9
0 to the data "A" of the cache line at address "a0"
0 ”and“ A1 ”are requested. During this time, the request address of the address "b1" is also received from the CPU 4 and a cache hit is determined. In the case of a cache miss, the memory control circuit 90 is requested for the data "B0" and "B1" of the cache line of the address "b1". To do. As a result, the cache memory receives the data “A0” of the address “a0” from the memory control circuit 90, and the CPU 4
At the same time, the data is written in the data memory 2, and the data “B1” at the address “b1” is requested to the memory control circuit 90. Then, the data “B1” at the address “b1” is received and transferred to the CPU 4, and at the same time the data memory 2
Write in. After that, the data "A" at the address "a1"
1 ”and the data“ B0 ”of the address“ b0 ”are sequentially received and written in the data memory 2.

【0030】以下、図1および図2を用いてキャッシュ
メモリの各クロック毎の動作を説明する。なお、図2に
おいて、符号1a〜18bは各クロックの期間を示す。 (期間1a)CPU4は、リクエスト信号60をハイレ
ベルとし、リクエストアドレスとしてアドレス「a0」
をバス51に出力する。この際、メモリ制御回路90か
ら出力されるアクノレッジ信号63がローレベルである
ため、制御部3はリードライトイネーブル信号13をハ
イレベルにする。
The operation of the cache memory for each clock will be described below with reference to FIGS. 1 and 2. In addition, in FIG. 2, reference numerals 1a to 18b indicate periods of each clock. (Period 1a) The CPU 4 sets the request signal 60 to the high level and sets the address “a0” as the request address.
Is output to the bus 51. At this time, since the acknowledge signal 63 output from the memory control circuit 90 is at low level, the control unit 3 sets the read / write enable signal 13 at high level.

【0031】(期間1b)バス51のアドレス「a0」
がラッチ7でラッチされ、バス50に出力される。ま
た、リードライトイネーブル信号13がハイレベルなの
で、セレクタ20は、バス50のアドレス「a0」のセ
レクト部をバス52に出力する。
(Period 1b) Address "a0" of the bus 51
Is latched by the latch 7 and output to the bus 50. Further, since the read / write enable signal 13 is at the high level, the selector 20 outputs the select unit of the address “a0” of the bus 50 to the bus 52.

【0032】また、タグメモリ1は、バス52のアドレ
ス「a0」のセレクト部を用いてエントリを選択し、選
択されたエントリのタグアドレスTA1をバス53に出
力する。また、比較回路8は、バス50のアドレス「a
0」のタグ部と、バス53のタグアドレスとを比較し、
一致する場合すなわちキャッシュヒットの場合には、ヒ
ット信号10をハイレベルとし、不一致の場合すなわち
キャッシュミスの場合には、ヒット信号10をローレベ
ルにする。図2にはキャッシュミスの例を示してるの
で、ヒット信号10はローレベルになっている。
Further, the tag memory 1 selects an entry using the selector of the address "a0" of the bus 52 and outputs the tag address TA1 of the selected entry to the bus 53. In addition, the comparison circuit 8 uses the address “a” of the bus 50.
Compare the tag part of "0" and the tag address of the bus 53,
When they match, that is, when a cache hit occurs, the hit signal 10 is set to a high level, and when they do not match, that is, a cache miss, the hit signal 10 is set to a low level. Since the example of the cache miss is shown in FIG. 2, the hit signal 10 is at the low level.

【0033】また、データメモリ2は、バス52のアド
レス「a0」のセレクト部を用いてエントリを選択し、
選択されたエントリET0のデータをバス58に出力
し、エントリET1のデータをバス59に出力する。ま
た、セレクタ21は、バス50のアドレス「a0」のオ
フセット部の最上位ビットを用いてバス58およびバス
59のうちの一方を選択する。ここでは、バス50はア
ドレス「a0」であるので、バス58を選択しエントリ
ET0のデータをバス57に出力する。
Further, the data memory 2 selects an entry by using the select part of the address "a0" of the bus 52,
The data of the selected entry ET0 is output to the bus 58, and the data of the entry ET1 is output to the bus 59. Further, the selector 21 selects one of the bus 58 and the bus 59 by using the most significant bit of the offset part of the address “a0” of the bus 50. Here, since the bus 50 has the address “a0”, the bus 58 is selected and the data of the entry ET0 is output to the bus 57.

【0034】また、制御部3は、リクエスト信号60が
ハイレベルであり、かつステートマシンM1の状態がS
0であるので、ステートマシンM0の状態をS1にす
る。これにより、制御部3はラッチイネーブル信号11
をハイレベルにする。 (期間2a)CPU4はリクエスト信号60をハイレベ
ルにし、アドレス「b1」をバス51に出力する。
Further, the control section 3 determines that the request signal 60 is at the high level and the state machine M1 is in the S state.
Since it is 0, the state of the state machine M0 is set to S1. As a result, the control unit 3 causes the latch enable signal 11
To high level. (Period 2a) The CPU 4 sets the request signal 60 to the high level and outputs the address "b1" to the bus 51.

【0035】ラッチイネーブル信号11がハイレベルで
あるので、ラッチ5はバス50のアドレス「a0」をラ
ッチし、バス55に出力する。アドレス「a0」に対す
るヒット信号10がローレベルであり、かつステートマ
シンM0の状態がS1であるので、制御部3は制御信号
19を用いてセレクタ22を制御し、バス55のアドレ
ス「a0」をメモリ制御回路90へのリクエストアドレ
スとしてバス54に出力させる。また、同時にメモリ制
御回路90へのリクエスト信号62をハイレベルにす
る。
Since the latch enable signal 11 is at the high level, the latch 5 latches the address "a0" of the bus 50 and outputs it to the bus 55. Since the hit signal 10 for the address "a0" is at the low level and the state machine M0 is in the state S1, the control unit 3 controls the selector 22 by using the control signal 19 to change the address "a0" of the bus 55 to the address "a0". It is output to the bus 54 as a request address to the memory control circuit 90. At the same time, the request signal 62 to the memory control circuit 90 is set to high level.

【0036】制御部3のステートマシンM0の状態がS
1であり、ステートマシンM1の状態がS0であるので
リードライトイネーブル信号13をハイレベルにする。
ラッチ96は、バス57のデータをラッチし、バス48
に出力する。ラッチ97はヒット信号10をラッチし、
信号95に出力する。トライステートバッファ98は信
号95がローレベルであるのでバス70をハイインピー
ダンスにする。すなわち、ミスヒットの動作であるので
バス48のデータは使われない。
The state of the state machine M0 of the control unit 3 is S
Since it is 1, and the state of the state machine M1 is S0, the read / write enable signal 13 is set to the high level.
The latch 96 latches the data on the bus 57 and
Output to. The latch 97 latches the hit signal 10,
The signal 95 is output. The tri-state buffer 98 sets the bus 70 to high impedance because the signal 95 is at low level. That is, since it is a mishit operation, the data on the bus 48 is not used.

【0037】(期間2b)アドレス「b1」がラッチ7
でラッチされ、バス50に出力される。リードライトイ
ネーブル信号13がハイレベルなのでセレクタ20は、
バス50を選択し、バス50のアドレス「b1」のセレ
クタ部をバス52に出力する。タグメモリ1はバス52
のアドレス「b1」のセレクタ部を用いてエントリを選
択し、タグアドレスTA2をバス53に出力する。
(Period 2b) Address "b1" is latched 7
Is latched by and output to the bus 50. Since the read / write enable signal 13 is at high level, the selector 20
The bus 50 is selected, and the selector unit of the address “b1” of the bus 50 is output to the bus 52. Tag memory 1 is bus 52
An entry is selected using the selector unit of the address "b1" of and the tag address TA2 is output to the bus 53.

【0038】比較回路8はバス50のタグ部とバス53
のタグアドレスTA2とを比較し、一致する場合はヒッ
ト信号10をハイレベルとし、不一致の場合はヒット信
号10をローレベルにする。図2では不一致の例を示し
ているのでローレベルになっている。データメモリ2は
バス52のアドレス「b1」のセレクタ部を用いてエン
トリを選択し、エントリET0のデータをバス58に出
力し、エントリET1のデータをバス59に出力する。
The comparator circuit 8 includes a tag portion of the bus 50 and a bus 53.
The tag signal TA2 is compared with the tag address TA2 and the hit signal 10 is set to the high level when they match, and the hit signal 10 is set to the low level when they do not match. FIG. 2 shows an example of non-coincidence, so it is at a low level. The data memory 2 selects an entry using the selector unit of the address “b1” of the bus 52, outputs the data of the entry ET0 to the bus 58, and outputs the data of the entry ET1 to the bus 59.

【0039】セレクタ21はバス50のアドレス「b
1」のオフセット部の最上位ビットを用いてバス58か
バス59を選択し、バス57に出力する。ここではアド
レス「b1」であるのでバス59が選択される。制御部
3ではリクエスト信号60がハイレベルでかつステート
マシンM0の状態がS0ではないので、ステートマシン
M1の状態をS1にする。
The selector 21 selects the address "b" of the bus 50.
The bus 58 or the bus 59 is selected by using the most significant bit of the offset portion of "1" and output to the bus 57. Since the address is "b1" here, the bus 59 is selected. In the control unit 3, since the request signal 60 is at the high level and the state of the state machine M0 is not S0, the state of the state machine M1 is set to S1.

【0040】制御部3のステートマシンM1の状態がS
1になったのでラッチイネーブル信号12がハイレベル
になる。ステートマシンM0の状態がS1であるので、
それをS2にする。ステートマシンM0の状態がS2に
なったのでデータリクエスト信号64をハイレベルにす
る。これにより、メモリ制御回路90はメモリ99から
データ「A0」を読み出す。
The state of the state machine M1 of the control unit 3 is S
Since it becomes 1, the latch enable signal 12 becomes high level. Since the state of the state machine M0 is S1,
Set it to S2. Since the state of the state machine M0 has changed to S2, the data request signal 64 is set to high level. As a result, the memory control circuit 90 reads the data “A0” from the memory 99.

【0041】(期間3a)ラッチイネーブル信号12が
ハイレベルであるのでラッチ6はバス50のアドレス
「b1」をラッチし、バス56に出力する。アドレス
「b1」に対するヒット信号10がローレベルであり、
かつステートマシンM1の状態がS1であるので、制御
部3は制御信号19を用いてセレクタ22を制御し、バ
ス56のアドレス「b1」をメモリ制御回路90へのリ
クエストアドレスとしてバス54に出力する。また、制
御部3はメモリ制御回路90へのリクエスト信号61を
ハイレベルにする。
(Period 3a) Since the latch enable signal 12 is at the high level, the latch 6 latches the address "b1" of the bus 50 and outputs it to the bus 56. The hit signal 10 for the address "b1" is at low level,
Moreover, since the state of the state machine M1 is S1, the control unit 3 controls the selector 22 using the control signal 19 and outputs the address "b1" of the bus 56 to the bus 54 as a request address to the memory control circuit 90. .. Further, the control unit 3 sets the request signal 61 to the memory control circuit 90 to the high level.

【0042】ラッチ96はバス57のデータをラッチ
し、バス48に出力する。ラッチ97はヒット信号10
をラッチし、信号95に出力する。トライステートバッ
ファ98は信号95がローレベルであるのでバス70を
ハイインピーダンスにする。すなわち、ミスヒットの動
作であるのでバス48のデータは使われない。 (期間3b)ステートマシンM1の状態がS1であるの
で、それをS2にする。
The latch 96 latches the data on the bus 57 and outputs it to the bus 48. Latch 97 is hit signal 10
Are latched and output to the signal 95. The tri-state buffer 98 sets the bus 70 to high impedance because the signal 95 is at low level. That is, since it is a mishit operation, the data on the bus 48 is not used. (Period 3b) Since the state of the state machine M1 is S1, it is set to S2.

【0043】(期間4a)ステートマシンM0の状態が
S2であり、かつステートマシンM1の状態がS2であ
るので、制御部3は制御信号19を用いてセレクタ22
を制御し、バス55のアドレス「a0」をバス54に出
力する。つまり、キャッシュメモリは、CPU4からの
二つのリクエストアドレス「a0」およびリクエストア
ドレス「b1」に対して、一つ目のデータ「A1」(C
PU4が要求しているデータ)を待っている状態である
ので一つ目のリクエストアドレス「a0」が優先され
る。
(Period 4a) Since the state machine M0 is in the state S2 and the state machine M1 is in the state S2, the control unit 3 uses the control signal 19 to select the selector 22.
And outputs the address “a0” of the bus 55 to the bus 54. That is, the cache memory responds to the two request addresses “a0” and “b1” from the CPU 4 with the first data “A1” (C
Since the PU4 is waiting for the requested data), the first request address "a0" is prioritized.

【0044】(期間4b)ラッチ81はバス54のアド
レス「a0」をラッチし、バス49に出力する。 (期間5a〜6b)メモリ制御回路90からのデータ
「A0」を待っている状態である。 (期間7a)データリクエスト信号64がハイレベルで
あるので、メモリ制御回路90はアドレス「a0」に対
応したデータ「A0」をバス70に出力し、アクノレッ
ジ信号63をハイレベルにする。
(Period 4b) The latch 81 latches the address "a0" of the bus 54 and outputs it to the bus 49. (Periods 5a to 6b) The state is waiting for the data "A0" from the memory control circuit 90. (Period 7a) Since the data request signal 64 is at the high level, the memory control circuit 90 outputs the data "A0" corresponding to the address "a0" to the bus 70 and sets the acknowledge signal 63 to the high level.

【0045】データ「A0」は、CPU4が要求してい
るデータであるので、CPU4に対してアクノレッジ信
号61をハイレベルにする。CPU4はバス70のデー
タ「A0」を受けとることができる。ラッチ80はバス
70のデータ「A0」をラッチし、バス71に出力す
る。 (期間7b)ステートマシンM0の状態がS2であり、
アクノレッジ信号63がハイレベルであるのでリードラ
イトイネーブル信号13をローレベルにする。
Since the data "A0" is the data requested by the CPU 4, the acknowledge signal 61 for the CPU 4 is set to the high level. The CPU 4 can receive the data “A0” on the bus 70. The latch 80 latches the data “A0” on the bus 70 and outputs it to the bus 71. (Period 7b) The state of the state machine M0 is S2,
Since the acknowledge signal 63 is at high level, the read / write enable signal 13 is set at low level.

【0046】リードライトイネーブル信号13がローレ
ベルになると、セレクタ20は、バス49のアドレス
「a0」のセレクタ部をバス52に出力する。タグメモ
リ1は、バス52のセレクタ部を用いてエントリを一つ
選択する。リードライトイネーブル信号13がローレベ
ルであるので、タグメモリ1はバス49のアドレス「a
0」のタグ部を選択されたエントリに書き込む。
When the read / write enable signal 13 becomes low level, the selector 20 outputs the selector portion of the address “a0” of the bus 49 to the bus 52. The tag memory 1 selects one entry using the selector unit of the bus 52. Since the read / write enable signal 13 is at the low level, the tag memory 1 is in the address "a" of the bus 49.
Write the tag portion of "0" to the selected entry.

【0047】セレクタ93は、制御信号94によって制
御されバス49のアドレス「a0」のオフセット部の最
上位ビットを信号92に出力する。データメモリ2は、
バス52のセレクタ部を用いてエントリを一つ選択す
る。リードライトイネーブル信号13がローレベルであ
るので、データメモリ2はバス71のデータ「A0」を
選択されたエントリに書き込む。その際、信号92を用
いてエントリET0またはエントリET1に書き込む。
ここではエントリET0に書き込む。
The selector 93 outputs the most significant bit of the offset portion of the address “a0” of the bus 49, which is controlled by the control signal 94, to the signal 92. The data memory 2 is
One of the entries is selected using the selector section of the bus 52. Since the read / write enable signal 13 is at the low level, the data memory 2 writes the data “A0” on the bus 71 to the selected entry. At this time, the signal 92 is used to write to the entry ET0 or the entry ET1.
Here, the entry ET0 is written.

【0048】制御部3のステートマシンM0の状態をS
2からS3にする。制御部3のステートマシンM0の状
態がS3であり、かつステートマシンM1の状態がS2
であるのでデータリクエスト信号64をローレベルに
し、データリクエスト信号65をハイレベルにする。こ
れにより、メモリ制御回路90はメモリ99からデータ
「B1」を読み出す。
The state of the state machine M0 of the control unit 3 is changed to S
Change from 2 to S3. The state of the state machine M0 of the control unit 3 is S3, and the state of the state machine M1 is S2.
Therefore, the data request signal 64 is set to low level and the data request signal 65 is set to high level. As a result, the memory control circuit 90 reads the data “B1” from the memory 99.

【0049】(期間8a)制御部3のステートマシンM
0の状態がS3であり、かつステートマシンM1の状態
がS2であるので、制御部3は制御信号19を用いてセ
レクタ22を制御し、バス56のアドレス「b1」をバ
ス54に出力する。つまり、キャッシュメモリは、CP
U4からの一つ目のリクエストアドレス「a0」に対す
る二つ目のデータ「A1」(CPU4の不要なデータ)
および二つ目のリクエストアドレス「b1」に対する一
つ目のデータ「B1」(CPU4の要求しているデー
タ)を待っているが、二つ目のリクエストアドレス「b
1」が優先される。
(Period 8a) State machine M of control unit 3
Since the state of 0 is S3 and the state of the state machine M1 is S2, the control unit 3 controls the selector 22 using the control signal 19 and outputs the address "b1" of the bus 56 to the bus 54. In other words, the cache memory is CP
The second data "A1" for the first request address "a0" from U4 (data unnecessary for CPU4)
And waiting for the first data "B1" (data requested by the CPU 4) for the second request address "b1", but the second request address "b"
1 ”has priority.

【0050】(期間8b)ラッチ81はバス54のアド
レス「b1」をラッチし、バス49に出力する。アクノ
レッジ信号63がローレベルであるのでリードライトイ
ネーブル信号13をハイレベルにする。 (期間9a〜11b)メモリ制御回路90からのデータ
「B1」を待っている状態である。
(Period 8b) The latch 81 latches the address "b1" of the bus 54 and outputs it to the bus 49. Since the acknowledge signal 63 is at low level, the read / write enable signal 13 is set at high level. (Periods 9a to 11b) The state is waiting for the data "B1" from the memory control circuit 90.

【0051】(期間12a)データリクエスト信号65
がハイレベルであるので、メモリ制御回路90は二つ目
のリクエストアドレス「b1」に対するデータ「B1」
をバス70に出力し、アクノレッジ信号63をハイレベ
ルにする。データ「B1」はCPU4が要求しているデ
ータであるので、制御部3は、CPU4に対してアクノ
レッジ信号61をハイレベルにする。CPU4はバス7
0のデータ「B1」を受けとり、次の処理を開始するこ
とができる。
(Period 12a) Data request signal 65
Is high level, the memory control circuit 90 causes the data "B1" for the second request address "b1".
Is output to the bus 70, and the acknowledge signal 63 is set to the high level. Since the data “B1” is the data requested by the CPU 4, the control unit 3 sets the acknowledge signal 61 to the high level for the CPU 4. CPU4 is bus 7
When the data "B1" of 0 is received, the next process can be started.

【0052】ラッチ80はバス70のデータ「B1」を
ラッチし、バス71に出力する。 (期間12b)制御部3のステートマシンM1の状態が
S2であり、アクノレッジ信号63がハイレベルである
のでリードライトイネーブル信号13をローレベルにす
る。リードライトイネーブル信号13がローレベルにな
ると、セレクタ20はバス49のアドレス「b1」のセ
レクタ部をバス52に出力する。
The latch 80 latches the data “B1” on the bus 70 and outputs it to the bus 71. (Period 12b) Since the state of the state machine M1 of the control unit 3 is S2 and the acknowledge signal 63 is at high level, the read / write enable signal 13 is set at low level. When the read / write enable signal 13 becomes low level, the selector 20 outputs the selector unit of the address “b1” of the bus 49 to the bus 52.

【0053】タグメモリ1はバス52のアドレス「b
1」のセレクタ部を用いてエントリを一つ選択する。リ
ードライトイネーブル13がローレベルであるので、タ
グメモリ1はバス49のアドレス「b1」のタグ部を選
択されたエントリに書き込む。セレクタ93は制御信号
94によって制御され、バス49のアドレス「b1」の
オフセット部の最上位ビットを信号92に出力する。
The tag memory 1 has the address "b" of the bus 52.
Select one entry using the selector unit of "1". Since the read / write enable 13 is at the low level, the tag memory 1 writes the tag portion of the address “b1” on the bus 49 into the selected entry. The selector 93 is controlled by the control signal 94 and outputs the most significant bit of the offset portion of the address “b1” of the bus 49 to the signal 92.

【0054】データメモリ2は、バス52のアドレス
「b1」のセレクタ部を用いてエントリを一つ選択す
る。リードライトイネーブル信号13がローレベルであ
るので、データメモリ2はバス71のデータ「B1」を
選択されたエントリに書き込む。その際、信号92を用
いてエントリET0またはエントリET1に書き込む。
ここではエントリET1に書き込む。
The data memory 2 selects one entry by using the selector unit of the address "b1" of the bus 52. Since the read / write enable signal 13 is at low level, the data memory 2 writes the data “B1” on the bus 71 to the selected entry. At this time, the signal 92 is used to write to the entry ET0 or the entry ET1.
Here, the entry ET1 is written.

【0055】制御部3のステートマシンM1の状態をS
2からS3にする。制御部3のステートマシンM0の状
態がS3であり、かつステートマシンM1の状態がS3
であるのでデータリクエスト信号64をハイレベルに
し、データリクエスト信号65をローレベルにする。こ
れにより、メモリ制御回路90はデータ「A1」を読み
出す。
The state of the state machine M1 of the control unit 3 is changed to S
Change from 2 to S3. The state of the state machine M0 of the control unit 3 is S3, and the state of the state machine M1 is S3.
Therefore, the data request signal 64 is set to the high level and the data request signal 65 is set to the low level. As a result, the memory control circuit 90 reads the data “A1”.

【0056】(期間13a)ステートマシンM0の状態
がS3であり、かつステートマシンM1の状態がS3で
あるので、制御部3は制御信号19を用いてセレクタ2
2を制御し、バス55のアドレス「a1」をバス54に
出力する。 (期間13b)ラッチ81はバス54のアドレス「a
1」をラッチし、バス49に出力する。
(Period 13a) Since the state of the state machine M0 is S3 and the state of the state machine M1 is S3, the control unit 3 uses the control signal 19 to select the selector 2
2 is controlled and the address “a1” of the bus 55 is output to the bus 54. (Period 13b) Latch 81 uses address "a" of bus 54
1 ”is latched and output to the bus 49.

【0057】(期間14a〜14b)メモリ制御回路9
0からのデータ「A1」を待っている状態である。 (期間15a)データリクエスト信号64がハイレベル
であるので、メモリ制御回路90はデータ「A1」をバ
ス70に出力し、アクノレッジ信号63をハイレベルに
する。
(Period 14a-14b) Memory control circuit 9
It is in a state of waiting for data "A1" from 0. (Period 15a) Since the data request signal 64 is at the high level, the memory control circuit 90 outputs the data “A1” to the bus 70 and sets the acknowledge signal 63 to the high level.

【0058】ラッチ80はバス70のデータ「A1」を
ラッチし、バス71に出力する。 (期間15b)ステートマシンM0の状態がS3であ
り、アクノレッジ信号63がハイレベルであるのでリー
ドライトイネーブル信号13をローレベルにする。リー
ドライトイネーブル信号13がローレベルになると、セ
レクタ20はバス49のアドレス「a1」のセレクタ部
をバス52に出力する。
The latch 80 latches the data “A1” on the bus 70 and outputs it to the bus 71. (Period 15b) Since the state of the state machine M0 is S3 and the acknowledge signal 63 is at high level, the read / write enable signal 13 is set at low level. When the read / write enable signal 13 becomes low level, the selector 20 outputs the selector unit of the address “a1” of the bus 49 to the bus 52.

【0059】タグメモリ1は、バス52のアドレス「a
1」のセレクタ部を用いてエントリを一つ選択する。リ
ードライトイネーブル信号13がローレベルであるの
で、タグメモリ1はバス49のアドレス「a1」のタグ
部を選択されたエントリに書き込む。セレクタ93は、
制御信号94によって制御され、バス49のアドレス
「a1」のオフセット部の最上位ビットの反転信号を信
号92に出力する。
The tag memory 1 has the address "a" of the bus 52.
Select one entry using the selector unit of "1". Since the read / write enable signal 13 is at the low level, the tag memory 1 writes the tag portion of the address “a1” on the bus 49 into the selected entry. The selector 93 is
Controlled by the control signal 94, the inverted signal of the most significant bit of the offset portion of the address “a1” of the bus 49 is output to the signal 92.

【0060】データメモリ2は、バス52のアドレス
「a1」のセレクタ部を用いてエントリを一つ選択す
る。リードライトイネーブル信号13がローレベルであ
るので、データメモリ2はバス71のデータ「A1」を
選択されたエントリに書き込む。その際、信号92を用
いてエントリET0またはエントリET1に書き込む。
ここではエントリET1に書き込まれる。
The data memory 2 selects one entry using the selector unit of the address "a1" of the bus 52. Since the read / write enable signal 13 is at the low level, the data memory 2 writes the data “A1” on the bus 71 to the selected entry. At this time, the signal 92 is used to write to the entry ET0 or the entry ET1.
Here, it is written in the entry ET1.

【0061】制御部3のステートマシンM0の状態をS
3からS0にする。制御部3のステートマシンM1の状
態がS3であるのでデータリクエスト信号64をローレ
ベルにし、データリクエスト信号65をハイレベルにす
る。これにより、メモリ制御回路90はメモリ99から
データ「B0」を読み出す。 (期間16a)ステートマシンM0の状態がS0でかつ
ステートマシンM1の状態がS3であるので、制御部3
は制御信号19を用いてセレクタ22を制御し、バス5
6のアドレス「b0」をバス54に出力する。
The state of the state machine M0 of the control unit 3 is changed to S
Change from 3 to S0. Since the state of the state machine M1 of the control unit 3 is S3, the data request signal 64 is set to low level and the data request signal 65 is set to high level. As a result, the memory control circuit 90 reads the data “B0” from the memory 99. (Period 16a) Since the state of the state machine M0 is S0 and the state of the state machine M1 is S3, the control unit 3
Controls the selector 22 using the control signal 19 and the bus 5
The address "b0" of 6 is output to the bus 54.

【0062】(期間16b)ラッチ81は、バス54の
アドレス「b0」をラッチし、バス49に出力する。 (期間17a〜17b)メモリ制御回路90からのデー
タ「B0」を待っている状態である。
(Period 16b) The latch 81 latches the address “b0” of the bus 54 and outputs it to the bus 49. (Periods 17a to 17b) The state is waiting for the data "B0" from the memory control circuit 90.

【0063】(期間18a)データリクエスト信号65
がハイレベルであるので、メモリ制御回路90はデータ
「B0」をバス70に出力し、アクノレッジ信号63を
ハイレベルにする。ラッチ80はバス70のデータ「B
0」をラッチし、バス71に出力する。 (期間18b)ステートマシンM1の状態がS3であ
り、アクノレッジ信号63がハイレベルであるのでリー
ドライトイネーブル信号13をローレベルにする。
(Period 18a) Data request signal 65
Is high level, the memory control circuit 90 outputs the data “B0” to the bus 70 and sets the acknowledge signal 63 to high level. The latch 80 is the data “B” of the bus 70.
0 ”is latched and output to the bus 71. (Period 18b) Since the state of the state machine M1 is S3 and the acknowledge signal 63 is at high level, the read / write enable signal 13 is set at low level.

【0064】リードライトイネーブル信号13がローレ
ベルになると、セレクタ20はバス49のアドレス「b
0」のセレクタ部をバス52に出力する。タグメモリ1
は、バス52のアドレス「b0」のセレクタ部を用いて
エントリを一つ選択する。リードライトイネーブル13
がローレベルであるので、タグメモリ1はバス49のア
ドレス「b0」のタグ部を選択されたエントリに書き込
む。
When the read / write enable signal 13 goes low, the selector 20 selects the address "b" of the bus 49.
The selector unit of "0" is output to the bus 52. Tag memory 1
Selects one entry using the selector unit of the address "b0" of the bus 52. Read / write enable 13
Is low level, the tag memory 1 writes the tag portion of the address “b0” of the bus 49 into the selected entry.

【0065】セレクタ93は、制御信号94によって制
御され、バス49のアドレス「b0」のオフセット部の
最上位ビットの反転信号を信号92に出力する。データ
メモリ2は、バス52のアドレス「b0」のセレクタ部
を用いてエントリを一つ選択する。リードライトイネー
ブル信号13がローレベルであるので、データメモリ2
は、バス71のデータB0を選択されたエントリに書き
込む。その際、信号92を用いてエントリET0または
エントリET1に書き込む。ここではエントリET0に
書き込む。
The selector 93 is controlled by the control signal 94 and outputs the inverted signal of the most significant bit of the offset portion of the address “b0” of the bus 49 to the signal 92. The data memory 2 selects one entry using the selector unit of the address “b0” of the bus 52. Since the read / write enable signal 13 is at the low level, the data memory 2
Writes the data B0 on the bus 71 to the selected entry. At this time, the signal 92 is used to write to the entry ET0 or the entry ET1. Here, the entry ET0 is written.

【0066】制御部3のステートマシンM1の状態をS
3からS0にする。以上のように実施例によれば、CP
U4からの一つ目のリクエストアドレス「a0」の判定
結果がキャッシュミスとなった時点から、このキャッシ
ュミスとなったリクエストアドレス「a0」に対応した
データ「A0」をメモリ99から受け取るまでの間に、
判定手段およびデータ転送要求出力手段により、CPU
4から新たな二つ目のリクエストアドレス「b1」を受
け取り、このリクエストアドレス「b1」に対してキャ
ッシュヒットかキャッシュミスかの判定を行うことによ
り、二つ目のリクエストアドレス「b1」に対するキャ
ッシュヒットの判定を見かけ上なくすことができる。し
たがって、CPU4の待ち時間を少なくすることができ
る。
The state of the state machine M1 of the control unit 3 is changed to S
Change from 3 to S0. As described above, according to the embodiment, the CP
From the time when the determination result of the first request address “a0” from U4 is a cache miss until the data “A0” corresponding to the request address “a0” that is the cache miss is received from the memory 99. To
By the determination means and the data transfer request output means, the CPU
By receiving a new second request address "b1" from 4, and determining whether the request address "b1" is a cache hit or a cache miss, a cache hit for the second request address "b1" is made. It is possible to eliminate the judgment of. Therefore, the waiting time of the CPU 4 can be reduced.

【0067】さらに、二つ目のリクエストアドレス「b
1」のキャッシュヒットの判定を行ない、それがキャッ
シュミスの場合は、先ず、一つ目のリクエストアドレス
「a0」に対応したCPU4が要求するデータ「A0」
をCPU4に転送し、次に二つ目のリクエストアドレス
「b1」に対応したCPU4が要求するデータ「B1」
をCPU4に転送した後に、データ「A0」および「B
1」と同じキャッシュラインのデータ、すなわちCPU
4が必要としないデータ「A1」および「B0」をメモ
リ99から転送する。すなわち、CPU4からの一つ目
のリクエストアドレス「a0」に対応したデータ「A
0」と同一キャッシュラインのデータ「A1」よりも、
二つ目のリクエストアドレス「b1」に対応したCPU
4が要求しているデータ「B1」をメモリ99から優先
的に転送させる。これにより、二つ目のキャッシュミス
でCPU4に転送する必要のないデータ「A1」をメモ
リ99からキャッシュメモリに転送する時間だけCPU
4の待ち時間が少なくすることができる。
Further, the second request address "b
If a cache hit of "1" is determined and it is a cache miss, first, the data "A0" requested by the CPU 4 corresponding to the first request address "a0" is requested.
To the CPU 4, and then the data “B1” requested by the CPU 4 corresponding to the second request address “b1”.
Data to the CPU 4 and then the data “A0” and “B
Data of the same cache line as 1 ", that is, CPU
The data "A1" and "B0" which are not required by the No. 4 are transferred from the memory 99. That is, the data “A” corresponding to the first request address “a0” from the CPU 4
0 ”and the same cache line data“ A1 ”,
CPU corresponding to the second request address "b1"
4 preferentially transfers the data “B1” requested by No. 4 from the memory 99. As a result, the data "A1" that does not need to be transferred to the CPU 4 due to the second cache miss is transferred from the memory 99 to the cache memory for the CPU time.
The waiting time of 4 can be reduced.

【0068】なお、実施例では、CPU4は、1クロッ
クに一回のリクエストを行っているが、スーパースカラ
方式などの並列処理のように1クロックに複数のリクエ
ストを出してもよい。また、キャッシュメモリはダイレ
クトマップ方式だけでなくセットアソシエイティブ方式
でも同様の効果が得られる。さらに、キャッシュメモリ
のキャッシュラインは二回のバス転送でなくてもよく、
その回数が多くなると効果が上がる。その場合は、メモ
リ制御回路90内にキャッシュラインの全てのデータを
格納するだけのリードバッファを持たせておく方が良
い。
In the embodiment, the CPU 4 makes a request once in one clock, but it may make a plurality of requests in one clock as in parallel processing such as the superscalar method. Further, the cache memory can obtain the same effect not only by the direct map method but also by the set associative method. Furthermore, the cache memory cache line does not have to be two bus transfers,
The effect increases as the number of times increases. In that case, it is better to provide the memory control circuit 90 with a read buffer for storing all the data of the cache line.

【0069】また、CPU4は複数のメモリ階層におけ
る前段のメモリであってもよく、メモリ制御回路90は
次段のメモリ階層であってもよい。また、実施例ではキ
ャッシュメモリがCPU4の二つのリクエストを受け付
ける例を示しているが三つ以上であってもよく、さらに
複数のCPU4のリクエスト中にキャッシュヒットがあ
ってもよい。
Further, the CPU 4 may be a memory at the preceding stage in the plurality of memory hierarchies, and the memory control circuit 90 may be the memory stage at the next stage. Further, in the embodiment, the cache memory accepts two requests from the CPU 4, but the number may be three or more, and a cache hit may occur in the requests from a plurality of CPUs 4.

【0070】また、この実施例は請求項2に対応した実
施例を示しているが、請求項1のみに対応したものであ
っても高速化の効果を出すことができる。
Further, although this embodiment shows an embodiment corresponding to claim 2, even if it corresponds only to claim 1, the effect of speeding up can be obtained.

【0071】[0071]

【発明の効果】請求項1記載のキャッシュメモリによれ
ば、判定手段による一つ目のデータ転送要求の判定結果
がキャッシュミスとなった時点から、このキャッシュミ
スとなった一つ目のデータ転送要求に対応したデータを
次段のメモリ階層から受け取るまでの間に、判定手段お
よびデータ転送要求出力手段により、前段のメモリ階層
から新たな二つ目のデータ転送要求を受け取り、この二
つ目のデータ転送要求に対してキャッシュヒットかキャ
ッシュミスかの判定を行うことによって、二つ目のデー
タ転送要求に対する前記判定を見かけ上なくすことがで
きる。
According to the cache memory of the first aspect, from the time when the determination result of the first data transfer request by the determination means is a cache miss, the first data transfer that has this cache miss. Until the data corresponding to the request is received from the memory hierarchy of the next stage, the determining means and the data transfer request output means receive a new second data transfer request from the memory hierarchy of the previous stage, and the second data transfer request is received. By determining whether the data transfer request is a cache hit or a cache miss, it is possible to apparently eliminate the above determination for the second data transfer request.

【0072】その結果、前段のメモリ階層のアクセス待
ち時間を少なくすることのできるキャッシュメモリを得
ることができる。さらに、請求項2記載のキャッシュメ
モリによれば、請求項1記載のキャッシュメモリにおい
て、データ転送手段により次段のメモリ階層から前段の
メモリ階層にデータ転送を行う場合に、前段のメモリ階
層に転送する必要はないが記憶する必要のある1つ目の
データ転送要求に対応したデータと同じキャッシュライ
ンのデータよりも、前段のメモリ階層から出力された新
たな二つ目のデータ転送要求に対応したデータを優先し
て転送することにより、前段のメモリ階層が要求してい
るデータを優先的に次段のメモリ階層から前段のメモリ
階層に転送することができる。これにより、前段のメモ
リ階層のアクセス待ち時間を少なくすることができる。
As a result, it is possible to obtain a cache memory in which the access waiting time of the preceding memory hierarchy can be shortened. Further, according to the cache memory of the second aspect, in the cache memory of the first aspect, when data is transferred from the memory hierarchy of the next stage to the memory hierarchy of the previous stage by the data transfer means, the data is transferred to the memory hierarchy of the previous stage. It corresponds to the new second data transfer request output from the previous memory hierarchy rather than the data of the same cache line as the data corresponding to the first data transfer request that does not need to be stored. By preferentially transferring data, it is possible to preferentially transfer the data requested by the previous memory hierarchy from the next memory hierarchy to the previous memory hierarchy. As a result, it is possible to reduce the access waiting time of the previous memory hierarchy.

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

【図1】この発明の一実施例のキャッシュメモリの構成
を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a cache memory according to an embodiment of the present invention.

【図2】同キャッシュメモリの動作を説明するための波
形図である。
FIG. 2 is a waveform diagram for explaining the operation of the cache memory.

【図3】従来のキャッシュメモリの構成を示すブロック
図である。
FIG. 3 is a block diagram showing a configuration of a conventional cache memory.

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

1 タグメモリ 2 データメモリ 3 制御部 4 CPU(前段のメモリ階層) 99 メモリ(次段のメモリ階層) 8 比較回路 200 保持部 1 Tag Memory 2 Data Memory 3 Control Unit 4 CPU (Previous Memory Hierarchy) 99 Memory (Next Memory Hierarchy) 8 Comparison Circuit 200 Holding Unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 前段のメモリ階層および次段のメモリ階
層間に介挿されたキャッシュメモリであって、 前記前段のメモリ階層から出力されたデータ転送要求に
対してキャッシュヒットかキャッシュミスかの判定を行
う判定手段と、 前記データ転送要求を保持し、前記判定結果がキャッシ
ュミスの場合に、このキャッシュミスとなったデータ転
送要求を前記次段のメモリ階層に出力するデータ転送要
求出力手段と、 前記次段のメモリ階層から前記キャッシュミスとなった
データ転送要求に対応したデータを受け取り、このデー
タを前記前段のメモリ階層に転送するとともに記憶する
データ転送手段とを備え、 前記判定手段による前記データ転送要求の判定結果がキ
ャッシュミスとなった時点から、このキャッシュミスと
なったデータ転送要求に対応したデータを前記次段のメ
モリ階層から受け取るまでの間に、前記前段のメモリ階
層から新たなデータ転送要求を受け取りこの新たなデー
タ転送要求に対して前記判定手段および前記データ転送
要求出力手段を実行するようにしたキャッシュメモリ。
1. A cache memory interposed between a memory hierarchy of a previous stage and a memory hierarchy of a next stage, wherein a cache hit or a cache miss is determined for a data transfer request output from the memory hierarchy of the preceding stage. And a data transfer request output unit that holds the data transfer request and outputs the data transfer request resulting in the cache miss to the memory hierarchy of the next stage when the determination result is a cache miss, A data transfer unit that receives data corresponding to the data transfer request resulting in the cache miss from the memory layer of the next stage, transfers the data to the memory layer of the previous stage, and stores the data, From the time when the transfer request judgment result is a cache miss, the data transfer request that resulted in this cache miss During the period until the corresponding data is received from the memory hierarchy of the next stage, a new data transfer request is received from the memory hierarchy of the previous stage, and the determination means and the data transfer request output means are operated in response to the new data transfer request. Cache memory that you want to run.
【請求項2】 データ転送手段により次段のメモリ階層
から前段のメモリ階層にデータ転送を行う場合に、前記
前段のメモリ階層に転送する必要はないが記憶する必要
のあるデータ転送要求に対応したデータと同じキャッシ
ュラインのデータよりも、前記前段のメモリ階層から出
力された新たなデータ転送要求に対応したデータを優先
して転送するようにした請求項1記載のキャッシュメモ
リ。
2. When the data transfer means transfers data from the memory hierarchy of the next stage to the memory hierarchy of the previous stage, the data transfer request which does not need to be transferred to the memory hierarchy of the previous stage but needs to be stored is dealt with. 2. The cache memory according to claim 1, wherein the data corresponding to the new data transfer request output from the preceding memory hierarchy is preferentially transferred over the data on the same cache line as the data.
JP4042872A 1992-02-28 1992-02-28 Cache memory Pending JPH05241953A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4042872A JPH05241953A (en) 1992-02-28 1992-02-28 Cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4042872A JPH05241953A (en) 1992-02-28 1992-02-28 Cache memory

Publications (1)

Publication Number Publication Date
JPH05241953A true JPH05241953A (en) 1993-09-21

Family

ID=12648131

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4042872A Pending JPH05241953A (en) 1992-02-28 1992-02-28 Cache memory

Country Status (1)

Country Link
JP (1) JPH05241953A (en)

Similar Documents

Publication Publication Date Title
US5283886A (en) Multiprocessor cache system having three states for generating invalidating signals upon write accesses
JPS6118222B2 (en)
US5724548A (en) System including processor and cache memory and method of controlling the cache memory
JPH05241953A (en) Cache memory
JPH02110646A (en) Pre-readout device for memory
JPH09185547A (en) Method and device for controlling multiprocessor
JPH06103477B2 (en) Parallel cache memory
EP0502206A1 (en) System equipped with processor and cache memory, and method of controlling said cache memory
JPH02156352A (en) Cache memory
JPH0573415A (en) Hierarchized cache system
JPH01226056A (en) Address converter
JPH05225147A (en) Multiprocessor type data processing system
JP2542284B2 (en) Buffer storage device and buffer storage device system
JPH06124235A (en) Cache control system
JPH04239944A (en) Cache lock system
JPH0877072A (en) Cache memory device
JPH04291642A (en) Cache control system
JP2000066946A (en) Memory controller
JPS6266350A (en) Cache memory
JPH06149673A (en) Cache control system
JPH11328013A (en) Memory controller
JPH1055308A (en) Cache memory
JPH06243045A (en) Cache memory
JPH01102662A (en) Memory device
JPH06149674A (en) Information processor having shared cache memory and its block replacement controlling method