JP3262182B2 - Cache memory system and microprocessor device - Google Patents

Cache memory system and microprocessor device

Info

Publication number
JP3262182B2
JP3262182B2 JP15746792A JP15746792A JP3262182B2 JP 3262182 B2 JP3262182 B2 JP 3262182B2 JP 15746792 A JP15746792 A JP 15746792A JP 15746792 A JP15746792 A JP 15746792A JP 3262182 B2 JP3262182 B2 JP 3262182B2
Authority
JP
Japan
Prior art keywords
cache memory
memory
address
tag
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP15746792A
Other languages
Japanese (ja)
Other versions
JPH05324473A (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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP15746792A priority Critical patent/JP3262182B2/en
Publication of JPH05324473A publication Critical patent/JPH05324473A/en
Application granted granted Critical
Publication of JP3262182B2 publication Critical patent/JP3262182B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

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 system, and more particularly to a cache memory system in which a plurality of direct-mapped cache memories are hierarchically connected and a microprocessor device.

【0002】[0002]

【従来の技術】近年の半導体装置の進歩をみると、マイ
クロプロセッサのクロック周波数が年々向上するのに対
し、メインメモリとなるDRAMやROMのアクセス時
間はそれほど短くならない。このスピードギャップを埋
めるために、高速・小容量のメモリで構成するキャッシ
ュメモリ装置をプロセッサとメインメモリの間に設ける
方策が、よく採用されている。
2. Description of the Related Art Recent advances in semiconductor devices show that the clock frequency of a microprocessor is improving year by year, but the access time of a DRAM or ROM as a main memory is not so short. In order to fill the speed gap, a method of providing a cache memory device composed of a high-speed and small-capacity memory between the processor and the main memory is often adopted.

【0003】キャッシュメモリの基本方式は後述の参考
1で詳しく説明されている。メインメモリをあらかじめ
一定の容量(普通16Byte程度)にブロック分け
し、これらの一部のブロックをキャッシュメモリに格納
する。キャッシュメモリ内のブロックをエントリと呼
ぶ。
The basic method of the cache memory is described in detail in Reference 1 described later. The main memory is divided into blocks of a predetermined capacity (usually about 16 bytes), and some of these blocks are stored in the cache memory. A block in the cache memory is called an entry.

【0004】キャッシュメモリの各エントリは、3つの
部分から構成される。(1)データを格納するデータ
部、(2)どのアドレスにあるブロックが書込まれてい
るかを示す情報(タグと呼ぶ)を格納するタグ部、
(3)そのエントリに有効なデータが格納されているか
否かを示すステータスフラグ、である。方式によっては
ステータスに別の意味を持たせることもある。
Each entry in the cache memory is composed of three parts. (1) a data section for storing data; (2) a tag section for storing information (called a tag) indicating at which address a block is written;
(3) A status flag indicating whether or not valid data is stored in the entry. Depending on the method, the status may have a different meaning.

【0005】キャッシュメモリの構成には、ダイレクト
マップ方式、セット・アソシアティブ方式、フル・アソ
シアティブ方式の3通りがある。
There are three types of cache memory configurations: a direct map system, a set associative system, and a full associative system.

【0006】ダイレクトマップ方式 RAMで構成するタグ部,ステータスフラグ,データ部
を1組づつ持つ。アドレスの下位ビット(インデクス)
をアドレスにしてRAM(タグ部とデータ部)をアクセ
スする。タグ部からの出力とアドレスの上位ビット(タ
グ)が等しく、ステータスフラグの内容が「有効」であ
れば、そのエントリのデータ部は有効(ヒット)であ
る。
[0006] The direct map system has one set of a tag section, a status flag, and a data section each constituted by a RAM. Lower bits of the address (index)
Is used as an address to access the RAM (tag section and data section). If the output from the tag section is equal to the upper bit (tag) of the address and the content of the status flag is "valid", the data section of that entry is valid (hit).

【0007】セット・アソシアティブ方式 ダイレクトマップ方式のRAMをN組(普通2または4
組)持ち、並列にアクセスする。ヒットした組がひとつ
でもあれば、ヒットした組のデータ部の出力が選択され
る。
[0007] Set associative method Direct map type RAM is set to N sets (usually 2 or 4).
Pairs) and have access in parallel. If there is at least one hit set, the output of the data part of the hit set is selected.

【0008】フル・アソシアティブ方式 各エントリのタグ部に比較器を持ち、アドレスとタグ部
の内容を直接比較する。普通、CAM(Content
Addressable Ram)で構成する。
Full associative system Each entry has a comparator in the tag section, and directly compares the address and the contents of the tag section. Normally, CAM (Content
Addressable Ram).

【0009】上記3方式のヒット率(ヒット回数/アク
セス回数)は、<<の順で高い。しかし、キャッ
シュメモリのアクセス時間も、<<の順で長くな
る。LSI化したときの面積は、<<の順で大き
くなる。特に、方式は、面積の増加が大きく、ヒット
しなかったとき(ミスしたとき)の処理が複雑など、欠
点が多い。
The hit ratios (the number of hits / the number of accesses) of the above three methods are higher in the order of <<. However, the access time of the cache memory also increases in the order of <<. The area of the LSI becomes larger in the order of <<. In particular, the system has many drawbacks, such as a large increase in area and complicated processing when no hit is made (when a miss is made).

【0010】最近のRISC(Reduced Ins
truction Set Computer)CPU
では、キャッシュメモリのアクセス時間がクロック周波
数に直接影響するため、(ダイレクトマップ方式)を
採用するものが多い。
[0010] Recent RISC (Reduced Ins)
fraction set computer) CPU
In this case, since the access time of the cache memory directly affects the clock frequency, the (direct map method) is often used.

【0011】方式のミス率(1−ヒット率)の違い
を図8(参考文献1の図8,12のデータに基づく)に
示す。上記方式またはでは、異なるアドレスが同一
のエントリを使うよう強制されるためのミス(コンフリ
クト・ミスと呼ぶ)が発生するため、方式よりもミス
率が増加する。
FIG. 8 (based on the data of FIGS. 8 and 12 of Reference 1) shows the difference in the miss rate (1-hit rate) of the system. In the above method or the above, a miss (referred to as a conflict miss) occurs because different addresses are forced to use the same entry, so that the miss rate is higher than the method.

【0012】もうひとつ図8から読取れるのは、キャッ
シュメモリの容量が大きくなるにしたがってコスト/パ
フォーマンスが低下していることである。キャッシュ容
量が2倍になるにしたがって、ミス率は一定の割合で減
少(0.7〜0.8倍)している。一方、キャッシュメ
モリをLSI化したときの面積は、容量にほぼ比例して
いる。
Another thing that can be read from FIG. 8 is that the cost / performance decreases as the capacity of the cache memory increases. As the cache capacity doubles, the miss rate decreases at a constant rate (0.7 to 0.8 times). On the other hand, the area when the cache memory is formed into an LSI is almost proportional to the capacity.

【0013】そのため、キャッシュメモリとCPUを1
チップLSI化するには、省面積でかつミス率の低いキ
ャッシュメモリ方式が望まれている。
Therefore, one cache memory and one CPU are used.
In order to implement a chip LSI, a cache memory system with a small area and a low miss rate is desired.

【0014】もうひとつの従来例を挙げる。ダイレクト
マップ方式(方式:高速だがミス率が高い)のキャッ
シュメモリに、小規模なフルアソシアティブ方式(方式
:低速だがミスが低い)のキャッシュメモリを付加し
た、効率の良いキャッシュメモリ方式が後述の参考文献
2で提案されている。
Another conventional example will be described. An efficient cache memory method that adds a small, fully associative (method: low speed but low miss) cache memory to a direct map (high speed but high miss rate) cache memory is described below. Proposed in reference 2.

【0015】ダイレクトマップ方式キャッシュ(1次キ
ャッシュ)がミスした場合、2次キャッシュとしてフル
アソシアティブ方式キャッシュ(彼等はヴィクティムキ
ャッシュと呼んでいる)をアクセスする。
If the direct mapped cache (primary cache) misses, it accesses a full associative cache (they call it a victim cache) as a secondary cache.

【0016】2次キャッシュがミスした場合はメインメ
モリをアクセスする。どちらのキャッシュメモリもCP
Uと同一のLSIチップに組込まれているので、1次キ
ャッシュと2次キャッシュの間の転送は高速(1クロッ
クサイクル)で行なわれる。
When the secondary cache misses, the main memory is accessed. Both cache memories are CP
Since it is incorporated in the same LSI chip as U, transfer between the primary cache and the secondary cache is performed at high speed (one clock cycle).

【0017】ダイレクトマップ方式キャッシュメモリの
コンフリクト・ミスの大半が2次キャッシュにヒットす
るので、1次キャッシュを2倍の容量にするのと同程度
のミス率低減効果が、4〜8エントリの2次キャッシュ
で得られる。
Since most of the conflict misses of the direct-map cache memory hit the secondary cache, the effect of reducing the miss rate as much as doubling the capacity of the primary cache is 2 to 4 entries. Obtained in the next cache.

【0018】参考文献2では1次キャッシュと2次キャ
ッシュの内容に重複が無いように制御することで、少な
いエントリ数の2次キャッシュで効果を上げている。
In Reference Document 2, by controlling the contents of the primary cache and the secondary cache so that there is no duplication, the effect is improved with the secondary cache having a small number of entries.

【0019】この方式の欠点は、2次キャッシュにフル
アソシアティブ方式を用いていることである。フルアソ
シアティブ方式は、各エントリに比較器を持つため面積
の増加が著しい。また、ミスした場合にどのエントリを
入替えるかを決める制御論理(通常はLRU:Leas
t Recent Used)が複雑であり、テストも
難しい。ただし、速度が遅いという欠点だけは、1次キ
ャッシュがミスしたときだけ使用されるため、あまり問
題ではない。
A disadvantage of this method is that a full associative method is used for the secondary cache. The full associative method has a remarkable increase in area because each entry has a comparator. Also, a control logic for determining which entry is replaced when a mistake is made (usually LRU: Leas)
t Recent Used) is complicated and the test is difficult. However, only the disadvantage of low speed is not a problem because it is used only when the primary cache misses.

【0020】参考文献1:「Computer Arc
htecture: A Quantitative
Approach」 John L. Henness
y & David A. Patterson, 1
990, Morgan Kaufmann Publ
ishers Inc.
Reference 1: "Computer Arc"
htake: A Quantitative
Applach, "John L. Hennesse
y & David A. Patterson, 1
990, Morgan Kaufmann Publ
ishers Inc.

【0021】参考文献2:「Improving Di
rect−Mapped Cache Perform
ance by the Addition of a
Small Fully−Associative
Cache and PrefetchBuffer
s」Norman P. Jouppi, 1990,
IEEEInternational Sympos
ium on ComputerArchtectur
e.
Reference 2: "Improving Di"
Rect-Mapped Cache Perform
ance by the Addition of a
Small Fully-Associative
Cache and PrefetchBuffer
s "Norman P.S. Jooppi, 1990,
IEEE International Sympos
ium on ComputerArchtectur
e.

【0022】[0022]

【発明が解決しようとする課題】上述した従来の3種類
のキャッシュメモリ方式の欠点をまとめる。 ダイレクトマップ方式では、高速であるが、ミス率が
高い。面積も小さい。 セットアソシアティブ方式では、速度,面積ではに
劣り、ミス率ではに劣る。 フルアソシアティブ方式では、ミス率は一番低い。し
かし、速度は遅く、面積が著しく大きい。制御論理も複
雑であり、テストも難しい。
The drawbacks of the above three conventional cache memory systems are summarized below. The direct map method is fast but has a high error rate. The area is also small. The set associative method is inferior in speed and area, and inferior in miss rate. The error rate is the lowest in the fully associative method. However, the speed is slow and the area is significantly large. The control logic is complicated and the test is difficult.

【0023】もうひとつのヴィクティムキャッシュ方式
は、ダイレクトマップ方式の高速性を活かしたまま、
フルアソシアティブ方式の低ミス率を実現する優れた
方式である。ただ、方式の面積,複雑といった欠点は
有しているため、改良の余地がある。
Another victim cache system utilizes the high speed of the direct map system,
This is an excellent system that achieves the low miss rate of the full associative system. However, since the method has drawbacks such as area and complexity, there is room for improvement.

【0024】本発明の目的は、CPUとキャッシュメモ
リを一体にLSI化するときに、占有面積が小さく、か
つ性能の良いキャッシュメモリ方式を提供するととも
に、このキャッシュメモリ方式を使用したマイクロプロ
セッサ装置を提供することにある。
An object of the present invention is to provide a cache memory system which occupies a small area and has a high performance when a CPU and a cache memory are integrated into an LSI, and a microprocessor device using this cache memory system. To provide.

【0025】[0025]

【課題を解決するための手段】前記目的を達成するた
め、本発明に係わるキャッシュメモリ方式は、第1のキ
ャッシュメモリと第2のキャッシュメモリとを有するキ
ャッシュメモリ方式であって、第1のキャッシュメモリ
手段をアクセスするアドレスで指定される該当ブロック
を保持する保持手段を有し、各キャッシュメモリは、デ
ータ用メモリと、タグ用メモリと、比較器と、ヒット発
生回路とを含み、データ用メモリは、ブロック単位にデ
ータを記憶するものであり、タグ用メモリは、前記デー
タ用メモリの各ブロックに記憶したデータがアドレス空
間のどこに位置しているものかを示す情報(タグ)を記
憶したものであり、比較器は、アドレス中のアドレスタ
グと前記タグ用メモリの出力を照合するものであり、ヒ
ット発生回路は、前記比較器の内容に基づいてヒット信
号を発生するものであり、内部からの読み出しアクセス
に対して前記第1のキャッシュメモリ手段をアクセス
し、前記第1のキャッシュメモリ手段でヒット信号が発
生しなければ前記読み出しでアドレス指定される該当ブ
ロックの内容を前記保持手段に保持すると共に前記第2
のキャッシュメモリ手段をアクセスし、前記第2のキャ
ッシュメモリ手段でヒット信号が発生すれば前記第2の
キャッシュメモリ手段の該当ブロックの内容を前記第1
のキャッシュメモリ手段の該当ブロックへ書き込み、前
記保持手段に保持した内容を前記第2のキャッシュメモ
リ手段の該当ブロックへ書き込むことで両該当ブロック
の内容を交換し、前記第2のキャッシュメモリ手段でヒ
ット信号が発生しなければ外部メモリをアクセスするも
のである。
To achieve the above object, according to an aspect of the cache memory system according to the present invention, there is provided a cache memory system having a first cache memory and a second cache memory, the first cache memory
Applicable block specified by address to access means
Has a holding means for holding, each cache memory, a data memory, a tag memory, comprising a comparator, a hit generation circuit, data memory is for storing data in block units , The tag memory stores information (tag) indicating where the data stored in each block of the data memory is located in the address space, and the comparator stores the address tag in the address. And a hit generation circuit for generating a hit signal based on the content of the comparator, and the first cache memory for internal read access. Access means, and if no hit signal is generated in said first cache memory means, the corresponding block addressed by said reading is accessed.
The content of the lock is held in the holding means and the second
And if a hit signal is generated in the second cache memory means, the second cache memory means is accessed .
The contents of the corresponding block of the cache memory means are stored in the first
Write to the corresponding block of the cache memory means of the previous
The contents held in the storage means are stored in the second cache memo.
By writing to the corresponding block of the storage means, both corresponding blocks
Are exchanged, and if no hit signal is generated in the second cache memory means, an external memory is accessed.

【0026】また、前記第1のキャッシュメモリ手段の
ミスによるアクセスにおいて、アドレスの一部の排他的
論理和をとって前記第2のキャッシュメモリ手段のタグ
用メモリとデータ用メモリのアドレスとしたものであ
る。
Also, in an access due to a miss in the first cache memory means, an exclusive OR of a part of the address is taken to be the addresses of the tag memory and the data memory of the second cache memory means. It is.

【0027】また、前記第2のキャッシュメモリ手段の
メモリ容量が前記第1のキャッシュメモリ手段のメモリ
容量以下としたものである。
Further, the memory capacity of the second cache memory means is smaller than the memory capacity of the first cache memory means.

【0028】また、本発明に係るマイクロプロセッサ装
置は、第1のキャッシュメモリ手段のミスによるアクセ
スにおいて、アドレスの一部の排他的論理和をとって第
2のキャッシュメモリ手段のタグ用メモリとデータ用メ
モリのアドレスとしたキャッシュメモリ方式をもつ第1
及び第2のキャッシュメモリ手段と中央処理装置とを同
一のLSIチップに集積し、前記第1のキャッシュメモ
リ手段と前記第2のキャッシュメモリ手段の間の転送を
クロックサイクル毎に行うものである。
Also, in the microprocessor device according to the present invention, when the first cache memory means accesses due to a miss, the exclusive OR of a part of the address is taken and the tag memory of the second cache memory means and the data are read. First with a cache memory system as the address of the storage memory
And the second cache memory means and the central processing unit are integrated on the same LSI chip, and transfer between the first cache memory means and the second cache memory means is performed every clock cycle.

【0029】また、本発明に係るマイクロプロセッサ装
置は、第2のキャッシュメモリ手段が第1のキャッシュ
メモリ手段のメモリ容量以下としたキャッシュメモリ方
式をもつ第1及び第2のキャッシュメモリ手段と中央処
理装置とを同一のLSIチップに集積し、前記第1のキ
ャッシュメモリ手段と前記第2のキャッシュメモリ手段
の間の転送をクロックサイクル毎に行うものである。
Further, the microprocessor device according to the present invention is characterized in that the first and second cache memory means having a cache memory system in which the second cache memory means has a memory capacity smaller than that of the first cache memory means and the central processing unit. The device is integrated on the same LSI chip, and transfer between the first cache memory means and the second cache memory means is performed every clock cycle.

【0030】[0030]

【作用】上述した従来のヴィクティム・キャッシュメモ
リ方式は、ダイレクトマップ方式の1次キャッシュメモ
リと小規模なフルアソシアティブ方式の2次キャッシュ
メモリを用いて、高速かつ低ミス率のキャッシュシステ
ムを構成する。
In the conventional victim cache memory system described above, a high-speed and low miss rate cache system is constructed using a primary cache memory of a direct map system and a small-scale secondary cache memory of a full associative system.

【0031】これに対し、本発明は、ダイレクトマップ
方式の1次キャッシュメモリと小規模なダイレクトマッ
プ方式の2次キャッシュメモリを用いて、高速かつ低ミ
ス率かつ制御が容易なキャッシュシステムを構成すると
いう独創的内容を有する。
On the other hand, the present invention uses a direct-mapped primary cache memory and a small-scale direct-mapped secondary cache memory to configure a cache system that is fast, has a low miss rate, and is easy to control. It has an original content.

【0032】[0032]

【実施例】次に図面を用いて、本発明の実施例を説明す
る。
Next, an embodiment of the present invention will be described with reference to the drawings.

【0033】(実施例1)図1は、本発明の実施例1を
示すブロック図である。
(Embodiment 1) FIG. 1 is a block diagram showing Embodiment 1 of the present invention.

【0034】図1において、100はマイクロプロセッ
サLSI、110はCPU(中央処理装置)、120は
1次キャッシュメモリ、140は2次キャッシュメモ
リ、160はメインメモリ(主記憶装置)である。ここ
に、CPU110、1次キャッシュメモリ120、2次
キャッシュメモリ140を同一のマイクロプロセッサL
SI100に集積し、マイクロプロセッサ装置を構成す
る。
In FIG. 1, 100 is a microprocessor LSI, 110 is a CPU (central processing unit), 120 is a primary cache memory, 140 is a secondary cache memory, and 160 is a main memory (main storage device). Here, the CPU 110, the primary cache memory 120, and the secondary cache memory 140 are connected to the same microprocessor L.
The microprocessor is integrated with the SI 100 to constitute a microprocessor device.

【0035】111はバイト単位のメモリアドレスとア
クセスするデータの大きさを指定可能で、CPU110
が出力するアドレスバス、112はCPU110が入出
力するデータバス、113は1次キャッシュメモリ12
0が出力するバス待合わせ信号、131は1次キャッシ
ュメモリ120が出力するアドレスバスである。
Reference numeral 111 designates a memory address in byte units and the size of data to be accessed.
, An address bus 112, a data bus input / output by the CPU 110, and a primary cache memory 113.
A bus wait signal 0 is output, and 131 is an address bus output from the primary cache memory 120.

【0036】また、132は1次キャッシュメモリ12
0が入出力するデータバス、136はメインメモリ16
0のデータを1次キャッシュメモリ120に伝えるバイ
パス、133は2次キャッシュメモリ140が出力する
バス待合わせ信号、151は2次キャッシュメモリ14
0が出力するアドレスバス、152は2次キャッシュメ
モリ140が入出力するデータバス、153はメインメ
モリ160が出力するバス待合わせ信号である。
Reference numeral 132 denotes the primary cache memory 12
0 is a data bus for input / output, and 136 is a main memory 16
0 is a bypass for transmitting data of 0 to the primary cache memory 120, 133 is a bus waiting signal output from the secondary cache memory 140, 151 is the secondary cache memory 14
0 is an address bus output, 152 is a data bus input / output by the secondary cache memory 140, and 153 is a bus waiting signal output by the main memory 160.

【0037】121,141はアドレス111,131
の下位ビット(インデクス)をアドレスとしてアドレス
111,131の上位ビット(タグ)を格納する2i
×tビットのタグ用メモリ、122,142はアドレス
111,131の下位ビット(インデクス)をアドレス
として各エントリが有効かどうかを示す2i 語×2ビッ
トのステータスフラグ用メモリである。
The addresses 121 and 141 are addresses 111 and 131.
Lower bits (index) 2 i words × t bits of the tag memory for storing the high-order bits of the address 111, 131 (tag) as the address, 122 and 142 as an address the lower bits of the address 111, 131 (index) of This is a status flag memory of 2 i words × 2 bits indicating whether each entry is valid.

【0038】123,143はアドレス111,131
の下位ビット(インデクスとオフセット)をアドレスと
してデータバス112,132またはデータバス13
2,152の値を読み書きする2(1+b-2) 語×32ビッ
トのデータ用メモリ、124,144はアドレス11
1,131の上位ビット(タグ)とタグ用メモリ12
1,141の出力が一致しているか検出する比較器であ
る。
123 and 143 are addresses 111 and 131
Data buses 112 and 132 or data bus 13 using lower bits (index and offset) of
2, (1 + b-2) words × 32-bit data memory for reading and writing the value of 2,152, and 124 and 144 are addresses 11
1,131 upper bits (tags) and tag memory 12
This is a comparator for detecting whether or not the outputs 1 and 141 match.

【0039】125,145は比較器124,144、
ステータスフラグ用メモリ122,142の出力とアド
レス111,131からキャッシュメモリ120,14
0を制御する制御回路である。
125 and 145 are comparators 124 and 144,
From the outputs of the status flag memories 122 and 142 and the addresses 111 and 131, the cache memories 120 and 14 are read.
0 is a control circuit.

【0040】126,146はキャッシュメモリ12
0,140がミスしたときにメモリアドレスを生成する
アドレスバッファ、134はタグ用メモリ121のタグ
情報を一時保持してタグ用メモリ141に伝えるタグバ
ッファである。
Reference numerals 126 and 146 denote the cache memory 12
An address buffer 134 generates a memory address when 0 and 140 are missed. A tag buffer 134 temporarily holds the tag information of the tag memory 121 and transmits the tag information to the tag memory 141.

【0041】135はデータ用メモリ123のデータを
一時保持してデータ用メモリ143に伝えるタグバッフ
ァである。
Reference numeral 135 denotes a tag buffer for temporarily storing data in the data memory 123 and transmitting the data to the data memory 143.

【0042】アドレスバス111,131のアドレス値
がどのようにキャッシュメモリ120,140で使われ
るかを図2に示す。ブロックサイズが2b バイトとする
と、ブロック内オフセットはbビット幅、キャッシュの
エントリ数が2i エントリとすると、インデクスはiビ
ット幅、タグはアドレスのビット幅からインデクスとオ
フセットを引いた幅をもつ。
FIG. 2 shows how the address values of the address buses 111 and 131 are used in the cache memories 120 and 140. If the block size is 2 b bytes, the offset in the block is b bits wide, and if the number of cache entries is 2 i entries, the index has an i bit width, and the tag has a width obtained by subtracting the index and offset from the bit width of the address. .

【0043】例えば、32ビットアドレスで、1次キャ
ッシュの容量が8Kバイト、ブロックサイズが16バイ
トの場合、ブロック内オフセットは4ビット(24 =1
6)、エントリ数は512(=8K/16)であるの
で、インデクスは9ビット(29 =512)、タグは1
9ビット(=32−9−4)となる。
For example, if the primary cache capacity is 8 Kbytes and the block size is 16 bytes at a 32-bit address, the offset in the block is 4 bits (2 4 = 1).
6) Since the number of entries is 512 (= 8K / 16), the index is 9 bits (2 9 = 512) and the tag is 1
This is 9 bits (= 32-9-4).

【0044】ブロックサイズbは、1次キャッシュメモ
リ120と2次キャッシュメモリ140で同じ大きさと
する。
The block size b is the same for the primary cache memory 120 and the secondary cache memory 140.

【0045】次に、図1のキャッシュメモリ方式の動作
について、図3,図4を用いて説明する。
Next, the operation of the cache memory system shown in FIG. 1 will be described with reference to FIGS.

【0046】制御回路125によって制御される、1次
キャッシュメモリ120の動作を図3に示す。ステータ
スフラグ122の内容は「無効」に初期化されているも
のとする。
The operation of the primary cache memory 120 controlled by the control circuit 125 is shown in FIG. It is assumed that the content of the status flag 122 has been initialized to "invalid".

【0047】CPU110によるメモリアクセスが発生
すると、アドレス111のインデクスをアドレスとして
メモリ121,122を読み出し(ステップ301)、
タグ用メモリ121の出力とアドレス110のタグを比
較器124で比較する(ステップ302)。比較が等し
く、かつ、ステータスフラグ122が「有効」または
「書込」を示す場合はヒット、それ以外はミスである。
When a memory access by the CPU 110 occurs, the memories 121 and 122 are read using the index of the address 111 as an address (step 301).
The comparator 124 compares the output of the tag memory 121 with the tag of the address 110 (step 302). If the comparisons are equal and the status flag 122 indicates "valid" or "write", it is a hit, otherwise it is a miss.

【0048】ヒットした場合、アドレス111のインデ
クスおよびブロック内オフセットをアドレスとして、デ
ータバス112を介して、データ用メモリ123の内容
を読み書きする(ステップ304,305)。
If a hit occurs, the contents of the data memory 123 are read / written via the data bus 112 using the index of the address 111 and the offset in the block as addresses (steps 304 and 305).

【0049】CPU110からのアクセスが書込みであ
る場合は、データ用メモリ123の内容を、エントリ中
の指定されたアドレスに指定されたサイズ(バイト幅,
ワード幅など)の部分だけ書換え、ステータスフラグに
「書込」を書込む(ステップ305,306)。
When the access from the CPU 110 is a write, the contents of the data memory 123 are stored in the specified size (byte width,
(Word width, etc.), and write "write" into the status flag (steps 305, 306).

【0050】ミスした場合、まず、ステータスフラグ1
22が「書込」か「有効」か「無効」かを判定し(ステ
ップ307)、「書込」ならばインデクスで指定されて
いるエントリを2次キャッシュメモリ140に書込む
(ステップ308)。このとき、タグメモリ122から
読み出した値をアドレスとし、データはデータ用メモリ
123の内容である。ステータスフラグ122が「有
効」ならば該当するエントリのタグとデータをバッファ
134,135に保存する(ステップ309)。
If a mistake is made, first, the status flag 1
It is determined whether 22 is "write", "valid" or "invalid" (step 307). If "write", the entry specified by the index is written to the secondary cache memory 140 (step 308). At this time, the value read from the tag memory 122 is used as an address, and the data is the contents of the data memory 123. If the status flag 122 is "valid", the tag and data of the corresponding entry are stored in the buffers 134 and 135 (step 309).

【0051】CPU110からのアクセスが読み出しの
場合は、次に、外からアドレス111で指定されたエン
トリを読み込む。読み込んだエントリに対して、アドレ
ス111で指定されたサイズ分だけ、データ用メモリ1
23の内容をデータバス112を介してCPU110に
転送する(ステップ311)。同時に、タグ用メモリ1
21にアドレス111のタグを、ステータスフラグ12
2に「有効」を書込む(ステップ312,313)。
When the access from the CPU 110 is a read operation, an entry specified by the address 111 is read from the outside. For the read entry, the data memory 1 has the size specified by the address 111.
23 is transferred to the CPU 110 via the data bus 112 (step 311). At the same time, tag memory 1
21 and the status flag 12
"Valid" is written in 2 (steps 312 and 313).

【0052】CPU110からのアクセスが書込みの場
合は、次にタグ用メモリにアドレス111のタグを書込
む(ステップ314)。同時に、データ用メモリ123
の内容を、エントリ中の指定されたアドレスに指定され
たサイズ(バイト幅,ワード幅など)の部分だけが書換
え、ステータスフラグに「書込」を書込む(ステップ3
05,306)。
If the access from the CPU 110 is write, the tag at the address 111 is written to the tag memory (step 314). At the same time, the data memory 123
Is rewritten only in the portion of the designated size (byte width, word width, etc.) at the designated address in the entry, and "write" is written in the status flag (step 3).
05, 306).

【0053】制御回路145によって制御される、2次
キャッシュメモリ140の動作を図4に示す。動作は、
1次キャッシュメモリ120と似ているが一部異なる。
FIG. 4 shows the operation of the secondary cache memory 140 controlled by the control circuit 145. The operation is
Similar to the primary cache memory 120 but partially different.

【0054】1次キャッシュメモリ120によるメモリ
アクセスが発生すると、アドレス131のインデクスを
アドレスとしてメモリ141,142を読み出し(ステ
ップ401)、タグ用メモリ141の出力とアドレス1
31のタグを比較器144で比較する(ステップ40
2)。比較が等しく、かつ、ステータスフラグ142が
「有効」または「書込」を示す場合はヒット、それ以外
はミスである。
When a memory access by the primary cache memory 120 occurs, the memories 141 and 142 are read using the index of the address 131 as an address (step 401), and the output of the tag memory 141 and the address 1 are read.
The 31 tags are compared by the comparator 144 (step 40).
2). If the comparisons are equal and the status flag 142 indicates "valid" or "write", it is a hit, otherwise it is a miss.

【0055】ヒットした場合、アドレス131のインデ
クスおよびブロック内オフセットをアドレスとして、デ
ータバス132を介して、データ用メモリ143の内容
を読み書きする(ステップ404,408)。1次キャ
ッシュメモリ120からのアクセスが読み出しである場
合は、バッファ134,135に保存してある1次キャ
ッシュメモリの該当エントリの内容をメモリ141,1
43に転送する(ステップ405,406)。
When a hit occurs, the contents of the data memory 143 are read / written via the data bus 132 using the index of the address 131 and the offset in the block as addresses (steps 404 and 408). When the access from the primary cache memory 120 is read, the contents of the corresponding entry of the primary cache memory stored in the buffers 134 and 135 are stored in the memories 141 and 1.
43 (steps 405 and 406).

【0056】それから、ステータスフラグ142に、読
出しアクセスなら1次キャッシュメモリの該当エントリ
のステータス値を、書込アクセスなら「書込」を書込む
(ステップ407,409)。
Then, the status flag 142 is written with the status value of the corresponding entry in the primary cache memory for a read access, and "write" for a write access (steps 407 and 409).

【0057】ミスした場合、まず、ステータスフラグ1
42が「書込」か「有効」か「無効」かを判定し(ステ
ップ407)、「書込」ならばインデクスで指定されて
いるエントリをメインメモリ160に書込む(ステップ
411)。
When a mistake is made, first, the status flag 1
It is determined whether 42 is "write", "valid" or "invalid" (step 407). If "write", the entry specified by the index is written to the main memory 160 (step 411).

【0058】このとき、タグメモリ142から読み出し
た値をアドレスとし、データはデータ用メモリ143の
内容である。外へのアクセスは1エントリ分であり、ブ
ロックサイズがバス幅より大きいときは複数のバスサイ
クルとなる。
At this time, the value read from the tag memory 142 is used as an address, and the data is the contents of the data memory 143. Access to the outside is for one entry, and when the block size is larger than the bus width, a plurality of bus cycles are required.

【0059】1次キャッシュメモリ120からのアクセ
スが読み出しの場合は、次に、メインメモリからアドレ
ス131で指定されたエントリを読み込み、2次キャッ
シュメモリの中を素通り(152,136,132)さ
せて1次キャッシュメモリ120にデータを転送する。
If the access from the primary cache memory 120 is a read, the entry specified by the address 131 is read from the main memory, and is passed through the secondary cache memory (152, 136, 132). The data is transferred to the primary cache memory 120.

【0060】1次キャッシュメモリ120からのアクセ
スが書込みの場合は、次に、タグ用メモリ141にアド
レス131のタグを書込む(ステップ414)。同時
に、データ用メモリ143の内容を、エントリ中の指定
されたアドレスに指定されたサイズ(バイト幅,ワード
幅など)の部分だけが書換え、ステータスフラグに「書
込」を書込む(ステップ408,409)。
If the access from the primary cache memory 120 is a write, then the tag of the address 131 is written into the tag memory 141 (step 414). At the same time, the contents of the data memory 143 are rewritten only in the portion of the specified size (byte width, word width, etc.) at the specified address in the entry, and "write" is written in the status flag (step 408, 409).

【0061】1次キャッシュメモリ120がミスした場
合の処理が終了するまで、制御回路125は信号113
によってCPU110を待たせておく。同様に、2次キ
ャッシュメモリ140へのアクセス(ステップ408,
410)は、制御信号133によって待たされる場合が
ある。
Until the processing when the primary cache memory 120 misses is completed, the control circuit 125 outputs the signal 113
CPU 110 is kept waiting. Similarly, access to the secondary cache memory 140 (step 408,
410) may be delayed by the control signal 133.

【0062】キャッシュメモリ単体の制御方式自体は公
知のものである。
The control method of the cache memory alone is known.

【0063】ここで述べたキャッシュメモリ単体の制御
方式は、一般にはライトバック(コピーバック,ストア
インとも呼ぶ)という方式である。ステータスフラグ1
22,142は、3状態(「無効」,「有効」,「書
込」)を持つ。上位からの書込みアクセスは、直接には
下位に伝えられない。
The control method of the cache memory alone described here is generally a method called write-back (also called copy-back or store-in). Status flag 1
22 and 142 have three states ("invalid", "valid", and "write"). Write accesses from the upper level are not directly transmitted to the lower level.

【0064】上位からの書込みアクセスがあると、直
接、下位のメモリを書込む方式(ライトスルーと呼ぶ)
もある。ステータスフラグ122,142は、2状態
(「無効」,「有効」)しかなく、制御は単純である。
しかし、ライトバック方式よりミス率は高い。
When there is a write access from the upper level, the lower level memory is written directly (called a write-through method).
There is also. The status flags 122 and 142 have only two states ("invalid" and "valid"), and the control is simple.
However, the miss rate is higher than the write-back method.

【0065】マイクロプロセッサに対応するために、ス
テータスフラグの状態を更に増やしたライトバック方式
もある。
There is also a write-back method in which the number of status flags is further increased in order to support a microprocessor.

【0066】通常のライトバック方式と異なるのは、1
次キャッシュメモリと2次キャッシュメモリの間にデー
タの重複がないようにしていることである。
The difference from the normal write-back method is that
This is to prevent data duplication between the secondary cache memory and the secondary cache memory.

【0067】読み出しアクセスにおいて、1次,2次キ
ャッシュメモリ共にミスのときは、メインメモリから1
次キャッシュメモリにデータが転送され、1次キャッシ
ュメモリがミスし2次キャッシュメモリがヒットしたと
きは、1次キャッシュメモリと2次キャッシュメモリの
データを入替える。このように制御することで、1次キ
ャッシュメモリと2次キャッシュメモリに同一アドレス
のデータは重複しない。よって、2次キャッシュメモリ
の効率を上げている。
In a read access, if both the primary and secondary cache memories are missed, the main memory
When data is transferred to the secondary cache memory and the primary cache memory misses and the secondary cache memory hits, the data in the primary cache memory and the secondary cache memory are exchanged. By controlling in this manner, data at the same address does not overlap in the primary cache memory and the secondary cache memory. Therefore, the efficiency of the secondary cache memory is increased.

【0068】本発明の要旨は、キャッシュメモリ単体の
制御方式でなく、階層構造と、1次/2次キャッシュメ
モリを同等のアクセス時間でアクセスできること、1次
と2次のキャッシュメモリ間での転送が高速にできるこ
とである。
The gist of the present invention is that the hierarchical structure and the primary / secondary cache memory can be accessed in the same access time, not the control method of the cache memory alone, and the transfer between the primary and secondary cache memories. Can be done at high speed.

【0069】これらのキャッシュメモリ単体の制御方式
が、キャッシュメモリ120,140にどのような組合
せで実現されていても、本発明の主旨に見合うことは言
うまでもない。
It goes without saying that any combination of these control methods for the cache memories implemented in the cache memories 120 and 140 is in accordance with the gist of the present invention.

【0070】(実施例2)次に本発明の実施例2を説明
する。図5に本発明の実施例2を示す。実施例1(図
1)と異なるのは、2ヵ所ある。ひとつは、2次キャッ
シュメモリ140において、メモリ141,142,1
43のアドレスとなるインデクスを、インデクス生成回
路146を用いて生成していることである。もうひとつ
は、タグ用メモリの幅(tビット)が、実施例1より広
いことである。
(Embodiment 2) Next, Embodiment 2 of the present invention will be described. FIG. 5 shows a second embodiment of the present invention. There are two differences from the first embodiment (FIG. 1). One is that in the secondary cache memory 140, the memories 141, 142, 1
That is, the index serving as the address 43 is generated using the index generation circuit 146. The other is that the width (t bits) of the tag memory is wider than in the first embodiment.

【0071】アドレスバス131のアドレス値がどのよ
うにキャッシュメモリ140で使われるかを図6,図7
に示す。図2と違って、アドレスからブロック内オフセ
ットを抜いた分が、タグとなっている。インデクスは、
タグの一部をインデクス生成回路146によってハッシ
ュして得る。ハッシュ関数としては、図6,図7のよう
に、階層的に排他的論理和をとったものを用いる。
FIGS. 6 and 7 show how the address value of address bus 131 is used in cache memory 140.
Shown in Unlike FIG. 2, the tag is obtained by subtracting the intra-block offset from the address. The index is
A part of the tag is obtained by hashing by the index generation circuit 146. As the hash function, a function obtained by taking an exclusive OR in a hierarchical manner as shown in FIGS. 6 and 7 is used.

【0072】アドレスのハッシュされる部分は、1次キ
ャッシュメモリのインデクスとタグの一部(アドレスの
ビット位置で)を含むようにすると良い。コンフリクト
ミスが解消されミス率が減るためである。
It is preferable that the hashed portion of the address includes the index of the primary cache memory and a part of the tag (at the bit position of the address). This is because conflict errors are eliminated and the error rate is reduced.

【0073】図6の例ではハッシュするビットを下位か
ら詰めて取っているが、図7のようにタグ全体から取っ
てきてもよい。
In the example of FIG. 6, the bits to be hashed are packed from the bottom, but may be obtained from the entire tag as shown in FIG.

【0074】また、図6,図7では排他的論理和を2段
階のツリー構造にしているが、1段だけにしても、3段
階以上のツリーにしてもよいことは言うまでもない。
In FIGS. 6 and 7, the exclusive OR has a two-stage tree structure. However, it goes without saying that the exclusive OR may be a tree having only one stage or a tree having three or more stages.

【0075】インデクス生成回路146によって2次キ
ャッシュメモリ140のアクセス時間は長くなる。しか
し、CPU110から1次キャッシュメモリ120への
アクセスと並行して、インデクス生成回路146を動作
させることによって、アクセス時間を長くしないことが
できる。
The access time of the secondary cache memory 140 is extended by the index generation circuit 146. However, by operating the index generation circuit 146 in parallel with the access from the CPU 110 to the primary cache memory 120, the access time can be prevented from being lengthened.

【0076】ここで、従来例,実施例の性能とハードウ
ェアコストを計算してみる。
Here, the performance and hardware cost of the conventional example and the embodiment will be calculated.

【0077】ノーウェイトのメモリを毎クロックアクセ
スできるときの性能を1.0とした、CPUの相対性能
は以下のように表わせる。CPUからは毎クロックでメ
モリアクセスが発生するものとする。
The relative performance of the CPU, where the performance when a no-wait memory can be accessed every clock is 1.0, can be expressed as follows. It is assumed that a memory access is generated from the CPU every clock.

【0078】 相対性能=1/平均アクセス時間 …(1) ここで、 M1 1次キャッシュメモリのミス率 M2 2次キャッシュメモリのミス率 B1 1次キャッシュメモリのアクセス時間(cloc
k) B2 2次キャッシュメモリのアクセス時間(cloc
k) B3 メインメモリのアクセス時間(clock) b ブロックサイズ(Byte) a バス幅(Byte) とすると、
Relative performance = 1 / average access time (1) where: M1 miss rate of primary cache memory M2 miss rate of secondary cache memory B1 access time of primary cache memory (clock)
k) B2 Secondary cache memory access time (clock)
k) B3 Main memory access time (clock) b Block size (Byte) a Bus width (Byte)

【0079】キャッシュメモリが1階層(従来方式)の
場合、 相対性能=1/{(1−M1)×B1 +(M1×b/a×B3)} …(2)
When the cache memory has one layer (conventional system), relative performance = 1 / {(1−M1) × B1 + (M1 × b / a × B3)} (2)

【0080】キャッシュメモリが2階層(ヴィクティム
キャッシュまたは本発明)の場合、 相対性能=1/{(1−M1) +(M1×(1−M2)×b/a×B2) +(M1×M2×b/a×B3)} …(3)
When the cache memory has two levels (victim cache or the present invention), relative performance = 1 / {(1-M1) + (M1 × (1-M2) × b / a × B2) + (M1 × M2) × b / a × B3)} (3)

【0081】ここで、例を挙げる。 B1=1clock,B2=1clock,B3=8clock b=16Byte,a=4Byte …(4) とする。Here, an example will be given. B1 = 1 clock, B2 = 1 clock, B3 = 8 clock b = 16 Byte, a = 4 Byte (4)

【0082】あるアプリケーション(diff:16K
B程度のデータ)において、ダイレクトマップ方式のキ
ャッシュメモリの容量とミス率を測定した結果を表1に
示す。相対性能は式(2),(4)から求めた。
An application (diff: 16K)
Table 1 shows the results of measuring the capacity and the miss rate of the cache memory of the direct map system for data of about B). The relative performance was determined from equations (2) and (4).

【0083】[0083]

【表1】 [Table 1]

【0084】同じアプリケーションで、ヴィクティムキ
ャッシュ方式、実施例1,2について測定した結果を表
2に示す。相対性能は、式(3),(4)から求めた。
1次キャッシュメモリは全て、8Kバイトのダイレクト
マップ方式(表1の例1と同じ)である。
Table 2 shows the measurement results of the victim cache system and Examples 1 and 2 using the same application. The relative performance was determined from equations (3) and (4).
All primary cache memories are of the 8K byte direct map system (same as Example 1 in Table 1).

【0085】例3はヴィクティムキャッシュの一例、例
4,例5は本発明の実施例1の例、例6,例7は本発明
の実施例2の例である。
Example 3 is an example of a victim cache, Examples 4 and 5 are examples of the first embodiment of the present invention, and Examples 6 and 7 are examples of the second embodiment of the present invention.

【0086】上記6例の性能を、図8にまとめる。さら
に、図8には、各例をLSI化したときの相対面積(例
2を1とした)と、効率(相対性能/相対面積)を示し
た。
FIG. 8 summarizes the performances of the above six examples. Further, FIG. 8 shows the relative area (Example 2 was set to 1) and the efficiency (relative performance / relative area) when each example was formed into an LSI.

【0087】[0087]

【表2】 [Table 2]

【0088】[0088]

【発明の効果】以上説明したように、本発明によるキャ
ッシュメモリ方式は、以下の効果を有する。 性能が高い。図8から分かるように、本発明の性能は
高い。実施例(例7)2では、例2(1次キャッシュメ
モリの容量を倍にしたもの)よりも性能が高い。 ハードウェア効率が良い。図8から分かるように、本
発明によるハードウェア量(LSI化したときの面積)
は、いずれも例2(1次キャッシュメモリの容量を倍に
したもの)よりも小さい。例6(実施例2)では、ヴィ
クティムキャッシュ(例3)より小面積で、同等の効率
を実現している。例3ではフルアソシアティブ方式を用
いるため、面積効率が非常に悪い。例7では、8Kバイ
トの1次キャッシュメモリに2Kバイトの2次キャッシ
ュメモリを付加しただけで、例2(16Kバイトの1次
キャッシュメモリ)よりも高い性能を実現している。 ハードウェアが簡単である。従来例で示したように、
ヴィクティムキャッシュ方式の2次キャッシュメモリで
用いられるフルアソシアティブ方式には、制御論理が複
雑であるという欠点がある。ミスした場合にどのエント
リを入替えるかを決める制御論理(通常はLRU:Le
ast Recent Used)は複雑であり、通常
は比較器を介してデータメモリをアクセスするが、入替
え時にはランダムアクセスできなければならない。それ
ゆえ、テストも難しい。
As described above, the cache memory system according to the present invention has the following effects. High performance. As can be seen from FIG. 8, the performance of the present invention is high. In the second embodiment (Example 7), the performance is higher than in Example 2 (in which the capacity of the primary cache memory is doubled). Good hardware efficiency. As can be seen from FIG. 8, the amount of hardware according to the present invention (area when implemented in LSI)
Are smaller than those in Example 2 (in which the capacity of the primary cache memory is doubled). In Example 6 (Example 2), the same efficiency is realized with a smaller area than the victim cache (Example 3). In Example 3, since the fully associative method is used, the area efficiency is very poor. Example 7 achieves higher performance than Example 2 (a 16 Kbyte primary cache memory) simply by adding a 2 Kbyte secondary cache memory to an 8 Kbyte primary cache memory. Hardware is simple. As shown in the conventional example,
The full associative scheme used in the secondary cache memory of the victim cache scheme has a disadvantage that the control logic is complicated. A control logic (usually LRU: Le) that determines which entry is replaced when a mistake is made
The “ast Recent Used” is complicated, and usually accesses the data memory via a comparator, but must be able to perform random access at the time of replacement. Therefore, testing is also difficult.

【0089】ところが、本発明による2次キャッシュメ
モリはダイレクトマップ方式であり、非常にシンプルで
ある。ハードウェアはSRAM+比較器ひとつという単
純さである。また、1次キャッシュメモリと2次キャッ
シュメモリが同じ方式であるため、制御回路の設計が容
易(使い回しができる)である。
However, the secondary cache memory according to the present invention employs a direct map system and is very simple. The hardware is as simple as SRAM + one comparator. In addition, since the primary cache memory and the secondary cache memory are of the same type, the control circuit can be easily designed (reusable).

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

【図1】本発明の実施例1のハードウェア構成を示す図
である。
FIG. 1 is a diagram illustrating a hardware configuration according to a first embodiment of the present invention.

【図2】ダイレクトマップ方式のアドレスの構成を示す
図である。
FIG. 2 is a diagram showing a configuration of an address in a direct map system.

【図3】本発明の動作を説明する図である。FIG. 3 is a diagram illustrating the operation of the present invention.

【図4】本発明の動作を説明する図である。FIG. 4 is a diagram illustrating the operation of the present invention.

【図5】本発明の実施例2のハードウェア構成を示す図
である。
FIG. 5 is a diagram illustrating a hardware configuration according to a second embodiment of the present invention.

【図6】実施例2のアドレスの構成を示す図である。FIG. 6 is a diagram illustrating a configuration of an address according to a second embodiment.

【図7】実施例2のアドレスの構成を示す図である。FIG. 7 is a diagram illustrating a configuration of an address according to a second embodiment.

【図8】従来のキャッシュメモリ方式のミス率を示す図
である。
FIG. 8 is a diagram showing a miss rate of the conventional cache memory system.

【図9】本発明の効果を示す図である。FIG. 9 is a diagram showing the effect of the present invention.

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

100 マイクロプロセッサLSI 110 CPU 120 1次キャッシュメモリ 140 2次キャッシュメモリ 160 メインメモリ 121,141 タグ用メモリ 122,142 ステータスフラグ用メモリ 123,143 データ用メモリ 124,144 比較器 125,145 制御回路 146 インデクス生成回路 Reference Signs List 100 microprocessor LSI 110 CPU 120 primary cache memory 140 secondary cache memory 160 main memory 121, 141 tag memory 122, 142 status flag memory 123, 143 data memory 124, 144 comparator 125, 145 control circuit 146 index Generation circuit

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.7 識別記号 FI G06F 12/08 509 G06F 12/08 509D 597 597 (56)参考文献 特開 平4−49445(JP,A) 特開 昭58−91573(JP,A) 特開 昭61−241853(JP,A) 特開 昭53−33023(JP,A) 特開 昭61−15247(JP,A) 特開 昭54−89531(JP,A)──────────────────────────────────────────────────続 き Continued on the front page (51) Int.Cl. 7 Identification code FI G06F 12/08 509 G06F 12/08 509D 597 597 (56) References JP-A-4-49445 (JP, A) JP-A Sho58 JP-A-91573 (JP, A) JP-A-61-241853 (JP, A) JP-A-53-33023 (JP, A) JP-A-61-15247 (JP, A) JP-A-54-89531 (JP, A) )

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 第1のキャッシュメモリと第2のキャッ
シュメモリとを有するキャッシュメモリ方式であって、
第1のキャッシュメモリ手段をアクセスするアドレスで
指定される該当ブロックを保持する保持手段を有し、
キャッシュメモリは、データ用メモリと、タグ用メモリ
と、比較器と、ヒット発生回路とを含み、データ用メモ
リは、ブロック単位にデータを記憶するものであり、タ
グ用メモリは、前記データ用メモリの各ブロックに記憶
したデータがアドレス空間のどこに位置しているものか
を示す情報(タグ)を記憶したものであり、比較器は、
アドレス中のアドレスタグと前記タグ用メモリの出力を
照合するものであり、ヒット発生回路は、前記比較器の
内容に基づいてヒット信号を発生するものであり、内部
からの読み出しアクセスに対して前記第1のキャッシュ
メモリ手段をアクセスし、前記第1のキャッシュメモリ
手段でヒット信号が発生しなければ前記読み出しでアド
レス指定される該当ブロックの内容を前記保持手段に保
持すると共に前記第2のキャッシュメモリ手段をアクセ
スし、前記第2のキャッシュメモリ手段でヒット信号が
発生すれば前記第2のキャッシュメモリ手段の該当ブロ
ックの内容を前記第1のキャッシュメモリ手段の該当ブ
ロックへ書き込み、前記保持手段に保持した内容を前記
第2のキャッシュメモリ手段の該当ブロックへ書き込む
ことで両該当ブロックの内容を交換し、前記第2のキャ
ッシュメモリ手段でヒット信号が発生しなければ外部メ
モリをアクセスすることを特徴とするキャッシュメモリ
方式。
1. A cache memory system having a first cache memory and a second cache memory,
At an address to access the first cache memory means
Has a holding means for holding the block to be specified, each cache memory, a data memory, a tag memory, a comparator, and a hit generation circuit, data memory, the data in block units The tag memory stores information (tag) indicating where the data stored in each block of the data memory is located in the address space, and the comparator includes:
An address tag in an address is compared with the output of the tag memory.The hit generating circuit generates a hit signal based on the content of the comparator, and the hit signal is generated for an internal read access. Accessing the first cache memory means, and if no hit signal is generated in the first cache memory means, the address is read by the read.
The contents of the corresponding block designated as address
Appropriate bromide of the second accesses the cache memory means, said second of said if a hit signal is generated in the cache memory means second cache memory means while lifting
The contents of the corresponding block of the first cache memory means.
Write to the lock and store the content held in the
Write to the corresponding block of the second cache memory means
The contents of both corresponding blocks are exchanged, and an external memory is accessed unless a hit signal is generated in the second cache memory means.
【請求項2】 前記第1のキャッシュメモリ手段のミス
によるアクセスにおいて、アドレスの一部の排他的論理
和をとって前記第2のキャッシュメモリ手段のタグ用メ
モリとデータ用メモリのアドレスとしたことを特徴とす
る請求項1に記載のキャッシュメモリ方式。
2. The method according to claim 2, wherein, when the first cache memory is accessed due to a miss, an exclusive OR of a part of the address is calculated to obtain the address of the tag memory and the address of the data memory of the second cache memory. The cache memory system according to claim 1, wherein:
【請求項3】 前記第2のキャッシュメモリ手段のメモ
リ容量が前記第1のキャッシュメモリ手段のメモリ容量
以下としたことを特徴とする請求項2に記載のキャッシ
ュメモリ方式。
3. The cache memory system according to claim 2, wherein a memory capacity of said second cache memory means is smaller than a memory capacity of said first cache memory means.
【請求項4】 請求項2に記載のキャッシュメモリ方式
をもつ第1及び第2のキャッシュメモリ手段と中央処理
装置とを同一のLSIチップに集積し、前記第1のキャ
ッシュメモリ手段と前記第2のキャッシュメモリ手段の
間の転送をクロックサイクル毎に行うことを特徴とする
マイクロプロセッサ装置。
4. The first and second cache memory units having the cache memory system according to claim 2 and a central processing unit are integrated on the same LSI chip, and the first cache memory unit and the second cache memory unit are integrated. Wherein the transfer between the cache memory means is performed every clock cycle.
【請求項5】 請求項3に記載のキャッシュメモリ方式
をもつ第1及び第2のキャッシュメモリ手段と中央処理
装置とを同一のLSIチップに集積し、前記第1のキャ
ッシュメモリ手段と前記第2のキャッシュメモリ手段の
間の転送をクロックサイクル毎に行うことを特徴とする
マイクロプロセッサ装置。
5. The first and second cache memory units having the cache memory system according to claim 3 and a central processing unit are integrated on the same LSI chip, and the first cache memory unit and the second cache memory unit are integrated. Wherein the transfer between the cache memory means is performed every clock cycle.
JP15746792A 1992-05-25 1992-05-25 Cache memory system and microprocessor device Expired - Fee Related JP3262182B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15746792A JP3262182B2 (en) 1992-05-25 1992-05-25 Cache memory system and microprocessor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15746792A JP3262182B2 (en) 1992-05-25 1992-05-25 Cache memory system and microprocessor device

Publications (2)

Publication Number Publication Date
JPH05324473A JPH05324473A (en) 1993-12-07
JP3262182B2 true JP3262182B2 (en) 2002-03-04

Family

ID=15650313

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15746792A Expired - Fee Related JP3262182B2 (en) 1992-05-25 1992-05-25 Cache memory system and microprocessor device

Country Status (1)

Country Link
JP (1) JP3262182B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5319049B2 (en) 2005-08-22 2013-10-16 富士通セミコンダクター株式会社 Cash system
JP2014186397A (en) 2013-03-21 2014-10-02 Fujitsu Ltd Cache memory device, information processor and cache memory control method
US9690710B2 (en) * 2015-01-15 2017-06-27 Qualcomm Incorporated System and method for improving a victim cache mode in a portable computing device

Also Published As

Publication number Publication date
JPH05324473A (en) 1993-12-07

Similar Documents

Publication Publication Date Title
US5581725A (en) Cache memory system having first and second direct-mapped cache memories organized in hierarchical structure
US9064330B2 (en) Shared virtual memory between a host and discrete graphics device in a computing system
US6772315B1 (en) Translation lookaside buffer extended to provide physical and main-memory addresses
JP2833062B2 (en) Cache memory control method, processor and information processing apparatus using the cache memory control method
JP4447580B2 (en) Partitioned sparse directory for distributed shared memory multiprocessor systems
US6014732A (en) Cache memory with reduced access time
US6304944B1 (en) Mechanism for storing system level attributes in a translation lookaside buffer
EP0470734A1 (en) Cache memory management system
KR20010101694A (en) Techniques for improving memory access in a virtual memory system
JPH10504124A (en) Two-way set associative cache memory
JP2001195303A (en) Translation lookaside buffer whose function is parallelly distributed
JP3262182B2 (en) Cache memory system and microprocessor device
JPH0830568A (en) Cache control system for distributed memory type parallel computer
JPS5922315B2 (en) Buffer memory control method
JP3158761B2 (en) Cache memory device and control method
JP2001282616A (en) Memory management system
JPH06124237A (en) Address translation buffer device
JPH06250926A (en) Data processing system provided with cache memory of plural hierarchies
JPH086857A (en) Cache memory
JPH08272687A (en) Input/output cache memory
JPS6280742A (en) Buffer storage control system
JPH10124389A (en) Cache device
JPH02171944A (en) Buffer storage device
JPH03105537A (en) Memory control system for data processor
JPH04328655A (en) Cache memory

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980721

LAPS Cancellation because of no payment of annual fees