JP3522140B2 - HIT / MISS counter for each way and counting method thereof - Google Patents

HIT / MISS counter for each way and counting method thereof

Info

Publication number
JP3522140B2
JP3522140B2 JP01734599A JP1734599A JP3522140B2 JP 3522140 B2 JP3522140 B2 JP 3522140B2 JP 01734599 A JP01734599 A JP 01734599A JP 1734599 A JP1734599 A JP 1734599A JP 3522140 B2 JP3522140 B2 JP 3522140B2
Authority
JP
Japan
Prior art keywords
counter
address
way
tag
ram
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
JP01734599A
Other languages
Japanese (ja)
Other versions
JP2000215104A (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 JP01734599A priority Critical patent/JP3522140B2/en
Publication of JP2000215104A publication Critical patent/JP2000215104A/en
Application granted granted Critical
Publication of JP3522140B2 publication Critical patent/JP3522140B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、複数のWAYから
構成されるキャッシュメモリにおいて、その使用および
動作効率を測定するWAY別HIT/MISSカウンタ
およびそのカウント方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a way-dependent HIT / MISS counter for measuring the use and operation efficiency of a cache memory composed of a plurality of ways and a counting method thereof.

【0002】[0002]

【従来の技術】近年プログラムの高速化により大容量で
かつ高速なアクセスが可能であるキャッシュメモリを搭
載したプロセッサが数多く開発されている。各プロセッ
サにおけるキャッシュメモリの容量、方式は、そのプロ
セッサのハ−ドウェア的な制限および使用目的によって
決まってくる。特に使用目的に関しては、そのプロセッ
サにおいてどのようなプログラム(計算)を実行するの
かでプロセッサの性能は大きく変わってくる。例えば、
プログラムの内容によりキャッシュメモリの使用方法が
全く異なってしまい、せっかく大容量のキャッシュメモ
リを搭載しても効率よく使用できない場合が出てくる。
2. Description of the Related Art In recent years, a large number of processors equipped with a cache memory having a large capacity and capable of high speed access have been developed due to the speeding up of programs. The capacity and method of the cache memory in each processor are determined by the hardware limitation of the processor and the purpose of use. Particularly regarding the purpose of use, the performance of the processor greatly changes depending on what program (calculation) is executed in the processor. For example,
The method of using the cache memory is completely different depending on the contents of the program, and even if a large capacity cache memory is installed, it may not be used efficiently.

【0003】[0003]

【発明が解決しようとうする課題】上述した従来の技術
の問題点を解決するには、プログラムの変更を行うか、
プロセッサのキャッシュメモリの構成を変更する必要が
ある。ただし、これらのことをあらかじめ考慮して変
更、設計するには、実行するプログラムをあらかじめソ
フトウェアツールによりシミュレートするか、または現
状のプロセッサ上で実行させて、その結果により類推す
る必要がある。シミュレートする場合、綿密かつ詳細な
データを収集することは可能であるが、非常に時間がか
かり大量のデータの収集はできないとう問題点があっ
た。
In order to solve the above-mentioned problems of the prior art, it is necessary to change the program or
It is necessary to change the configuration of the cache memory of the processor. However, in order to change and design in consideration of these things in advance, it is necessary to simulate a program to be executed by a software tool in advance or to execute it on an existing processor and to make an analogy with the result. When simulating, it is possible to collect detailed and detailed data, but there was a problem that it took a very long time and a large amount of data could not be collected.

【0004】一方、現状のプロセッサ上で実行させる場
合、そのプロセッサのキャッシュメモリの容量および方
式をあらかじめ知っておくだけでなく、実際に動作して
いる場合のキャッシュメモリの使用効率(方法)を何ら
かの形で入手する必要があった。
On the other hand, when executing on a current processor, not only should the capacity and method of the cache memory of that processor be known in advance, but also the use efficiency (method) of the cache memory when actually operating should be somehow determined. Had to get it in shape.

【0005】従来、一部のプロセッサでは、これらの情
報を得るためにキャッシュメモリのヒットおよびミスの
回数を測定するHIT/MISSカウンタを備えている
ものがある。これらのカウンタは、収集するデータの内
容をある程度区別してカウントする。例えば、命令フェ
ッチの回数または命令フェッチに要した時間、データフ
ェッチの回数またはデータフェッチに要した時間等をカ
ウントして、これらの情報を参考に各プログラムにおけ
るキャッシュメモリの性能を測定していた。
Conventionally, some processors have a HIT / MISS counter for measuring the number of hits and misses in the cache memory in order to obtain such information. These counters count the contents of the collected data while distinguishing them to some extent. For example, the number of instruction fetches or the time required for the instruction fetches, the number of data fetches or the time required for the data fetches, etc. are counted, and the performance of the cache memory in each program is measured with reference to these pieces of information.

【0006】ここで、WAYとは、複数のTAGアドレ
スアレイやキャッシュメモリへのアクセスルートのこと
である。エントリとは、簡単に言うとメモリ中の項目の
ことであり、例えば、256エントリとはそのメモリの
中に256個の項目があることを意味する。 また、キ
ャッシュメモリとは、CPUとメインメモリとの間に介
在した小容量で高速なメモリのことであり、CPUがキ
ャッシュメモリをアクセスしたときに、該当するCPU
のアドレスにデータが存在する場合は、CPUはプログ
ラムに従い命令を実行していくが、存在しない場合は、
プログラムの実行を中断して主記憶のデータをキャッシ
ュメモリに転送する。
Here, WAY is an access route to a plurality of TAG address arrays and cache memories. An entry is simply an item in the memory, and for example, 256 entry means that there are 256 items in the memory. The cache memory is a small-capacity, high-speed memory interposed between the CPU and the main memory, and when the CPU accesses the cache memory, the corresponding CPU
If the data exists at the address of, the CPU executes the instruction according to the program, but if it does not exist,
The execution of the program is interrupted and the data in the main memory is transferred to the cache memory.

【0007】なお、該当するアドレスにデータが存在す
る場合はそのアドレスがヒットしたといい、存在しない
場合はミスしたという。該当するアドレスにデータが存
在している確率のことをヒット率という。
It should be noted that if data exists at the corresponding address, that address is hit, and if it does not exist, then it is missed. The probability that data exists at the corresponding address is called the hit rate.

【0008】最近では、これらの情報だけでは足りず、
キャッシュメモリ中のどのエントリに対してアクセスを
しているのか。またヒット回数あるいはミス回数はどの
位なのか。更新の度合いはどの位なのかの情報が必要と
なってきている。もし、これらの情報を入手できれば、
これらの情報により、キャッシュメモリのあるエントリ
にのみ集中してアクセスしているのがわかり、プログラ
ムを変更してあるアドレスのみにアクセスが集中しない
ようアドレスを分散させることも可能となるが、これら
の情報を効率良く収集する手段はこれまで実現されてい
なかった。
[0008] Recently, these kinds of information are not enough,
Which entry in the cache memory is being accessed? What is the number of hits or mistakes? Information on the degree of update is needed. If you can get this information,
From this information, it can be seen that access is concentrated only on certain entries in the cache memory, and it is possible to distribute the addresses so that access is not concentrated only on certain addresses by changing the program. Means to collect information efficiently have not been realized so far.

【0009】本発明は上述したような従来の技術が有す
る問題点に鑑みなされたものであって、上述した情報を
簡単なハードウェアで実施するため、複数のWAYから
構成されるキャッシュメモリにおいて、これらの情報を
格納しておくトレース用RAMとカウンタを用いてその
使用および動作効率を測定する各WAY別HIT/MI
SSカウンタおよびそのカウント方法を提供することを
目的とする。
The present invention has been made in view of the problems of the above-described conventional technique. In order to implement the above-mentioned information with simple hardware, a cache memory composed of a plurality of WAYs is provided. HIT / MI for each WAY to measure its use and operation efficiency by using a trace RAM for storing such information and a counter
An object is to provide an SS counter and a counting method thereof.

【0010】[0010]

【課題を解決するための手段】上記の問題点を解決する
ため、本発明は、複数のWAYから構成されるキャッシ
ュメモリにおいて、キャッシュメモリの使用効率を測定
するために各WAYごとに複数存在するキャッシュメモ
リのTAGアドレスが格納されたTAGアドレスアレイ
を有し、TAGアドレスアレイのエントリに登録されて
いるアドレスをヒットした回数をカウントするWAY別
HITカウンタであって、WAY別HITカウンタは、
エントリがヒットされるごとにインクリメントされる第
1のカウンタと、第1のカウンタがカウントしたカウン
ト値が格納される第1のRAMと、TAGアドレスアレ
イの内容が更新されるごとに更新前のTAGアドレスお
よび第1のRAMに格納されたカウント値が登録される
第2のRAMと、第2のRAMへの登録アドレスを生成
する第2のカウンタと、を具備することを特徴とする。
In order to solve the above problems, according to the present invention, in a cache memory composed of a plurality of WAYs , a plurality of WAYs exist for each way in order to measure the usage efficiency of the cache memory. A WAY-specific HIT counter that has a TAG address array in which the TAG address of the cache memory is stored and counts the number of times the address registered in the entry of the TAG address array is hit.
A first counter that is incremented each time an entry is hit, a first RAM that stores the count value counted by the first counter, and a TAG before updating each time the content of the TAG address array is updated. It is characterized by comprising a second RAM in which an address and a count value stored in the first RAM are registered, and a second counter which generates an address registered in the second RAM.

【0011】また、第1のRAMの内容は、TAGアド
レスアレイをアクセスする信号と同じ信号でアクセスさ
れ、TAGアドレスアレイがいずれかのWAYでヒット
すると、読み出した値を第1のカウンタでHITしたW
AYに対応するカウンタのみインクリメントして、その
他のWAYに対応するカウンタはそのままの値で前記値
を読み出した同じ領域に書き込むことを特徴とする。
The contents of the first RAM are accessed by the same signal as the signal for accessing the TAG address array. When the TAG address array is hit by any WAY, the read value is hit by the first counter. W
It is characterized in that only the counter corresponding to AY is incremented and the counters corresponding to other WAYs are written in the same area from which the value is read out with the same value .

【0012】また、第2のRAMの内容は、TAGアド
レスアレイの内容が更新されるごとに、更新されるエン
トリにおける更新前のTAGアドレスおよび第1のRA
Mに登録された対応するエントリ上のカウント値が登録
されることを特徴とする。
The contents of the second RAM are the TAG address before the update and the first RA in the updated entry each time the contents of the TAG address array are updated.
It is characterized in that the count value on the corresponding entry registered in M is registered.

【0013】また、TAGごとにヒット数をカウントす
る場合は、ヒットするごとに第1のカウンタがインクリ
メントされ、TAGアドレスが更新されると第1のカウ
ンタの内容がリセットされて、第2のRAMに更新前の
TAGアドレスおよび更新前に第1のRAMに格納され
カウント値が登録され、エントリごとにヒット数をカ
ウントする場合は、ヒットするごとに第1のカウンタが
インクリメントされ、TAGアドレスが更新されても第
1のカウンタの内容がリセットされずそのままカウント
を続けることを特徴とする。
When the number of hits is counted for each TAG, the first counter is incremented for each hit, and when the TAG address is updated, the contents of the first counter are reset and the second RAM Stored in the first RAM before the update and the TAG address before the update
When the number of hits is registered for each entry and the number of hits is counted for each entry, the first counter is incremented for each hit, and even if the TAG address is updated, the contents of the first counter are not reset and the count is continued. Characterized by continuing.

【0014】また、複数のWAYから構成されるキャッ
シュメモリにおいて、各WAYごとに複数存在するキャ
ッシュメモリのTAGアドレスが格納されたTAGアド
レスアレイを有し、TAGアドレスアレイのエントリに
登録されているアドレスをミスした回数をカウントして
キャッシュメモリの使用効率を測定するWAY別MIS
Sカウンタであって、WAY別MISSカウンタは、エ
ントリミスするごとにインクリメントされる第1のカ
ウンタと、第1のカウンタがカウントしたカウント値が
格納される第1のRAMと、TAGアドレスアレイの内
容が更新されるごとに更新前のTAGアドレスおよび
1のRAMに格納されたカウント値が登録される第2の
RAMと、第2のRAMへの登録アドレスを生成する第
2のカウンタと、を具備することを特徴とする。
Further, in a cache memory composed of a plurality of WAYs, each WAY has a TAG address array storing the TAG address of a plurality of cache memories, and the address registered in the entry of the TAG address array. MIS for each WAY that counts the number of misses and measures the usage efficiency of cache memory
The WAY-specific MISS counter, which is an S counter, includes a first counter that is incremented each time an entry is missed, a first RAM that stores a count value counted by the first counter, and a TAG address array. Every time the content is updated, the TAG address and the
It is characterized by comprising a second RAM in which the count value stored in the first RAM is registered, and a second counter for generating a registration address in the second RAM.

【0015】また、TAGごとにミス数をカウントする
場合は、ミスするごとに第1のカウンタがインクリメン
トされ、TAGアドレスが更新されると第1のカウンタ
の内容がリセットされて、第2のRAMに更新前のTA
Gアドレスおよび更新前に第1のRAMに格納された
ウント値が登録され、エントリごとにミス数をカウント
する場合は、ミスするごとに第1のカウンタがインクリ
メントされ、TAGアドレスが更新されても第1のカウ
ンタの内容がリセットされずそのままカウントを続ける
ことを特徴とする。
When counting the number of misses for each TAG, the first counter is incremented for each miss, and when the TAG address is updated, the content of the first counter is reset and the second RAM is used. Before updating to
When the G address and the count value stored in the first RAM before updating are registered and the number of misses is counted for each entry, the first counter is incremented for each miss and the TAG address Is updated, the contents of the first counter are not reset and the counting is continued.

【0016】上記のように構成される本発明において
は、各RAMにそれぞれ異なる値が格納されるので、キ
ャッシュメモリのエントリごと、またはWAY別のヒッ
ト回数を求めることができ、キャッシュメモリのWAY
別エントリ別の使用率およびヒット率等を容易に算出す
ることができる。
In the present invention configured as described above, since different values are stored in the respective RAMs, the number of hits for each entry of the cache memory or for each WAY can be obtained, and the WAY of the cache memory can be obtained.
It is possible to easily calculate the usage rate and the hit rate for each different entry.

【0017】また、キャッシュメモリのエントリごと、
またはWAY別のミス回数を求めることができので、キ
ャッシュメモリのWAY別エントリ別の使用率およびミ
ス率等を容易に算出することができる。
Also, for each cache memory entry,
Alternatively, since the number of misses for each WAY can be obtained, it is possible to easily calculate the usage rate and miss rate for each WAY by entry of the cache memory.

【0018】さらに、これらのデータを参考にすること
により、より効率的なプログラム、高速なプログラムの
作成が容易となるので、さらに、今後のキャッシュメモ
リの設計をするにあたって重要なデータを提供できる。
Further, by referring to these data, it becomes easy to create a more efficient program and a high-speed program, so that important data can be provided in the future design of the cache memory.

【0019】[0019]

【発明の実施の形態】次に、本発明の実施例について図
面を参照して説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments of the present invention will be described with reference to the drawings.

【0020】図1は、本発明の第1の実施例の全体構成
を示すブロック図である。
FIG. 1 is a block diagram showing the overall configuration of the first embodiment of the present invention.

【0021】図1において、点線で囲んだトレース回路
部7が本発明に関する部分であり、それ以外のTAGア
ドレスを格納したTAGアドレス2aと後述するTAG
アドレスアレイ5a〜5dのアドレスを指すINDEX
アドレス2bおよびBLOCKアドレス2cを格納した
命令アドレス2と、命令アドレス2のINDEXアドレ
ス2bと外部から入力したWAY更新用INDEX3a
信号を選択するセレクタ4と、キャッシュメモリ(図示
せず)のTAGアドレスを格納した複数のTAGアドレ
スアレイ5a〜5dと、各TAGアドレスアレイ5a〜
5dの出力とTAGアドレス2aを比較するコンパレー
タ6a〜6dとは従来からの公知の技術である。
In FIG. 1, a trace circuit portion 7 surrounded by a dotted line is a portion related to the present invention, and a TAG address 2a storing other TAG addresses and a TAG described later.
INDEX indicating the address of the address arrays 5a to 5d
The instruction address 2 storing the address 2b and the BLOCK address 2c, the INDEX address 2b of the instruction address 2, and the WAY update INDEX 3a input from the outside.
A selector 4 for selecting a signal, a plurality of TAG address arrays 5a to 5d storing TAG addresses of a cache memory (not shown), and each TAG address array 5a to
The comparators 6a to 6d for comparing the output of 5d and the TAG address 2a are well-known techniques.

【0022】トレース回路部7は、各TAGアドレスア
レイ5a〜5dから出力された信号(TAGDATA)
とWAY更新用DATA(WE:Write Enable)を選択
するセレクタ8と、各WAY別のヒット数を格納する複
数のWAY別HITカウンタ9a〜9dと、WAY別H
ITカウンタ9a〜9dのカウント値を格納する複数の
トレース用RAM10a〜10dと、複数のトレース用
RAM10a〜10dの出力を選択するセレクタ11
と、TAGアドレスアレイ5a〜5dの内容が更新され
るごとに複数のトレース用RAM10a〜10dの出力
等を格納するトレース用RAM12と、を含む。
The trace circuit section 7 outputs the signals (TAGDATA) output from the respective TAG address arrays 5a to 5d.
And a selector 8 for selecting WAY update DATA (WE: Write Enable), a plurality of WAY-specific HIT counters 9a to 9d for storing the number of hits for each WAY, and a WAY-specific H
A plurality of trace RAMs 10a to 10d for storing the count values of the IT counters 9a to 9d and a selector 11 for selecting the output of the plurality of trace RAMs 10a to 10d.
And a trace RAM 12 that stores the output of the plurality of trace RAMs 10a to 10d each time the contents of the TAG address arrays 5a to 5d are updated.

【0023】また、図1には示されていないが実際には
TAGアドレスアレイ5a〜5dの他に、データアレイ
も設けられている。
Although not shown in FIG. 1, a data array is actually provided in addition to the TAG address arrays 5a to 5d.

【0024】図1中において、各信号の接続関係を示
す。
FIG. 1 shows the connection relationship of each signal.

【0025】命令アドレス2のTAGアドレス2aはコ
ンパレータ6a〜6dに入力され、INDEXアドレス
2bはセレクタ4に入力される。WAY更新用INDE
X信号3aはセレクタ4を経て、TAGアドレスアレイ
5a〜5dとトレース回路部7のトレース用RAM10
a〜10dに入力される。
The TAG address 2a of the instruction address 2 is input to the comparators 6a to 6d, and the INDEX address 2b is input to the selector 4. INDE for WAY update
The X signal 3a passes through the selector 4, the TAG address arrays 5a to 5d and the trace RAM 10 of the trace circuit unit 7.
a to 10d are input.

【0026】また、WAY更新用DATA(WE)3b
〜3eとWAY更新用DATA(TAG)3fは、それ
ぞれTAGアドレスアレイ5a〜5dに入力される。T
AGアドレス5a〜5dからの一方の出力はコンパレー
タ6a〜6dに入力して命令アドレス2から入力したT
AGアドレス2aと比較され、もう一方は、セレクタ8
に入力される。セレクタ8はWAY更新用DATA(W
E)3b〜3eにより選択される。
In addition, WAY update DATA (WE) 3b
~ 3e and WAY update DATA (TAG) 3f are input to the TAG address arrays 5a to 5d, respectively. T
One of the outputs from the AG addresses 5a to 5d is input to the comparators 6a to 6d and the T input from the instruction address 2 is input.
The AG address 2a is compared, and the other is compared with the selector 8
Entered in. The selector 8 is WAY update DATA (W
E) Selected by 3b to 3e.

【0027】命令アドレス2のTAGアドレス2aとT
AGアドレスアレイ5a〜5dから読み出したTAGア
ドレスをコンパレータ6a〜6dに入力し、両方の信号
が一致すれば、WAYHIT信号13a〜13dとして
外部回路(図示せず)に出力されると共に、トレース回
路部7の各WAY別HITカウンタ9a〜9dにも出力
される。
TAG address 2a and T of instruction address 2
The TAG addresses read from the AG address arrays 5a to 5d are input to the comparators 6a to 6d, and if both signals match, the WAY addresses are output to the external circuit (not shown) as the WAYHIT signals 13a to 13d and the trace circuit unit It is also output to each WAY-specific HIT counter 9a to 9d.

【0028】図2は、命令アドレス2のINDEXアド
レス2bとTAGアドレスアレイ5a〜5dの対応関係
を示す図である。
FIG. 2 is a diagram showing a correspondence relationship between the INDEX address 2b of the instruction address 2 and the TAG address arrays 5a to 5d.

【0029】図2のように、INDEXアドレス2b
は、キャッシュメモリのTAGアドレスが格納されたT
AGアドレスアレイ5a〜5dのある登録エントリを指
している。そして、INDEXアドレス2bが指すTA
Gアドレスアレイ5a〜5dのいずれかのTAGアドレ
スアレイからTAGアドレスが読み出される。
As shown in FIG. 2, the INDEX address 2b
Is T that stores the TAG address of the cache memory
It points to a registration entry of the AG address arrays 5a to 5d. The TA indicated by the INDEX address 2b
The TAG address is read from any one of the G address arrays 5a to 5d.

【0030】図3は、図1に示したTAGアドレスアレ
イ5a〜5dとキャッシュメモリ20a〜20dの対応
関係を示す図である。
FIG. 3 is a diagram showing a correspondence relationship between the TAG address arrays 5a to 5d shown in FIG. 1 and the cache memories 20a to 20d.

【0031】図3のように、TAGアドレスアレイ5a
〜5dの各TAGアドレスはキャッシュメモリ20a〜
20dのあるTAGアドレス21a〜21dを指してい
る。ここで、TAGとは、各キャッシュメモリ20a〜
20dに格納されているブロック単位ごとに管理される
領域の先頭アドレスを指す。
As shown in FIG. 3, the TAG address array 5a
Each TAG address of 5d is the cache memory 20a
It indicates TAG addresses 21a to 21d with 20d. Here, TAG means each cache memory 20a to 20a.
This indicates the start address of the area managed in units of blocks stored in 20d.

【0032】図3に示すように、各TAGアドレスアレ
イ5a〜5dは、TAG00からTAG3255の10
24個のTAGメモリアドレスで構成され、各TAGア
ドレスアレイ5a〜5dのTAGアドレスは、キャッシ
ュメモリ20a〜20dのTAGアドレスと対応してい
る。例えば、TAGメモリアドレス5aのTAG00
は、キャッシュメモリ20aのブロックの先頭アドレス
21aを指しており、TAG0225はアドレス11a
を指している。
As shown in FIG. 3, each of the TAG address arrays 5a to 5d includes 10 of TAG00 to TAG3255.
It is composed of 24 TAG memory addresses, and the TAG address of each TAG address array 5a to 5d corresponds to the TAG address of the cache memories 20a to 20d. For example, TAG00 of TAG memory address 5a
Indicates the start address 21a of the block of the cache memory 20a, and TAG0225 indicates the address 11a.
Pointing to.

【0033】ここでは、4つのTAGアドレスアレイ5
a〜5dと、キャッシュメモリ20a〜20dしか示し
ていないが、システムの規模や要求に応じ、もちろんこ
れ以上のTAGアドレスアレイとキャッシュメモリを追
加できることは言うまでもない。
Here, four TAG address arrays 5
Although only a to 5d and cache memories 20a to 20d are shown, it goes without saying that more TAG address arrays and cache memories can be added depending on the system scale and requirements.

【0034】図4は、図1に示したトレース回路部7を
拡大した図である。
FIG. 4 is an enlarged view of the trace circuit section 7 shown in FIG.

【0035】図4において、トレース用RAM10a〜
10dとは、各WAY別HITカウンタ9a〜9dでカ
ウントした各WAYごとのヒット数を格納しておく領域
である。各トレース用RAM10a〜10dは、それぞ
れ0〜255までのヒット数のカウン値が格納され、
4つのトレース用RAM6全部で255×4の1026
個のカウン値を格納しておくことができる。
In FIG. 4, the trace RAMs 10a ...
10d is an area for storing the number of hits for each WAY counted by the WAY-specific HIT counters 9a to 9d. Each trace RAM10a~10d are count values the number of hits between 0 and 255, respectively are stored,
RAM 6 for 4 traces, which is 255 × 4 1026
It is possible to store the number of the count value.

【0036】トレース用RAM12は、TAGアドレス
アレイ5a〜5dの内容が更新されるごとにTAGアド
レス、INDEX、トレース用RAM10a〜10dの
カウント値を時系列的に格納しておく領域である。この
トレース用RAM12は、各WAY別を示すWAYWE
0〜WAYWEn部12aと、TAGアドレスを格納し
たTAGアドレス0〜TAGアドレスn部12bと、I
NDEX0〜INDEXn部12cと、各WAYごとの
ヒット数を格納しておくカウント値0〜カウント値n部
12dと、を含む。
The trace RAM 12 is an area for storing the TAG address, INDEX, and the count values of the trace RAMs 10a to 10d in time series every time the contents of the TAG address arrays 5a to 5d are updated. This trace RAM 12 is WAYWE indicating each way.
0-WAY WEn section 12a, TAG address 0-TAG address n section 12b storing the TAG address, and I
It includes an NDEX0 to INDEXn section 12c and a count value 0 to count value n section 12d for storing the number of hits for each WAY.

【0037】図4中において、各信号の接続関係を示
す。
FIG. 4 shows the connection relationship of each signal.

【0038】TAGアドレスアレイ5a〜5dからの読
み出しDATA(TAG)WAY15a〜15dはセレ
クタ8を経て、トレース用RAM12のTAGアドレス
0〜TAGアドレスn12bに入力される。外部回路か
らのWAY更新用DATAWE(0:4)16はセレク
タ8に入力すると共に、セレクタ11にも入力しここを
経てトレース用RAM12のカウント値0〜カウント値
n12dに入力される。命令アドレス2からのINDE
Xアドレス信号2bは、トレース用RAM10a〜10
dとトレース用RAM12のINDEX0〜INDEX
n12cに入力される。また、コンパレータ6a〜6
からのWAY0 HIT〜WAY3HIT信号13a〜
13dはカウンタ9a〜9dに入力し、各カウンタ9a
〜9dのカウント値はトレース用RAM10a〜10d
に格納され、TAGアドレスアレイ5a〜5dの内容が
更新される度にトレース用RAM12のカウント値0〜
カウント値n12dに格納される。
The read DATA (TAG) WAYs 15a to 15d from the TAG address arrays 5a to 5d are input to the TAG address 0 to the TAG address n12b of the trace RAM 12 via the selector 8. The WAY update DATAWE (0: 4) 16 from the external circuit is input to the selector 8 and also to the selector 11, and is input to the count value 0 to the count value n12d of the trace RAM 12 via the selector 11. INDE from instruction address 2
The X address signal 2b is supplied to the trace RAMs 10a-10
d and INDEX0 to INDEX of the trace RAM 12
It is input to n12c. In addition, the comparator 6a~6 d
WAY0 HIT to WAY3 HIT signal 13a from
13d is input to the counters 9a to 9d, and each counter 9a
The count value of the ~9d is RAM10a~10d for trace
Is stored in the trace RAM 12 every time the contents of the TAG address arrays 5a to 5d are updated.
It is stored in the count value n12d.

【0039】本実施例の動作の説明に入る前に、図1と
図4に示した各信号の機能をここで簡単に説明してお
く。
Before explaining the operation of this embodiment, the function of each signal shown in FIGS. 1 and 4 will be briefly described here.

【0040】(1)WAY更新用INDEX信号 命令アドレス2から出力され、TAGアドレスを更新す
るとき、TAGアドレスアレイ5a〜5dのアドレスを
示す信号である。
(1) WAY update INDEX signal This signal is output from the instruction address 2 and indicates the address of the TAG address arrays 5a to 5d when the TAG address is updated.

【0041】(2)WAY1〜WAY3更新用DATA
(WE)信号 外部回路から出力され、TAGアドレスを更新すると
き、WAY更新用INDEX信号3aで指定したTAG
アドレスアレイの更新を許可する信号である。
(2) DATA for updating WAY1 to WAY3
(WE) signal Output from an external circuit, and when updating the TAG address, the TAG specified by the WAY update INDEX signal 3a
This is a signal that permits updating of the address array.

【0042】(3)WAY更新用DATA(TAG) 外部回路から出力され、TAGアドレスアレイを更新す
るときの更新データである。
(3) WAY update DATA (TAG) Update data output from an external circuit when updating the TAG address array.

【0043】(4)WAY0 HIT〜WAY3 HI
T信号 命令アドレス2のTAGアドレス2aとTAGアドレス
アレイ5a〜5dから読み出したTAGアドレスが一致
した(ヒット)したときにコンパレータ6a〜6dから
出力される信号である。
(4) WAY0 HIT to WAY3 HI
This is a signal output from the comparators 6a to 6d when the TAG address 2a of the T signal instruction address 2 and the TAG address read from the TAG address arrays 5a to 5d match (hit).

【0044】(5)読み出しDATA(TAG)WAY
0〜WAY3信号 TAGアドレスアレイ5a〜5dから読み出された信号
(TAGアドレス)である。
(5) Read DATA (TAG) WAY
0 to WAY3 signal TAG address signals (TAG address) read from the array 5a to 5d.

【0045】(6)WAY更新用DATA WE(0:
4)信号 外部回路から出力され、TAGアドレスアレイ5a〜5
dの出力を選択する信号である。
(6) WAY update DATA WE (0:
4) The signal is output from the external circuit, and the TAG address arrays 5a to 5 are output.
This is a signal for selecting the output of d.

【0046】(7)INDEXアドレス信号 命令アドレス2から出力され、トレース用RAM10a
〜1dのどのトレース用RAMのどのアドレスからカ
ウンタ値を読み出すか指定する信号である。
(7) INDEX address signal Output from the instruction address 2 and the trace RAM 10a
It is a signal that specifies from which address of which trace RAM of 1 to 10 d the counter value is read.

【0047】次に、本発明の第1の実施例の動作を説明
する。
Next, the operation of the first embodiment of the present invention will be described.

【0048】なお、本発明においては4WAY256エ
ントリのキャッシュメモリを例にとって説明する。
In the present invention, a cache memory of 4WAY256 entries will be described as an example.

【0049】本実施例は、複数のWAYを有するキャッ
シュメモリにおけるアドレスアレイの登録において、各
WAYごとに複数存在する登録エントリの1個の登録エ
ントリごとに、そのエントリに登録されているTAGア
ドレスにヒットした回数を保持する領域を設け、この領
域が属するエントリにアドレスがヒットするごとに+1
インクリメントされた値が更新され書き込まれるもので
ある。
In this embodiment, when registering an address array in a cache memory having a plurality of WAYs, one registration entry of a plurality of registration entries for each WAY is assigned to the TAG address registered in the entry. An area for holding the number of hits is provided, and +1 each time an address hits the entry to which this area belongs.
The incremented value is updated and written.

【0050】本実施例は、キャッシュメモリ20a〜2
0dにおけるTAGアドレスアレイ5a〜5dに付属す
るトレース回路部7であり、その構成は、 TAGアド
レスメモリ5a〜5dにアクセスするINDEXアドレ
ス2bにより登録したカウント値を読み出すトレース用
RAM10a〜10dと、読み出したカウント値を各W
AYごとのWAY0〜WAY3 HIT信号により+1
カウントアップする各WAY別HITカウンタ9a〜9
dと、TAGアドレスアレイ5a〜5dが更新されるご
とに更新前のTAGアドレスおよびヒットカウント値等
を登録していくトレース用RAM12と、から構成され
る。
In this embodiment, the cache memories 20a to 2 are used.
The trace circuit unit 7 is attached to the TAG address arrays 5a to 5d at 0d, and its configuration is as follows: Trace RAMs 10a to 10d for reading the count value registered by the INDEX address 2b for accessing the TAG address memories 5a to 5d Count value for each W
WAY0 to WAY3 for each AY +1 by HIT signal
WAY-specific HIT counters 9a to 9 to be counted up
d, and a trace RAM 12 for registering the TAG address before update and the hit count value etc. each time the TAG address arrays 5a to 5d are updated.

【0051】図5は、キャッシュメモリ20a〜20d
がヒットしたときの信号の流れを示す図であり、図6
は、トレース回路部7の信号の流れを示す図である。
FIG. 5 shows the cache memories 20a to 20d.
FIG. 7 is a diagram showing a signal flow when is hit by FIG.
FIG. 6 is a diagram showing a signal flow of the trace circuit unit 7.

【0052】それでは、まず最初に図5および図6を参
照して、キャッシュメモリ20a〜20dがヒットした
ときの動作を説明する。
Now, first, with reference to FIGS. 5 and 6, the operation when the cache memories 20a to 20d are hit will be described.

【0053】なお、本文中の番号〜は、図5および
図6中の〜に対応している。
The numbers ~ in the text correspond to ~ in FIGS. 5 and 6.

【0054】図5において、初期設定として各WAY対
応のトレース用RAM10a〜10dにはALL 0を
設定しておく。このトレース用RAM10a〜10dの
各エントリはTAGアドレスアレイ5a〜5dの各WA
Yの登録エントリと1対1に対応している。次に、キャ
ッシュメモリ20a〜20dのアクセス命令におけるア
ドレス(図5の命令アドレス2)のINDEXアドレス
2bを取り出し()、これを各WAYの登録エントリ
としてTAGアドレスアレイ5a〜5dからTAGアド
レスを読み出す()。読み出された各WAYのTAG
アドレスは、コンパレータ6a〜6dにより命令アドレ
スのTAG部分と比較され()、一致すれば外部回路
へWAY HIT信号13a〜13dが出力される
()。
In FIG. 5, ALL 0 is set in the tracing RAMs 10a to 10d corresponding to each WAY as an initial setting. Each entry of the trace RAMs 10a to 10d corresponds to each WA of the TAG address arrays 5a to 5d.
There is a one-to-one correspondence with the registration entry of Y. Next, the INDEX address 2b of the address (instruction address 2 in FIG. 5) in the access instruction of the cache memories 20a to 20d is taken out (), and the TAG address is read from the TAG address arrays 5a to 5d using this as the registration entry of each WAY ( ). TAG of each WAY read
The address is compared with the TAG portion of the instruction address by the comparators 6a to 6d (), and if they match, the WAY HIT signals 13a to 13d are output to the external circuit ().

【0055】続いて、図6において、TAGアドレスア
レイ5a〜5dがアクセスされると、トレース用RAM
10a〜1dも同じINDEXアドレス信号2bによ
りアクセスされ、それぞれカウント値が読み出される
()。カウント値を読み出した後、いずれかのWAY
でヒットするとWAYHIT信号により対応するWAY
の各WAY別HITカウンタが+1インクリメントされ
る()。その他の各WAY別HITカウンタはインク
リメントされず、そのままの値を保持する。例えば、I
NDEX01においてTAGアドレスメモリ5aがヒッ
トするとWAY0HIT信号13aによりトレース用R
AM10aのINDEX01に入っていたカウント値
(初めてヒットした場合は当然0が読み出されているは
ずである。)を+1インクリメントして再び同じトレー
ス用RAM10aの同じ領域に書き込んで、カウント値
を更新する。
Then, in FIG. 6, when the TAG address arrays 5a to 5d are accessed, the trace RAM is used.
10a~1 0 d also be accessed by the same INDEX address signal 2b, the count value is read respectively (). After reading the count value, either WAY
When hit with, the WAY corresponding to the WAYHIT signal
Each WAY-specific HIT counter is incremented by +1 (). The other WAY-specific HIT counters are not incremented and hold the same values. For example, I
When the TAG address memory 5a hits in NDEX01, the WAY 0HIT signal 13a causes the trace R
The count value stored in the INDEX01 of the AM 10a (0 should have been read if it hits for the first time) is incremented by +1 and written again in the same area of the same trace RAM 10a to update the count value. .

【0056】一方、同じINDEX01によって読み出
されたWAY1〜WAY3対応のトレース用RAM10
b〜10dから読み出されたカウント値は+1インクリ
メントされずにそのまま同じ領域に書き込まれる。結果
的に、ヒットした場合にだけそのヒットしたWAYに対
応する各WAY別HITカウンタがインクリメントさ
れ、ヒットしなかった場合は、そのヒットしなかったW
AYに対応する各WAY別HITカウンタがインクリメ
ントされない。
On the other hand, the trace RAM 10 corresponding to WAY1 to WAY3 read by the same INDEX01.
The count values read from b to 10d are written in the same area as they are without being incremented by +1. As a result, the WAY-specific HIT counter corresponding to the hit WAY is incremented only when there is a hit, and when there is no hit, the W that has not hit
The WAY-specific HIT counter corresponding to AY is not incremented.

【0057】このような動作をキャッシュメモリ20a
〜20dをアクセスする命令が実行されるごとに行う。
以上がキャッシュメモリ20a〜20dをヒットしたと
きの動作である。
Such operation is performed by the cache memory 20a.
This is performed every time an instruction to access .about.20d is executed.
The above is the operation when the cache memories 20a to 20d are hit.

【0058】図7は、TAGアドレスを更新するときの
信号の流れを示す図であり、図8は、トレース回路部7
の信号の流れを示す図である。
FIG. 7 is a diagram showing a signal flow when updating the TAG address, and FIG. 8 is a diagram showing the trace circuit section 7.
It is a figure which shows the flow of the signal of.

【0059】次に、TAGアドレスアレイ5a〜5dの
アドレスの更新が発生した場合の動作を説明する。
Next, the operation when the addresses of the TAG address arrays 5a to 5d are updated will be described.

【0060】本実施例は、ヒットした回数を保持する領
域に属するTAGアドレスが更新される場合、この領域
のHITカウンタ値も0にリセットされるか、またこれ
とは反対に、TAGアドレスが更新されても、HITカ
ウンタ値はリセットされずカウント値を引き継いでカウ
ントアップするように設定することができる。これらの
2つの機能は初期設定時に選択される。
In the present embodiment, when the TAG address belonging to the area holding the number of hits is updated, the HIT counter value of this area is also reset to 0, or conversely, the TAG address is updated. Even if it is done, the HIT counter value can be set so as not to be reset but to continue counting up. These two functions are selected during initial setup.

【0061】また、この領域が属するTAGアドレスが
更新された場合、更新前にこの領域に登録されていたH
ITカウント値およびこの領域が属するTAGアドレス
を読み出し、これを別に用意した保存領域に書き込む。
保存領域に登録されるデータは、このTAGアドレス登
録領域のTAGアドレスおよびアクセスアドレス(エン
トリ番号(INDEXアドレス))、HITカウント値
および書き込み(読み出し)WAY信号となる。保存領
域にはTAGアドレスアレイ5a〜5dのどこかのエン
トリが更新された場合に登録データが書き込まれる。保
存領域は書き込みが終了すると、登録用カウンタ14を
+1インクリメントして、次の書き込みに備える。
When the TAG address to which this area belongs is updated, the H that was registered in this area before the update.
The IT count value and the TAG address to which this area belongs are read out and written in a separately prepared storage area.
The data registered in the storage area is the TAG address and access address (entry number (INDEX address)), HIT count value, and write (read) WAY signal of this TAG address registration area. Registration data is written in the save area when an entry in any of the TAG address arrays 5a to 5d is updated. When the writing in the storage area is completed, the registration counter 14 is incremented by +1 to prepare for the next writing.

【0062】通常、キャッシュメモリ20a〜20dの
アクセス命令がTAGアドレスアレイ5a〜5dのWA
Y0 〜WAY3のどれとも一致しない場合、つまりミ
スした場合は、ミスヒットとなり主記憶(図示せず)よ
りデータを読み出しに行く。このとき主記憶より読み出
されたデータは実際に必要なデータを含むブロック単位
で読み出され、この読み出されたブロックデータがキャ
ッシュメモリ20a〜20dに登録される。そして、登
録されたメモリの先頭アドレス(TAGアドレス)を新
たにWAY0〜WAY3のどれかに登録する。(登録方
法については色々な方式があるが特に本発明とは関係な
いので省略する。)まず最初に図7および図8を参照し
て、TAGアドレスアレを更新するときの信号の流れ
を説明する。
Normally, the access instruction of the cache memories 20a to 20d is the WA of the TAG address arrays 5a to 5d.
If it does not match any of Y0 to WAY3, that is, if there is a miss, a miss occurs and the data is read from the main memory (not shown). At this time, the data read from the main memory is read in block units including the actually required data, and the read block data is registered in the cache memories 20a to 20d. Then, the head address (TAG address) of the registered memory is newly registered in any of WAY0 to WAY3. (Omitted because there are various schemes, but not related to the particular invention For registration.) First with reference to FIGS. 7 and 8, illustrating the flow of signals when updating TAG address array To do.

【0063】図7において、TAGアドレスアレイ5a
〜5dのある領域を更新するためにINDEXアドレス
3aが入力されると()、新しいTAGアドレスが書
き込まれる前に、TAGアドレスアレイ5a〜5dから
更新される前のTAGアドレスが読み出される()。
また同時にトレース用RAM10a〜10dから対応す
るカウン値が読み出される()。
In FIG. 7, the TAG address array 5a
When the INDEX address 3a is input to update an area of ˜5d (), the TAG address before being updated is read from the TAG address arrays 5a to 5d () before the new TAG address is written ().
The count value is read out from the corresponding trace RAM10a~10d simultaneously ().

【0064】次に、図8において、TAGアドレスアレ
イ5a〜5dのどのWAYに書き込むかを指定する4ビ
ットのWAY更新用DATA (WE)信号3b〜3e
により、各WAYから読み出された4つのTAGアドレ
スのうち一つをセレクタ8により選択し()、トレー
ス用RAM10a〜10dから出力された4つのカウン
ト値をセレクタ11により選択する()。選択された
TAGアドレスおよびカウント値は、そのときアクセス
したINDEXおよびそのときのWAY更新用DATA
(WE)信号と共にトレース用RAM12に書き込まれ
る()。
Next, referring to FIG. 8, 4-bit WAY update DATA (WE) signals 3b to 3e for designating to which WAY the TAG address arrays 5a to 5d are written.
Thus, one of the four TAG addresses read from each WAY is selected by the selector 8 (), and the four count values output from the trace RAMs 10a to 10d are selected by the selector 11 (). The selected TAG address and count value are INDEX accessed at that time and WAY update DATA at that time.
It is written in the trace RAM 12 together with the (WE) signal ().

【0065】これらのデータは、あるWAYのエントリ
において登録していたTAGアドレスとそれに対するヒ
ット回数を示している。
These data show the TAG address registered in a certain WAY entry and the number of hits for the TAG address.

【0066】トレース用RAM12は書き込みが終了す
ると登録用カウンタ14を+1インクリメントして次の
書き込みに備える()。トレース用RAM12へはT
AGアドレスの更新が起こる度に登録動作が行われ、登
録される内容は更新されるエントリに格納されているT
AGアドレスおよびそのアドレスにヒットしたカウント
値である。
When the writing is completed, the trace RAM 12 increments the registration counter 14 by +1 to prepare for the next writing (). T to the RAM 12 for tracing
The registration operation is performed every time the AG address is updated, and the registered content is T stored in the updated entry.
It is the AG address and the count value that hits the address.

【0067】なお、更新された領域(エントリ)に対応
するトレース用RAM10a〜10d中のカウント値は
リセットされる。これにより新たに登録されたTAGア
ドレスに対するヒット回数をカウントすることができ
る。
The count value in the trace RAMs 10a to 10d corresponding to the updated area (entry) is reset. As a result, the number of hits for the newly registered TAG address can be counted.

【0068】一方、エントリごとのヒット回数にのみ注
目し、そのときにエントリに登録されているアドレス、
およびこのエントリが更新されることは考慮しない場
合、更新動作が行われても対応するトレース用RAM1
0a〜10d中のカウント値をリセットせずにそのまま
引き続きカウントアップするような設定とする。こうす
ることにより、そのエントリの通算のヒット回数を求め
ることができる。
On the other hand, paying attention only to the number of hits for each entry, the address registered in the entry at that time,
If the update of this entry is not considered, the trace RAM 1 corresponding to the update operation is performed even if the update operation is performed.
The count value of 0a to 10d is set to be continuously incremented without resetting. By doing so, the total number of hits of the entry can be obtained.

【0069】なお、本設定を採用した場合でも、更新さ
れるごとにトレース用RAM1にTAGアドレス、お
よびカウント値を登録することが可能である。
Even if this setting is adopted, it is possible to register the TAG address and the count value in the trace RAM 12 each time the trace RAM 12 is updated.

【0070】以上のように、本実施例によれば、キャッ
シュメモリのエントリごと、またはWAY別のヒット回
数を求めることができので、キャッシュメモリのWAY
別およびエントリ別の使用率とヒット率を容易に求める
ことができる。
As described above, according to the present embodiment, the hit count for each entry of the cache memory or for each WAY can be obtained.
The usage rate and hit rate for each entry and each entry can be easily obtained.

【0071】図9は、本発明の第2の実施例の全体構成
を示すブロック図である。
FIG. 9 is a block diagram showing the overall structure of the second embodiment of the present invention.

【0072】本実施例は、アドレスをヒットした回数を
カウントするのではなく、ミスし回数をカウントし
て、トレース用RAMに登録する例である。
In this embodiment, the number of address hits is not counted, but the number of misses is counted and registered in the trace RAM.

【0073】図9に示すように、本実施例は、図1に示
した第1の実施例の各WAY別HITカウンタ9a〜9
の代わりに各WAY別MISSカウンタ9a’〜9
d’を設けており、命令アドレス2のTAGアドレス2
aとTAGアドレスアレイ5a〜5dから読み出したT
AGアドレスを比較し、一致しないときにWAYHIT
0〜WAY HIT3信号13a’〜13d’を外部回
路とトレース回路部7に出力する。
As shown in FIG. 9, in this embodiment, the WAY-specific HIT counters 9a to 9 of the first embodiment shown in FIG. 1 are used.
WAY-specific MISS counters 9a'-9 instead of d
d'is provided and instruction address 2 is TAG address 2
a and T read from the TAG address arrays 5a to 5d.
If AG addresses are compared and they do not match, WAYHIT
0 to WAY HIT3 signals 13a 'to 13d' are output to the external circuit and the trace circuit section 7.

【0074】図10は、図9に示したトレース回路部7
を拡大した図である。
FIG. 10 shows the trace circuit section 7 shown in FIG.
It is the figure which expanded.

【0075】WAY0 MISS〜WAY3 MISS
信号13a〜13dが各WAY別MISカウンタ9
a'〜9d'入力されている。
WAY0 MISS to WAY3 MISS
The signals 13a 'to 13d ' are WAY-dependent MIS counters 9
a'-9d 'has been input.

【0076】これ以外の構成は図1に示した第1の実施
例と同様であるため、図1と同じ符号を付して示す。
Since the structure other than this is the same as that of the first embodiment shown in FIG. 1, the same reference numerals as those in FIG.

【0077】本実施例は、アドレスをヒットした回数で
はなく、ミスした回数をカウントしている以外は第1の
実施例と同様であるので、構成や動作の詳しい説明は省
略する。
The present embodiment is the same as the first embodiment except that the number of misses, not the number of address hits, is counted. Therefore, detailed description of the configuration and operation will be omitted.

【0078】以上のように、本実施例によれば、キャッ
シュメモリのエントリごと、またはWAY別のミス回数
を求めることができので、キャッシュメモリのWAY別
およびエントリ別の使用率とミス率を容易に求めること
ができる。
As described above, according to the present embodiment, the number of misses for each entry of the cache memory or for each WAY can be obtained, so that the usage rate and miss rate for each cache memory way and each entry can be easily achieved. You can ask.

【0079】[0079]

【発明の効果】以上説明したように、本発明によれば、
以下のような顕著な効果を奏する。
As described above, according to the present invention,
The following remarkable effects are achieved.

【0080】(1)キャッシュメモリのエントリごと、
またはWAY別のヒット回数を求めることができ、これ
により、キャッシュメモリのWAY別エントリ別の使用
率およびヒット率等を容易に算出することができる。
(1) For each cache memory entry,
Alternatively, the number of hits for each WAY can be obtained, and thus the usage rate and hit rate for each WAY entry for the cache memory can be easily calculated.

【0081】(2)キャッシュメモリのエントリごと、
またはWAY別のミス回数を求めることができ、これに
より、キャッシュメモリのWAY別エントリ別の使用率
およびミス率等を容易に算出することができる。
(2) For each cache memory entry,
Alternatively, it is possible to obtain the number of misses for each WAY, and thereby, it is possible to easily calculate the usage rate and the miss rate for each WAY by entry of the cache memory.

【0082】(3)これらのデータを参考にすることに
より、より効率的なプログラム、高速なプログラムの作
成が容易となる。さらに、今後のキャッシュメモリの設
計をするにあたって重要なデータを提供できる。
(3) By referring to these data, it becomes easy to create a more efficient program and a high-speed program. Furthermore, important data can be provided for future cache memory design.

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

【図1】本発明の第1の実施例の全体構成を示すブロッ
ク図である。
FIG. 1 is a block diagram showing an overall configuration of a first exemplary embodiment of the present invention.

【図2】命令アドレスとそのINDEXアドレスとTA
Gアドレスアレイの対応関係を示す図である。
FIG. 2 Instruction address and its INDEX address and TA
It is a figure which shows the correspondence of G address array.

【図3】図1に示した各TAGメモリアドレスとキャッ
シュアドレスメモリの対応関係を示す図である。
FIG. 3 is a diagram showing a correspondence relationship between each TAG memory address shown in FIG. 1 and a cache address memory.

【図4】図1に示したトレース回路部を拡大した図であ
る。
FIG. 4 is an enlarged view of a trace circuit unit shown in FIG.

【図5】キャッシュメモリがヒットしたときの信号の流
れを示す図である。
FIG. 5 is a diagram showing a signal flow when a cache memory is hit.

【図6】トレース回路部の信号の流れを示す図である。FIG. 6 is a diagram showing a signal flow in a trace circuit section.

【図7】TAGアドレスの更新するときの信号の流れを
示す図である。
FIG. 7 is a diagram showing a signal flow when updating a TAG address.

【図8】トレース回路部の信号の流れを示す図である。FIG. 8 is a diagram showing a signal flow in a trace circuit section.

【図9】本発明の第2の実施例の全体構成を示す図であ
る。
FIG. 9 is a diagram showing an overall configuration of a second exemplary embodiment of the present invention.

【図10】図9に示したトレース回路部を拡大した図で
ある。
10 is an enlarged view of the trace circuit unit shown in FIG.

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

1 WAY別HITカウンタ 1’ WAY別MISSカウンタ 2 命令アドレス 2a TAGアドレス 2b INDEXアドレス 2c Blockアドレス 3a WAY更新用INDEX信号 3b,3c,3d,3e,16 WAY更新用DATA
(WE)信号 3f WAY更新用DATA(TAG) 4,8,11 セレクタ 5a,5b,5c,5d TAGアドレスアレイ 6a,6b,6c,6d コンパレータ 7 トレース回路部 9a,9b,9c,9d 各WAY別HITカウンタ 9a’,9b’,9c’,9d’ 各WAY別HITカ
ウンタ 10a,10b,10c,10d,12 トレース用R
AM 11a,11b,11c,11d TAGアドレス 12a WAYWE0〜WAYWE3 12b TAGアドレス0〜TAGアドレス3 12c INDEX0〜INDEXn 12d カウント値0〜カウント値n 13a,13b,13c,13d WAYHIT信号 13a’,13b’,13c’,13d’ WAYMI
SS信号 14 登録用カウンタ 15a,15b,15c,15d 読み出しDATA
(TAG)WAY0〜WAYn信号 20a,20b,20c,20d キャッシュメモリ 21a,21b,21c,21d TAGアドレス
1 WAY-specific HIT counter 1'WAY-specific MISS counter 2 Instruction address 2a TAG address 2b INDEX address 2c Block address 3a WAY update INDEX signals 3b, 3c, 3d, 3e, 16 WAY update DATA
(WE) signal 3f DATA for updating WAY (TAG) 4, 8, 11 Selectors 5a, 5b, 5c, 5d TAG address arrays 6a, 6b, 6c, 6d Comparator 7 Trace circuit sections 9a, 9b, 9c, 9d For each WAY HIT counters 9a ', 9b', 9c ', 9d' WAY-specific HIT counters 10a, 10b, 10c, 10d, 12 Trace R
AM 11a, 11b, 11c, 11d TAG address 12a WAYWE0-WAYWE3 12b TAG address 0-TAG address 3 12c INDEX0-INDEXn 12d count value 0-count value n 13a, 13b, 13c, 13d WAYHIT signals 13a ', 13b', 13c. ', 13d' WAYMI
SS signal 14 Registration counters 15a, 15b, 15c, 15d Read DATA
(TAG) WAY0 to WAYn signals 20a, 20b, 20c, 20d cache memory 21a, 21b, 21c, 21d TAG address

フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/08 G06F 11/22 - 11/34 Front page continued (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 12/08 G06F 11/22-11/34

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数のWAYから構成されるキャッシュ
メモリにおいて、該キャッシュメモリの使用効率を測定
するために前記各WAYごとに複数存在する前記キャッ
シュメモリのTAGアドレスが格納されたTAGアドレ
スアレイを有し、該TAGアドレスアレイのエントリに
登録されているアドレスをヒットした回数をカウントす
るWAY別HITカウンタであって、 前記WAY別HITカウンタは、前記エントリがヒット
されるごとにインクリメントされる第1のカウンタと、 前記第1のカウンタがカウントしたカウント値が格納さ
れる第1のRAMと、 前記TAGアドレスアレイの内容が更新されるごとに更
新前のTAGアドレスおよび前記第1のRAMに格納さ
れたカウント値が登録される第2のRAMと、 前記第2のRAMへの登録アドレスを生成する第2のカ
ウンタと、 を具備することを特徴とするWAY別HITカウンタ。
1. A cache memory comprising a plurality of WAYs, comprising a TAG address array in which a plurality of TAG addresses of the cache memory existing for each WAY are stored in order to measure usage efficiency of the cache memory. A WAY-specific HIT counter for counting the number of times the address registered in the entry of the TAG address array is hit, wherein the WAY-specific HIT counter is incremented every time the entry is hit. A counter; a first RAM that stores the count value counted by the first counter; a TAG address before updating and a first RAM that stores the TAG address before updating each time the content of the TAG address array is updated.
Second RAM and, WAY-specific HIT counter, characterized by comprising a second counter, the generating the registration address to the second RAM which count value is registered.
【請求項2】 請求項1に記載のWAY別HITカウン
タにおいて、 前記第1のRAMの内容は、前記TAGアドレスアレイ
をアクセスする信号と同じ信号でアクセスされ、該TA
GアドレスアレイがいずれかのWAYでヒットすると、
読み出した値を前記第1のカウンタでHITしたWAY
に対応するカウンタのみインクリメントして、その他の
WAYに対応するカウンタはそのままの値で前記読み出
した値を読み出した同じ領域に書き込むことを特徴とす
るWAY別HITカウンタ。
2. The WAY-specific HIT counter according to claim 1, wherein the contents of the first RAM are accessed by the same signal as a signal for accessing the TAG address array,
When the G address array is hit by any WAY,
WAY the read value is hit by the first counter
Is incremented, and the counters corresponding to other WAYs are read out with the same value.
A WAY-specific HIT counter, which writes the written value in the same area where it is read.
【請求項3】 請求項1に記載のWAY別HITカウン
タにおいて、 前記第2のRAMの内容は、前記TAGアドレスアレイ
の内容が更新されるごとに、更新されるエントリにおけ
る更新前のTAGアドレスおよび前記第1のRAMに登
録された対応するエントリ上のカウント値が登録される
ことを特徴とするWAY別HITカウンタ。
3. The WAY-specific HIT counter according to claim 1, wherein the content of the second RAM is a TAG address before being updated in an entry to be updated each time the content of the TAG address array is updated. A way-specific HIT counter in which a count value on a corresponding entry registered in the first RAM is registered.
【請求項4】 請求項1に記載のWAY別HITカウン
タのカウント方法であって、 TAGごとにヒット数をカウントする場合は、ヒットす
るごとに前記第1のカウンタがインクリメントされ、T
AGアドレスが更新されると前記第1のカウンタの内容
がリセットされて、前記第2のRAMに更新前のTAG
アドレスおよび更新前に前記第1のRAMに格納された
カウント値が登録され、前記エントリごとにヒット数を
カウントする場合は、ヒットするごとに前記第1のカウ
ンタがインクリメントされ、TAGアドレスが更新され
ても前記第1のカウンタの内容がリセットされずそのま
まカウントを続けることを特徴とするWAY別HITカ
ウンタのカウント方法。
4. The method for counting the WAY-specific HIT counter according to claim 1, wherein when the number of hits is counted for each TAG, the first counter is incremented for each hit, and T is counted.
When the AG address is updated, the contents of the first counter are reset, and the TAG before the update is stored in the second RAM.
When the address and the count value stored in the first RAM before updating are registered and the number of hits is counted for each entry, the first counter is incremented for each hit and the TAG is set. A method for counting a WAY-specific HIT counter, wherein the contents of the first counter are not reset even if the address is updated and the counting is continued.
【請求項5】 複数のWAYから構成されるキャッシュ
メモリにおいて、前記各WAYごとに複数存在する前記
キャッシュメモリのTAGアドレスが格納されたTAG
アドレスアレイを有し、該TAGアドレスアレイのエン
トリに登録されているアドレスをミスした回数をカウン
トして該キャッシュメモリの使用効率を測定するWAY
別MISSカウンタであって、 前記WAY別MISSカウンタは、前記エントリミス
するごとにインクリメントされる第1のカウンタと、 前記第1のカウンタがカウントしたカウント値が格納さ
れる第1のRAMと、 前記TAGアドレスアレイの内容が更新されるごとに更
新前のTAGアドレスおよび前記第1のRAMに格納さ
れたカウント値が登録される第2のRAMと、 前記第2のRAMへの登録アドレスを生成する第2のカ
ウンタと、 を具備することを特徴とするWAY別MISSカウン
タ。
5. A TAG in which a TAG address of a plurality of cache memories existing for each WAY is stored in a cache memory composed of a plurality of WAYs.
A WAY that has an address array and counts the number of misses in the address registered in the entry of the TAG address array to measure the usage efficiency of the cache memory.
A separate MISS counter, wherein the WAY-specific MISS counter includes a first counter that is incremented each time the entry is missed, and a first RAM that stores a count value counted by the first counter. Every time the contents of the TAG address array are updated, the TAG address before the update and the first RAM are stored.
A WAY-specific MISS counter, comprising: a second RAM in which the stored count value is registered; and a second counter that generates a registration address in the second RAM.
【請求項6】 請求項5に記載のWAY別MISSカウ
ンタのカウント方法であって、 TAGごとにミス数をカウントする場合は、ミスするご
とに前記第1のカウンタがインクリメントされ、TAG
アドレスが更新されると前記第1のカウンタの内容がリ
セットされて、前記第2のRAMに更新前のTAGアド
レスおよび更新前に前記第1のRAMに格納されたカウ
ント値が登録され、前記エントリごとにミス数をカウン
トする場合は、ミスするごとに前記第1のカウンタがイ
ンクリメントされ、TAGアドレスが更新されても前記
第1のカウンタの内容がリセットされずそのままカウン
トを続けることを特徴とするWAY別MISSカウンタ
のカウント方法。
6. The method for counting WAY-specific MISS counters according to claim 5, wherein when counting the number of misses for each TAG, the first counter is incremented for each miss and the TAG is set.
When the address is updated, the contents of the first counter are reset so that the TAG address before updating and the count value stored in the first RAM before updating are stored in the second RAM. When the number of misses is registered for each entry and the number of misses is counted, the first counter is incremented each time a miss is made, and even if the TAG address is updated, the content of the first counter is not reset and continues counting. A method for counting WAY-specific MISS counters, which is characterized in that
JP01734599A 1999-01-26 1999-01-26 HIT / MISS counter for each way and counting method thereof Expired - Fee Related JP3522140B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01734599A JP3522140B2 (en) 1999-01-26 1999-01-26 HIT / MISS counter for each way and counting method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01734599A JP3522140B2 (en) 1999-01-26 1999-01-26 HIT / MISS counter for each way and counting method thereof

Publications (2)

Publication Number Publication Date
JP2000215104A JP2000215104A (en) 2000-08-04
JP3522140B2 true JP3522140B2 (en) 2004-04-26

Family

ID=11941474

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01734599A Expired - Fee Related JP3522140B2 (en) 1999-01-26 1999-01-26 HIT / MISS counter for each way and counting method thereof

Country Status (1)

Country Link
JP (1) JP3522140B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599210B2 (en) 2017-06-29 2020-03-24 Samsung Electronics Co., Ltd. Processor, computing device including the same and method of selecting low power mode of the same

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1866771B1 (en) 2005-03-31 2012-10-24 Semiconductor Energy Laboratory Co., Ltd. Arithmetic processing device and electronic appliance using arithmetic processing device
JP2007206806A (en) * 2006-01-31 2007-08-16 Matsushita Electric Ind Co Ltd Cache observation system, analysis method of processor, and cache memory
WO2012169142A1 (en) 2011-06-09 2012-12-13 Semiconductor Energy Laboratory Co., Ltd. Cache memory and method for driving the same
JP6012263B2 (en) 2011-06-09 2016-10-25 株式会社半導体エネルギー研究所 Semiconductor memory device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599210B2 (en) 2017-06-29 2020-03-24 Samsung Electronics Co., Ltd. Processor, computing device including the same and method of selecting low power mode of the same

Also Published As

Publication number Publication date
JP2000215104A (en) 2000-08-04

Similar Documents

Publication Publication Date Title
TWI338218B (en) Method and apparatus for prefetching data from a data structure
US7634591B2 (en) Method and apparatus for tracking command order dependencies
US7272754B2 (en) Implementation-efficient multiple-counter value hardware performance counter
US6745291B1 (en) High speed LRU line replacement system for cache memories
CN100392623C (en) Methods and apparatus for invalidating multiple address cache entries
JPH07104816B2 (en) Method for operating computer system and memory management device in computer system
US6950909B2 (en) System and method for reducing contention in a multi-sectored cache
JPH01290050A (en) Buffer memory
JP3929872B2 (en) Cache memory, processor and cache control method
JP3522140B2 (en) HIT / MISS counter for each way and counting method thereof
JP3407808B2 (en) Computer system
JPH02234242A (en) Partial write control system
IL145651A (en) Status bits for cache memory
US20100257319A1 (en) Cache system, method of controlling cache system, and information processing apparatus
CN118295936B (en) Management method and device of cache replacement policy and electronic equipment
US6915405B2 (en) Emulated target associative memory system with a multi-digit incrementable validity counter
JPH05225060A (en) Information processor
CN100462941C (en) Method for realizing memory space in configurable RISC CPU
US5926840A (en) Out-of-order fetching
JP2004021896A (en) Cache fill control method and cpu
Crisu An architectural survey and modeling of data cache memories in verilog hdl
JPH1185613A (en) Cache memory
JP2001249829A (en) System simulator
JPH04326142A (en) Performance evaluating method for cache storage device
CN118295936A (en) Management method and device of cache replacement policy and electronic equipment

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040203

LAPS Cancellation because of no payment of annual fees