JPH06161896A - Semiconductor memory device and address storing system - Google Patents

Semiconductor memory device and address storing system

Info

Publication number
JPH06161896A
JPH06161896A JP4314689A JP31468992A JPH06161896A JP H06161896 A JPH06161896 A JP H06161896A JP 4314689 A JP4314689 A JP 4314689A JP 31468992 A JP31468992 A JP 31468992A JP H06161896 A JPH06161896 A JP H06161896A
Authority
JP
Japan
Prior art keywords
address
memory
tag
hit rate
entry
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
JP4314689A
Other languages
Japanese (ja)
Inventor
Hiroshi Murakami
弘志 村上
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.)
Mitsubishi Electric Engineering Co Ltd
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Engineering Co Ltd
Mitsubishi Electric 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 Mitsubishi Electric Engineering Co Ltd, Mitsubishi Electric Corp filed Critical Mitsubishi Electric Engineering Co Ltd
Priority to JP4314689A priority Critical patent/JPH06161896A/en
Publication of JPH06161896A publication Critical patent/JPH06161896A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To provide a high HIT rate regardless of spatial locality provided for a user program concerning a cache memory in a set associative system. CONSTITUTION:This device is provided with an address decoder 5 controlled by a decoder controller 3 and provided with a function for changing a dividing ratio between the TAG part and ENTRY part of an input address, WAY controller 4 for controlling the physical arrangement of a TAG memory 1 and a data memory 2 to the suitable number of WAYs corresponding to a block size at that time, and hit rate detection part 7 for detecting the hit rate for each block size when the cache is turned to an active state, and a control part 8 controls the WAY control circuit 4 and the decoder control circuit 3 so that the block size with the maximum hit rate can be selected and following access can be performed with the memory configuration.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は半導体記憶装置及びア
ドレス記憶方式に関し、特にキャッシュメモリと主記憶
をブロック単位に分割し、この単位で対応付けを行うセ
ット・アソシアティブ方式を採用するキャッシュメモリ
とそのアドレス記憶方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a semiconductor memory device and an address memory system, and more particularly to a cache memory adopting a set associative system in which a cache memory and a main memory are divided into blocks and the blocks are associated with each other. The present invention relates to an address storage system.

【0002】[0002]

【従来の技術】大容量のメインメモリを高速度のメモリ
を用いて構成すると高価なものとなるため、CPUとメ
インメモリとの間に小容量の高速メモリ(キャッシュメ
モリ)を設け、アクセスの速い大容量メモリを等価的に
実現する方式が用いられている。
2. Description of the Related Art A large-capacity main memory using a high-speed memory becomes expensive, and therefore a small-capacity high-speed memory (cache memory) is provided between the CPU and the main memory to achieve fast access. A method of equivalently realizing a large capacity memory is used.

【0003】この方式では、CPUはプログラム実行時
にまずキャッシュメモリに優先的にアクセスし、目的と
するデータが存在する場合(キャッシュ・ヒット)に
は、そのまま処理を進めるが、キャッシュメモリに必要
とするデータが見つからない場合(キャッシュ・ミスヒ
ット)には、プログラムを中断してキャッシュメモリと
メインメモリの内容を交換し、再度プログラムを開始し
てキャッシュメモリをアクセスするように構成されてい
る。
According to this method, the CPU first preferentially accesses the cache memory at the time of executing the program, and if the target data exists (cache hit), the process proceeds as it is, but the cache memory requires it. When no data is found (cache miss hit), the program is interrupted, the contents of the cache memory and the main memory are exchanged, and the program is restarted to access the cache memory.

【0004】図4は従来のキャッシュメモリ及びこれを
制御する制御回路等を同一の半導体基板上に集積した半
導体記憶装置のブロック構成図であり、図において、1
はキャッシュデータのキャッシュメモリにおける記憶ア
ドレスをそのデータとし記憶するタグ(TAG)メモ
リ、2はキャッシュデータを記憶するデータメモリであ
り、SRAM等の高速アクセスが可能な半導体メモリで
構成されている。なお、図中データメモリ2やタグメモ
リ1の破線で囲んだ部分は256エントリ中の1つのエ
ントリを示すものである。7は外部の図示しないCPU
やDMAコントローラから与えられるアドレスと、この
アドレスによりタグメモリ1から読み出されたアドレス
データとを比較し、キャッシュヒットか否かを判定する
アドレスコンパレータ、18はこのアドレスコンパレー
タ8の出力や外部からの制御信号等に応じてキャッシュ
メモリ2や後述するセレクタの入出力を制御する制御回
路、19は制御回路18の制御に応じて外部からのデー
タをキャッシュメモリ2のどこのウエイ(WAY)に入
力するか、もしくはどのWAYのデータを外部に出力す
るかを切り換えるセレクタである。
FIG. 4 is a block diagram of a semiconductor memory device in which a conventional cache memory and a control circuit for controlling the same are integrated on the same semiconductor substrate.
Is a tag (TAG) memory for storing the storage address of the cache data in the cache memory as the data, and 2 is a data memory for storing the cache data, which is composed of a semiconductor memory such as SRAM capable of high speed access. It should be noted that the portion surrounded by the broken line of the data memory 2 or the tag memory 1 in the figure shows one entry out of 256 entries. 7 is an external CPU (not shown)
The address comparator 18 compares the address given by the DMA controller and the address data read from the tag memory 1 with this address to determine whether or not there is a cache hit. A control circuit for controlling input / output of the cache memory 2 and a selector described later according to a control signal or the like, and 19 inputs data from the outside to a way of the cache memory 2 under control of the control circuit 18. It is a selector for switching which WAY data is output to the outside.

【0005】次に動作について説明する。CPU,DM
Aコントローラ等によって主記憶の実アドレスが与えら
れると、実アドレスのエントリアドレス部分でTAGメ
モリ1のエントリを選択する(図中、TAGメモリ部の
破線で囲んだ部分)。選択したエントリのN個のWAY
に記憶された内容(TAGアドレス)と実アドレスのT
AGアドレス部分とをアドレスコンパレータ7で同時に
それぞれ比較する。一致するものが有った場合、アドレ
スコンパレータ7はヒット信号を制御部18に出力し、
制御部18は外部からのタイミング制御信号に従い、セ
レクタ19を制御し、データメモリ2の対応するエント
リの内容をアクセスできるようにする。一致するものが
無かった場合、主記憶をアクセスすると同時に選択され
たエントリのN個のWAYのうち1つとTAGメモリ1
及びデータメモリ2の内容を置き換える。
Next, the operation will be described. CPU, DM
When the real address of the main memory is given by the A controller or the like, the entry of the TAG memory 1 is selected in the entry address part of the real address (the part surrounded by the broken line of the TAG memory part in the figure). N ways of the selected entry
Contents (TAG address) and T of real address
The address comparator 7 and the AG address portion are simultaneously compared. If there is a match, the address comparator 7 outputs a hit signal to the control unit 18,
The control unit 18 controls the selector 19 according to a timing control signal from the outside so that the contents of the corresponding entry of the data memory 2 can be accessed. If there is no match, the main memory is accessed and at the same time, one of the N ways of the selected entry and the TAG memory 1 are accessed.
And the contents of the data memory 2 are replaced.

【0006】ところで従来より、キャッシュメモリはそ
の容量に比例してヒット率が向上することが知られてい
る。しかしながら、むやみに容量を増やすことは現実的
にはコストが高くなり問題となる。そこで、性能とコス
トのバランスによって、キャッシュメモリの容量が決定
される。また、このキャッシュ容量に対応して最適なブ
ロックサイズがあることが一般的に知られているが、こ
れはCPUが実行する各命令を一般的な割合で任意に構
成した特定のプログラムを想定し、シミュレートした結
果より得られたものに過ぎない。
By the way, hitherto, it is known that the hit rate of a cache memory is improved in proportion to its capacity. However, increasing the capacity unnecessarily increases the cost and poses a problem. Therefore, the capacity of the cache memory is determined by the balance between performance and cost. Further, it is generally known that there is an optimum block size corresponding to this cache capacity, but this assumes a specific program in which each instruction executed by the CPU is arbitrarily configured at a general ratio. , It was only obtained from the simulated results.

【0007】現実的にはユーザのプログラミングの仕方
は自由であり、当然プログラムにおける命令の構成も多
種多様であり、また規定された範囲内ではアドレス空間
の使用方法も多種多様であると考えられる。つまり、上
述の方法で一意的に決定したキャッシュメモリのブロッ
クサイズは、ユーザプログラムによっては必ずしも最適
ではなく、キャッシュメモリの容量を十分に生かせない
場合が発生することになる。
In reality, it is considered that the user can freely program, that the instructions in the program have various configurations, and that the address space is used in various ways within the specified range. That is, the block size of the cache memory uniquely determined by the above-described method is not necessarily optimal depending on the user program, and the capacity of the cache memory may not be fully utilized.

【0008】一例として、説明を簡単にするため、アド
レスbit数が10bitsの場合のセット・アソシア
ティブ方式のキャッシュメモリを例にとって説明する。
セット・アソシアティブ方式では、基本的に主記憶上の
全てのアドレスは、そのブロック内のアドレス(エント
リアドレス)によって決まるキャッシュメモリ上のエン
トリとだけ対応する。
As an example, in order to simplify the description, a set associative cache memory in the case where the number of address bits is 10 bits will be described as an example.
In the set associative method, basically all addresses in the main memory correspond only to the entries in the cache memory determined by the address (entry address) in the block.

【0009】図5はTAGアドレスを4bits、エン
トリアドレスを4bits、インクリメンタアドレスを
2bitsとし、4WAYで構成した場合のTAGメモ
リの構成を示す。この構成は実行するプログラムに時間
的かつ空間的局在性が大きい場合に有効である。つまり
エントリに着目すると、ブロックが大きいため直前にア
クセスしたデータはそれぞれ別のエントリに記憶されて
いる。従って連続したアドレスのデータ群が比較的大き
くても、それらをひとまとめに保持しておくことが可能
である。
FIG. 5 shows the configuration of the TAG memory when the TAG address is 4 bits, the entry address is 4 bits, the incrementer address is 2 bits, and the configuration is 4 WAY. This configuration is effective when the program to be executed has a large temporal and spatial locality. In other words, focusing on the entries, the data accessed immediately before is stored in different entries because the blocks are large. Therefore, even if the data group of consecutive addresses is relatively large, it is possible to hold them all together.

【0010】図6は、TAGアドレスを5bits、エ
ントリアドレスを3bits、インクリメンタアドレス
を2bitsとし、8WAYで構成した場合のTAGメ
モリの構成を示す。この構成は実行するプログラムが時
間的かつ空間的局在性が小さい場合に有効である。つま
りWAY数が多い分、特定エントリに着目すると、過去
のデータが長く保持されていることになり、多くのブロ
ックのデータを記憶できる利点がある。なお上記図5及
び図6図中の網掛けした領域は再び参照されるデータを
示し、数字はTAGアドレス(ブロックナンバー)を示
す。
FIG. 6 shows the configuration of the TAG memory when the TAG address is 5 bits, the entry address is 3 bits, the incrementer address is 2 bits, and the configuration is 8 WAY. This configuration is effective when the program to be executed has small temporal and spatial locality. That is, when the number of WAYs is large, focusing on a specific entry means that past data is held for a long time, which is advantageous in that data of many blocks can be stored. The shaded areas in FIG. 5 and FIG. 6 indicate the data to be referred to again, and the numbers indicate the TAG address (block number).

【0011】以上のように、キャッシュメモリの容量が
同一であっても、ブロックのサイズ及びWAY数によっ
て保持可能な連続したアドレス領域の大きさが異なると
共に保持可能な連続したアドレス領域の数も異なる。従
って、ユーザプログラムを無視してキャッシュメモリの
構成を決定する場合、ユーザプログラムにおけるサブル
ーチンやデータ群の配置による空間的または時間的局在
性の有無によって充分なヒット率が得られないことが生
じる。
As described above, even if the capacity of the cache memory is the same, the size of the continuous address area that can be held differs depending on the block size and the number of WAYs, and the number of continuous address areas that can be held also differs. . Therefore, when ignoring the user program and determining the configuration of the cache memory, a sufficient hit rate may not be obtained depending on the presence or absence of spatial or temporal localization due to the arrangement of the subroutine and the data group in the user program.

【0012】[0012]

【発明が解決しようとする課題】従来の半導体記憶装置
は以上のように構成されており、チップの設計段階にお
いて一意的にメモリの構成が決定されるため、アドレス
の分割がユーザプログラムに応じて必ずしも最適化され
ておらず、ヒット率の低下を招くという問題点があっ
た。
The conventional semiconductor memory device is configured as described above, and since the memory configuration is uniquely determined at the chip designing stage, the address division depends on the user program. It was not necessarily optimized, and there was a problem that the hit rate was lowered.

【0013】例えば、図5のようにブロックサイズが大
きい構成では、空間的局在性の大きなプログラムでかつ
繰り返し参照する領域が比較的大きい場合は効果を期待
できるが、局在性が小さく参照する領域が点在するよう
なプログラムではWAY数が少ないため、キャッシュミ
スを繰り返すことになり、充分なヒット率は得られな
い。また逆に図6のようにブロックサイズを小さくしW
AY数を多くした構成では、プログラムの空間的局在性
が小さくても比較的高いヒット率を期待できる。
For example, in the configuration having a large block size as shown in FIG. 5, an effect can be expected in a program having a large spatial locality and a region to be repeatedly referred to is relatively large, but a small locality is referred to. Since the number of ways is small in a program with scattered areas, cache misses are repeated and a sufficient hit rate cannot be obtained. On the contrary, the block size is reduced as shown in FIG.
With a configuration having a large number of AYs, a relatively high hit rate can be expected even if the spatial localization of the program is small.

【0014】このように従来のキャッシュメモリではユ
ーザプログラムの局在性の有無によてヒット率が左右さ
れるという問題点があった。
As described above, the conventional cache memory has a problem in that the hit rate depends on the presence or absence of the locality of the user program.

【0015】この発明は上記のような問題点を解消する
ためになされたもので、メモリのアドレス分割を可変に
し、ユーザプログラムに応じてメモリ構成を最適に制御
することができる半導体記憶装置を得ることを目的とす
る。
The present invention has been made in order to solve the above problems, and obtains a semiconductor memory device in which the address division of a memory is variable and the memory configuration can be optimally controlled according to a user program. The purpose is to

【0016】[0016]

【課題を解決するための手段】この発明に係る半導体記
憶装置及びアドレス記憶方式は、メモリのアドレス分割
を可変にするビット数変更手段と、メモリ構成を順次、
数種類変化させるブロックサイズ変更手段と、ブロック
サイズの異なるメモリ構成で任意の一定期間ユーザプロ
グラムを実行してそのときのヒット率を検出するヒット
率検出手段と、上記各手段を制御する制御手段とを備
え、上記ヒット率の高かったメモリ構成を自動的に選択
してアクセスを行うようにしたものである。
SUMMARY OF THE INVENTION A semiconductor memory device and an address storage system according to the present invention include a bit number changing means for changing the address division of a memory, and a memory configuration sequentially.
A block size changing means for changing several types, a hit rate detecting means for executing a user program with a memory configuration having different block sizes for an arbitrary fixed period to detect a hit rate at that time, and a control means for controlling each of the means. The memory configuration having the high hit ratio is automatically selected and accessed.

【0017】[0017]

【作用】この発明においては、TAGアドレスとエント
リアドレスのbit数の割合及びWAY数を変更可能な
構成とし、ユーザプログラムに応じてヒット率が向上す
るように自動的にメモリ構成を最適化するようにしたか
ら、プログラムの局在性の有無に係わらず常に高いヒッ
ト率が得られる。
According to the present invention, the ratio of the number of bits of the TAG address and the entry address and the number of ways can be changed, and the memory configuration is automatically optimized so that the hit rate is improved according to the user program. Therefore, a high hit rate can always be obtained regardless of whether or not the program is localized.

【0018】[0018]

【実施例】【Example】

実施例1.以下、本発明の実施例について説明する。図
1は本発明の一実施例による半導体記憶装置であるキャ
ッシュメモリ及びその制御系を含むブロック構成図であ
り、図4と同一符号は同一または相当部分を示し、3は
後述するアドレスデコーダ5を制御するデコーダ制御回
路、4はブロックサイズに応じてTAGメモリ1,デー
タメモリ2の物理的配置を適当なWAY数に設定するW
AY制御回路、5は入力アドレスのTAG部とENTR
Y部の分割比を変更する機能を有するアドレスデコー
ダ、6はデータメモリに新たなデータを書き込む際に適
切なWAYを選択するためのリプレイス制御回路、8は
後述するヒット率検出部の出力に応じて上記デコーダ制
御回路3,WAY制御回路4,リプレイス制御回路6を
コントロールする制御部、9はアクセス時に一定時間内
のヒット数をカウントし、各動作時のカウンタ値を比較
してその結果を上記制御部8に出力するヒット率検出部
である。
Example 1. Examples of the present invention will be described below. FIG. 1 is a block configuration diagram including a cache memory which is a semiconductor memory device and a control system thereof according to an embodiment of the present invention. The same reference numerals as those in FIG. 4 denote the same or corresponding portions, and 3 denotes an address decoder 5 described later. The decoder control circuit 4 for controlling W sets the physical arrangement of the TAG memory 1 and the data memory 2 to an appropriate number of ways according to the block size.
AY control circuit, 5 is the TAG part of the input address and ENTR
An address decoder having a function of changing the division ratio of the Y section, 6 is a replacement control circuit for selecting an appropriate WAY when writing new data to the data memory, and 8 is according to the output of a hit rate detection section described later. A control unit 9 for controlling the decoder control circuit 3, the WAY control circuit 4, and the replacement control circuit 6 counts the number of hits within a certain time at the time of access, compares the counter values at each operation and compares the result with the above. It is a hit rate detection unit that outputs to the control unit 8.

【0019】次に動作について図2のフローチャートを
参照しつつ説明する。まず、ステップS1において、デ
コーダ制御回路3の出力によってアドレスデコーダ5を
構成するセレクタ51が制御され、例えば第1のエント
リデコーダ52が選択されることによって、TAGメモ
リ1およびデータメモリ2の構成を所定のTAG×EN
TRYからなる『マトリクス1』の状態にする。続いて
ステップS2でヒット率検出部9を初期化し、ヒット数
を計数するヒット数カウンタ91をゼロにする。
Next, the operation will be described with reference to the flowchart of FIG. First, in step S1, the selector 51 forming the address decoder 5 is controlled by the output of the decoder control circuit 3, and the first entry decoder 52 is selected, so that the configurations of the TAG memory 1 and the data memory 2 are predetermined. TAG × EN
The state of “matrix 1” made of TRY is set. Subsequently, in step S2, the hit rate detection unit 9 is initialized and the hit number counter 91 for counting the number of hits is set to zero.

【0020】その後、ステップS3においてキャッシン
グを始め、ヒットする度にヒット数カウンタ91でカウ
ントアップする。この状態でタイマ92で設定された一
定時間が経過すると、カウンタ91の値を第1のヒット
数記憶用レジスタ93に写し、続いてステップS4でT
AGメモリ1及びデータメモリ2を初期化する。次に、
デコーダ制御回路3の出力によって、アドレスデコーダ
5を構成するセレクタ51が制御されて、例えば第1及
び第2のエントリデコーダ52,53がともに選択され
ることによって、TAGメモリ1及びデータメモリ2の
構成を上記『マトリクス1』とは異なるTAG×ENT
RY構成からなる『マトリクス2』の状態にする(ステ
ップS5)。
Then, in step S3, caching is started, and the hit number counter 91 counts up each time a hit occurs. In this state, when the fixed time set by the timer 92 has elapsed, the value of the counter 91 is copied to the first hit number storage register 93, and then in step S4 T
The AG memory 1 and the data memory 2 are initialized. next,
The output of the decoder control circuit 3 controls the selector 51 that constitutes the address decoder 5 and, for example, the first and second entry decoders 52 and 53 are both selected, whereby the configurations of the TAG memory 1 and the data memory 2 are configured. TAG × ENT different from the above “Matrix 1”
The "matrix 2" having the RY structure is set (step S5).

【0021】その後、ステップS6においてステップS
3と同様にキャッシングを始め、そのときのヒット数を
カウンタ91でカウントし、一定時間後、得られたカウ
ント数を第2のヒット数記憶用レジスタ94に移す。次
いでステップS7において、コンパレータ95で第1の
ヒット数記憶用レジスタ93と第2のHIT数記憶用レ
ジスタ94に記憶された値が比較され、ヒット数の多か
った構成(TAG×ENTRY)が採用されるように制
御部8に検出信号を出力する。
Then, in step S6, step S
As in the case of 3, caching is started, the number of hits at that time is counted by the counter 91, and after a certain period of time, the obtained number of counts is transferred to the second hit number storage register 94. Next, in step S7, the values stored in the first hit number storage register 93 and the second HIT number storage register 94 are compared by the comparator 95, and the configuration in which the number of hits is large (TAG × ENTRY) is adopted. In this way, the detection signal is output to the control unit 8.

【0022】すなわちステップS7で、レジスタ93の
値がレジスタ94の値よりも小さいと判定された場合、
ステップS8に進んでTAGメモリ1,データメモリ2
の構成として『マトリクス2』の状態を継続することで
以降のキャッシングを行う。
That is, when it is determined in step S7 that the value of the register 93 is smaller than the value of the register 94,
In step S8, the TAG memory 1 and the data memory 2
The subsequent caching is performed by continuing the state of "matrix 2".

【0023】一方、レジスタ93の値がレジスタ94の
値よりも大きい時には、ステップS9に進んでTAGメ
モリ1,データメモリ2を初期化したのち、ステップS
10でTAGメモリ1,データメモリ2の構成として
『マトリクス1』の状態に変更する。
On the other hand, when the value of the register 93 is larger than the value of the register 94, the process proceeds to step S9 to initialize the TAG memory 1 and the data memory 2, and then the step S9.
At 10, the configuration of the TAG memory 1 and the data memory 2 is changed to the state of "matrix 1".

【0024】以下、実際のメモリ構成において具体例を
挙げて説明する。図3はキャッシュメモリのTAGメモ
リ1及びアドレスデコーダ5のより詳細な構成を示すブ
ロック図であり、図において、11はメモリ1,2内に
内蔵されたウエイセレクタであり、WAY制御回路4の
出力であるWAY構成・コントロール信号を受けて、8
WAY構成時にはWAY−A〜Hの全WAYに、また4
WAY構成時にはTAGアドレスA4に応じて活性化さ
れたエントリデコーダ側のWAY−A〜Dの4つのWA
YにTAGアドレスを送るためのセレクタである。ま
た、リプレイス制御回路6の出力であるリプレイス・ウ
エイ・コントロール信号に従い、入力されたTAGアド
レスを所定のWAYに書き込む際のイネーブル信号を伝
達する機能も具備している。
A specific example of the actual memory configuration will be described below. FIG. 3 is a block diagram showing a more detailed structure of the TAG memory 1 and the address decoder 5 of the cache memory. In the figure, 11 is a way selector built in the memories 1 and 2, and an output of the WAY control circuit 4. 8 in response to the WAY configuration / control signal
When WAY is configured, all WAYs from WAY-A to H are
In the WAY configuration, four WAs of WAYs A to D on the entry decoder side activated according to the TAG address A4.
A selector for sending a TAG address to Y. Further, it also has a function of transmitting an enable signal for writing the input TAG address in a predetermined WAY according to the replace way control signal output from the replace control circuit 6.

【0025】ここでは、説明の簡略化のため、入力アド
レスはA0:9の10bits構成としている。またア
ドレスバスはTAGアドレス用として、A0:3、及び
A4を設け、エントリアドレス用としてA4:7、及び
A5:7を設ける。ここでアドレスA4が重複して設定
されているのは、TAGアドレスの幅を4〜5bits
内で変更可能とし、エントリアドレスの幅を3〜4bi
ts内で変更可能にするためである。またWAY数は上
記アドレス割付に応じて、4WAYもしくは8WAYに
設定可能なものとする。
Here, for simplification of the description, the input address has a 10-bit structure of A0: 9. The address bus is provided with A0: 3 and A4 for the TAG address and A4: 7 and A5: 7 for the entry address. Here, the address A4 is set redundantly because the width of the TAG address is 4 to 5 bits.
The width of the entry address can be changed within 3-4 bi
This is because it can be changed within ts. The number of WAYs can be set to 4 WAY or 8 WAY according to the above address allocation.

【0026】上記のTAGメモリを構成するため、TA
GアドレスがA0:4の5bits構成の場合を考慮
し、1エントリ当たり5bits必要である。またエン
トリ数は8または16であることからTAGメモリの最
小構成単位を、8エントリ×5bits×4WAY(b
its)となり、さらにエントリアドレスがA4:7
(4bits幅)の場合にエントリ数が2の4乗個(=
16エントリ)が必要であるため、上記最小構成単位か
らなるTAGメモリ群が2個用いられて上記TAGメモ
リ1が構成されることとなる。このうち紙面下側のタグ
メモリ群は8WAY構成時にWAY−E〜Hとして機能
するものである。
In order to configure the above TAG memory, the TA
Considering the case where the G address has a 5 bits configuration of A0: 4, 5 bits are required for each entry. Further, since the number of entries is 8 or 16, the minimum configuration unit of the TAG memory is 8 entries × 5 bits × 4WAY (b
its) and the entry address is A4: 7.
In case of (4 bits width), the number of entries is 2 to the 4th power (=
Since 16 entries are required, the TAG memory 1 is configured by using two TAG memory groups each including the minimum unit. Of these, the tag memory group on the lower side of the page functions as WAY-E to H in the 8-way configuration.

【0027】上記のアドレス割付を採用することによ
り、エントリアドレス幅3bits,TAGアドレス幅
5bits,8WAYの構成と、エントリアドレス幅4
bits,TAGアドレス幅4bits,4WAYの構
成とを切り換えて選択可能とすることができる。
By adopting the above address allocation, the structure of the entry address width is 3 bits, the TAG address width is 5 bits, and 8 WAY, and the entry address width is 4.
Bits and TAG address widths of 4 bits and 4 WAY can be switched to be selectable.

【0028】すなわちエントリアドレスセレクタ51に
よって、エントリアドレス幅3bits,8WAY構成
のときは2つのエントリデコーダ52,53が活性化さ
れて2つのTAGメモリ群の両者がアクセスされ、3b
itsのエントリアドレスは各エントリデコーダ52,
53によって、それぞれWAY−A〜Hにおいて8エン
トリにデコードされる。またエントリアドレス幅4bi
ts,4WAY構成の時はエントリデコーダ52,53
のいずれか一方が活性化されて1つのTAGメモリ群が
アクセスされ、エントリデコーダ52(53)によっ
て、それぞれWAY−A〜Dにおいて8エントリにデコ
ードされる。
In other words, the entry address selector 51 activates the two entry decoders 52 and 53 in the case of an entry address width of 3 bits and 8 WAY configuration so that both of the two TAG memory groups are accessed and 3b.
The entry address of “its” is the entry decoder 52,
53 is decoded into 8 entries in WAY-A to WAY H, respectively. Entry address width 4bi
Entry decoders 52, 53 for ts, 4 WAY configuration
One of the two is activated to access one TAG memory group, and is decoded by the entry decoder 52 (53) into eight entries in WAYs A to D, respectively.

【0029】一方、アドレスのENTRY部は、エント
リデコーダ5を介して、それぞれTAGメモリ1及びデ
ータメモリ2(図1参照)のデコードされたエントリを
アクセス可能とする。
On the other hand, the ENTRY portion of the address makes the decoded entries of the TAG memory 1 and the data memory 2 (see FIG. 1) accessible via the entry decoder 5.

【0030】また、一旦TAGメモリ書き込みが行われ
ると、アドレスコンパレータ7によって、現在記憶して
いるTAGアドレスと新たに入力されたTAGアドレス
とが比較され、一致すればヒット信号が出力される。な
お、CPUのリード動作時はヒットしたWAYのデータ
が出力され、CPU等のライト動作ではヒットしたWA
Yのデータが書換えられるか同エントリのTAGアドレ
スが無効化される。
Further, once the TAG memory writing is performed, the address comparator 7 compares the currently stored TAG address with the newly input TAG address, and if they match, a hit signal is output. The data of the hit WAY is output during the read operation of the CPU, and the hit WAY is output during the write operation of the CPU.
The Y data is rewritten or the TAG address of the same entry is invalidated.

【0031】次にアドレス分割時のアドレスデコーダの
動作について詳細な説明をする。プログラムの局在性が
大きくアドレスA4をエントリアドレスとして使用する
場合、すなわちエントリアドレス4bits,TAGア
ドレス4bits,4WAY時には、エントリアドレス
セレクタ51はアドレスA4に従って後段のエントリデ
コーダ52,53のどちらか一方を活性化する。
Next, the operation of the address decoder at the time of address division will be described in detail. When the program is highly localized and the address A4 is used as the entry address, that is, when the entry address is 4 bits, the TAG address is 4 bits, and 4 WAY, the entry address selector 51 activates either one of the entry decoders 52 and 53 in the subsequent stage according to the address A4. Turn into.

【0032】一方、プログラムの局在性が小さくアドレ
スA4がTAGアドレスとして使用される場合すなわ
ち、エントリアドレス3bits,TAGアドレス5b
its,8WAY時には、アドレスA4はTAGアドレ
スとして無効となる。またこの時、エントリアドレスセ
レクタ51は両デコーダ52,53を活性化し、A5〜
A7の3bitsをエントリアドレスとして伝達する。
On the other hand, when the locality of the program is small and the address A4 is used as the TAG address, that is, the entry address 3 bits and the TAG address 5b.
At the time of its, 8 WAY, the address A4 becomes invalid as a TAG address. At this time, the entry address selector 51 activates both the decoders 52 and 53, and sets A5 to A5.
The 3 bits of A7 are transmitted as the entry address.

【0033】以上のように、TAGアドレスは常時全て
のTAGメモリに入力されており、エントリデコーダ5
2,53によって該当するエントリのみTAGアドレス
が比較される。アドレスのTAG部がA0:3の4bi
tsで構成されている場合、TAGメモリのA4部分は
比較には使用せず、ヒット信号生成時も無視するよう制
御する。
As described above, the TAG address is always input to all the TAG memories, and the entry decoder 5
2, the TAG address is compared only for the corresponding entry. Address TAG part is A0: 3 4bi
When it is composed of ts, the A4 portion of the TAG memory is not used for comparison and is controlled so as to be ignored when the hit signal is generated.

【0034】このように本実施例によれば、アドレスデ
コーダ5によってTAGアドレスとエントリアドレスの
ビット数の割合を変化させ、WAY制御回路4でTAG
メモリ1,データメモリ2のWAY数を変更し、複数の
アドレス割付状態及びWAY数の組み合わせからなる構
成で一定期間アクセスを行って各構成でのヒット率をヒ
ット率検出部9で検出し、該ヒット率検出部9の検出結
果を受けて最もヒット率の高かったマトリクス状態が選
択されるように制御部8でデコーダ制御回路3,WAY
制御回路4,リプレイス制御回路6をコントロールする
ことにより、プログラムの局在性に係わらず、常に高い
ヒット率が得られる。
As described above, according to the present embodiment, the ratio of the number of bits of the TAG address and the entry address is changed by the address decoder 5, and the WAY control circuit 4 performs the TAG.
The number of WAYs of the memory 1 and the data memory 2 is changed, and access is performed for a certain period of time in a configuration including a combination of a plurality of address allocation states and WAY numbers, and the hit rate in each configuration is detected by the hit rate detection unit 9, In response to the detection result of the hit rate detection section 9, the control section 8 selects the matrix state with the highest hit rate by the decoder control circuit 3, WAY.
By controlling the control circuit 4 and the replacement control circuit 6, a high hit rate can always be obtained regardless of the locality of the program.

【0035】なお上記実施例では、アドレス割付けをエ
ントリアドレス3bits,TAGアドレス5bit
s,8WAY構成の場合と、エントリアドレス4bit
s,TAGアドレス4bits,4WAY構成の場合の
2通りの組み合わせが得られるようにしたが、割付け時
のbits構成や、割付けの組み合わせ数はこれに限ら
れるものではなく、種々の変更が可能であることは言う
までもない。
In the above embodiment, the address allocation is performed by using the entry address 3 bits and the TAG address 5 bits.
s, 8 WAY configuration, entry address 4 bits
Although two combinations of s, TAG address 4 bits, and 4 WAY configuration are obtained, the number of bits configuration at the time of allocation and the number of combinations of allocation are not limited to this, and various changes are possible. Needless to say.

【0036】[0036]

【発明の効果】以上のように、この発明によれば、デー
タメモリ自体のサイズを変更することなく、自動的に各
ユーザプログラムの持つ空間的局所性に応じてブロック
サイズを最適化し、キャッシュメモリのヒット率が最大
となるメモリ構成を選択するようにしたので、メモリが
より一層有効なデータを保持することができ、スループ
ットを低下することなく、ユーザがプログラミングする
際の自由度が拡張される効果がある。
As described above, according to the present invention, the block size is automatically optimized according to the spatial locality of each user program without changing the size of the data memory itself, and the cache memory is Since the memory configuration that maximizes the hit rate is selected, the memory can hold more effective data, and the degree of freedom in programming by the user is expanded without lowering the throughput. effective.

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

【図1】この発明の一実施例による半導体記憶装置のキ
ャッシュメモリを中心とした構成を示すブロック図。
FIG. 1 is a block diagram showing a configuration centered on a cache memory of a semiconductor memory device according to an embodiment of the present invention.

【図2】上記キャッシュメモリにおいてヒット率を向上
するための最適なメモリ構成を自動決定する際のフロー
図。
FIG. 2 is a flowchart for automatically determining an optimum memory configuration for improving the hit rate in the cache memory.

【図3】上記実施例においてアドレス割付を可変にする
ためのキャッシュメモリのTAG部の構成を示すブロッ
ク図。
FIG. 3 is a block diagram showing a configuration of a TAG unit of a cache memory for making address allocation variable in the above embodiment.

【図4】従来の半導体記憶装置のキャッシュメモリを中
心とした構成を示すブロック図。
FIG. 4 is a block diagram showing a configuration centered around a cache memory of a conventional semiconductor memory device.

【図5】従来の半導体記憶装置における8ブロック構成
の場合のTAGメモリの記憶内容を示す図。
FIG. 5 is a diagram showing the stored contents of a TAG memory in the case of an 8-block configuration in a conventional semiconductor memory device.

【図6】従来の半導体記憶装置における16ブロック構
成の場合のTAGメモリの記憶内容を示す図。
FIG. 6 is a diagram showing stored contents of a TAG memory in the case of a 16-block configuration in a conventional semiconductor memory device.

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

1 TAGメモリ 2 データメモリ 3 デコーダ制御回路 4 WAY制御回路 5 アドレスデコーダ 51 エントリセレクタ 52 第1のエントリデコーダ 53 第2のエントリデコーダ 6 リプレイス制御回路 7 アドレスコンパレータ 8 制御部 9 ヒット率検出部 91 ヒット数カウンタ 92 タイマー 93 第1のヒット数記憶レジスタ 94 第2のヒット数記憶レジスタ 95 コンパレータ 11 ウエイセレクタ 1 TAG Memory 2 Data Memory 3 Decoder Control Circuit 4 WAY Control Circuit 5 Address Decoder 51 Entry Selector 52 First Entry Decoder 53 Second Entry Decoder 6 Replace Control Circuit 7 Address Comparator 8 Control Section 9 Hit Rate Detection Section 91 Hit Number Counter 92 Timer 93 First Hit Number Storage Register 94 Second Hit Number Storage Register 95 Comparator 11 Way Selector

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 キャッシュメモリと主記憶をブロック単
位に分割し、この単位で対応付けを行いアドレスを記憶
させるセット・アソシアティブ方式のキャッシュメモリ
を有する半導体記憶装置において、 記録時にアドレス信号をTAGアドレスとエントリアド
レスに分割する際のビット数の割合を変更するビット数
変更手段と、 キャッシュメモリのブロックサイズを変更するブロック
サイズ変更手段と、 所定のビット構成を有するアドレスが、所定のブロック
サイズを有するキャッシュメモリに記憶されるように上
記ビット数変更手段及びブロックサイズ変更手段を制御
して記憶時のモードを設定する制御手段と、 該制御手段により設定された各モード時のキャッシュヒ
ット率を検出し、それぞれのモードでのヒット率を比較
するヒット率検出手段とを備え、 上記ヒット率検出手段の出力に応じて、該検出されるヒ
ット率が大きくなるように上記制御手段によるモード設
定が行われることを特徴とする半導体記憶装置。
1. A semiconductor memory device having a set associative cache memory, in which a cache memory and a main memory are divided into blocks, and the addresses are stored by associating the blocks with each other and the address signal is changed to a TAG address during recording. A bit number changing means for changing the ratio of the number of bits when dividing into entry addresses, a block size changing means for changing the block size of the cache memory, and a cache in which an address having a predetermined bit configuration has a predetermined block size. Controlling means for controlling the bit number changing means and the block size changing means so as to be stored in the memory and setting a mode at the time of storing; and detecting a cache hit rate in each mode set by the controlling means, Hit rate comparing the hit rate in each mode And means out, in accordance with the output of the hit ratio detecting means, a semiconductor memory device, characterized in that the mode setting by the control means is performed so that the hit rate issued 該検 increases.
【請求項2】 キャッシュメモリと主記憶をブロック単
位に分割し、この単位で対応付けてアドレスの記憶を行
うセット・アソシアティブ方式のアドレス記憶方式にお
いて、 記憶時のアドレスのTAGアドレスとエントリアドレス
のビット数の割合を変化させるとともにキャッシュメモ
リのブロックサイズを変化させて得られる複数のモード
でアクセスを行い、 各々のモードにおけるヒット率が大きいときのモードを
採用してアクセスを行うことを特徴とするアドレス記憶
方式。
2. A set associative address storage system in which a cache memory and a main memory are divided into blocks, and addresses are stored in association with each other in the unit, and a TAG address of an address at the time of storage and a bit of an entry address. An address characterized by performing access in a plurality of modes obtained by changing the block ratio of the cache memory while changing the number ratio, and adopting the mode when the hit rate is large in each mode. Memory method.
JP4314689A 1992-11-25 1992-11-25 Semiconductor memory device and address storing system Pending JPH06161896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4314689A JPH06161896A (en) 1992-11-25 1992-11-25 Semiconductor memory device and address storing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4314689A JPH06161896A (en) 1992-11-25 1992-11-25 Semiconductor memory device and address storing system

Publications (1)

Publication Number Publication Date
JPH06161896A true JPH06161896A (en) 1994-06-10

Family

ID=18056370

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4314689A Pending JPH06161896A (en) 1992-11-25 1992-11-25 Semiconductor memory device and address storing system

Country Status (1)

Country Link
JP (1) JPH06161896A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5897651A (en) * 1995-11-13 1999-04-27 International Business Machines Corporation Information handling system including a direct access set associative cache and method for accessing same
US7120745B2 (en) 2002-07-05 2006-10-10 Fujitsu Limited Cache memory device and memory allocation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5897651A (en) * 1995-11-13 1999-04-27 International Business Machines Corporation Information handling system including a direct access set associative cache and method for accessing same
US7120745B2 (en) 2002-07-05 2006-10-10 Fujitsu Limited Cache memory device and memory allocation method

Similar Documents

Publication Publication Date Title
US5737750A (en) Partitioned single array cache memory having first and second storage regions for storing non-branch and branch instructions
US5689679A (en) Memory system and method for selective multi-level caching using a cache level code
US5410669A (en) Data processor having a cache memory capable of being used as a linear ram bank
JPH05241962A (en) Re-configuration possible cache memory system, method for re-constituting the system and data processing system
JP4445081B2 (en) Cache memory
JPH04242848A (en) System for controlling cache memory by running mode
JP3605205B2 (en) Data processing device and processing method
EP0549218A1 (en) A memory apparatus and method for use in a data processing system
US20040199723A1 (en) Low-power cache and method for operating same
JPH07114500A (en) Nonvolatile memory device
JPH06161896A (en) Semiconductor memory device and address storing system
JP2003131945A (en) Cache memory device
US7543113B2 (en) Cache memory system and method capable of adaptively accommodating various memory line sizes
JPH01125641A (en) Buffer memory control system
JP5000850B2 (en) Data processing apparatus and data processing method
JPH0540694A (en) Cache memory device
JPH04369061A (en) Control system for cache memory
KR0158487B1 (en) Cache memory control method and apparatus thereof
JPH02213960A (en) Cache memory
JPH01255944A (en) Cache memory
JPH05225062A (en) Disk cache device
JPH04288647A (en) Substitution controller for cache memory
JPH04205154A (en) Microprocessor system
JPH01228036A (en) Cache memory
KR100505633B1 (en) Data reading apparatus and method for cache memory