JP2000235519A - Cache system and cache processing method - Google Patents

Cache system and cache processing method

Info

Publication number
JP2000235519A
JP2000235519A JP11356678A JP35667899A JP2000235519A JP 2000235519 A JP2000235519 A JP 2000235519A JP 11356678 A JP11356678 A JP 11356678A JP 35667899 A JP35667899 A JP 35667899A JP 2000235519 A JP2000235519 A JP 2000235519A
Authority
JP
Japan
Prior art keywords
cache
fsa
data
hit
line
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
JP11356678A
Other languages
Japanese (ja)
Inventor
Mitsuhiro Miyazaki
充弘 宮崎
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 JP11356678A priority Critical patent/JP2000235519A/en
Publication of JP2000235519A publication Critical patent/JP2000235519A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To realize both of high speed data access and a high cache bit rate at high levels by improving the storing performance of a cache line having a high bit rate and the using efficiency of a cache memory space. SOLUTION: In a cache part obtained by combining an FSA type cache and a cache such as a DM type cache other than the FSA type, tag comparison is simultaneously executed by both the caches. When count values related to the numbers of cache hits of respective cache lines of the FSA type cache are stored and a certain cache line in the FSA type e.g. is hit, '1' is added to the count value of the cache line, and when both cache tables are mis-hit, '1' is simultaneously subtracted from the count values of all cache lines. Since the data of respective caches are managed/transferred by using the count values in accordance with respective cases, the overlap of data in both the caches is removed, a cache line of a high bit rate is stored in the FSA type cache and the FSA type cache of a high speed and a high bit rate can be realized.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、MPU(Micr
oProcessor Unit)、CPU(Cent
ral Processing Unit)等のデータ
処理ユニットに適用され、メインメモリ等の外部メモリ
へのアクセス時間を短縮するためのキャッシュシステム
およびキャッシュ処理方法に関するものであり、特に、
FSA(フルセットアソシアティブ)方式以外のキャッ
シュ(ダイレクトマッピング方式キャッシュ、2ウェイ
アソシアティブ方式キャッシュ、4ウェイアソシアティ
ブ方式キャッシュ、8ウェイアソシアティブ方式キャッ
シュ等)に、使用頻度の高いキャッシュラインを保持さ
せることが可能なFSA方式キャッシュを付加すること
によりキャッシュヒット率の向上を図るキャッシュシス
テムおよびキャッシュ処理方法に関するものである。
TECHNICAL FIELD The present invention relates to an MPU (Micr
oProcessor Unit), CPU (Cent
The present invention relates to a cache system and a cache processing method which are applied to a data processing unit such as a ral processing unit (RL) and reduce an access time to an external memory such as a main memory.
A cache line other than the FSA (full set associative) system (a direct mapping system cache, a two-way associative system cache, a four-way associative system cache, an eight-way associative system cache, etc.) can hold a frequently used cache line. The present invention relates to a cache system and a cache processing method for improving a cache hit rate by adding an FSA cache.

【0002】[0002]

【従来の技術】キャッシュ(キャッシュメモリともい
う)は、高速でデータ処理を実行するMPU、CPU等
がデータ処理速度の低いメインメモリ等の外部メモリへ
アクセスする際のアクセス時間を短縮するために広く用
いられている。特に、MPU、CPU等のプログラム実
行速度を高め、MPU、CPU等を含むシステムのスル
ープットを向上させるために一次キャッシュと二次キャ
ッシュとからなる階層化キャッシュが多用されている。
キャッシュメモリは一般に、複数のタグと各々のタグに
対応したデータとを保持するキャッシュテーブルを備え
ており、入力データから分離されたタグがキャッシュテ
ーブルに格納されたタグと比較される。タグが一致した
際には、一致したタグに対応したデータがキャッシュテ
ーブルから選択され、MPU、CPU等に供給される。
このような処理により、データ処理速度の低いメインメ
モリ等の外部メモリへのアクセス回数が抑えられ、MP
U、CPU等のデータ処理ユニットの高速データ処理が
実現される。
2. Description of the Related Art A cache (also referred to as a cache memory) is widely used in order to reduce the access time when an MPU, CPU, or the like, which executes data processing at high speed, accesses an external memory such as a main memory having a low data processing speed. Used. In particular, a hierarchical cache composed of a primary cache and a secondary cache is frequently used in order to increase the execution speed of programs such as MPUs and CPUs and to improve the throughput of a system including the MPUs and CPUs.
The cache memory generally includes a cache table that holds a plurality of tags and data corresponding to each tag, and tags separated from input data are compared with tags stored in the cache table. When the tags match, data corresponding to the matching tag is selected from the cache table and supplied to the MPU, CPU, and the like.
By such processing, the number of accesses to an external memory such as a main memory having a low data processing speed is suppressed, and the MP
High-speed data processing of a data processing unit such as U and CPU is realized.

【0003】このようなキャッシュとしては、FSA方
式キャッシュとダイレクトマッピング方式キャッシュが
よく知られている。ダイレクトマッピング方式キャッシ
ュは、小回路規模で高速アクセスを実現することができ
るが、そのキャッシュヒット率が悪化しやすい。一方、
FSA方式キャッシュは消費電力が大きくかつ回路規模
が複雑であるものの、ヒット率の高いキャッシュライン
を保持することが可能である。なお、ダイレクトマッピ
ング方式キャッシュと類似する機能を備えたFSA方式
以外のキャッシュとして、2ウェイアソシアティブ方式
キャッシュ、4ウェイアソシアティブ方式キャッシュ、
8ウェイアソシアティブ方式キャッシュも周知である。
As such caches, an FSA cache and a direct mapping cache are well known. Although the direct mapping cache can realize high-speed access with a small circuit scale, the cache hit rate is liable to be deteriorated. on the other hand,
Although the FSA cache has large power consumption and a complicated circuit scale, it can hold a cache line with a high hit rate. In addition, as a cache other than the FSA system having a function similar to the direct mapping system cache, a 2-way associative cache, a 4-way associative cache,
8-way associative caches are also well known.

【0004】図10は、典型的な従来のダイレクトマッ
ピング方式キャッシュを示すブロック図である。図10
のダイレクトマッピング方式キャッシュは、複数のタグ
とこれらのタグに対応するデータとを格納するキャッシ
ュテーブル801と、コンパレータ802と、ANDゲ
ート803と、データセレクタ804とを備えている。
キャッシュテーブル801の各キャッシュラインには、
そのキャッシュラインが活性か非活性かを示すための活
性化ビット(valid bit)が設けられている。
活性化ビット「1」はそのキャッシュラインが活性であ
ることを示し、活性化ビット「0」はそのキャッシュラ
インが非活性であることを示す。図10の上部には、入
力アドレスデータの例として「00000040」(1
6進)が示されている。この入力アドレスデータは、タ
グ、インデックス、およびオフセットを含んでおり、例
えば入力アドレスデータ「00000040」の場合に
は、タグは「00000」(例えば16進数の入力アド
レスデータの最初の5桁)、インデックスは「04」
(例えば16進数の入力アドレスデータの次の2桁)、
オフセットは「0」(例えば16進数の入力アドレスデ
ータの最後の1桁)となる。
FIG. 10 is a block diagram showing a typical conventional direct mapping cache. FIG.
The direct mapping cache includes a cache table 801 storing a plurality of tags and data corresponding to these tags, a comparator 802, an AND gate 803, and a data selector 804.
Each cache line of the cache table 801 has
An activation bit (valid bit) for indicating whether the cache line is active or inactive is provided.
The activation bit “1” indicates that the cache line is active, and the activation bit “0” indicates that the cache line is inactive. In the upper part of FIG. 10, "0000040" (1
Hexadecimal) is shown. The input address data includes a tag, an index, and an offset. For example, in the case of the input address data “0000040”, the tag is “00000” (for example, the first five digits of hexadecimal input address data), and the index Is "04"
(For example, the next two digits of hexadecimal input address data),
The offset is "0" (for example, the last digit of hexadecimal input address data).

【0005】図11はCPUにより実現されるプログラ
ムの例を示す模式図である。図11のプログラムは、実
行されるべき複数の命令(1),(2),・・・を含ん
でいる。メインメモリには予め多数の命令がそれぞれ対
応するアドレスに格納されており、図11のプログラム
がCPUによって実行される場合には、CPUはまずこ
のプログラムの最初の命令(1)に対応する入力アドレ
スデータ(プログラムカウンタから与えられる)を参照
する。最初の命令(1)に対応する入力アドレスデータ
「00000040」は、この命令(1)がメインメモ
リのアドレス「00000040」に予め格納されてい
ることを示す。この最初の命令(1)に対して、図10
のダイレクトマッピング方式キャッシュのコンパレータ
802が、入力アドレスデータ「00000040」か
ら抽出されたタグ「00000」が図10のキャッシュ
テーブル801のインデックス「04」に対応するキャ
ッシュラインに格納されていたタグに一致するかを判定
する。一致した場合には、その一致したタグに対応する
データがダイレクトマッピング方式キャッシュのキャッ
シュテーブル801から読み出され、CPU(命令デコ
ーダ)に送られる。一致しなかった場合は、CPUはメ
インメモリにアクセスし、メインメモリのアドレス「0
0000040」からこの命令(1)をフェッチする。
この不一致の場合、インデックス「04」に対応するキ
ャッシュラインは書き替えられる。すなわち、インデッ
クス「04」に対応するキャッシュラインのデータはメ
インメモリからフェッチされたデータに書き替えられ、
そのキャッシュラインのタグは入力アドレスデータ「0
0000040」に対応するタグ「00000」に書き
替えられる。その後、続く命令(2),(3)・・・に
対しても同様の処理が行われる。このようなダイレクト
マッピング方式キャッシュの使用により、CPUの長い
アクセス時間を要するメインメモリへのアクセスの回数
が減らされ、CPUによる高速プログラム実行(キャッ
シュ処理)が実現される。
FIG. 11 is a schematic diagram showing an example of a program realized by the CPU. The program in FIG. 11 includes a plurality of instructions (1), (2),... To be executed. In the main memory, a large number of instructions are stored in advance at corresponding addresses, and when the program in FIG. 11 is executed by the CPU, the CPU first inputs an input address corresponding to the first instruction (1) of the program. Refers to data (given from the program counter). The input address data “00000040” corresponding to the first instruction (1) indicates that this instruction (1) is stored in advance at the address “00000040” of the main memory. For the first instruction (1), FIG.
In the direct mapping cache 802, the tag “0000” extracted from the input address data “00000040” matches the tag stored in the cache line corresponding to the index “04” of the cache table 801 in FIG. Is determined. If they match, the data corresponding to the matching tag is read from the cache table 801 of the direct mapping cache and sent to the CPU (instruction decoder). If they do not match, the CPU accesses the main memory and sets the address “0” of the main memory.
This instruction (1) is fetched from "0000040".
In the case of a mismatch, the cache line corresponding to the index “04” is rewritten. That is, the data of the cache line corresponding to the index “04” is rewritten with the data fetched from the main memory,
The tag of the cache line is input address data "0
00000040 "is replaced with a tag" 00000 ". After that, the same processing is performed for the following instructions (2), (3),. By using such a direct mapping cache, the number of accesses to the main memory that requires a long access time by the CPU is reduced, and high-speed program execution (cache processing) by the CPU is realized.

【0006】図12(a)および(b)は、CPUが図
11のプログラムを実行する際の図10のダイレクトマ
ッピング方式キャッシュのキャッシュテーブル801の
状態変化の例を示す模式図である。図12(a)は命令
(1)実行直後の状態を示し、図12(b)は命令
(5)実行直後の状態を示す。12(a)を参照する
と、命令(1)が実行された直後の時点では、キャッシ
ュテーブル801のインデックス「04」に対応するキ
ャッシュラインには、入力アドレスデータ「00000
040」に対応するタグ「00000」とこのタグ「0
0000」に対応するデータとが格納されている。図1
2(b)を参照すると、命令(5)が実行された直後の
時点では、キャッシュテーブル801のインデックス
「04」に対応する同じキャッシュラインには、入力ア
ドレスデータ「00001040」に対応するタグ「0
0001」とこのタグ「00001」に対応するデータ
とが格納されている。
FIGS. 12A and 12B are schematic diagrams showing an example of a state change of the cache table 801 of the direct mapping cache shown in FIG. 10 when the CPU executes the program shown in FIG. FIG. 12A shows a state immediately after the execution of the instruction (1), and FIG. 12B shows a state immediately after the execution of the instruction (5). Referring to FIG. 12A, immediately after the execution of the instruction (1), the cache line corresponding to the index “04” of the cache table 801 has the input address data “00000”.
040 "and the tag" 0000 "
0000 ”is stored. FIG.
Referring to FIG. 2B, immediately after the execution of the instruction (5), the tag “0” corresponding to the input address data “0000001040” is stored in the same cache line corresponding to the index “04” of the cache table 801.
0001 ”and data corresponding to the tag“ 00001 ”.

【0007】図13(a)および(b)は、このダイレ
クトマッピング方式キャッシュを使用するCPUが図1
1のプログラムを2回実行する場合のアクセス時間を示
す模式図であり、図13(a)は1回目のプログラム実
行の場合、図13(b)は2回目のプログラム実行の場
合を示している。なお、以下のプログラム実行時間に関
する説明は、ダイレクトマッピング方式キャッシュの各
キャッシュラインのデータ格納領域の長さが4ワード
(16バイト)であり図11のプログラムの各命令の長
さが1ワード(4バイト)である(すなわち、ダイレク
トマッピング方式キャッシュの各キャッシュラインのデ
ータ格納領域に4個の命令が格納される)という仮定の
下に行う。データ(命令)をメインメモリからフェッチ
するのに必要なアクセス時間は、最初の1ワードに10
0ns、続く3ワードの各々にそれぞれ30nsと仮定
する。従って、4ワード分のデータ(4個の命令)をメ
インメモリからフェッチしてこれらのデータをダイレク
トマッピング方式キャッシュの1つのキャッシュライン
格納するために必要なアクセス時間は、100+30+
30+30=190nsとなる。CPUがキャッシュラ
インに格納された直後の命令を読み出して実行するのに
10nsかかると仮定すれば、4ワード分のデータ(4
個の命令)をメインメモリからフェッチしてこれらのデ
ータをダイレクトマッピング方式キャッシュに格納して
格納された最初の命令(1)を実行するのに要するアク
セス時間は190+10=200nsとなる。
FIGS. 13 (a) and 13 (b) show that the CPU using this direct mapping cache is
FIG. 13A is a schematic diagram illustrating an access time when one program is executed twice, FIG. 13A illustrates a case of executing a first program, and FIG. 13B illustrates a case of executing a second program. . In the following description of the program execution time, the length of the data storage area of each cache line of the direct mapping cache is 4 words (16 bytes), and the length of each instruction of the program in FIG. 11 is 1 word (4 bytes). (That is, four instructions are stored in the data storage area of each cache line of the direct mapping cache). The access time required to fetch data (instruction) from main memory is 10 words in the first word.
Assume 0 ns and 30 ns each for each of the following three words. Therefore, the access time required to fetch four words of data (four instructions) from the main memory and store these data in one cache line of the direct mapping cache is 100 + 30 +
30 + 30 = 190 ns. Assuming that it takes 10 ns for the CPU to read and execute the instruction immediately after being stored in the cache line, four words of data (4
Access times required to execute the first instruction (1) stored in the direct mapping cache and fetching these instructions from the main memory are 190 + 10 = 200 ns.

【0008】初期化において、ダイレクトマッピング方
式キャッシュのすべてのキャッシュラインが非活性化さ
れる。すなわち、全キャッシュラインの活性化ビットが
「0」にリセットされる。この初期化の直後には活性化
ビットVがすべて「0」であるため、ダイレクトマッピ
ング方式キャッシュ中には実質的にはデータが存在しな
いことになる。このためCPUは、必要なデータ(最初
のインデックス「04」に対応する命令(1)〜
(4))をメインメモリからフェッチし、フェッチした
命令(1)〜(4)をダイレクトマッピング方式キャッ
シュのインデックス「04」に対応するキャッシュライ
ンに書き込む。このデータ書き込みにより、このインデ
ックス「04」に対応するキャッシュラインは活性化さ
れる。すなわち、このキャッシュラインの活性化ビット
Vが「1」にセットされる(図10参照)。その後、C
PUはこのキャッシュラインから命令(1)を読み出し
て実行する。図13(a)に示される最初のプログラム
実行においては、スタートアップルーチンの後にCPU
が最初の命令(1)を実行するのに100+30+30
+30+10=200nsが必要であり、続く命令
(2),(3),(4)の実行には各々10nsが必要
である(230ns)。その後CPUは、アドレス「0
0001030」から「0000103C」に対応する
4個の命令を同様に実行する(200+10+10+1
0=230ns)。
In the initialization, all cache lines of the direct mapping cache are deactivated. That is, the activation bits of all the cache lines are reset to “0”. Immediately after this initialization, the activation bits V are all "0", so that there is substantially no data in the direct mapping cache. For this reason, the CPU transmits necessary data (commands (1) to (1) corresponding to the first index “04”).
(4)) is fetched from the main memory, and the fetched instructions (1) to (4) are written to the cache line corresponding to the index "04" of the direct mapping cache. By this data writing, the cache line corresponding to the index “04” is activated. That is, the activation bit V of this cache line is set to "1" (see FIG. 10). Then, C
The PU reads the instruction (1) from this cache line and executes it. In the first program execution shown in FIG. 13A, the CPU is executed after the startup routine.
100 + 30 + 30 to execute the first instruction (1)
+ 30 + 10 = 200 ns is required, and execution of the following instructions (2), (3), and (4) requires 10 ns each (230 ns). Thereafter, the CPU proceeds to address “0”.
Four instructions corresponding to “0000103” through “0000103C” are similarly executed (200 + 10 + 10 + 1).
0 = 230 ns).

【0009】その後、前述のインデックス「04」に対
応する命令(5)をCPUが実行しようとする時、ダイ
レクトマッピング方式キャッシュのインデックス「0
4」に対応するキャッシュラインには、既に命令(1)
とこの命令(1)に対応するタグ「00000」が格納
されているため、このインデックス「04」に対応する
キャッシュラインにミスヒット(「00001」≠「0
0000」)が起こる。このため、CPUは命令(5)
をメインメモリからフェッチし、この命令(5)と対応
するタグ「00001」とをインデックス「04」に対
応するキャッシュラインに格納する。このミスヒットに
より、命令(5)の実行も100+30+30+30+
10=200nsかかる。続く3個の命令の実行には同
様に各々10nsかかる。従って、1回目のプログラム
実行における総プログラム実行時間は230×3=69
0nsとなる。
Thereafter, when the CPU attempts to execute the instruction (5) corresponding to the above-mentioned index "04", the index "0" of the direct mapping cache is used.
In the cache line corresponding to "4", the instruction (1) has already been set.
And the tag “00000” corresponding to the instruction (1) are stored, so that the cache line corresponding to the index “04” has a mishit (“00001” ≠ “0”).
0000 ") occurs. Therefore, the CPU issues the instruction (5)
Is fetched from the main memory, and the instruction (5) and the corresponding tag “00001” are stored in the cache line corresponding to the index “04”. Due to this mishit, the execution of the instruction (5) is also 100 + 30 + 30 + 30 +
It takes 10 = 200 ns. Execution of the following three instructions also takes 10 ns each. Therefore, the total program execution time in the first program execution is 230 × 3 = 69.
0 ns.

【0010】図13(a)の1回目のプログラム実行が
終了した時点で、インデックス「04」に対応するキャ
ッシュラインは、図12(b)に示すように、命令
(5)に対応するタグ「00001」を格納している。
このため、2回目のプログラム実行において前述のイン
デックス「04」に対応する命令(1)をCPUが実行
しようとする時、このインデックス「04」に対応する
キャッシュラインに再度ミスヒット(「00000」≠
「00001」)が起こる。このためCPUはこの命令
(1)を再度メインメモリからフェッチすることとな
り、2回目のプログラム実行における命令(1)の実行
にまた200nsかかることとなる。続く3個の命令の
実行には同様に各々10nsかかる(230ns)。そ
の後CPUは、アドレス「00001030」から「0
000103C」に対応する4個の命令を、ダイレクト
マッピング方式キャッシュのインデックス「03」に対
応するキャッシュラインに既に格納されたキャッシュデ
ータを使用して実行する(10+10+10+10=4
0ns)。その後、2回目のプログラム実行において前
述のインデックス「04」に対応する命令(5)をCP
Uが実行しようとする時、このインデックス「04」に
対応するキャッシュラインに再度同様なミスヒット
(「00001」≠「00000」)が起こる(200
ns)。続く3個の命令の実行には同様に各々10ns
かかる(230ns)。従って、2回目のプログラム実
行におけるプログラム実行時間は230+40+230
=500nsとなる。よって、図11のプログラムを2
回実行するために必要な総プログラム実行時間(アクセ
ス時間)は690+500=1190nsとなる。
At the time when the first program execution in FIG. 13A is completed, the cache line corresponding to the index "04" has the tag "" corresponding to the instruction (5) as shown in FIG. 00001 ”is stored.
Therefore, when the CPU attempts to execute the instruction (1) corresponding to the above-mentioned index “04” in the second program execution, the cache line corresponding to this index “04” is mis-hit (“00000” ≠) again.
"00001") occurs. Therefore, the CPU fetches the instruction (1) from the main memory again, and it takes 200 ns to execute the instruction (1) in the second program execution. Execution of the following three instructions also takes 10 ns each (230 ns). Thereafter, the CPU changes the address “00001030” to “0”.
000103C ”are executed using the cache data already stored in the cache line corresponding to the index“ 03 ”of the direct mapping cache (10 + 10 + 10 + 10 = 4).
0 ns). Thereafter, in the second program execution, the instruction (5) corresponding to the above-mentioned index “04” is
When U tries to execute, a similar mishit (“00001” ≠ “00000”) occurs again in the cache line corresponding to the index “04” (200).
ns). Each of the following three instructions is similarly executed for 10 ns.
This (230 ns). Therefore, the program execution time in the second program execution is 230 + 40 + 230
= 500 ns. Therefore, the program in FIG.
The total program execution time (access time) required to execute the program twice is 690 + 500 = 1190 ns.

【0011】上述のように、ダイレクトマッピング方式
キャッシュは小さな回路規模で高速アクセスを実現でき
る長所を持つ反面、キャッシュミス(ミスヒット)が容
易にかつ繰り返し発生してしまう欠点を持つ。ミスヒッ
トによるメインメモリへのアクセスは例えば200ns
という長時間を要し、このためにCPUのプログラム実
行時間(プログラム実行のためのアクセス時間)が長く
なってしまうという課題があった。
As described above, the direct mapping cache has the advantage that high-speed access can be realized with a small circuit scale, but has the disadvantage that cache misses (miss hits) occur easily and repeatedly. Access to the main memory due to a mishit is, for example, 200 ns
Therefore, there is a problem that the program execution time of the CPU (access time for executing the program) becomes long.

【0012】キャッシュヒット率を向上させ、メモリア
クセス時間およびプログラム実行時間を低減するため、
一次キャッシュと二次キャッシュとからなる階層化キャ
ッシュが広く用いられるようになった。例えば、特開昭
61−241853号公報に開示された「キャッシュメ
モリ制御方式」の従来例では、一次キャッシュがCPU
とメインメモリの間に設けられ、二次キャッシュが一次
キャッシュとメインメモリの間に設けられる。一次キャ
ッシュがキャッシュヒットした場合、一次キャッシュに
格納されていた必要なデータがキャッシュデータとして
CPUに与えられる。一次キャッシュがミスヒットし、
二次キャッシュがキャッシュヒットした場合、二次キャ
ッシュに格納されていた必要なデータが一次キャッシュ
に転送され、その後CPUに与えられる。この場合、二
次キャッシュから転送された必要なデータを格納できる
非活性な(使用されていない)キャッシュラインが一次
キャッシュになければ、一次キャッシュの1つのキャッ
シュラインに格納されていたデータが一次キャッシュか
ら削除され、二次キャッシュの1つのキャッシュライン
に転送される。この場合、一次キャッシュから削除され
たデータを格納できる非活性な(使用されていない)キ
ャッシュラインが二次キャッシュになければ、その一次
キャッシュから削除されたデータを格納できるように、
二次キャッシュの1つのキャッシュラインに格納されて
いたデータが二次キャッシュから削除される。一次キャ
ッシュと二次キャッシュの両方がミスヒットした場合、
必要なデータはメインメモリからフェッチされ、一次キ
ャッシュに書き込まれる。通常の階層化キャッシュでは
フェッチされたデータは一次キャッシュと二次キャッシ
ュの両方に書き込まれるが、この従来例では二次キャッ
シュには書き込まれず一次キャッシュにのみ書き込まれ
る。このような動作により、二次キャッシュのキャッシ
ュヒット率の改善が図られている。
In order to improve the cache hit rate and reduce the memory access time and the program execution time,
Hierarchical caches composed of a primary cache and a secondary cache have been widely used. For example, in the conventional example of the "cache memory control method" disclosed in Japanese Patent Application Laid-Open No. 61-241853,
And a main memory, and a secondary cache is provided between the primary cache and the main memory. When a cache hit occurs in the primary cache, necessary data stored in the primary cache is provided to the CPU as cache data. The primary cache misses,
When a cache hit occurs in the secondary cache, necessary data stored in the secondary cache is transferred to the primary cache, and then given to the CPU. In this case, if there is no inactive (unused) cache line capable of storing necessary data transferred from the secondary cache in the primary cache, the data stored in one cache line of the primary cache is replaced with the primary cache. And transferred to one cache line of the secondary cache. In this case, if there is no inactive (unused) cache line in the secondary cache that can store the data deleted from the primary cache, the data deleted from the primary cache can be stored.
Data stored in one cache line of the secondary cache is deleted from the secondary cache. If both the primary and secondary caches miss,
The required data is fetched from main memory and written to the primary cache. In a normal hierarchical cache, fetched data is written to both the primary cache and the secondary cache, but in this conventional example, it is not written to the secondary cache but is written only to the primary cache. By such an operation, the cache hit rate of the secondary cache is improved.

【0013】また、特開平5−73415号公報に開示
された「階層化キャッシュ方式」の従来例では、CPU
が、必要なデータが一次キャッシュか二次キャッシュに
存在するか否かを判別する。一次キャッシュがミスヒッ
トし、二次キャッシュがヒットした場合、二次キャッシ
ュでヒットしたデータは一次キャッシュに転送される。
この転送において、一次キャッシュから排除されること
となるデータは二次キャッシュに転送される。
In the conventional example of the "hierarchical cache system" disclosed in Japanese Patent Laid-Open No. 5-73415,
Determines whether the required data exists in the primary cache or the secondary cache. If the primary cache misses and the secondary cache hits, the data hit in the secondary cache is transferred to the primary cache.
In this transfer, data to be removed from the primary cache is transferred to the secondary cache.

【0014】また、特開平6−012323号公報に開
示された「キャッシュメモリシステム」の従来例では、
ダイレクトマッピング方式キャッシュが一次キャッシュ
に、FSA方式キャッシュが二次キャッシュに用いら
れ、キャッシュヒットの判定のためのタグ比較が一次キ
ャッシュと二次キャッシュとで同時に行われる。メイン
メモリからフェッチされたデータは、従来の階層化キャ
ッシュの技術と同様にして一次キャッシュと二次キャッ
シュとの両方に書き込まれる。この従来例には二次キャ
ッシュ(FSA方式キャッシュ)の各キャッシュライン
へのアクセス(キャッシュヒット)の回数をカウントす
るカウンタが提案されており、1つのキャッシュライン
のカウンタのカウント値が所定数を越えた場合には、そ
のキャッシュラインが後のアクセスのために一次キャッ
シュ(ダイレクトマッピング方式キャッシュ)にロード
される。
Further, in a conventional example of the "cache memory system" disclosed in Japanese Patent Application Laid-Open No. 6-012323,
The direct mapping cache is used for the primary cache, and the FSA cache is used for the secondary cache. Tag comparison for determining a cache hit is performed simultaneously in the primary cache and the secondary cache. Data fetched from the main memory is written to both the primary cache and the secondary cache in the same manner as in the conventional hierarchical cache technology. In this conventional example, a counter for counting the number of accesses (cache hits) to each cache line of the secondary cache (FSA cache) is proposed, and the count value of the counter of one cache line exceeds a predetermined number. If so, the cache line is loaded into the primary cache (direct mapping cache) for later access.

【0015】また、特開平6−250926号公報に開
示された「複数階層のキャッシュメモリを備えたデータ
処理システム」の従来例では、一次キャッシュがミスヒ
ットした場合には二次キャッシュへのアクセスが行われ
る。二次キャッシュがキャッシュヒットした場合、二次
キャッシュに格納されていた必要なデータが一次キャッ
シュに転送され(二次キャッシュにおいては非活性化さ
れる)、CPUに与えられる。二次キャッシュでもミス
ヒットした場合、メインメモリへのアクセスが行われ、
必要なデータがメインメモリからフェッチされる。この
従来例のある実施の形態では、一次キャッシュに十分な
メモリ空間がある場合にはメインメモリからフェッチさ
れたデータは一次キャッシュにのみ登録され(二次キャ
ッシュには登録されない)、一次キャッシュに十分なメ
モリ空間がない場合にはメインメモリからフェッチされ
たデータは二次キャッシュにのみ登録される(一次キャ
ッシュには登録されない)。他の実施の形態では、メイ
ンメモリからフェッチされたデータは一次キャッシュの
みに直接登録される(二次キャッシュには登録されな
い)。このメインメモリから一次キャッシュへの直接デ
ータ登録において一次キャッシュに登録できないデータ
が生じた場合、そのデータは一次キャッシュから転送さ
れて二次キャッシュに登録される。
In a conventional example of a "data processing system having a cache memory of a plurality of levels" disclosed in Japanese Patent Application Laid-Open No. 6-250926, if the primary cache misses, the secondary cache is not accessed. Done. When the secondary cache hits the cache, the necessary data stored in the secondary cache is transferred to the primary cache (inactivated in the secondary cache) and given to the CPU. If there is a miss in the secondary cache, the main memory is accessed,
The required data is fetched from main memory. In one embodiment of this conventional example, if there is sufficient memory space in the primary cache, the data fetched from the main memory is registered only in the primary cache (not registered in the secondary cache), and If there is no sufficient memory space, the data fetched from the main memory is registered only in the secondary cache (not registered in the primary cache). In another embodiment, data fetched from main memory is registered directly in the primary cache only (not in the secondary cache). When data that cannot be registered in the primary cache occurs in direct data registration from the main memory to the primary cache, the data is transferred from the primary cache and registered in the secondary cache.

【0016】[0016]

【発明が解決しようとする課題】前述のように、従来の
ダイレクトマッピング方式キャッシュにおいては、キャ
ッシュヒット率の高いキャッシュラインの保持を行うこ
とは不可能である。ダイレクトマッピング方式キャッシ
ュメモリは1つのインデックスに対して1つのキャッシ
ュラインしか持てないためミスヒットが頻繁にかつ反復
的に発生し、そのためメインメモリへのアクセス回数が
多くなってしまうという課題があった。
As described above, in the conventional direct mapping type cache, it is impossible to hold a cache line having a high cache hit rate. Since the direct mapping cache memory can have only one cache line for one index, there is a problem that mishits occur frequently and repeatedly, thereby increasing the number of accesses to the main memory.

【0017】また、一次キャッシュと二次キャッシュを
有した階層化キャッシュを用いることによりキャッシュ
ヒット率を改善することが可能となったが、二次キャッ
シュへのアクセスは一般に余分なアクセス時間を必要と
し、CPU等のデータ処理ユニットのプログラム実行時
間が長くなってしまうという課題があった。タグ比較を
ダイレクトマッピング方式キャッシュによりなる一次キ
ャッシュとFSA方式キャッシュによりなる二次キャッ
シュとの両方で同時に行う階層化キャッシュの従来例も
存在したが、FSA方式キャッシュにおけるヒット率の
高いキャッシュラインの保持に関して改善の余地がまだ
多く残るものであった。また、同一のデータが一次キャ
ッシュ(ダイレクトマッピング方式キャッシュ)と二次
キャッシュ(FSA方式キャッシュ)との両方に格納さ
れる場合が存在し、そのためにキャッシュメモリのメモ
リ空間の使用効率が低下し、キャッシュメモリに格納可
能なキャッシュデータの量が減少してしまい、キャッシ
ュヒット率を最大まで向上させることができないという
課題があった。
Although the use of a hierarchical cache having a primary cache and a secondary cache makes it possible to improve the cache hit rate, access to the secondary cache generally requires extra access time. There has been a problem that the program execution time of a data processing unit such as a CPU becomes longer. There has been a conventional example of a hierarchical cache in which tag comparison is simultaneously performed in both a primary cache formed by a direct mapping cache and a secondary cache formed by an FSA cache. There is still much room for improvement. In addition, there is a case where the same data is stored in both the primary cache (direct mapping cache) and the secondary cache (FSA cache), so that the use efficiency of the memory space of the cache memory is reduced, There is a problem that the amount of cache data that can be stored in the memory decreases, and the cache hit rate cannot be improved to the maximum.

【0018】本発明は、このような従来の技術における
課題を解決するものであり、FSA方式キャッシュとダ
イレクトマッピング方式キャッシュ等のFSA方式以外
のキャッシュとを組み合わせ、ヒット率の高いキャッシ
ュラインの保持性能とキャッシュメモリ空間の使用効率
を向上することにより、高速データアクセスと高キャッ
シュヒット率の両方を高レベルで実現し、これによりC
PU、MPU等のデータ処理ユニットの、メインメモリ
等の外部メモリへのアクセス回数とデータアクセス時間
とを最小化することが可能なキャッシュシステムおよび
キャッシュ処理方法を提供することを目的とする。
The present invention solves the above-mentioned problems in the conventional technology, and combines an FSA cache and a non-FSA cache such as a direct mapping cache to provide a cache line having a high hit rate. And high efficiency of the cache memory space, thereby realizing both high-speed data access and a high cache hit rate at a high level.
It is an object of the present invention to provide a cache system and a cache processing method capable of minimizing the number of accesses to an external memory such as a main memory and the data access time of a data processing unit such as a PU and an MPU.

【0019】[0019]

【課題を解決するための手段】請求項1記載のキャッシ
ュシステムは、CPU(Central Proces
sing Unit)、MPU(MicroProce
ssor Unit)等のデータ処理ユニットの、メイ
ンメモリ等の外部メモリへのアクセス回数を削減するた
めのキャッシュシステムにおいて、キャッシュヒット率
の高いキャッシュラインの保持が可能なFSA(フルセ
ットアソシアティブ)方式キャッシュであり入力アドレ
スデータから抽出された第1のタグが前記FSA方式キ
ャッシュの活性なキャッシュラインに格納されていた第
1のタグの一つと一致した場合にその一致した第1のタ
グに対応する活性なキャッシュラインに格納されていた
データが前記データ処理ユニットによりキャッシュデー
タとして読み込まれるFSA方式キャッシュと、前記キ
ャッシュシステムにおいて前記FSA方式キャッシュと
組み合わせられる形で設けられキャッシュヒット判定の
ためのタグ比較を前記FSA方式キャッシュと同時に行
うFSA方式以外のキャッシュであり前記入力アドレス
データから抽出された第2のタグが前記FSA方式以外
のキャッシュの前記入力アドレスデータから抽出された
インデックスに対応する活性なキャッシュラインに格納
されていた第2のタグに一致した場合にその一致した第
2のタグに対応する活性なキャッシュラインに格納され
ていたデータが前記データ処理ユニットによりキャッシ
ュデータとして読み込まれるFSA方式以外のキャッシ
ュと、前記FSA方式キャッシュの各キャッシュライン
に対応して設けられ前記キャッシュラインに生じたキャ
ッシュヒットの回数に関するキャッシュヒットカウント
値を格納するキャッシュヒットカウント格納手段と、前
記FSA方式キャッシュの各キャッシュラインのキャッ
シュヒットをカウントし前記キャッシュヒットカウント
格納手段に格納される前記キャッシュヒットカウント値
を管理し更新するキャッシュヒットカウント管理手段と
を備えるようにし、前記FSA方式以外のキャッシュに
前記インデックスに対応する非活性なキャッシュライン
が存在せず前記FSA方式キャッシュに1以上の非活性
なキャッシュラインが存在する時に前記FSA方式キャ
ッシュと前記FSA方式以外のキャッシュの両方がミス
ヒットした場合は、前記FSA方式以外のキャッシュの
ミスヒットした前記インデックスに対応するあるキャッ
シュラインに格納されていたデータが前記FSA方式キ
ャッシュの前記非活性なキャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリからフェッチされたデータは前記FSA
方式キャッシュへのデータ転送元となった前記FSA方
式以外のキャッシュの前記キャッシュラインに書き込ま
れるようにし、前記FSA方式以外のキャッシュに前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュが活性なキャッシュラ
インで一杯な時に前記FSA方式キャッシュと前記FS
A方式以外のキャッシュの両方がミスヒットした場合
は、前記FSA方式以外のキャッシュのミスヒットした
前記インデックスに対応するあるキャッシュラインに格
納されていたデータが前記FSA方式キャッシュの最小
のキャッシュヒットカウント値を持つキャッシュライン
のうちの一つに転送され、前記両方のキャッシュのミス
ヒットにより前記外部メモリからフェッチされたデータ
は前記FSA方式キャッシュへのデータ転送元となった
前記FSA方式以外のキャッシュの前記キャッシュライ
ンに書き込まれるようにし、前記FSA方式以外のキャ
ッシュに前記インデックスに対応する非活性なキャッシ
ュラインが存在する時に前記FSA方式キャッシュと前
記FSA方式以外のキャッシュの両方がミスヒットした
場合は、前記両方のキャッシュのミスヒットにより前記
外部メモリからフェッチされたデータは前記FSA方式
以外のキャッシュの前記インデックスに対応する非活性
なキャッシュラインに書き込まれるようにしたものであ
る。
According to a first aspect of the present invention, there is provided a cache system comprising a CPU (Central Processes).
sing Unit), MPU (MicroProce)
In a cache system for reducing the number of accesses to an external memory such as a main memory of a data processing unit such as a ssor unit, an FSA (full set associative) type cache capable of holding a cache line having a high cache hit rate is used. If the first tag extracted from the input address data matches one of the first tags stored in the active cache line of the FSA cache, the active tag corresponding to the matched first tag is used. An FSA cache in which data stored in a cache line is read as cache data by the data processing unit, and a tag comparison for determining a cache hit, which is provided in the cache system in combination with the FSA cache. An active cache line that is a non-FSA cache that is performed simultaneously with the FSA cache and whose second tag extracted from the input address data corresponds to an index extracted from the input address data of the non-FSA cache. A non-FSA cache in which data stored in an active cache line corresponding to the matched second tag is read as cache data by the data processing unit when the second tag stored in the cache matches. A cache hit count storage means provided corresponding to each cache line of the FSA cache and storing a cache hit count value relating to the number of cache hits occurring in the cache line; A cache hit count management unit that counts a cache hit of a line and manages and updates the cache hit count value stored in the cache hit count storage unit, and stores the cache corresponding to the index in the non-FSA cache. If there is no inactive cache line and there is one or more inactive cache lines in the FSA cache and both the FSA cache and the non-FSA cache miss-hit, the FSA cache is not used. Is transferred to one of the inactive cache lines of the FSA cache, and the data stored in a cache line corresponding to the index of the cache that has missed is transferred to one of the inactive cache lines. Data fetched from Kigaibu memory the FSA
The data is transferred to the cache line of the cache other than the FSA system which is the data transfer source to the system cache, and there is no inactive cache line corresponding to the index in the cache other than the FSA system, and the FSA system The FSA cache and the FS when the cache is full of active cache lines
If both of the caches other than the A-type cache miss-hit, the data stored in a certain cache line corresponding to the index of the cache other than the FSA-type cache becomes the minimum cache hit count value of the FSA-type cache. The data fetched from the external memory due to the mishit of both the caches is transferred to one of the cache lines having the non-FSA type cache which is the data transfer source to the FSA type cache. In the case where both the FSA cache and the non-FSA cache miss-hit when there is an inactive cache line corresponding to the index in the cache other than the FSA cache, Both Data fetched from the external memory by mishit Yasshu are those to be written to the non-active cache line corresponding to the index of the cache other than the FSA method.

【0020】請求項2記載のキャッシュシステムは、請
求項1記載のキャッシュシステムにおいて、前記FSA
方式キャッシュのあるキャッシュラインがキャッシュヒ
ットした場合には、前記キャッシュヒットカウント管理
手段はそのキャッシュラインの前記キャッシュヒットカ
ウント値を1つインクリメントし、前記FSA方式キャ
ッシュと前記FSA方式以外のキャッシュの両方がミス
ヒットした場合には、前記キャッシュヒットカウント管
理手段は前記FSA方式キャッシュの全キャッシュライ
ンの前記キャッシュヒットカウント値を一斉に1つデク
リメントするようにしたものである。
According to a second aspect of the present invention, in the cache system according to the first aspect, the FSA
When a cache line in a cache system has a cache hit, the cache hit count management means increments the cache hit count value of the cache line by one, and both the FSA cache and the non-FSA cache are updated. In the case of a miss hit, the cache hit count management means decrements the cache hit count value of all the cache lines of the FSA type cache by one at a time.

【0021】請求項3記載のキャッシュシステムは、請
求項1記載のキャッシュシステムにおいて、前記FSA
方式キャッシュのあるキャッシュラインがキャッシュヒ
ットした場合には、前記キャッシュヒットカウント管理
手段はそのキャッシュラインの前記キャッシュヒットカ
ウント値を1つインクリメントし、前記FSA方式キャ
ッシュがミスヒットした場合には、前記キャッシュヒッ
トカウント管理手段は前記FSA方式キャッシュの全キ
ャッシュラインの前記キャッシュヒットカウント値を一
斉に1つデクリメントするようにしたものである。
According to a third aspect of the present invention, in the cache system according to the first aspect, the FSA
The cache hit count management means increments the cache hit count value of the cache line by one when a cache line of the cache system has a cache hit. The hit count management means decrements the cache hit count value of all the cache lines of the FSA cache by one at a time.

【0022】請求項4記載のキャッシュシステムは、請
求項1記載のキャッシュシステムにおいて、前記FSA
方式キャッシュのあるキャッシュラインがキャッシュヒ
ットした場合には、前記キャッシュヒットカウント管理
手段はそのキャッシュラインの前記キャッシュヒットカ
ウント値を1つインクリメントするようにしたものであ
る。
According to a fourth aspect of the present invention, in the cache system according to the first aspect, the FSA
When a cache line in a system cache has a cache hit, the cache hit count management means increments the cache hit count value of the cache line by one.

【0023】請求項5記載のキャッシュシステムは、請
求項1から4のうちのいずれか1項に記載のキャッシュ
システムにおいて、前記FSA方式以外のキャッシュと
して、ダイレクトマッピング方式キャッシュを用いるも
のである。
A cache system according to a fifth aspect of the present invention is the cache system according to any one of the first to fourth aspects, wherein a direct mapping cache is used as a cache other than the FSA cache.

【0024】請求項6記載のキャッシュシステムは、請
求項1から4のうちのいずれか1項に記載のキャッシュ
システムにおいて、前記FSA方式以外のキャッシュと
して、Nウェイセットアソシアティブキャッシュ(N=
2,4,8,・・・)が用いるものである。
A cache system according to a sixth aspect of the present invention is the cache system according to any one of the first to fourth aspects, wherein an N-way set associative cache (N =
2, 4, 8,...) Are used.

【0025】請求項7記載のキャッシュシステムは、請
求項1から6のうちのいずれか1項に記載のキャッシュ
システムにおいて、前記FSA方式キャッシュの各キャ
ッシュラインに対応して設けられ、前記キャッシュライ
ンに生じた最新のキャッシュヒットの日時に関するデー
タを格納するキャッシュヒット日時格納手段をさらに備
えるようにし、前記FSA方式以外のキャッシュに前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュが活性なキャッシュラ
インで一杯な時に前記FSA方式キャッシュと前記FS
A方式以外のキャッシュの両方がミスヒットした前記場
合には、前記キャッシュヒット日時格納手段に格納され
た前記データに基づいて前記FSA方式キャッシュの前
記最小のキャッシュヒットカウント値を持つ前記キャッ
シュラインの中から最近のキャッシュヒットが最も古い
キャッシュラインが選択され、その選択されたキャッシ
ュラインが前記FSA方式以外のキャッシュから前記F
SA方式キャッシュへの前記データ転送の転送先として
指定されるようにしたものである。
A cache system according to a seventh aspect of the present invention is the cache system according to any one of the first to sixth aspects, wherein the cache system is provided corresponding to each cache line of the FSA cache. The system further includes a cache hit date and time storage unit for storing data relating to the date and time of the latest cache hit that has occurred, wherein the inactive cache line corresponding to the index does not exist in a cache other than the FSA system and the FSA system cache is The FSA cache and the FS when the active cache line is full
In the case where both of the caches other than the system A have a mishit, the cache line having the minimum cache hit count value of the FSA system cache based on the data stored in the cache hit date and time storage means. The cache line with the oldest cache hit is selected, and the selected cache line is
This is specified as a transfer destination of the data transfer to the SA system cache.

【0026】請求項8記載のキャッシュシステムは、請
求項6記載のキャッシュシステムにおいて、各インデッ
クスに対応して設けられ、そのインデックスに対応する
N本のキャッシュラインの中で最近のキャッシュヒット
が最も古いキャッシュラインを示すためのLRU(Le
ast Recently Used)値を格納するL
RU格納手段をさらに備えるようにし、前記Nウェイセ
ットアソシアティブキャッシュに前記インデックスに対
応する非活性なキャッシュラインが存在せず前記FSA
方式キャッシュに1以上の非活性なキャッシュラインが
存在する時に前記FSA方式キャッシュと前記Nウェイ
セットアソシアティブキャッシュの両方がミスヒットし
た前記場合には、前記Nウェイセットアソシアティブキ
ャッシュのN本のミスヒットしたキャッシュラインの中
から前記LRU値により指定されたキャッシュラインが
選択され、その選択されたキャッシュラインに格納され
ていたデータが前記FSA方式キャッシュの前記非活性
なキャッシュラインのうちの一つに転送され、前記両方
のキャッシュのミスヒットにより前記外部メモリからフ
ェッチされたデータは前記FSA方式キャッシュへのデ
ータ転送元となった前記Nウェイセットアソシアティブ
キャッシュの前記選択されたキャッシュラインに書き込
まれるようにし、前記Nウェイセットアソシアティブキ
ャッシュに前記インデックスに対応する非活性なキャッ
シュラインが存在せず前記FSA方式キャッシュが活性
なキャッシュラインで一杯な時に前記FSA方式キャッ
シュと前記Nウェイセットアソシアティブキャッシュの
両方がミスヒットした前記場合には、前記Nウェイセッ
トアソシアティブキャッシュのN本のミスヒットしたキ
ャッシュラインの中から前記LRU値により指定された
キャッシュラインが選択され、その選択されたキャッシ
ュラインに格納されていたデータが前記FSA方式キャ
ッシュの前記最小のキャッシュヒットカウント値を持つ
前記キャッシュラインのうちの一つに転送され、前記両
方のキャッシュのミスヒットにより前記外部メモリから
フェッチされたデータは前記FSA方式キャッシュへの
データ転送元転送元となった前記Nウェイセットアソシ
アティブキャッシュの前記選択されたキャッシュライン
に書き込まれるようにし、前記Nウェイセットアソシア
ティブキャッシュに前記インデックスに対応する非活性
なキャッシュラインが1以上存在する時に前記FSA方
式キャッシュと前記Nウェイセットアソシアティブキャ
ッシュの両方がミスヒットした前記場合には、前記両方
のキャッシュのミスヒットにより前記外部メモリからフ
ェッチされたデータは前記Nウェイセットアソシアティ
ブキャッシュの前記インデックスに対応する前記非活性
なキャッシュラインのうちの一つのキャッシュラインに
書き込まれるようにしたものである。
The cache system according to claim 8 is the cache system according to claim 6, wherein the cache system is provided corresponding to each index, and the latest cache hit among the N cache lines corresponding to the index is the oldest. LRU (Le for indicating a cache line)
L that stores the value of the last recently used value
RU storage means, wherein the inactive cache line corresponding to the index does not exist in the N-way set associative cache and the FSA
In the case where both the FSA cache and the N-way set associative cache miss-hit when one or more inactive cache lines are present in the cache, the N misses of the N-way set associative cache have occurred. A cache line specified by the LRU value is selected from the cache lines, and data stored in the selected cache line is transferred to one of the inactive cache lines of the FSA cache. The data fetched from the external memory due to the mishits of the two caches is written to the selected cache line of the N-way set associative cache from which data is transferred to the FSA cache; When there is no inactive cache line corresponding to the index in the N-way set associative cache and the FSA cache is full of active cache lines, both the FSA cache and the N-way set associative cache have a miss. In this case, the cache line specified by the LRU value is selected from the N missed cache lines of the N-way set associative cache, and the data stored in the selected cache line is deleted. Data transferred to one of the cache lines of the FSA cache having the smallest cache hit count value and fetched from the external memory due to a mishit in both caches is An inactive cache line corresponding to the index is written to the selected cache line of the N-way set associative cache that has become a data transfer source transfer source to the expression cache. In the above case, when both the FSA cache and the N-way set associative cache miss-hit, the data fetched from the external memory due to the miss-hit of both the caches is stored in the N-way set associative cache. The data is written to one of the inactive cache lines corresponding to the index.

【0027】請求項9記載のキャッシュシステムは、請
求項1から8のうちのいずれか1項に記載のキャッシュ
システムにおいて、前記FSA方式キャッシュと前記F
SA方式以外のキャッシュからなる一次キャッシュに付
加して設けられた二次キャッシュをさらに備えるように
したものである。
A cache system according to a ninth aspect of the present invention is the cache system according to any one of the first to eighth aspects, wherein the FSA cache and the FSA cache are provided.
A secondary cache is further provided in addition to a primary cache including a cache other than the SA system.

【0028】請求項10記載のキャッシュ処理方法は、
キャッシュヒット率の高いキャッシュラインの保持が可
能なFSA(フルセットアソシアティブ)方式キャッシ
ュと前記FSA方式キャッシュと同時にキャッシュヒッ
ト判定のためのタグ比較を行うFSA方式以外のキャッ
シュとの組み合わせを用い、CPU(CentralP
rocessing Unit)、MPU(Micro
ProcessorUnit)等のデータ処理ユニット
の、メインメモリ等の外部メモリへのアクセス回数を削
減するためのキャッシュ処理方法において、入力アドレ
スデータから抽出された第1のタグが前記FSA方式キ
ャッシュの活性なキャッシュラインに格納されていた複
数の第1のタグと比較され、前記第1のタグの一致が有
った場合に前記FSA方式キャッシュがキャッシュヒッ
トしたと判定される第1のタグ比較工程と、前記第1の
タグ比較工程と同時に行われ、前記入力アドレスデータ
から抽出された第2のタグが前記FSA方式以外のキャ
ッシュの前記入力アドレスデータから抽出されたインデ
ックスに対応する1以上の活性なキャッシュラインに格
納されていた第2のタグと比較され、前記第2のタグの
一致が有った場合に前記FSA方式以外のキャッシュが
キャッシュヒットしたと判定される第2のタグ比較工程
と、前記FSA方式キャッシュの各キャッシュラインに
起きたキャッシュヒットがカウントされ、前記FSA方
式キャッシュの各キャッシュラインに対応して設けられ
たキャッシュヒットカウント格納手段に格納された各キ
ャッシュライン毎のキャッシュヒットカウント値が管理
し更新されるキャッシュヒットカウント管理工程と、前
記第1のタグ比較工程において前記FSA方式キャッシ
ュがキャッシュヒットした場合に、前記FSA方式キャ
ッシュの前記一致した第1のタグに対応するキャッシュ
ラインに格納されていたデータが、前記データ処理ユニ
ットによりキャッシュデータとして読み込まれる第1の
キャッシュデータ読み込み工程と、前記第2のタグ比較
工程において前記FSA方式以外のキャッシュがキャッ
シュヒットした場合に、前記FSA方式以外のキャッシ
ュの前記インデックスと前記一致した第2のタグに対応
するキャッシュラインに格納されていたデータが、前記
データ処理ユニットによりキャッシュデータとして読み
込まれる第2のキャッシュデータ読み込み工程と、前記
FSA方式以外のキャッシュに前記インデックスに対応
する非活性なキャッシュラインが存在せず前記FSA方
式キャッシュに1以上の非活性なキャッシュラインが存
在する時に前記FSA方式キャッシュと前記FSA方式
以外のキャッシュの両方がミスヒットした場合に、前記
FSA方式以外のキャッシュのミスヒットした前記イン
デックスに対応するあるキャッシュラインに格納されて
いたデータが前記FSA方式キャッシュの前記非活性な
キャッシュラインのうちの一つに転送され、前記両方の
キャッシュのミスヒットにより前記外部メモリからフェ
ッチされたデータが前記FSA方式キャッシュへのデー
タ転送元となった前記FSA方式以外のキャッシュの前
記キャッシュラインに書き込まれる第1のデータ転送工
程と、前記FSA方式以外のキャッシュに前記インデッ
クスに対応する非活性なキャッシュラインが存在せず前
記FSA方式キャッシュが活性なキャッシュラインで一
杯な時に前記FSA方式キャッシュと前記FSA方式以
外のキャッシュの両方がミスヒットした場合に、前記F
SA方式以外のキャッシュのミスヒットした前記インデ
ックスに対応するあるキャッシュラインに格納されてい
たデータが前記FSA方式キャッシュの最小のキャッシ
ュヒットカウント値を持つキャッシュラインのうちの一
つに転送され、前記両方のキャッシュのミスヒットによ
り前記外部メモリからフェッチされたデータが前記FS
A方式キャッシュへのデータ転送元となった前記FSA
方式以外のキャッシュの前記キャッシュラインに書き込
まれる第2のデータ転送工程と、前記FSA方式以外の
キャッシュに前記インデックスに対応する非活性なキャ
ッシュラインが存在する時に前記FSA方式キャッシュ
と前記FSA方式以外のキャッシュの両方がミスヒット
した場合に、前記両方のキャッシュのミスヒットにより
前記外部メモリからフェッチされたデータが前記FSA
方式以外のキャッシュの前記インデックスに対応する非
活性なキャッシュラインに書き込まれる第3のデータ転
送工程とを備えるようにしたものである。
[0028] The cache processing method according to claim 10 is
Using a combination of an FSA (full set associative) cache capable of holding a cache line with a high cache hit rate and a cache other than the FSA cache that performs tag comparison for cache hit determination simultaneously with the FSA cache, CentralP
processing Unit), MPU (Micro
In a cache processing method for reducing the number of accesses to an external memory such as a main memory of a data processing unit such as a processor unit, a first tag extracted from input address data is an active cache line of the FSA type cache. A first tag comparison step of comparing the first tag stored in the first tag with the first tag and determining that the FSA cache has a cache hit when there is a match of the first tag; And the second tag extracted from the input address data is stored in one or more active cache lines corresponding to the index extracted from the input address data in the non-FSA cache. Compared with the stored second tag, if there is a match of the second tag A second tag comparison step in which a cache other than the FSA cache is determined to have a cache hit, and a cache hit occurring in each cache line of the FSA cache are counted and correspond to each cache line of the FSA cache. A cache hit count management step of managing and updating the cache hit count value for each cache line stored in the cache hit count storage means provided in the cache memory; A first cache data reading step in which the data stored in the cache line corresponding to the matched first tag in the FSA cache is read as cache data by the data processing unit; In the second tag comparison step, when a cache hit of the non-FSA system cache hits, the data stored in the cache line corresponding to the second tag that matches the index of the non-FSA system cache is deleted. A second cache data reading step in which the data processing unit reads the cache data as cache data; and there is no inactive cache line corresponding to the index in the cache other than the FSA system, and one or more non-active cache lines are stored in the FSA system cache. If both the FSA cache and the non-FSA cache miss-hit when an active cache line exists, the cache is stored in a certain cache line corresponding to the missed index of the non-FSA cache. The data that has been fetched from the external memory due to the mishits of both caches is transferred to one of the inactive cache lines of the FSA A first data transfer step of writing to the cache line of the non-FSA cache, and the inactive cache line corresponding to the index does not exist in the non-FSA cache and the FSA cache becomes active. If both the FSA cache and the non-FSA cache miss-hit when the cache line is full,
The data stored in a certain cache line corresponding to the index in which the cache hit other than the SA type has hit is transferred to one of the cache lines having the minimum cache hit count value of the FSA type cache. The data fetched from the external memory due to the cache mishit of
The FSA from which data is transferred to the A-type cache
A second data transfer step in which data is written to the cache line of the non-FSA cache, and when there is an inactive cache line corresponding to the index in the non-FSA cache, the FSA cache and the non-FSA cache are used. If both cache misses, the data fetched from the external memory due to both cache misses is
And a third data transfer step of writing data to an inactive cache line corresponding to the index of the cache other than the scheme.

【0029】請求項11記載のキャッシュ処理方法は、
請求項10記載のキャッシュ処理方法の前記キャッシュ
ヒットカウント管理工程において、前記FSA方式キャ
ッシュのあるキャッシュラインがキャッシュヒットした
場合には、そのキャッシュラインの前記キャッシュヒッ
トカウント値が1つインクリメントされ、前記FSA方
式キャッシュと前記FSA方式以外のキャッシュの両方
がミスヒットした場合には、前記FSA方式キャッシュ
の全キャッシュラインの前記キャッシュヒットカウント
値が一斉に1つデクリメントされるようにしたものであ
る。
The cache processing method according to claim 11 is
11. The cache hit count managing step of the cache processing method according to claim 10, wherein, when a cache hit occurs in a cache line of the FSA cache, the cache hit count value of the cache line is incremented by one, and When both the system cache and the non-FSA system cache miss, the cache hit count value of all the cache lines of the FSA system cache is decremented by one at a time.

【0030】請求項12記載のキャッシュ処理方法は、
請求項10記載のキャッシュ処理方法の前記キャッシュ
ヒットカウント管理工程において、前記FSA方式キャ
ッシュのあるキャッシュラインがキャッシュヒットした
場合には、そのキャッシュラインの前記キャッシュヒッ
トカウント値が1つインクリメントされ、前記FSA方
式キャッシュがミスヒットした場合には、前記FSA方
式キャッシュの全キャッシュラインの前記キャッシュヒ
ットカウント値が一斉に1つデクリメントされるように
したものである。
The cache processing method according to claim 12 is
11. The cache hit count managing step of the cache processing method according to claim 10, wherein when a cache line of the FSA type cache has a cache hit, the cache hit count value of the cache line is incremented by one, and When the system cache misses, the cache hit count value of all the cache lines of the FSA system cache is decremented by one at a time.

【0031】請求項13記載のキャッシュ処理方法は、
請求項10記載のキャッシュ処理方法の前記キャッシュ
ヒットカウント管理工程において、前記FSA方式キャ
ッシュのあるキャッシュラインがキャッシュヒットした
場合には、そのキャッシュラインの前記キャッシュヒッ
トカウント値が1つインクリメントされるようにしたも
のである。
A cache processing method according to claim 13 is
11. The cache hit count managing step of the cache processing method according to claim 10, wherein when a cache hit occurs in a certain cache line of the FSA cache, the cache hit count value of the cache line is incremented by one. It was done.

【0032】請求項14記載のキャッシュ処理方法は、
請求項10から13のうちのいずれか1項に記載のキャ
ッシュ処理方法において、前記FSA方式以外のキャッ
シュとして、ダイレクトマッピング方式キャッシュを用
いるようにしたものである。
The cache processing method according to claim 14 is
The cache processing method according to any one of claims 10 to 13, wherein a direct mapping cache is used as the cache other than the FSA cache.

【0033】請求項15記載のキャッシュ処理方法は、
請求項10から13のうちのいずれか1項に記載のキャ
ッシュ処理方法において、前記FSA方式以外のキャッ
シュとして、Nウェイセットアソシアティブキャッシュ
(N=2,4,8,・・・)を用いるようにしたもので
ある。
The cache processing method according to claim 15 is
14. The cache processing method according to claim 10, wherein an N-way set associative cache (N = 2, 4, 8,...) Is used as the cache other than the FSA scheme. It was done.

【0034】請求項16記載のキャッシュ処理方法は、
請求項10から15のうちのいずれか1項に記載のキャ
ッシュ処理方法において、前記FSA方式キャッシュの
各キャッシュラインに生じた最新のキャッシュヒットの
日時に関するデータを前記各キャッシュラインに対応し
て設けられたキャッシュヒット日時格納手段に格納する
キャッシュヒット日時格納工程をさらに備えるように
し、前記第2のデータ転送工程においては、前記キャッ
シュヒット日時格納手段に格納された前記データに基づ
いて前記FSA方式キャッシュの前記最小のキャッシュ
ヒットカウント値を持つ前記キャッシュラインの中から
最近のキャッシュヒットが最も古いキャッシュラインが
選択され、その選択されたキャッシュラインが前記FS
A方式以外のキャッシュから前記FSA方式キャッシュ
への前記データ転送の転送先として指定されるようにし
たものである。
The cache processing method according to claim 16 is
16. The cache processing method according to claim 10, wherein data relating to the date and time of the latest cache hit occurring in each cache line of the FSA cache is provided corresponding to each cache line. A cache hit date / time storing step of storing the data in the cache hit date / time storing means, and in the second data transfer step, the FSA cache based on the data stored in the cache hit date / time storing means. The cache line having the oldest cache hit is selected from among the cache lines having the minimum cache hit count value, and the selected cache line is assigned to the FS.
It is designed to be designated as a transfer destination of the data transfer from a cache other than the A system to the FSA system cache.

【0035】請求項17記載のキャッシュ処理方法は、
請求項15記載のキャッシュ処理方法において、各イン
デックスに対応するN本のキャッシュラインの中で最近
のキャッシュヒットが最も古いキャッシュラインを示す
ためのLRU(LeastRecently Use
d)値を各インデックスに対応して設けられたLRU格
納手段に格納するLRU格納工程をさらに備えるように
し、前記第1のデータ転送工程においては、前記Nウェ
イセットアソシアティブキャッシュのN本のミスヒット
したキャッシュラインの中から前記LRU値により指定
されたキャッシュラインが選択され、その選択されたキ
ャッシュラインに格納されていたデータが前記FSA方
式キャッシュの前記非活性なキャッシュラインのうちの
一つに転送され、前記両方のキャッシュのミスヒットに
より前記外部メモリからフェッチされたデータは前記F
SA方式キャッシュへのデータ転送元となった前記Nウ
ェイセットアソシアティブキャッシュの前記選択された
キャッシュラインに書き込まれるようにし、前記第2の
データ転送工程においては、前記Nウェイセットアソシ
アティブキャッシュのN本のミスヒットしたキャッシュ
ラインの中から前記LRU値により指定されたキャッシ
ュラインが選択され、その選択されたキャッシュライン
に格納されていたデータが前記FSA方式キャッシュの
前記最小のキャッシュヒットカウント値を持つ前記キャ
ッシュラインのうちの一つに転送され、前記両方のキャ
ッシュのミスヒットにより前記外部メモリからフェッチ
されたデータは前記FSA方式キャッシュへのデータ転
送元となった前記Nウェイセットアソシアティブキャッ
シュの前記選択されたキャッシュラインに書き込まれる
ようにし、前記第3のデータ転送工程においては、前記
両方のキャッシュのミスヒットにより前記外部メモリか
らフェッチされたデータは前記Nウェイセットアソシア
ティブキャッシュの前記インデックスに対応する前記非
活性なキャッシュラインのうちの一つのキャッシュライ
ンに書き込まれるようにしたものである。
The cache processing method according to claim 17 is
16. The cache processing method according to claim 15, wherein an LRU (LeastRecently Use) for indicating a cache line in which a latest cache hit indicates an oldest cache line among N cache lines corresponding to each index.
d) an LRU storing step of storing a value in an LRU storing means provided corresponding to each index, wherein in the first data transfer step, N number of misses of the N-way set associative cache are stored. A cache line specified by the LRU value is selected from the selected cache lines, and data stored in the selected cache line is transferred to one of the inactive cache lines of the FSA type cache. And the data fetched from the external memory due to the mishit of both the caches is
The data is written to the selected cache line of the N-way set associative cache that has been the data transfer source to the SA system cache. The cache line specified by the LRU value is selected from the cache lines that have missed, and the data stored in the selected cache line has the minimum cache hit count value of the FSA cache. The data transferred to one of the lines and fetched from the external memory due to a mishit in both caches is selected by the N-way set associative cache from which data was transferred to the FSA cache. In the third data transfer step, the data fetched from the external memory due to the mishits of the two caches is stored in the non-cache corresponding to the index of the N-way set associative cache. The data is written to one of the active cache lines.

【0036】請求項18記載のキャッシュ処理方法は、
請求項10から17のうちのいずれか1項に記載のキャ
ッシュ処理方法において、前記FSA方式キャッシュと
前記FSA方式以外のキャッシュの両方がミスヒットし
た場合に前記FSA方式キャッシュと前記FSA方式以
外のキャッシュからなる一次キャッシュに付加する形で
設けられた二次キャッシュへのアクセスが行われる二次
キャッシュアクセス工程をさらに備えるようにしたもの
である。
The cache processing method according to claim 18 is
The cache processing method according to any one of claims 10 to 17, wherein both the FSA cache and the non-FSA cache miss-hit the FSA cache and the non-FSA cache. And a secondary cache access step for accessing a secondary cache provided in addition to the primary cache.

【0037】請求項19から27に記載の機械読み取り
可能な記録媒体は、請求項10から18に記載のキャッ
シュ処理方法に従うキャッシュ処理をコンピュータに実
行させるためのプログラムを格納した機械読み取り可能
な記録媒体である。
A machine-readable recording medium according to any one of claims 19 to 27, wherein the computer-readable recording medium stores a program for causing a computer to execute a cache process according to the cache processing method according to any one of claims 10 to 18. It is.

【0038】[0038]

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

【0039】実施の形態1.図1は本発明の実施の形態
1によるキャッシュシステムのキャッシュ部15の構成
を示すブロック図であり、図2は本発明の実施の形態1
によるキャッシュシステムが適用されたコンピュータシ
ステムの例を示すブロック図である。
Embodiment 1 FIG. 1 is a block diagram showing a configuration of a cache unit 15 of a cache system according to a first embodiment of the present invention, and FIG. 2 is a first embodiment of the present invention.
1 is a block diagram showing an example of a computer system to which a cache system according to the present invention is applied.

【0040】図2のコンピュータシステムは、CPU
(Central Processing Unit)
50、二次キャッシュ20、およびメインメモリ21を
備えており、二次キャッシュ20はCPU50の外部に
設けられている。二次キャッシュ20は、例えば、タグ
RAMとデータRAMとを備えたシンクロナスSRAM
や、ページROMを備えたメモリによって実現されてい
る。二次キャッシュ20の種類(フルセットアソシアテ
ィブ方式であるか否か等)は特に限定されない。図2の
コンピュータシステムには、CPU50、二次キャッシ
ュ20、メインメモリ21等を接続するアドレスバス1
とデータバス2が設けられており、メインメモリ21
は、CPU50の外部のアドレスバス1とデータバス2
とに、二次キャッシュ20と共に接続されている。
The computer system shown in FIG.
(Central Processing Unit)
50, a secondary cache 20, and a main memory 21. The secondary cache 20 is provided outside the CPU 50. The secondary cache 20 is, for example, a synchronous SRAM having a tag RAM and a data RAM.
And a memory having a page ROM. The type of the secondary cache 20 (whether or not a full set associative method is used) is not particularly limited. The computer system shown in FIG. 2 includes an address bus 1 for connecting the CPU 50, the secondary cache 20, the main memory 21, and the like.
And the data bus 2 are provided.
Are an address bus 1 and a data bus 2 external to the CPU 50.
At the same time as the secondary cache 20.

【0041】CPU50は、バスインタフェース(I/
F)部3、書込バッファ4、コントロールレジスタ5、
MMU(Memory Management Uni
t)レジスタ6、ALU(arithmetic lo
gic operationunit)7、GPR(G
eneral Purpose Register)レ
ジスタ8、マルチプライヤ9、バレルシフタ10、プロ
グラムカウンタ11、クロックジェネレータ12、キャ
ッシュ部15等を有している。このキャッシュ部15
は、本実施の形態のキャッシュシステムの一次キャッシ
ュとしてCPU50に設けられているもので、このキャ
ッシュ部15もアドレスバス1とデータバス2とに接続
されている。
The CPU 50 has a bus interface (I /
F) unit 3, write buffer 4, control register 5,
MMU (Memory Management Uni)
t) Register 6, ALU (arithmetic lo)
gic operation unit) 7, GPR (G
It has a register 8, a multiplier 9, a barrel shifter 10, a program counter 11, a clock generator 12, a cache unit 15, and the like. This cache unit 15
Is provided in the CPU 50 as a primary cache of the cache system of the present embodiment, and the cache unit 15 is also connected to the address bus 1 and the data bus 2.

【0042】クロックジェネレータ12は、与えられた
マスタクロック信号の周波数を逓倍して本コンピュータ
システムのクロック信号を生成し、そのクロック信号を
コンピュータシステムの各部品に供給する。書込バッフ
ァ4は、メインメモリ21や二次キャッシュ20等に書
き込まれるシステムデータを一時的に格納するバッファ
であり、バスI/F部3を介してアドレスバス1とデー
タバス2とに接続されている。システムデータの書込
は、バスI/F部3に供給される制御データに従って行
われる。コントロールレジスタ5とMMUレジスタ6も
同様にアドレスバス1とデータバス2に接続されてい
る。コントロールレジスタ5は、クロックジェネレータ
12の周波数逓倍数などの、CPU50の基本設定に関
するデータを格納し、MMUレジスタ6は仮想アドレス
−物理アドレス間のアドレス変換用のデータを格納す
る。ALU7、GPRレジスタ8、マルチプライヤ9、
バレルシフタ10およびプログラムカウンタ11を含む
各命令の実行のためのユニットも、アドレスバス1とデ
ータバス2に接続されている。なお、この部品7〜11
を含むユニットを以降、命令実行ユニットと呼ぶ。
The clock generator 12 multiplies the frequency of the applied master clock signal to generate a clock signal for the computer system, and supplies the clock signal to each component of the computer system. The write buffer 4 is a buffer for temporarily storing system data to be written to the main memory 21 or the secondary cache 20, and is connected to the address bus 1 and the data bus 2 via the bus I / F unit 3. ing. The writing of the system data is performed according to the control data supplied to the bus I / F unit 3. The control register 5 and the MMU register 6 are similarly connected to the address bus 1 and the data bus 2. The control register 5 stores data relating to basic settings of the CPU 50, such as the frequency multiple of the clock generator 12, and the MMU register 6 stores data for address conversion between a virtual address and a physical address. ALU7, GPR register 8, Multiplier 9,
A unit for executing each instruction including the barrel shifter 10 and the program counter 11 is also connected to the address bus 1 and the data bus 2. The parts 7 to 11
Are hereinafter referred to as an instruction execution unit.

【0043】図1を参照すると、本実施の形態のキャッ
シュシステムの一次キャッシュとしてのキャッシュ部1
5は、フルセットアソシアティブ(FSA)方式キャッ
シュテーブルTA、ダイレクトマッピング(DM)方式
キャッシュテーブルTB、コンパレータ30Aおよび3
0B、ANDゲート31Aおよび31B、ORゲート3
2、およびデータセレクタ33を備えている。
Referring to FIG. 1, a cache unit 1 as a primary cache of the cache system according to the present embodiment.
5 is a full set associative (FSA) type cache table TA, a direct mapping (DM) type cache table TB, comparators 30A and 30
0B, AND gates 31A and 31B, OR gate 3
2 and a data selector 33.

【0044】図1に示すように、本実施の形態の一次キ
ャッシュすなわちキャッシュ部15は、フルセットアソ
シアティブ(FSA)方式キャッシュメモリとダイレク
トマッピング(DM)方式キャッシュメモリの組み合わ
せによって構成される。なお、図1においては1個のコ
ンパレータ30Aと1個のANDゲート31Aのみが示
されているが、具体的には、FSA方式キャッシュテー
ブルTAの各キャッシュライン毎にコンパレータ30A
とANDゲート31Aが設けられ、全キャッシュライン
のANDゲート31Aの出力の論理和(OR)が図示し
ない1以上のORゲートを用いて取られる。
As shown in FIG. 1, the primary cache of this embodiment, that is, the cache unit 15, is constituted by a combination of a full set associative (FSA) type cache memory and a direct mapping (DM) type cache memory. Although FIG. 1 shows only one comparator 30A and one AND gate 31A, specifically, the comparator 30A is provided for each cache line of the FSA type cache table TA.
And an AND gate 31A, and a logical sum (OR) of the outputs of the AND gates 31A of all the cache lines is obtained by using one or more OR gates (not shown).

【0045】図1の上部には、入力アドレスデータの例
として「00000040」(16進)が示されてい
る。この入力アドレスデータは、タグ#2、インデック
ス、およびオフセットを含んでいる。このタグ#2は、
DM方式キャッシュテーブルTBに関して使用されるタ
グであり、FSA方式キャッシュテーブルTAに関して
使用されるもう一つのタグであるタグ#1が、タグ#2
とインデックスとの和として定義される(タグ#1=タ
グ#2+インデックス)。例えば入力アドレスデータ
「00000040」の場合には、タグ#2は「000
00」(例えば16進数の入力アドレスデータの最初の
5桁)、インデックスは「04」(例えば16進数の入
力アドレスデータの次の2桁)、タグ#1は「0000
004」(例えば16進数の入力アドレスデータの最初
の7桁)、オフセットは「0」(例えば16進数の入力
アドレスデータの最後の1桁)となる。
In the upper part of FIG. 1, "0000040" (hexadecimal) is shown as an example of the input address data. This input address data includes tag # 2, index, and offset. This tag # 2 is
Tag # 1, which is a tag used for DM cache table TB and another tag used for FSA cache table TA, is tag # 2.
(Tag # 1 = tag # 2 + index). For example, in the case of the input address data "00000040", the tag # 2 is "000
00 (for example, the first five digits of hexadecimal input address data), the index is "04" (for example, the next two digits of hexadecimal input address data), and tag # 1 is "0000".
004 "(for example, the first seven digits of hexadecimal input address data) and the offset is" 0 "(for example, the last one digit of hexadecimal input address data).

【0046】FSA方式キャッシュテーブルTAの各キ
ャッシュラインには、そのキャッシュラインに対して発
生したアクセス(キャッシュヒット)の数を示すための
アクセスカウント領域ACが設けられている。後に説明
するような方法によりアクセスカウント領域ACを用い
て各キャッシュラインのアクセス頻度を管理することに
より、FSA方式キャッシュテーブルTAにおける高ア
クセス頻度(高キャッシュヒット率)のキャッシュライ
ンの保持が実現される。なお、FSA方式キャッシュテ
ーブルTAの全キャッシュラインのアクセスカウント領
域ACを管理するためのアクセスカウンタが、例えば、
前述の部品7〜11を有した命令実行ユニットにより実
現される。また、この実施の形態のキャッシュシステム
の動作を制御するプログラムが、図示しないROM等の
記録媒体に格納されており、このプログラムに従って後
に詳細に述べるキャッシュシステムの動作が行われる。
Each cache line of the FSA system cache table TA is provided with an access count area AC for indicating the number of accesses (cache hits) made to the cache line. By managing the access frequency of each cache line using the access count area AC by a method to be described later, it is possible to hold a cache line with a high access frequency (high cache hit rate) in the FSA cache table TA. . Note that an access counter for managing the access count area AC of all cache lines in the FSA cache table TA is, for example,
This is realized by an instruction execution unit having the above-described components 7 to 11. A program for controlling the operation of the cache system according to the present embodiment is stored in a recording medium such as a ROM (not shown), and the operation of the cache system described in detail later is performed according to the program.

【0047】コンパレータ30Aは、入力アドレスデー
タから抽出されたタグ#1と、FSA方式キャッシュテ
ーブルTAの各キャッシュラインに格納されていたタグ
#1とを比較する。タグ#1の一致が有った場合には、
コンパレータ30Aはハイレベル(1)の比較信号をA
NDゲート31Aに出力する。ANDゲート31Aに
は、その一致したタグ#1に対応するキャッシュライン
が活性か非活性かを示す活性化ビットV1(1/0)が
FSA方式キャッシュテーブルTAから入力されてお
り、ANDゲート31Aはコンパレータ30Aからの前
記比較信号とFSA方式キャッシュテーブルTAからの
前記活性化ビットV1が共に「1」であればキャッシュ
ヒット信号(ハイレベル(1))を出力する。なお、前
述のように、図1には1個のコンパレータ30Aと1個
のANDゲート31Aとして示しているが具体的にはF
SA方式キャッシュテーブルTAの各キャッシュライン
毎にコンパレータ30AとANDゲート31Aが設けら
れ、全キャッシュラインのANDゲート31Aの出力の
論理和(OR)が取られる。
The comparator 30A compares the tag # 1 extracted from the input address data with the tag # 1 stored in each cache line of the FSA cache table TA. If there is a match for tag # 1,
The comparator 30A outputs a high level (1) comparison signal to A
Output to ND gate 31A. The activation bit V1 (1/0) indicating whether the cache line corresponding to the matching tag # 1 is active or inactive is input from the FSA cache table TA to the AND gate 31A. If both the comparison signal from the comparator 30A and the activation bit V1 from the FSA cache table TA are "1", a cache hit signal (high level (1)) is output. As described above, FIG. 1 shows one comparator 30A and one AND gate 31A.
A comparator 30A and an AND gate 31A are provided for each cache line of the SA type cache table TA, and the logical sum (OR) of the outputs of the AND gates 31A of all the cache lines is obtained.

【0048】このようなFSA方式キャッシュにおける
タグ比較と並行して、DM方式キャッシュにおけるコン
パレータ30Bは、入力アドレスデータから抽出された
タグ#2と、入力アドレスデータから抽出されたインデ
ックスに対応するDM方式キャッシュテーブルTBのキ
ャッシュラインに格納されていたタグ#2とを比較す
る。タグ#2が一致した場合には、コンパレータ30B
はハイレベル(1)の比較信号をANDゲート31Bに
出力する。ANDゲート31Bには、その一致したタグ
#2に対応するキャッシュラインが活性か非活性かを示
す活性化ビットV2(1/0)がDM方式キャッシュテ
ーブルTBから入力されており、ANDゲート31Bは
コンパレータ30Bからの前記比較信号とDM方式キャ
ッシュテーブルTBからの前記活性化ビットV2が共に
「1」であればキャッシュヒット信号(ハイレベル
(1))を出力する。
In parallel with the comparison of the tags in the FSA cache, the comparator 30B in the DM cache reads the tag # 2 extracted from the input address data and the DM # 2 corresponding to the index extracted from the input address data. The tag is compared with the tag # 2 stored in the cache line of the cache table TB. If the tag # 2 matches, the comparator 30B
Outputs a high-level (1) comparison signal to the AND gate 31B. An activation bit V2 (1/0) indicating whether the cache line corresponding to the matched tag # 2 is active or inactive is input from the DM cache table TB to the AND gate 31B. If both the comparison signal from the comparator 30B and the activation bit V2 from the DM cache table TB are “1”, a cache hit signal (high level (1)) is output.

【0049】ORゲート32は、ANDゲート31Aま
たはANDゲート31Bからハイレベル(1)のキャッ
シュヒット信号が入力されている場合に、活性化信号
(ハイレベル(1))を出力する。ORゲート32から
ハイレベル(1)の活性化信号が入力された場合、デー
タセレクタ33は、FSA方式キャッシュテーブルTA
またはDM方式キャッシュテーブルTBの前記ヒットし
たキャッシュラインに格納されていたデータの一部を入
力アドレスデータのオフセットに基づいて選択し、その
選択したデータをCPU50の図示しない命令デコーダ
またはGPRレジスタ8に送る。
The OR gate 32 outputs an activation signal (high level (1)) when a high level (1) cache hit signal is input from the AND gate 31A or 31B. When a high-level (1) activation signal is input from the OR gate 32, the data selector 33 sets the FSA cache table TA
Alternatively, a part of the data stored in the hit cache line of the DM cache table TB is selected based on the offset of the input address data, and the selected data is sent to the instruction decoder or the GPR register 8 (not shown) of the CPU 50. .

【0050】なお、この実施の形態においては、キャッ
シュヒットが起こる際にはFSA方式キャッシュテーブ
ルTAまたはDM方式キャッシュテーブルTBの一方で
起きる。すなわち、FSA方式キャッシュテーブルTA
とDM方式キャッシュテーブルTBの両方でキャッシュ
ヒットが起きる場合はない。
In this embodiment, when a cache hit occurs, one of the FSA cache table TA and the DM cache table TB occurs. That is, the FSA cache table TA
There is no case where a cache hit occurs in both the cache table and the DM cache table TB.

【0051】図1に示すFSA方式キャッシュテーブル
TA(FSA方式キャッシュメモリ)は、DM方式キャ
ッシュテーブルTB(DM方式キャッシュメモリ)と比
較して消費電力が大きく、かつ、回路構成が複雑である
ものの、ヒット率の高いキャッシュラインを保持させる
ことが可能である。一方、DM方式キャッシュテーブル
TB(DM方式キャッシュメモリ)は、小さな回路規模
の割に高速アクセスが可能であるが、ヒット率が容易に
悪化してしまう欠点がある。この実施の形態のキャッシ
ュシステムの一次キャッシュ(キャッシュ部15)は、
このような特徴を有するFSA方式キャッシュテーブル
TAとDM方式キャッシュテーブルTBとを組み合わせ
ることにより構成されている。
Although the FSA cache table TA (FSA cache memory) shown in FIG. 1 consumes more power than the DM cache table TB (DM cache memory) and has a complicated circuit configuration, It is possible to hold a cache line with a high hit rate. On the other hand, the DM cache table TB (DM cache memory) can be accessed at high speed for a small circuit scale, but has a disadvantage that the hit ratio is easily deteriorated. The primary cache (cache unit 15) of the cache system according to this embodiment is:
It is configured by combining the FSA cache table TA and the DM cache table TB having such features.

【0052】以下、この発明の実施の形態1によるキャ
ッシュシステムの動作について詳細に説明する。図3
は、本発明の実施の形態1によるキャッシュシステムの
動作を示すフローチャートである。なお、この実施の形
態においては、一次キャッシュとしてのキャッシュ部1
5がミスヒットした場合にメインメモリ21または二次
キャッシュ20からフェッチされたデータは、DM方式
キャッシュテーブルTBに格納、登録され、FSA方式
キャッシュテーブルTAには登録されない。キャッシュ
部15がミスヒットした場合(すなわち、FSA方式キ
ャッシュテーブルTAと、入力アドレスデータから抽出
されたインデックスに対応するDM方式キャッシュテー
ブルTBのキャッシュラインとの両方がミスヒットした
場合)、DM方式キャッシュテーブルTBのそのインデ
ックスに対応するキャッシュラインに格納されていたデ
ータは、DM方式キャッシュテーブルTBにおいて削除
(または非活性化)され、FSA方式キャッシュテーブ
ルTAに転送される。
Hereinafter, the operation of the cache system according to the first embodiment of the present invention will be described in detail. FIG.
5 is a flowchart showing an operation of the cache system according to the first embodiment of the present invention. In this embodiment, the cache unit 1 as a primary cache
In the case where 5 is missed, data fetched from the main memory 21 or the secondary cache 20 is stored and registered in the DM cache table TB, and is not registered in the FSA cache table TA. If the cache unit 15 misses (that is, if both the FSA cache table TA and the cache line of the DM cache table TB corresponding to the index extracted from the input address data miss hit), the DM cache Data stored in the cache line corresponding to the index in the table TB is deleted (or deactivated) in the DM cache table TB and transferred to the FSA cache table TA.

【0053】CPU50はプログラムカウンタ11から
供給される入力アドレスデータに従って命令フェッチ処
理を開始する(ステップS10)。FSA方式キャッシ
ュメモリにおいて、図1に示すコンパレータ30A(具
体的にはFSA方式キャッシュテーブルTAの各キャッ
シュラインに対応して設けられている複数のコンパレー
タ30A)が入力アドレスデータから抽出されたタグ#
1(入力アドレスデータのオフセット以外の部分)と、
FSA方式キャッシュテーブルTAの各キャッシュライ
ンに格納されていたタグ#1とを比較する。タグ#1の
一致があった場合は(ステップS11:Yes)、コン
パレータ30Aはハイレベル(1)の前記比較信号をA
NDゲート31Aに出力する。コンパレータ30Aの出
力と、FSA方式キャッシュテーブルTAのヒットした
タグ#1に対応するキャッシュラインの活性化ビットV
1が共に「1」である場合には(ステップS12:Ye
s)、図1に示すANDゲート31A(具体的にはFS
A方式キャッシュテーブルTAの各キャッシュラインに
対応して設けられている複数のANDゲート31Aとそ
の複数のANDゲート31Aの出力の論理和(OR)を
取るための1以上のORゲート)がハイレベル(1)の
前記キャッシュヒット信号をORゲート32に出力す
る。このキャッシュヒット信号は、FSA方式キャッシ
ュテーブルTAで有効なキャッシュヒットが生じたこと
を示す。抽出されたタグ#1がFSA方式キャッシュテ
ーブルTAのどのタグ#1とも一致しなかった場合(ス
テップS11:No)、またはヒットしたキャッシュラ
インの活性化ビットV1が「0」である場合(ステップ
S12:No)には、ANDゲート31Aの出力は
「0」となる(ステップS13)。
The CPU 50 starts the instruction fetch process according to the input address data supplied from the program counter 11 (step S10). In the FSA cache memory, the comparator 30A shown in FIG. 1 (specifically, a plurality of comparators 30A provided corresponding to each cache line of the FSA cache table TA) has a tag # extracted from the input address data.
1 (the part other than the offset of the input address data);
The tag is compared with the tag # 1 stored in each cache line of the FSA cache table TA. If there is a match of the tag # 1 (Step S11: Yes), the comparator 30A outputs the high-level (1) comparison signal to A
Output to ND gate 31A. The output of the comparator 30A and the activation bit V of the cache line corresponding to the hit tag # 1 of the FSA cache table TA
If both are “1” (step S12: Ye
s), the AND gate 31A shown in FIG.
A plurality of AND gates 31A provided corresponding to each cache line of the A-system cache table TA and one or more OR gates for obtaining a logical sum (OR) of outputs of the plurality of AND gates 31A are at a high level. The cache hit signal of (1) is output to the OR gate 32. This cache hit signal indicates that a valid cache hit has occurred in the FSA cache table TA. If the extracted tag # 1 does not match any tag # 1 in the FSA cache table TA (step S11: No), or if the activation bit V1 of the hit cache line is “0” (step S12) : No), the output of the AND gate 31A becomes "0" (step S13).

【0054】同時に、キャッシュヒットの有無の判定の
ためのタグ比較がDM方式キャッシュメモリにおいても
行われる。DM方式キャッシュメモリにおいては、イン
デックス(16進数の入力アドレスデータの最初の5桁
であるタグ#2に続く2桁)が入力アドレスデータより
抽出され、DM方式キャッシュテーブルTBのそのイン
デックスに対応するキャッシュラインが選択、指定され
る(ステップS14)。図1に示すコンパレータ30B
は、入力アドレスデータから抽出されたタグ#2(入力
アドレスデータのインデックスとオフセット以外の部
分)と、DM方式キャッシュテーブルTBの前記インデ
ックスに対応する選択されたキャッシュラインに格納さ
れていたタグ#2とを比較する。タグ#2が一致した場
合(ステップS15:Yes)、コンパレータ30Bは
ハイレベル(1)の比較信号をANDゲート31Bに出
力する。コンパレータ30Bの出力とヒットしたキャッ
シュラインの活性化ビットV2が共に「1」である場合
には(ステップS16:Yes)、ANDゲート31B
はハイレベル(1)のキャッシュヒット信号をORゲー
ト32に出力する。このキャッシュヒット信号は、DM
方式キャッシュテーブルTBで有効なキャッシュヒット
が生じたことを示す。タグ#2が一致しなかった場合
(ステップS15:No)、またはヒットしたキャッシ
ュラインの活性化ビットV2が「0」である場合(ステ
ップS16:No)には、ANDゲート31Bの出力は
「0」となる(ステップS17)。
At the same time, tag comparison for determining the presence or absence of a cache hit is also performed in the DM cache memory. In the DM cache memory, an index (two digits following tag # 2, which is the first five digits of hexadecimal input address data) is extracted from the input address data, and a cache corresponding to the index in the DM cache table TB is read. A line is selected and specified (step S14). Comparator 30B shown in FIG.
Is the tag # 2 extracted from the input address data (the part other than the index and offset of the input address data) and the tag # 2 stored in the selected cache line corresponding to the index in the DM cache table TB. Compare with If the tag # 2 matches (step S15: Yes), the comparator 30B outputs a high-level (1) comparison signal to the AND gate 31B. If both the output of the comparator 30B and the activation bit V2 of the hit cache line are “1” (step S16: Yes), the AND gate 31B
Outputs a high-level (1) cache hit signal to the OR gate 32. This cache hit signal is DM
Indicates that a valid cache hit has occurred in the scheme cache table TB. When the tag # 2 does not match (step S15: No), or when the activation bit V2 of the hit cache line is “0” (step S16: No), the output of the AND gate 31B is “0”. (Step S17).

【0055】図1に示すORゲート32は、ANDゲー
ト31Aからのキャッシュヒット信号またはANDゲー
ト31Bからのキャッシュヒット信号が「1」であれ
ば、ハイレベル(1)の前記活性化信号をデータセレク
タ33に出力する。それ以外の場合(両方からのキャッ
シュヒット信号が共に「0」である場合)は、ORゲー
ト32はローレベル(0)の活性化信号をデータセレク
タ33に出力する。なお、前述のように、この実施の形
態においては、FSA方式キャッシュテーブルTAとD
M方式キャッシュテーブルTBの両方でキャッシュヒッ
トが起きる場合はない。すなわち、ANDゲート31A
とANDゲート31Bの両方からのキャッシュヒット信
号が「1」である場合はない。
If the cache hit signal from the AND gate 31A or the cache hit signal from the AND gate 31B is "1", the OR gate 32 shown in FIG. 33. Otherwise (when both cache hit signals are “0”), the OR gate 32 outputs a low-level (0) activation signal to the data selector 33. As described above, in this embodiment, the FSA cache tables TA and D
There is no case where a cache hit occurs in both of the M type cache tables TB. That is, the AND gate 31A
There is no case where the cache hit signal from both the AND gate 31B is "1".

【0056】ORゲート32から出力される活性化信号
が「0」である場合(キャッシュ部15がミスヒットし
たことを示す)(ステップS18:No)、CPU50
は二次キャッシュ20を介してメインメモリ21にアク
セスし、メインメモリ21から(二次キャッシュ20が
ミスヒットした場合)または二次キャッシュ20から
(二次キャッシュ20がキャッシュヒットした場合)必
要なデータをフェッチする。この場合、DM方式キャッ
シュテーブルTBのミスヒットした前記インデックスに
対応するキャッシュラインに格納されていたデータ(タ
グ#2およびデータ)はFSA方式キャッシュテーブル
TAに転送され(DM方式キャッシュテーブルTBにお
いては削除または非活性化される)、メインメモリ21
または二次キャッシュ20からフェッチされたデータが
DM方式キャッシュテーブルTBのそのキャッシュライ
ンに格納される(ステップS19)。なお、この際にD
M方式キャッシュテーブルTBにインデックスに対応す
る非活性な(活性化ビットV2が「0」の)キャッシュ
ラインが存在した場合、前記のデータのFSA方式キャ
ッシュテーブルTAへの転送は行われず、メインメモリ
21または二次キャッシュ20からフェッチされたデー
タはDM方式キャッシュテーブルTBのインデックスに
対応する非活性なキャッシュラインに格納される(ステ
ップS19)。その後、CPU50はDM方式キャッシ
ュテーブルTBの前記キャッシュラインから前記データ
を読み出し、そのデータ(データまたは命令)に関する
処理を行う(ステップS21)。
If the activation signal output from the OR gate 32 is "0" (indicating that the cache unit 15 has miss-hit) (step S18: No), the CPU 50
Accesses the main memory 21 via the secondary cache 20, and obtains necessary data from the main memory 21 (when the secondary cache 20 has a mishit) or from the secondary cache 20 (when the secondary cache 20 has a cache hit). Fetch. In this case, the data (tag # 2 and data) stored in the cache line corresponding to the mis-hit index in the DM cache table TB is transferred to the FSA cache table TA (deleted in the DM cache table TB). Or deactivated), the main memory 21
Alternatively, data fetched from the secondary cache 20 is stored in the cache line of the DM cache table TB (step S19). In this case, D
When an inactive (active bit V2 is “0”) cache line corresponding to the index exists in the M-type cache table TB, the data is not transferred to the FSA-type cache table TA and the main memory 21 is not transferred. Alternatively, the data fetched from the secondary cache 20 is stored in an inactive cache line corresponding to the index of the DM cache table TB (step S19). Thereafter, the CPU 50 reads the data from the cache line of the DM cache table TB, and performs processing relating to the data (data or instruction) (step S21).

【0057】ORゲート32から出力される活性化信号
が「1」である場合(キャッシュ部15がキャッシュヒ
ットしたことを示す)(ステップS18:Yes)、デ
ータセレクタ33が、FSA方式キャッシュテーブルT
AまたはDM方式キャッシュテーブルTBのヒットした
キャッシュラインに格納されていたデータの一部を入力
アドレスデータのオフセットに基づいて選択、抽出し
(ステップS20)、CPU50がその選択されたデー
タ(データまたは命令)に関する処理を行う(ステップ
S21)。
When the activation signal output from the OR gate 32 is "1" (indicating that the cache unit 15 has hit the cache) (step S18: Yes), the data selector 33 sets the FSA cache table T
A part of the data stored in the hit cache line of the A or DM cache table TB is selected and extracted based on the offset of the input address data (step S20), and the CPU 50 selects the selected data (data or instruction). ) Is performed (step S21).

【0058】以下において、FSA方式キャッシュテー
ブルTAおよびDM方式キャッシュテーブルTBの動作
について詳細に説明する。
Hereinafter, the operations of the FSA cache table TA and the DM cache table TB will be described in detail.

【0059】初期化(図2のコンピュータシステムがリ
セットまたは電源ONされた際)において、FSA方式
キャッシュテーブルTAとDM方式キャッシュテーブル
TBのすべてのキャッシュラインが非活性化される。す
なわち、全キャッシュラインの活性化ビットV1,V2
が「0」にリセットされる。その後、FSA方式キャッ
シュテーブルTAまたはDM方式キャッシュテーブルT
Bのあるキャッシュラインにデータが書き込みまたは転
送される毎に、そのキャッシュラインが活性化される、
すなわちそのキャッシュラインの活性化ビットV1また
はV2が「0」から「1」に書き替えられる。
During initialization (when the computer system of FIG. 2 is reset or the power is turned on), all the cache lines of the FSA cache table TA and the DM cache table TB are deactivated. That is, the activation bits V1 and V2 of all the cache lines
Is reset to “0”. Thereafter, the FSA cache table TA or the DM cache table T
Each time data is written or transferred to a cache line with B, that cache line is activated.
That is, the activation bit V1 or V2 of the cache line is rewritten from "0" to "1".

【0060】キャッシュ部15がミスヒットした場合
(すなわちFSA方式キャッシュテーブルTAと、DM
方式キャッシュテーブルTBのインデックスに対応する
キャッシュラインとが共にミスヒットした場合)、DM
方式キャッシュテーブルTBのそのキャッシュラインに
格納されていたデータ(データとタグ#2)が、FSA
方式キャッシュテーブルTAの非活性なキャッシュライ
ンに転送される。この転送により、DM方式キャッシュ
テーブルTBのそのキャッシュラインは非活性化され
(すなわち、そのキャッシュラインに格納されていたデ
ータが非活性化または実質的に削除され)、FSA方式
キャッシュテーブルTAの前記キャッシュラインは活性
化される。DM方式キャッシュテーブルTBの非活性化
されたキャッシュラインには、メインメモリ21または
二次キャッシュ20からフェッチされたデータが書き込
まれ、これによりそのキャッシュラインは再度活性化さ
れる。なお前述のように、DM方式キャッシュテーブル
TBにインデックスに対応する非活性なキャッシュライ
ンが存在した場合、前記のデータのFSA方式キャッシ
ュテーブルTAへの転送は行われず、メインメモリ21
または二次キャッシュ20からフェッチされたデータは
DM方式キャッシュテーブルTBのインデックスに対応
する非活性なキャッシュラインに書き込まれる。
When the cache unit 15 makes a mishit (that is, the FSA cache table TA and the DM
When both the cache line corresponding to the index of the system cache table TB and the cache line are mishit, the DM
The data (data and tag # 2) stored in the cache line of the system cache table TB is
It is transferred to the inactive cache line of the scheme cache table TA. By this transfer, the cache line of the DM cache table TB is deactivated (that is, the data stored in the cache line is deactivated or substantially deleted), and the cache of the FSA cache table TA is deactivated. The line is activated. Data fetched from the main memory 21 or the secondary cache 20 is written to the inactivated cache line of the DM cache table TB, and the cache line is activated again. As described above, when there is an inactive cache line corresponding to the index in the DM cache table TB, the data is not transferred to the FSA cache table TA and the main memory 21 is not transferred.
Alternatively, data fetched from the secondary cache 20 is written to an inactive cache line corresponding to the index of the DM cache table TB.

【0061】FSA方式キャッシュテーブルTAの活性
状態のキャッシュラインは、各キャッシュラインのアク
セスカウント領域ACに格納されるアクセスカウント値
を用いて管理、制御される。なおこの実施の形態におけ
るアクセスカウント領域ACのビット数は、例えば2ビ
ットに設定される。FSA方式キャッシュテーブルTA
のあるキャッシュラインにデータが書き込まれた際に
は、そのキャッシュラインのアクセスカウント値が
「0」に、前述の図示しないアクセスカウンタによりリ
セットされる。この図示しないアクセスカウンタは、キ
ャッシュヒットがFSA方式キャッシュテーブルTAの
あるキャッシュラインに生じる毎にそのキャッシュライ
ンのアクセスカウント値を1ずつインクリメントする。
キャッシュ部15がミスヒットした場合(すなわちFS
A方式キャッシュテーブルTAと、DM方式キャッシュ
テーブルTBのインデックスに対応するキャッシュライ
ンとが共にミスヒットした場合)、前記アクセスカウン
タは、FSA方式キャッシュテーブルTAの全キャッシ
ュラインのアクセスカウント値を一斉に1ずつデクリメ
ントする。この実施の形態におけるこのアクセスカウン
ト値の最小値と最大値は、十進数で0と3となる。すな
わち、アクセスカウント値の0未満へのデクリメントお
よび4以上へのインクリメントは行われない。
The active cache line of the FSA cache table TA is managed and controlled using the access count value stored in the access count area AC of each cache line. Note that the number of bits of access count area AC in this embodiment is set to, for example, 2 bits. FSA cache table TA
When data is written to a certain cache line, the access count value of that cache line is reset to "0" by the access counter (not shown). Each time a cache hit occurs in a certain cache line in the FSA cache table TA, the access counter (not shown) increments the access count value of the cache line by one.
If the cache unit 15 has a miss (ie, FS
When both the A-type cache table TA and the cache line corresponding to the index of the DM-type cache table TB miss-hit), the access counter simultaneously increases the access count values of all the cache lines of the FSA-type cache table TA by one. Decrement by. The minimum and maximum values of the access count value in this embodiment are 0 and 3 in decimal. That is, the access count value is not decremented to less than 0 and incremented to 4 or more.

【0062】なお、上記においてはキャッシュ部15が
ミスヒットした際に前記のアクセスカウント値の一斉の
デクリメントが行われるものとしたが、FSA方式キャ
ッシュテーブルTAがミスヒットした際(すなわちFS
A方式キャッシュテーブルTAのすべてのキャッシュラ
インがミスヒットした際)にアクセスカウント値の一斉
のデクリメントが行われるものとすることも可能であ
る。この場合、DM方式キャッシュテーブルTBがキャ
ッシュヒットしてFSA方式キャッシュテーブルTAが
ミスヒットした場合も前記アクセスカウント値の一斉の
デクリメントが行われる点が上記とは異なり、このた
め、アクセスカウント値のデクリメントがより高い確率
で行われることとなる。
In the above description, the simultaneous decrement of the access count value is performed when the cache unit 15 mishits. However, when the FSA cache table TA mishits (ie, FS
Simultaneous decrement of the access count value may be performed when all cache lines of the A-method cache table TA miss-hit). In this case, even when the DM cache table TB hits the cache and the FSA cache table TA misses, the access count value is simultaneously decremented. Is performed with a higher probability.

【0063】このようなアクセスカウント値をまとめる
と、以下のようになる。 AC キャッシュラインの実質的アクセス数(キャッシュヒット数) 0 0回以下 1 1回 2 2回 3 3回以上
The following is a summary of such access count values. Substantial number of accesses to the AC cache line (number of cache hits) 0 0 or less 1 1 2 3 3 or more

【0064】FSA方式キャッシュテーブルTAに1以
上の非活性なキャッシュラインが存在する場合、そのキ
ャッシュラインは前述のように、DM方式キャッシュテ
ーブルTBのミスヒットしたキャッシュラインからFS
A方式キャッシュテーブルTAへのデータ転送の際の転
送先とみなされる。従って、(DM方式キャッシュテー
ブルTBにインデックスに対応する非活性なキャッシュ
ラインが存在せず)FSA方式キャッシュテーブルTA
に1以上の非活性なキャッシュラインが存在する時にキ
ャッシュ部15がミスヒットした場合、DM方式キャッ
シュテーブルTBのミスヒットしたキャッシュラインに
格納されていたデータ(データとタグ#2)はFSA方
式キャッシュテーブルTAの非活性なキャッシュライン
の内の一つに転送される。
When one or more inactive cache lines exist in the FSA cache table TA, the cache line is shifted from the missed cache line in the DM cache table TB to the FS cache line as described above.
It is regarded as a transfer destination when transferring data to the A-system cache table TA. Therefore, there is no inactive cache line corresponding to the index in the DM cache table TB.
If there is a miss hit in the cache unit 15 when there is one or more inactive cache lines in the cache, the data (data and tag # 2) stored in the missed cache line in the DM cache table TB is stored in the FSA cache. It is transferred to one of the inactive cache lines of the table TA.

【0065】一方、FSA方式キャッシュテーブルTA
が活性状態のキャッシュラインで一杯の場合には、FS
A方式キャッシュテーブルTAの最小のアクセスカウン
ト値を持つキャッシュライン(1本またはそれ以上)
が、DM方式キャッシュテーブルTBのミスヒットした
キャッシュラインからFSA方式キャッシュテーブルT
Aへのデータの転送の際の転送先とみなされる。従っ
て、(DM方式キャッシュテーブルTBにインデックス
に対応する非活性なキャッシュラインが存在せず)FS
A方式キャッシュテーブルTAが活性状態のキャッシュ
ラインで一杯の時にキャッシュ部15がミスヒットした
場合、DM方式キャッシュテーブルTBのミスヒットし
たキャッシュラインに格納されていたデータ(データと
タグ#2)はFSA方式キャッシュテーブルTAの最小
のアクセスカウント値を持つキャッシュラインの一つに
転送される。この場合の転送先は、最小カウント値を持
つ1本またはそれ以上のキャッシュラインからランダム
に選択してもよいが、最近のキャッシュヒットが最も古
いキャッシュラインをその中から選択してそのキャッシ
ュラインを転送先とみなすことも可能である。そのよう
な最近のキャッシュヒットが最も古いキャッシュライン
の選択は、例えば、アクセス日時を格納するための領域
をFSA方式キャッシュテーブルTAの各キャッシュラ
インに設けることによって実現できる。
On the other hand, the FSA cache table TA
Is full with active cache lines, FS
A cache line (one or more) having the minimum access count value in the A-type cache table TA
From the cache line of the DM system cache table TB that has missed the FSA system cache table T
A is considered as a transfer destination when data is transferred to A. Therefore, (there is no inactive cache line corresponding to the index in the DM cache table TB) FS
If the cache unit 15 misses while the A-type cache table TA is full of active cache lines, the data (data and tag # 2) stored in the mis-hit cache line of the DM type cache table TB is FSA. The data is transferred to one of the cache lines having the minimum access count value in the scheme cache table TA. In this case, the transfer destination may be randomly selected from one or more cache lines having the minimum count value, but the cache line having the oldest cache hit is selected from the cache lines and the cache line is selected. It is also possible to regard it as a transfer destination. Such selection of the cache line having the oldest cache hit can be realized, for example, by providing an area for storing the access date and time in each cache line of the FSA cache table TA.

【0066】また、DM方式キャッシュテーブルTBに
インデックスに対応する非活性なキャッシュラインが存
在する状態でキャッシュ部15がミスヒットした場合に
は、メインメモリ21または二次キャッシュ20からフ
ェッチされたデータは、DM方式キャッシュテーブルT
Bのそのインデックスに対応する非活性なキャッシュラ
インに書き込まれる。この場合、前述のDM方式キャッ
シュテーブルTBからFSA方式キャッシュテーブルT
Aへのデータ転送は行われない。
If the cache unit 15 misses while the DM cache table TB has an inactive cache line corresponding to the index, the data fetched from the main memory 21 or the secondary cache 20 is , DM cache table T
B is written to the inactive cache line corresponding to that index. In this case, the above-mentioned DM cache table TB to FSA cache table T
No data transfer to A is performed.

【0067】以下において、キャッシュ処理の実行時間
に関して説明する。
In the following, the execution time of the cache processing will be described.

【0068】図4は、CPU50によって実行されるプ
ログラムの一例を示す模式図である。なお、図4は従来
の技術の説明において参照した図11と同一の図であ
る。図4を参照すると、このプログラムは、実行される
べき命令(1),(2),・・・を有している。CPU
50はまず、プログラムカウンタ11から供給される、
命令(1)に関する入力アドレスデータを参照する。最
初の命令(1)に対応する入力アドレスデータ「000
00040」は、この命令(1)がメインメモリのアド
レス「00000040」に予め格納されていることを
示す。前述のようにこの入力アドレスデータ「0000
0040」は、タグ#2(00000)、インデックス
(04)およびオフセット(0)(およびタグ#1(0
000004))を含んでいる。このタグ#1、タグ#
2、インデックスおよびオフセットを含んだ入力アドレ
スデータがキャッシュ部15に供給され、キャッシュヒ
ット判定のための処理が前述のようにして行われる。C
PU50はこのキャッシュヒット判定処理の結果に従
い、必要なデータ(命令(1))をFSA方式キャッシ
ュテーブルTA、DM方式キャッシュテーブルTBまた
はメインメモリ21(または二次キャッシュ20)から
入手し、命令(1)を実行する。その後は、同様な処理
が続く命令(2),(3),・・・に対して行われる。
FIG. 4 is a schematic diagram showing an example of a program executed by the CPU 50. FIG. 4 is the same as FIG. 11 referred to in the description of the prior art. Referring to FIG. 4, this program has instructions (1), (2),... To be executed. CPU
50 is first supplied from the program counter 11;
The input address data related to the instruction (1) is referred to. Input address data "000" corresponding to the first instruction (1)
"0000040" indicates that this instruction (1) is stored in advance at address "00000040" in the main memory. As described above, the input address data “0000”
0040 "is the tag # 2 (00000), index (04) and offset (0) (and tag # 1 (0
000004)). This tag # 1, tag #
2. The input address data including the index and the offset is supplied to the cache unit 15, and the process for determining a cache hit is performed as described above. C
The PU 50 obtains necessary data (instruction (1)) from the FSA cache table TA, the DM cache table TB or the main memory 21 (or the secondary cache 20) according to the result of the cache hit determination process, and executes the instruction (1 ). After that, similar processing is performed for the following instructions (2), (3),.

【0069】図5(a)および(b)は、この実施の形
態のキャッシュシステムを用いるCPU50が図4のプ
ログラムを2回行う際のアクセス時間を示す模式図であ
り、図5(a)は1回目のプログラム実行の場合を、図
5(b)は2回目のプログラム実行の場合を示してい
る。図6は、図4のプログラムの命令(5)の実行直後
のFSA方式キャッシュテーブルTAとDM方式キャッ
シュテーブルTBの状態を示す模式図である。
FIGS. 5A and 5B are schematic diagrams showing access times when the CPU 50 using the cache system of this embodiment executes the program of FIG. 4 twice, and FIG. FIG. 5B shows the case of the first program execution, and FIG. 5B shows the case of the second program execution. FIG. 6 is a schematic diagram showing the states of the FSA cache table TA and the DM cache table TB immediately after the execution of the instruction (5) of the program in FIG.

【0070】なお、以下のプログラム実行時間に関する
説明は、従来技術における説明と同様の仮定の下に行
う。すなわち、FSA方式キャッシュテーブルTAとD
M方式キャッシュテーブルTBの各キャッシュラインの
データ格納領域の長さは4ワード(16バイト)とし、
図4のプログラムの各命令の長さは1ワード(4バイ
ト)とする(すなわち、FSA方式キャッシュテーブル
TAとDM方式キャッシュテーブルTBの各キャッシュ
ラインのデータ格納領域に4個の命令が格納されるもの
とする)。データ(命令)をメインメモリからフェッチ
するのに必要なアクセス時間は、最初の1ワードに10
0ns、続く3ワードの各々にそれぞれ30nsとす
る。従って、4ワード分のデータ(4個の命令)をメイ
ンメモリ21からフェッチしてこれらのデータをDM方
式キャッシュテーブルTBの1つのキャッシュライン格
納するために必要なアクセス時間は、100+30+3
0+30=190nsとなる。また、CPU50がDM
方式キャッシュテーブルTBのキャッシュラインに格納
された直後の命令を読み出して実行するのに10nsか
かるとものとする。また、キャッシュ部15がミスヒッ
トした際にはデータはメインメモリ21からフェッチさ
れる(二次キャッシュ20はキャッシュヒットしない)
ものとし、二次キャッシュ20のデータ処理時間は0と
する。DM方式キャッシュテーブルTBのキャッシュサ
イズは例えば4kバイトとする。
The following description of the program execution time will be made under the same assumption as in the description of the prior art. That is, the FSA cache tables TA and D
The length of the data storage area of each cache line of the M type cache table TB is 4 words (16 bytes),
The length of each instruction of the program of FIG. 4 is 1 word (4 bytes) (that is, four instructions are stored in the data storage area of each cache line of the FSA cache table TA and the DM cache table TB). Shall be). The access time required to fetch data (instruction) from main memory is 10 words in the first word.
0 ns, and 30 ns for each of the following three words. Therefore, the access time required to fetch four words of data (four instructions) from the main memory 21 and store these data in one cache line of the DM cache table TB is 100 + 30 + 3.
0 + 30 = 190 ns. In addition, the CPU 50
It is assumed that it takes 10 ns to read and execute the instruction immediately after being stored in the cache line of the system cache table TB. When the cache unit 15 has a miss hit, data is fetched from the main memory 21 (the secondary cache 20 does not hit the cache).
It is assumed that the data processing time of the secondary cache 20 is zero. The cache size of the DM cache table TB is, for example, 4 kbytes.

【0071】初期化において、FSA方式キャッシュテ
ーブルTAとDM方式キャッシュテーブルTBのすべて
のキャッシュラインが非活性化される。すなわち、全キ
ャッシュラインの活性化ビットV1,V2が「0」にリ
セットされる。この初期化の直後には活性化ビットV
1,V2がすべて「0」であるため、FSA方式キャッ
シュテーブルTAとDM方式キャッシュテーブルTBの
中には実質的にはデータが存在しないことになる。この
ためCPU50は、必要なデータ(最初のインデックス
に対応する命令(1)〜(4))をメインメモリ21か
らフェッチし、フェッチした命令(1)〜(4)をDM
方式キャッシュテーブルTBのインデックス「04」に
対応するキャッシュラインに書き込む。このデータ書き
込みにより、DM方式キャッシュテーブルTBのインデ
ックス「04」に対応するキャッシュラインは活性化さ
れる。すなわち、このキャッシュラインの活性化ビット
V2が「1」にセットされる(図1参照)。その後、C
PU50はそのキャッシュラインから最初の命令(1)
を読み出して実行する。
In the initialization, all the cache lines of the FSA cache table TA and the DM cache table TB are deactivated. That is, the activation bits V1 and V2 of all the cache lines are reset to “0”. Immediately after this initialization, the activation bit V
Since 1 and V2 are all "0", there is substantially no data in the FSA cache table TA and DM cache table TB. For this reason, the CPU 50 fetches necessary data (the instructions (1) to (4) corresponding to the first index) from the main memory 21 and transfers the fetched instructions (1) to (4) to the DM.
The data is written to the cache line corresponding to the index “04” of the scheme cache table TB. By this data writing, the cache line corresponding to the index “04” of the DM cache table TB is activated. That is, the activation bit V2 of this cache line is set to "1" (see FIG. 1). Then, C
PU 50 reads the first instruction (1) from the cache line.
Is read and executed.

【0072】図5(a)に示される最初のプログラム実
行においては、コンピュータシステムのスタートアップ
ルーチンの後にCPU50が最初の命令(1)を実行す
るのに100+30+30+30+10=200nsが
必要であり、続く命令(2),(3),(4)の実行に
は各々10nsが必要である(230ns)。その後C
PU50は、アドレス「00001030」から「00
00103C」に対応する4個の命令を同様に実行する
(200+10+10+10=230ns)。
In the first program execution shown in FIG. 5A, 100 + 30 + 30 + 30 + 10 = 200 ns is required for the CPU 50 to execute the first instruction (1) after the startup routine of the computer system, and the subsequent instruction (2 ), (3), and (4) each require 10 ns (230 ns). Then C
The PU 50 stores addresses “00001030” to “00”
Similarly, four instructions corresponding to "00103C" are executed (200 + 10 + 10 + 10 = 230 ns).

【0073】前述のインデックス「04」に対応する命
令(5)をCPU50が実行しようとする時、DM方式
キャッシュテーブルTBのインデックス「04」に対応
するキャッシュラインには、既に命令(1)とこの命令
(1)に対応するタグ「00000」が格納されている
ため、このインデックス「04」に対応するキャッシュ
ラインにミスヒット(「00001」≠「0000
0」)が起こる。1回目のプログラム実行においてはF
SA方式キャッシュテーブルTAもミスヒットする。こ
のため、DM方式キャッシュテーブルTBのインデック
ス「04」に対応するキャッシュラインに格納されてい
たこの命令(1)とタグ#2(00000)がFSA方
式キャッシュテーブルTAの非活性なキャッシュライン
に(または最小アクセスカウント値のキャッシュライン
に)転送され、メインメモリ21からフェッチされた命
令(5)と対応するタグ#2(00001)がDM方式
キャッシュテーブルTBのそのインデックス「04」に
対応するキャッシュラインに書き込まれる。このような
ミスヒットのため、命令(5)の実行も100+30+
30+30+10=200nsかかる。続く3個の命令
の実行にも同様に各々10nsかかる(230ns)。
従って、1回目のプログラム実行における総プログラム
実行時間は230×3=690nsとなる。
When the CPU 50 attempts to execute the instruction (5) corresponding to the above-mentioned index “04”, the instruction (1) and this instruction (1) are already stored in the cache line corresponding to the index “04” in the DM cache table TB. Since the tag “00000” corresponding to the instruction (1) is stored, the cache line corresponding to the index “04” has a mishit (“00001” ≠ “0000”).
0 ") occurs. In the first program execution, F
The SA cache table TA also misses. Therefore, the instruction (1) and the tag # 2 (00000) stored in the cache line corresponding to the index “04” of the DM cache table TB are added to the inactive cache line of the FSA cache table TA (or The tag # 2 (00001) corresponding to the instruction (5) transferred from the cache line having the minimum access count value and fetched from the main memory 21 is stored in the cache line corresponding to the index “04” in the DM cache table TB. Written. Due to such a mishit, the execution of instruction (5) is also 100 + 30 +
It takes 30 + 30 + 10 = 200 ns. The execution of the following three instructions also takes 10 ns each (230 ns).
Therefore, the total program execution time in the first program execution is 230 × 3 = 690 ns.

【0074】図5(a)の1回目のプログラム実行が終
了した時点で、図4のプログラムの全ての命令がFSA
方式キャッシュテーブルTAまたはDM方式キャッシュ
テーブルTBに格納された状態となっている。例えば、
2回目のプログラム実行において(前述のインデックス
「04」に対応する)命令(1)をCPU50が実行し
ようとする時、この命令(1)は図6に示すように既に
FSA方式キャッシュテーブルTAの方に格納されてお
り、命令(1)の2回目の実行においてミスヒットは発
生しない。このようにして、図5(b)の2回目のプロ
グラム実行においては、各命令はその実行に10nsず
つしかかからず、2回目のプログラム実行におけるプロ
グラム実行時間は10×12=120nsとなる。よっ
て、図4(図11)のプログラムを2回実行するために
必要な総プログラム実行時間(アクセス時間)は690
+120=810nsとなる。
When the first program execution of FIG. 5A is completed, all instructions of the program of FIG.
It is stored in the scheme cache table TA or the DM scheme cache table TB. For example,
When the CPU 50 attempts to execute the instruction (1) (corresponding to the above-mentioned index “04”) in the second program execution, this instruction (1) is already in the FSA cache table TA as shown in FIG. , And no mishit occurs in the second execution of the instruction (1). In this manner, in the second program execution of FIG. 5B, each instruction takes only 10 ns to execute, and the program execution time in the second program execution is 10 × 12 = 120 ns. Therefore, the total program execution time (access time) required to execute the program of FIG. 4 (FIG. 11) twice is 690.
+ 120 = 810 ns.

【0075】前述のように、従来のダイレクトマッピン
グ方式キャッシュを用いた場合には2回のプログラム実
行に1190nsの総プログラム実行時間が必要であっ
た。従って、本実施の形態のキャッシュシステムの使用
により、380nsのプログラム実行時間が削減された
こととなる。
As described above, when the conventional direct mapping cache is used, two program executions require a total program execution time of 1190 ns. Therefore, the use of the cache system of the present embodiment has reduced the program execution time of 380 ns.

【0076】上記のように、本発明の実施の形態1によ
るキャッシュシステムにおいては、FSA方式キャッシ
ュテーブルTAとDM方式キャッシュテーブルTBを組
み合わせたキャッシュ部15が、キャッシュシステムの
一次キャッシュとして用いられ、キャッシュヒット判定
のためのタグ比較がFSA方式キャッシュテーブルTA
とDM方式キャッシュテーブルTBの両方で同時に行わ
れる。このため、一次キャッシュとしてのキャッシュ部
15では、高速のタグ比較がより高いキャッシュヒット
率で行われ、CPU50の(二次キャッシュ20また
は)メインメモリ21へのアクセスの回数とデータアク
セス時間が削減され、これによりCPU50の高速なプ
ログラム実行が実現される。
As described above, in the cache system according to the first embodiment of the present invention, the cache unit 15 combining the FSA cache table TA and the DM cache table TB is used as the primary cache of the cache system. Tag comparison for hit judgment is FSA cache table TA
And in the DM cache table TB at the same time. Therefore, in the cache unit 15 as the primary cache, high-speed tag comparison is performed at a higher cache hit rate, and the number of accesses to the (secondary cache 20 or) the main memory 21 of the CPU 50 and the data access time are reduced. Thus, high-speed program execution of the CPU 50 is realized.

【0077】さらに、本キャッシュシステムにおいて
は、以下のようにしてデータの管理/転送が行われる。
FSA方式キャッシュテーブルTAの各キャッシュライ
ンへのアクセス(キャッシュヒット)の回数(アクセス
カウント値)が、各キャッシュラインのアクセスカウン
ト領域ACに格納される。FSA方式キャッシュテーブ
ルTAのあるキャッシュラインにキャッシュヒットが生
じた場合、そのキャッシュラインのアクセスカウント値
が1だけインクリメントされ、キャッシュ部15がミス
ヒットした場合(またはFSA方式キャッシュテーブル
TAがミスヒットした場合)、FSA方式キャッシュテ
ーブルTAの全キャッシュラインのアクセスカウント値
が一斉に1だけデクリメントされる。
Further, in the present cache system, data management / transfer is performed as follows.
The number of times of access (cache hit) to each cache line (access count value) of the FSA cache table TA is stored in the access count area AC of each cache line. When a cache hit occurs in a certain cache line of the FSA cache table TA, the access count value of the cache line is incremented by 1 and the cache unit 15 mishits (or the FSA cache table TA mishits). ), The access count values of all the cache lines in the FSA cache table TA are simultaneously decremented by one.

【0078】DM方式キャッシュテーブルTBにインデ
ックスに対応する非活性なキャッシュラインが存在せ
ず、FSA方式キャッシュテーブルTAに1以上の非活
性なキャッシュラインが存在する時に、キャッシュ部1
5のミスヒットが発生した場合には、DM方式キャッシ
ュテーブルTBのミスヒットしたキャッシュラインに格
納されていたデータ(データとタグ#2)はFSA方式
キャッシュテーブルTAの非活性なキャッシュラインの
うちの一つに転送され、キャッシュ部15のミスヒット
によりメインメモリ21(または二次キャッシュ20)
からフェッチされたデータはDM方式キャッシュテーブ
ルTBのその(FSA方式キャッシュテーブルTAへデ
ータ(データとタグ#2)が転送された)キャッシュラ
インに書き込まれる。
When there is no inactive cache line corresponding to the index in the DM cache table TB and one or more inactive cache lines exist in the FSA cache table TA, the cache unit 1
In the case where the 5th hit occurs, the data (data and tag # 2) stored in the missed cache line of the DM cache table TB is deleted from the inactive cache lines of the FSA cache table TA. And transferred to the main memory 21 (or the secondary cache 20) due to a mishit in the cache unit 15.
Is fetched from the cache line in the DM cache table TB (the data (data and tag # 2) are transferred to the FSA cache table TA).

【0079】DM方式キャッシュテーブルTBにインデ
ックスに対応する非活性なキャッシュラインが存在せ
ず、FSA方式キャッシュテーブルTAが活性なキャッ
シュラインで一杯な時に、キャッシュ部15のミスヒッ
トが発生した場合には、DM方式キャッシュテーブルT
Bのミスヒットしたキャッシュラインに格納されていた
データ(データとタグ#2)はFSA方式キャッシュテ
ーブルTAの最小のアクセスカウント値を持つキャッシ
ュラインの一つに転送され、キャッシュ部15のミスヒ
ットによりメインメモリ21(または二次キャッシュ2
0)からフェッチされたデータはDM方式キャッシュテ
ーブルTBのその(FSA方式キャッシュテーブルTA
へデータ(データとタグ#2)が転送された)キャッシ
ュラインに書き込まれる。好ましくは、FSA方式キャ
ッシュテーブルTAの最小のアクセスカウント値を持つ
キャッシュラインの中から最新のキャッシュヒットが最
も古いキャッシュラインが選択され、その選択されたキ
ャッシュラインがDM方式キャッシュテーブルTBから
FSA方式キャッシュテーブルTAへのデータ転送の際
の転送先として指定される。
If there is no inactive cache line corresponding to the index in the DM cache table TB and the FSA cache table TA is full of active cache lines, and a mishit occurs in the cache unit 15, , DM cache table T
The data (data and tag # 2) stored in the cache line with the miss hit B is transferred to one of the cache lines having the minimum access count value in the FSA cache table TA. Main memory 21 (or secondary cache 2)
0) is fetched from the (FSA cache table TA) of the DM cache table TB.
The data (data and tag # 2) has been transferred to the cache line. Preferably, the cache line having the oldest cache hit is selected from the cache lines having the minimum access count value in the FSA cache table TA, and the selected cache line is stored in the FSA cache table TB from the DM cache table TB. It is specified as a transfer destination when transferring data to the table TA.

【0080】DM方式キャッシュテーブルTBにインデ
ックスに対応する非活性なキャッシュラインが存在する
時にキャッシュ部15のミスヒットが発生した場合に
は、キャッシュ部15のミスヒットによりメインメモリ
21(または二次キャッシュ20)からフェッチされた
データはDM方式キャッシュテーブルTBのそのインデ
ックスに対応する非活性なキャッシュラインに書き込ま
れる。
If a miss hit of the cache unit 15 occurs when there is an inactive cache line corresponding to the index in the DM cache table TB, the miss hit of the cache unit 15 causes the main memory 21 (or the secondary cache). The data fetched from 20) is written to the inactive cache line corresponding to the index in the DM cache table TB.

【0081】このようなデータ管理/転送により、FS
A方式キャッシュテーブルTAが保持するキャッシュラ
インの更新が各キャッシュラインのアクセスカウント値
(実質的ヒットカウント)を基にして行われる。これに
より、FSA方式キャッシュテーブルTAにおける高ヒ
ット率のキャッシュラインの保持性能が高められ、キャ
ッシュ部15のキャッシュヒット率が向上する。さら
に、データのFSA方式キャッシュテーブルTAとDM
方式キャッシュテーブルTBにおける重複が完全に防止
される。すなわち、同一のデータがFSA方式キャッシ
ュテーブルTAとDM方式キャッシュテーブルTBの両
方に格納される場合がない。従って、FSA方式キャッ
シュテーブルTAとDM方式キャッシュテーブルTBの
メモリ空間を完全に有効に利用することができ、限られ
たデータ格納容量のキャッシュ部15中に格納できるキ
ャッシュデータの量を最大にすることができる。これに
より、キャッシュ部15のキャッシュヒット率をより有
効に増加させてCPU50のメインメモリ21(または
二次キャッシュ20)へのアクセス回数を最小化するこ
とができ、CPU50のプログラム実行時間削減を極め
て有効に行うことができる。
By such data management / transfer, the FS
Update of the cache line held by the A-type cache table TA is performed based on the access count value (substantial hit count) of each cache line. As a result, the holding performance of a cache line with a high hit rate in the FSA cache table TA is improved, and the cache hit rate of the cache unit 15 is improved. Further, the data FSA cache tables TA and DM
Duplication in the scheme cache table TB is completely prevented. That is, the same data is not stored in both the FSA cache table TA and the DM cache table TB. Therefore, the memory spaces of the FSA cache table TA and the DM cache table TB can be completely and effectively used, and the amount of cache data that can be stored in the cache unit 15 having a limited data storage capacity is maximized. Can be. As a result, the cache hit rate of the cache unit 15 can be more effectively increased, and the number of accesses to the main memory 21 (or the secondary cache 20) of the CPU 50 can be minimized. Can be done.

【0082】なお、実施の形態1のキャッシュシステム
は二次キャッシュ20を備えるものとして説明したが、
上記の実施の形態1の各効果は、図7に示す例のように
キャッシュシステムに二次キャッシュ20が設けられな
い場合にも得られるものである。二次キャッシュ20を
追加することにより、上記のキャッシュシステムの効果
をさらに増大させることができる。
Although the cache system according to the first embodiment has been described as including the secondary cache 20,
The effects of the first embodiment can be obtained even when the secondary cache 20 is not provided in the cache system as in the example shown in FIG. By adding the secondary cache 20, the effect of the cache system described above can be further increased.

【0083】実施の形態2.図8は本発明の実施の形態
2によるキャッシュシステムのキャッシュ部15Aの構
成を示すブロック図である。図8に示すキャッシュ部1
5Aは、実施の形態2において、図2や図7に示したコ
ンピュータシステムにおいて図1のキャッシュ部15の
代わりに用いられるものである。図8のキャッシュ部1
5AのFSA方式キャッシュテーブルTAは、図1にお
けるより大きなサイズのアクセスカウント領域ACを有
している。具体的には、各キャッシュラインのアクセス
カウント領域ACのサイズが例えば16ビットに設定さ
れる。この16ビット幅のアクセスカウント領域AC
は、例えば実施の形態1の2ビット幅のアクセスカウン
ト領域ACが0から3(十進)までのカウントであった
のに比して、0から65535(十進)までをカウント
することができる。
Embodiment 2 FIG. 8 is a block diagram showing a configuration of the cache unit 15A of the cache system according to the second embodiment of the present invention. Cache unit 1 shown in FIG.
5A is used in the computer system shown in FIGS. 2 and 7 in Embodiment 2 instead of the cache unit 15 in FIG. Cache unit 1 in FIG.
The FSA cache table TA of 5A has an access count area AC of a larger size in FIG. Specifically, the size of the access count area AC of each cache line is set to, for example, 16 bits. This 16-bit wide access count area AC
Can count from 0 to 65535 (decimal), for example, as compared to the 2-bit access count area AC of Embodiment 1 which counts from 0 to 3 (decimal). .

【0084】この実施の形態2においては、前記図示し
ないアクセスカウンタはすこし異なる方法でアクセスカ
ウント領域ACを管理する。FSA方式キャッシュテー
ブルTAのあるキャッシュラインがキャッシュヒットし
た場合、この図示しないアクセスカウンタは実施の形態
1と同様にして、このキャッシュラインのアクセスカウ
ント値を1だけインクリメントする。しかし、キャッシ
ュ部15Aのミスヒットが発生しても、FSA方式キャ
ッシュテーブルTAの全キャッシュラインのアクセスカ
ウント値の一斉デクリメント(−1)は行わない。従っ
て実施の形態2においては、FSA方式キャッシュテー
ブルTAの各キャッシュラインのアクセスカウント領域
ACに格納されるアクセスカウント値はインクリメント
されるのみとなる。なお、DM方式キャッシュテーブル
TBからFSA方式キャッシュテーブルTAへのデータ
転送は実施の形態1と同様に行われる。
In the second embodiment, the access counter (not shown) manages the access count area AC by a slightly different method. When a cache hit occurs in a certain cache line in the FSA cache table TA, the access counter (not shown) increments the access count value of this cache line by 1, as in the first embodiment. However, even if a mishit occurs in the cache unit 15A, simultaneous decrement (−1) of the access count values of all the cache lines in the FSA cache table TA is not performed. Therefore, in the second embodiment, the access count value stored in the access count area AC of each cache line of the FSA cache table TA is only incremented. The data transfer from the DM cache table TB to the FSA cache table TA is performed in the same manner as in the first embodiment.

【0085】2ビット幅のアクセスカウント領域ACを
用いた実施の形態1では、最小のアクセスカウント値
(例えば0)を持つキャッシュラインが多くなりがちで
あるが、この実施の形態2においてはその数を小さくす
ることができる。従って、実施の形態2のキャッシュシ
ステムによれば、FSA方式キャッシュテーブルTAの
高ヒット率(高ヒットカウント)キャッシュライン保持
ための工程に、キャッシュラインのヒット数の違いをよ
り直接的に取り込むことができる。
In the first embodiment using the 2-bit width access count area AC, the number of cache lines having the minimum access count value (for example, 0) tends to increase, but in the second embodiment, the number of cache lines is reduced. Can be reduced. Therefore, according to the cache system of the second embodiment, the difference in the number of hits of the cache line can be more directly taken into the process of holding the high hit rate (high hit count) cache line of the FSA cache table TA. it can.

【0086】実施の形態3.図9は本発明の実施の形態
3によるキャッシュシステムのキャッシュ部15Bにお
いてFSA(フルセットアソシアティブ)方式以外のキ
ャッシュテーブルとして用いられる4ウェイセットアソ
シアティブキャッシュテーブルTCを示す模式図であ
る。前記実施の形態1および実施の形態2では、キャッ
シュ部(15,15A)のFSA方式以外のキャッシュ
テーブルとしてDM(ダイレクトマッピング)方式キャ
ッシュテーブルTBを用いたが、この実施の形態3のキ
ャッシュ部15Bは、FSA方式キャッシュテーブルT
Aと組み合わせられるFSA方式以外のキャッシュテー
ブルとして、図9に示す4ウェイセットアソシアティブ
キャッシュテーブルTCを用いる。
Embodiment 3 FIG. 9 is a schematic diagram showing a 4-way set associative cache table TC used as a cache table other than the FSA (full set associative) method in the cache unit 15B of the cache system according to the third embodiment of the present invention. In the first and second embodiments, the DM (direct mapping) type cache table TB is used as a cache table other than the FSA type in the cache unit (15, 15A). However, the cache unit 15B in the third embodiment is used. Is the FSA cache table T
A 4-way set associative cache table TC shown in FIG. 9 is used as a cache table other than the FSA scheme combined with A.

【0087】図9を参照すると、この4ウェイセットア
ソシアティブキャッシュテーブルTCは、各インデック
ス毎に4本のキャッシュラインを備えている。1つのイ
ンデックスに対応する4本のキャッシュラインのそれぞ
れは、実施の形態1,2におけるDM方式キャッシュテ
ーブルTBの場合と同様に、活性化ビットV2、タグ#
2およびデータを格納するための3つの領域を持つ。4
本のキャッシュラインからなる行の左端には、LRU
(least recently used)値を格納
するためのLRU領域が設けられている。このLRU値
は、1つのインデックスに対応する4本のキャッシュラ
インの中から、最近のキャッシュヒットが最も古い、つ
まり最も昔に使用された(least recentl
y used)キャッシュラインを示すために用いられ
る。このLRU領域のサイズは、4本のキャッシュライ
ンを表すことが可能なように、例えば2ビットに設定さ
れる。
Referring to FIG. 9, this 4-way set associative cache table TC has four cache lines for each index. Each of the four cache lines corresponding to one index has an activation bit V2 and a tag #, as in the case of the DM cache table TB in the first and second embodiments.
2 and three areas for storing data. 4
At the left end of the line consisting of cache lines,
An LRU area for storing (least recently used) values is provided. The LRU value is the least recently used cache hit among the four cache lines corresponding to one index, that is, the least recently used cache hit.
y used) Used to indicate a cache line. The size of this LRU area is set to, for example, 2 bits so as to be able to represent four cache lines.

【0088】DM方式キャッシュテーブルTBが1つの
インデックスに対して(1つのタグ#2に対応する)1
個のデータしか格納できないのと比較して、4ウェイセ
ットアソシアティブキャッシュテーブルTCは1つのイ
ンデックスに対して(4つのタグ#2に対応する)4個
のデータを格納することができる。従って、4ウェイセ
ットアソシアティブキャッシュテーブルTCのキャッシ
ュヒット率はDM方式キャッシュテーブルTBのキャッ
シュヒット率より高い。
The DM cache table TB is set to 1 for one index (corresponding to one tag # 2).
The 4-way set associative cache table TC can store four pieces of data (corresponding to four tags # 2) for one index, as compared with storing only four pieces of data. Therefore, the cache hit ratio of the 4-way set associative cache table TC is higher than the cache hit ratio of the DM cache table TB.

【0089】以下において、この実施の形態3のキャッ
シュシステムのキャッシュ部15BにおけるFSA方式
キャッシュテーブルTAと4ウェイセットアソシアティ
ブキャッシュテーブルTCの動作について詳細に説明す
る。なお、4ウェイセットアソシアティブキャッシュテ
ーブルTCにおけるキャッシュヒット判定のためのタグ
比較は、DM方式キャッシュテーブルTBの場合と同様
に入力アドレスデータから抽出されたインデックスとタ
グ#2とを用いて行われる。4ウェイセットアソシアテ
ィブキャッシュテーブルTC(4ウェイセットアソシア
ティブキャッシュメモリ)の場合は、1つの入力アドレ
スデータから抽出された1個のインデックスと1個のタ
グ#2に関して、4つのタグ比較が同時に行われる。実
施の形態3のキャッシュシステムの以下の記載以外の動
作は実施の形態1のキャッシュシステムの動作とほぼ同
じである。
Hereinafter, operations of the FSA cache table TA and the 4-way set associative cache table TC in the cache unit 15B of the cache system according to the third embodiment will be described in detail. The tag comparison for the cache hit determination in the 4-way set associative cache table TC is performed using the index extracted from the input address data and the tag # 2 as in the case of the DM cache table TB. In the case of the 4-way set associative cache table TC (4-way set associative cache memory), four tag comparisons are simultaneously performed for one index and one tag # 2 extracted from one input address data. Operations of the cache system according to the third embodiment other than those described below are almost the same as those of the cache system according to the first embodiment.

【0090】初期化(コンピュータシステムがリセット
または電源ONされた際)において、FSA方式キャッ
シュテーブルTAと4ウェイセットアソシアティブキャ
ッシュテーブルTCのすべてのキャッシュラインが非活
性化される。すなわち、全キャッシュラインの活性化ビ
ットV1,V2が「0」にリセットされる。その後、F
SA方式キャッシュテーブルTAまたは4ウェイセット
アソシアティブキャッシュテーブルTCのあるキャッシ
ュラインにデータが書き込みまたは転送される毎に、そ
のキャッシュラインが活性化される、すなわちそのキャ
ッシュラインの活性化ビットV1またはV2が「0」か
ら「1」に書き替えられる。
During initialization (when the computer system is reset or the power is turned on), all the cache lines in the FSA cache table TA and the 4-way set associative cache table TC are deactivated. That is, the activation bits V1 and V2 of all the cache lines are reset to “0”. Then, F
Each time data is written or transferred to a certain cache line in the SA type cache table TA or the 4-way set associative cache table TC, the cache line is activated, that is, the activation bit V1 or V2 of the cache line is set to " It is rewritten from "0" to "1".

【0091】FSA方式キャッシュテーブルTAの各キ
ャッシュラインへのアクセス(キャッシュヒット)の回
数(アクセスカウント値)が、各キャッシュラインのア
クセスカウント領域ACに格納される。FSA方式キャ
ッシュテーブルTAのあるキャッシュラインにキャッシ
ュヒットが生じた場合、そのキャッシュラインのアクセ
スカウント値が1だけインクリメントされ、キャッシュ
部15Bがミスヒットした場合(またはFSA方式キャ
ッシュテーブルTAがミスヒットした場合)、FSA方
式キャッシュテーブルTAの全キャッシュラインのアク
セスカウント値が一斉に1だけデクリメントされる。
The number of accesses (cache hits) to each cache line (access count value) of the FSA cache table TA is stored in the access count area AC of each cache line. When a cache hit occurs in a certain cache line of the FSA cache table TA, the access count value of the cache line is incremented by 1 and the cache unit 15B misses (or the FSA cache table TA misses). ), The access count values of all the cache lines in the FSA cache table TA are simultaneously decremented by one.

【0092】4ウェイセットアソシアティブキャッシュ
テーブルTCにインデックスに対応する非活性なキャッ
シュラインが存在せず、FSA方式キャッシュテーブル
TAに1以上の非活性なキャッシュラインが存在する時
に、キャッシュ部15Bのミスヒットが発生した場合
(FSA方式キャッシュテーブルTAと、4ウェイセッ
トアソシアティブキャッシュテーブルTCのインデック
スに対応した4本のキャッシュラインがミスヒットした
場合)には、4ウェイセットアソシアティブキャッシュ
テーブルTCの4本のミスヒットしたキャッシュライン
の内の1つに格納されていたデータ(データとタグ#
2)がFSA方式キャッシュテーブルTAの非活性なキ
ャッシュラインのうちの一つに転送される。この際の4
本のミスヒットしたキャッシュラインからの選択は、そ
のインデックスに対応する行のLRU領域に格納されて
いるLRU値に基づいて行われ、LRU値により指定さ
れたキャッシュラインが4ウェイセットアソシアティブ
キャッシュテーブルTCからFSA方式キャッシュテー
ブルTAへのデータ転送の転送元として選択される。キ
ャッシュ部15Bのミスヒットによりメインメモリ21
(または二次キャッシュ20)からフェッチされたデー
タは、4ウェイセットアソシアティブキャッシュテーブ
ルTCの(FSA方式キャッシュテーブルTAへデータ
(データとタグ#2)が転送された)その選択されたキ
ャッシュラインに書き込まれる。
When the inactive cache line corresponding to the index does not exist in the 4-way set associative cache table TC and one or more inactive cache lines exist in the FSA cache table TA, the cache hit of the cache unit 15B is performed. Occurs (four cache lines corresponding to the indexes of the FSA cache table TA and the index of the 4-way set associative cache table TC cause a miss), the four misses of the 4-way set associative cache table TC. The data stored in one of the hit cache lines (data and tag #
2) is transferred to one of the inactive cache lines of the FSA cache table TA. 4 at this time
The selection from the missed cache line is performed based on the LRU value stored in the LRU area of the row corresponding to the index, and the cache line specified by the LRU value is stored in the 4-way set associative cache table TC. Is selected as a transfer source for data transfer from the FSA type cache table TA to the FSA type cache table TA. The main memory 21 due to a mishit in the cache unit 15B
The data fetched from the (or the secondary cache 20) is written to the selected cache line of the 4-way set associative cache table TC (the data (data and tag # 2) have been transferred to the FSA cache table TA). It is.

【0093】4ウェイセットアソシアティブキャッシュ
テーブルTCにインデックスに対応する非活性なキャッ
シュラインが存在せず、FSA方式キャッシュテーブル
TAが活性なキャッシュラインで一杯の時に、キャッシ
ュ部15Bのミスヒットが発生した場合には、4ウェイ
セットアソシアティブキャッシュテーブルTCの4本の
ミスヒットしたキャッシュラインの内の前記LRU値で
指定されたキャッシュラインに格納されていたデータ
(データとタグ#2)がFSA方式キャッシュテーブル
TAの最小アクセスカウント値を持つキャッシュライン
のうちの一つに転送される。この際の転送先は、最小ア
クセスカウント値を持つキャッシュラインのうちからラ
ンダムに選択することも可能であるが、最近のキャッシ
ュヒットが最も古いキャッシュラインをその中から選択
してそのキャッシュラインを転送先とみなすことも可能
である。そのような選択は、例えば、アクセス日時を格
納するための領域をFSA方式キャッシュテーブルTA
の各キャッシュラインに設けることにより実現できる。
キャッシュ部15Bのミスヒットによりメインメモリ2
1(または二次キャッシュ20)からフェッチされたデ
ータは、4ウェイセットアソシアティブキャッシュテー
ブルTCの(FSA方式キャッシュテーブルTAへデー
タ(データとタグ#2)が転送された)前記LRU値で
指定されたキャッシュラインに書き込まれる。
When there is no inactive cache line corresponding to the index in the 4-way set associative cache table TC and the FSA cache table TA is full of active cache lines, and a mishit occurs in the cache unit 15B. In the four-way set associative cache table TC, the data (data and tag # 2) stored in the cache line specified by the LRU value among the four missed cache lines in the four-way set associative cache table TC is stored in the FSA cache table TA. Is transferred to one of the cache lines having the minimum access count value. At this time, the transfer destination can be randomly selected from the cache lines having the minimum access count value. It can also be considered first. Such a selection is performed, for example, by setting an area for storing the access date and time in the FSA cache table TA.
Can be realized by providing each cache line.
Main memory 2 due to mishit in cache unit 15B
The data fetched from 1 (or the secondary cache 20) is specified by the LRU value of the 4-way set associative cache table TC (data (data and tag # 2) transferred to the FSA cache table TA). Written to the cache line.

【0094】4ウェイセットアソシアティブキャッシュ
テーブルTCにインデックスに対応する非活性なキャッ
シュラインが1以上存在する時に、キャッシュ部15B
のミスヒットが発生した場合には、キャッシュ部15B
のミスヒットによりメインメモリ21(または二次キャ
ッシュ20)からフェッチされたデータは、4ウェイセ
ットアソシアティブキャッシュテーブルTCのそのイン
デックスに対応する非活性なキャッシュラインのうちの
一つに書き込まれる。
When one or more inactive cache lines corresponding to the index exist in the 4-way set associative cache table TC, the cache unit 15B
If a mis-hit occurs, the cache unit 15B
The data fetched from the main memory 21 (or the secondary cache 20) due to the mishit is written to one of the inactive cache lines corresponding to the index in the 4-way set associative cache table TC.

【0095】上記のように、本発明の実施の形態3によ
るキャッシュシステムによれば、前記実施の形態1の各
効果が得られるほか、4ウェイセットアソシアティブキ
ャッシュテーブルTCの使用によりFSA方式以外のキ
ャッシュテーブルのヒット率をより高めることができ、
より高いキャッシュヒット率を持つキャッシュ部15B
を実現することができる。特に、CPU50により枝
(branch)の多いプログラムが実行されるような
場合に、すなわち、同一のインデックスに対応する多く
の命令がCPU50により実行されるような場合に、4
ウェイセットアソシアティブキャッシュテーブルTCの
キャッシュヒット率向上の効果が顕著に現れる。従っ
て、実施の形態3のキャッシュシステムは、枝を多く有
する複雑なプログラムを実行するようなコンピュータシ
ステムに対して特に有効である。
As described above, according to the cache system according to the third embodiment of the present invention, each effect of the first embodiment can be obtained, and in addition to the use of the 4-way set associative cache table TC, a cache other than the FSA system can be used. You can increase the hit rate of the table,
Cache unit 15B with higher cache hit rate
Can be realized. In particular, when the CPU 50 executes a program with many branches, that is, when the CPU 50 executes many instructions corresponding to the same index, 4
The effect of improving the cache hit rate of the way set associative cache table TC is remarkably exhibited. Therefore, the cache system according to the third embodiment is particularly effective for a computer system that executes a complicated program having many branches.

【0096】なお、この実施の形態3においてFSA方
式キャッシュと組み合わせられるFSA方式以外のキャ
ッシュとして4ウェイセットアソシアティブキャッシュ
を用いたが、FSA方式以外のキャッシュとして、2ウ
ェイセットアソシアティブキャッシュ、8ウェイセット
アソシアティブキャッシュ等を用いることももちろん可
能である。
In the third embodiment, a 4-way set associative cache is used as a cache other than the FSA system combined with the FSA system cache. Of course, it is also possible to use a cache or the like.

【0097】また、実施の形態2で用いたような大きな
サイズのアクセスカウント領域ACを実施の形態3のF
SA方式キャッシュテーブルTAの各キャッシュライン
に設け、図示しないアクセスカウンタに実施の形態2と
同様の動作をさせることも可能であり、その場合は実施
の形態2と同様の効果を得ることができる。
Further, the access count area AC having a large size as used in the second embodiment is used for the F in the third embodiment.
It is also possible to provide an access counter (not shown) for each cache line of the SA type cache table TA to perform the same operation as in the second embodiment. In this case, the same effect as in the second embodiment can be obtained.

【0098】なお、実施の形態1および3で、FSA方
式キャッシュテーブルTAの各キャッシュラインのアク
セスカウント領域ACに格納されるアクセスカウント値
の初期値を「0」であると仮定して説明を行ったが、こ
の初期値は「0」と限るものではない。例えば、アクセ
スカウント値が「0」に集中することを防ぐためにより
大きな初期値を持たせることも可能である。このような
場合には、アクセスカウント領域ACのサイズ(ビット
数)は少し大きめに設定される。
In the first and third embodiments, description will be made on the assumption that the initial value of the access count value stored in the access count area AC of each cache line of the FSA cache table TA is "0". However, this initial value is not limited to “0”. For example, it is possible to have a larger initial value to prevent the access count value from being concentrated on "0". In such a case, the size (number of bits) of the access count area AC is set slightly larger.

【0099】[0099]

【発明の効果】以上のように、本発明のキャッシュシス
テムおよびキャッシュ処理方法においては、DM方式キ
ャッシュ(TB)等のFSA方式以外のキャッシュ(T
B,TC)と、FSA方式キャッシュ(TA)とが組み
合わせられ、キャッシュヒット判定のためのタグ比較が
両キャッシュで同時に行われる。FSA方式キャッシュ
(TA)の各キャッシュラインに生じたキャッシュヒッ
トの数が図示しないアクセスカウンタによりカウントさ
れ、そのキャッシュヒット数に関するアクセスカウント
値が各キャッシュラインのアクセスカウント領域ACに
格納される。例えば、FSA方式キャッシュ(TA)の
あるキャッシュラインがキャッシュヒットした場合にそ
のキャッシュラインのアクセスカウント値が1ずつイン
クリメントされ、両キャッシュテーブルがミスヒットし
た場合にFSA方式キャッシュ(TA)の全キャッシュ
ラインのアクセスカウント値が一斉に1ずつデクリメン
トされる。
As described above, in the cache system and the cache processing method of the present invention, a cache (T) other than the FSA type such as the DM type cache (TB) is used.
B, TC) and the FSA cache (TA) are combined, and tag comparison for cache hit determination is performed simultaneously in both caches. The number of cache hits generated in each cache line of the FSA cache (TA) is counted by an access counter (not shown), and the access count value related to the number of cache hits is stored in the access count area AC of each cache line. For example, when a certain cache line of the FSA cache (TA) has a cache hit, the access count value of the cache line is incremented by one. Are decremented by one at a time.

【0100】FSA方式キャッシュ(TA)とFSA方
式以外のキャッシュ(TB,TC)とを含むキャッシュ
システムのキャッシュヒット率を向上させるために、上
記アクセスカウント値を用いて各キャッシュのデータの
管理/転送が以下のように行われる。
In order to improve the cache hit rate of the cache system including the FSA type cache (TA) and the non-FSA type caches (TB, TC), data management / transfer of each cache is performed using the access count value. Is performed as follows.

【0101】FSA方式以外のキャッシュ(TB,T
C)にインデックスに対応する非活性なキャッシュライ
ンが存在せずFSA方式キャッシュ(TA)に1以上の
非活性なキャッシュラインが存在する時にFSA方式キ
ャッシュ(TA)とFSA方式以外のキャッシュ(T
B,TC)の両方がミスヒットした場合は、FSA方式
以外のキャッシュ(TB,TC)のミスヒットしたイン
デックスに対応するあるキャッシュラインに格納されて
いたデータがFSA方式キャッシュ(TA)の非活性な
キャッシュラインのうちの一つに転送され、両方のキャ
ッシュのミスヒットによりCPU等の外部メモリ(2
0,21)からフェッチされたデータはFSA方式キャ
ッシュ(TA)へのデータ転送元となったFSA方式以
外のキャッシュ(TB,TC)の前記キャッシュライン
に書き込まれる。
Caches other than the FSA system (TB, T
When there is no inactive cache line corresponding to the index in C) and one or more inactive cache lines exist in the FSA cache (TA), the FSA cache (TA) and the non-FSA cache (T
B, TC), the data stored in a certain cache line corresponding to the missed index of the non-FSA cache (TB, TC) becomes inactive in the FSA cache (TA). Transfer to one of the cache lines, and an external memory (2
The data fetched from (0, 21) is written to the cache line of the non-FSA type cache (TB, TC) which is the data transfer source to the FSA type cache (TA).

【0102】FSA方式以外のキャッシュ(TB,T
C)にインデックスに対応する非活性なキャッシュライ
ンが存在せずFSA方式キャッシュ(TA)が活性なキ
ャッシュラインで一杯な時にFSA方式キャッシュ(T
A)とFSA方式以外のキャッシュ(TB,TC)の両
方がミスヒットした場合は、FSA方式以外のキャッシ
ュ(TB,TC)のミスヒットしたインデックスに対応
するあるキャッシュラインに格納されていたデータがF
SA方式キャッシュ(TA)の最小のキャッシュヒット
カウント値を持つキャッシュラインのうちの一つに転送
され、両方のキャッシュのミスヒットによりCPU等の
外部メモリ(20,21)からフェッチされたデータは
FSA方式キャッシュ(TA)へのデータ転送元となっ
たFSA方式以外のキャッシュ(TB,TC)の前記キ
ャッシュラインに書き込まれる。
Caches other than the FSA system (TB, T
If no inactive cache line corresponding to the index exists in C) and the FSA cache (TA) is full of active cache lines, the FSA cache (T
If both A) and the non-FSA caches (TB, TC) have a mishit, the data stored in a certain cache line corresponding to the mis-hit index of the non-FSA cache (TB, TC) F
The data transferred to one of the cache lines having the smallest cache hit count value of the SA type cache (TA) and fetched from the external memory (20, 21) such as the CPU due to the mishit of both caches is FSA. The data is written to the cache line of the non-FSA type cache (TB, TC) which has been the data transfer source to the type cache (TA).

【0103】FSA方式以外のキャッシュ(TB,T
C)にインデックスに対応する非活性なキャッシュライ
ンが存在する時にFSA方式キャッシュ(TA)とFS
A方式以外のキャッシュ(TB,TC)の両方がミスヒ
ットした場合は、両方のキャッシュのミスヒットにより
CPU等の外部メモリ(20,21)からフェッチされ
たデータはFSA方式以外のキャッシュ(TB,TC)
のインデックスに対応する非活性なキャッシュラインに
書き込まれる。
Caches other than the FSA system (TB, T
When an inactive cache line corresponding to the index exists in C), the FSA cache (TA) and the FS
If both the caches (TB, TC) other than the A type have a mishit, the data fetched from the external memory (20, 21) such as the CPU due to the mishits of both caches will not be used. TC)
Is written to the inactive cache line corresponding to the index of.

【0104】このようなアクセスカウント値(キャッシ
ュヒットカウント値)を用いたデータの管理/転送によ
り、FSA方式キャッシュ(TA)の高キャッシュヒッ
ト率のキャッシュラインの保持性能が改善され、キャッ
シュヒット率が向上される。また、同一のデータのFS
A方式キャッシュ(TA)とFSA方式以外のキャッシ
ュ(TB,TC)における重複が完全に防止され、キャ
ッシュシステムのメモリ空間の使用効率が最大まで向上
し、キャッシュヒット率の極めて高いレベルへの向上が
可能となる。これにより、キャッシュヒット率とデータ
アクセス速度の向上を極めて高いレベルで実現すること
ができる。
By managing / transferring data using such an access count value (cache hit count value), the holding performance of a cache line having a high cache hit rate of the FSA cache (TA) is improved, and the cache hit rate is reduced. Be improved. FS of the same data
Duplication between the A-type cache (TA) and the non-FSA type caches (TB, TC) is completely prevented, the use efficiency of the memory space of the cache system is improved to the maximum, and the cache hit ratio is improved to an extremely high level. It becomes possible. Thereby, the cache hit ratio and the data access speed can be improved at an extremely high level.

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

【図1】本発明の実施の形態1によるキャッシュシステ
ムのキャッシュ部15の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a cache unit 15 of a cache system according to a first embodiment of the present invention.

【図2】本発明の実施の形態1によるキャッシュシステ
ムが適用されたコンピュータシステムの例を示すブロッ
ク図である。
FIG. 2 is a block diagram illustrating an example of a computer system to which the cache system according to the first embodiment of the present invention is applied;

【図3】本発明の実施の形態1によるキャッシュシステ
ムの動作を示すフローチャートである。
FIG. 3 is a flowchart showing an operation of the cache system according to the first embodiment of the present invention.

【図4】図2に示すCPUによって実行されるプログラ
ムの一例を示す模式図である。
FIG. 4 is a schematic diagram showing an example of a program executed by a CPU shown in FIG.

【図5】本発明の実施の形態1のキャッシュシステムを
用いるCPUが図4のプログラムを2回行う際のアクセ
ス時間を示す模式図であり、(a)は1回目のプログラ
ム実行の場合を、(b)は2回目のプログラム実行の場
合を示す。
FIG. 5 is a schematic diagram showing an access time when a CPU using the cache system according to the first embodiment of the present invention executes the program of FIG. 4 twice; FIG. (B) shows the case of the second program execution.

【図6】図4のプログラムの命令(5)の実行直後の、
図1に示すFSA方式キャッシュテーブルTAとDM方
式キャッシュテーブルTBの状態を示す模式図である。
FIG. 6 shows a state immediately after execution of an instruction (5) of the program in FIG.
FIG. 2 is a schematic diagram showing states of an FSA cache table TA and a DM cache table TB shown in FIG. 1.

【図7】本発明よるキャッシュシステムの他の例をコン
ピュータシステムに適用した場合を示すブロック図であ
る。
FIG. 7 is a block diagram showing a case where another example of the cache system according to the present invention is applied to a computer system.

【図8】本発明の実施の形態2によるキャッシュシステ
ムのキャッシュ部の構成を示すブロック図である。
FIG. 8 is a block diagram showing a configuration of a cache unit of a cache system according to a second embodiment of the present invention.

【図9】本発明の実施の形態3によるキャッシュシステ
ムのキャッシュ部においてフルセットアソシアティブ方
式以外のキャッシュテーブルとして用いられる4ウェイ
セットアソシアティブキャッシュテーブルTCを示す模
式図である。
FIG. 9 is a schematic diagram showing a 4-way set associative cache table TC used as a cache table other than the full set associative method in the cache unit of the cache system according to the third embodiment of the present invention.

【図10】典型的な従来のダイレクトマッピング方式キ
ャッシュを示すブロック図である。
FIG. 10 is a block diagram illustrating a typical conventional direct mapping cache.

【図11】CPUにより実現されるプログラムの例を示
す模式図である。
FIG. 11 is a schematic diagram illustrating an example of a program realized by a CPU.

【図12】CPUが図11のプログラムを実行する際の
図10のダイレクトマッピング方式キャッシュのキャッ
シュテーブルの状態変化の例を示す模式図であり、
(a)は命令(1)実行直後の状態を、(b)は命令
(5)実行直後の状態を示す。
12 is a schematic diagram showing an example of a state change of the cache table of the direct mapping cache of FIG. 10 when the CPU executes the program of FIG. 11;
(A) shows the state immediately after the execution of the instruction (1), and (b) shows the state immediately after the execution of the instruction (5).

【図13】従来のダイレクトマッピング方式キャッシュ
を使用するCPUが図11のプログラムを2回実行する
場合のアクセス時間を示す模式図であり、(a)は1回
目のプログラム実行の場合、(b)は2回目のプログラ
ム実行の場合を示す。
13A and 13B are schematic diagrams showing access times when a CPU using a conventional direct mapping cache executes the program of FIG. 11 twice, wherein FIG. 13A shows the first program execution and FIG. Indicates the case of the second program execution.

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

15 キャッシュ部(一次キャッシュ) 20 二次キャッシュ(外部メモリ) 21 メインメモリ(外部メモリ) 50 CPU(データ処理ユニット) AC アクセスカウント領域(キャッシュヒットカウン
ト格納手段) TA FSA方式キャッシュテーブル(フルセットアソ
シアティブ方式キャッシュ) TB DM方式キャッシュテーブル(ダイレクトマッピ
ング方式キャッシュ、フルセットアソシアティブ方式以
外のキャッシュ) TC 4ウェイセットアソシアティブキャッシュテーブ
ル(Nウェイセットアソシアティブキャッシュ、フルセ
ットアソシアティブ方式以外のキャッシュ)
15 Cache unit (primary cache) 20 Secondary cache (external memory) 21 Main memory (external memory) 50 CPU (data processing unit) AC access count area (cache hit count storage means) TA FSA type cache table (full set associative type) Cache) TB DM cache table (cache other than direct mapping cache and full set associative cache) TC 4-way set associative cache table (cache other than N way set associative cache and full set associative cache)

Claims (27)

【特許請求の範囲】[Claims] 【請求項1】 CPU(Central Proces
sing Unit)(50)、MPU(MicroP
rocessor Unit)等のデータ処理ユニット
(50)の、メインメモリ(21)等の外部メモリ(2
0,21)へのアクセス回数を削減するためのキャッシ
ュシステムにおいて、 キャッシュヒット率の高いキャッシュラインの保持が可
能なFSA(フルセットアソシアティブ)方式キャッシ
ュ(TA)であり、入力アドレスデータから抽出された
第1のタグ(#1)が前記FSA方式キャッシュ(T
A)の活性なキャッシュラインに格納されていた第1の
タグ(#1)の一つと一致した場合に、その一致した第
1のタグ(#1)に対応する活性なキャッシュラインに
格納されていたデータが前記データ処理ユニット(5
0)によりキャッシュデータとして読み込まれるFSA
方式キャッシュ(TA)と、 前記キャッシュシステムにおいて前記FSA方式キャッ
シュ(TA)と組み合わせられる形で設けられキャッシ
ュヒット判定のためのタグ比較を前記FSA方式キャッ
シュ(TA)と同時に行うFSA方式以外のキャッシュ
(TB,TC)であり、前記入力アドレスデータから抽
出された第2のタグ(#2)が前記FSA方式以外のキ
ャッシュ(TB,TC)の前記入力アドレスデータから
抽出されたインデックスに対応する活性なキャッシュラ
インに格納されていた第2のタグ(#2)に一致した場
合に、その一致した第2のタグ(#2)に対応する活性
なキャッシュラインに格納されていたデータが前記デー
タ処理ユニット(50)によりキャッシュデータとして
読み込まれるFSA方式以外のキャッシュ(TB,T
C)と、 前記FSA方式キャッシュ(TA)の各キャッシュライ
ンに対応して設けられ、前記キャッシュラインに生じた
キャッシュヒットの回数に関するキャッシュヒットカウ
ント値を格納するキャッシュヒットカウント格納手段
(AC)と、 前記FSA方式キャッシュ(TA)の各キャッシュライ
ンのキャッシュヒットをカウントし、前記キャッシュヒ
ットカウント格納手段(AC)に格納される前記キャッ
シュヒットカウント値を管理し更新するキャッシュヒッ
トカウント管理手段とを備え、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)に1以上の非
活性なキャッシュラインが存在する時に前記FSA方式
キャッシュ(TA)と前記FSA方式以外のキャッシュ
(TB,TC)の両方がミスヒットした場合は、前記F
SA方式以外のキャッシュ(TB,TC)のミスヒット
した前記インデックスに対応するあるキャッシュライン
に格納されていたデータが前記FSA方式キャッシュ
(TA)の前記非活性なキャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリ(20,21)からフェッチされたデー
タは前記FSA方式キャッシュ(TA)へのデータ転送
元となった前記FSA方式以外のキャッシュ(TB,T
C)の前記キャッシュラインに書き込まれ、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)が活性なキャ
ッシュラインで一杯な時に前記FSA方式キャッシュ
(TA)と前記FSA方式以外のキャッシュ(TB,T
C)の両方がミスヒットした場合は、前記FSA方式以
外のキャッシュ(TB,TC)のミスヒットした前記イ
ンデックスに対応するあるキャッシュラインに格納され
ていたデータが前記FSA方式キャッシュ(TA)の最
小のキャッシュヒットカウント値を持つキャッシュライ
ンのうちの一つに転送され、前記両方のキャッシュのミ
スヒットにより前記外部メモリ(20,21)からフェ
ッチされたデータは前記FSA方式キャッシュ(TA)
へのデータ転送元となった前記FSA方式以外のキャッ
シュ(TB,TC)の前記キャッシュラインに書き込ま
れ、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在する時に前記FSA方式キャッシュ(TA)と前記F
SA方式以外のキャッシュ(TB,TC)の両方がミス
ヒットした場合は、前記両方のキャッシュのミスヒット
により前記外部メモリ(20,21)からフェッチされ
たデータは前記FSA方式以外のキャッシュ(TB,T
C)の前記インデックスに対応する非活性なキャッシュ
ラインに書き込まれることを特徴とするキャッシュシス
テム。
1. A CPU (Central Processes)
sing Unit) (50), MPU (MicroP)
external unit (2) such as a main memory (21) of a data processing unit (50) such as a processor unit.
A cache system for reducing the number of accesses to (0, 21) is a full set associative (FSA) cache (TA) capable of holding a cache line having a high cache hit rate, and is extracted from input address data. The first tag (# 1) is the FSA cache (T
When a match is found with one of the first tags (# 1) stored in the active cache line of A), the data is stored in the active cache line corresponding to the matched first tag (# 1). Data is stored in the data processing unit (5).
FSA read as cache data by 0)
And a non-FSA cache (TA) which is provided in combination with the FSA cache (TA) in the cache system and performs a tag comparison for cache hit determination simultaneously with the FSA cache (TA). TB, TC), and the second tag (# 2) extracted from the input address data is an active tag corresponding to the index extracted from the input address data of the cache (TB, TC) other than the FSA system. When the data matches the second tag (# 2) stored in the cache line, the data stored in the active cache line corresponding to the matched second tag (# 2) is stored in the data processing unit. A cache other than the FSA system read as cache data by (50) ( TB, T
C) a cache hit count storage means (AC) provided corresponding to each cache line of the FSA cache (TA) and storing a cache hit count value relating to the number of cache hits occurring in the cache line; A cache hit count managing means for counting cache hits of each cache line of the FSA cache (TA), and managing and updating the cache hit count value stored in the cache hit count storing means (AC); When there is no inactive cache line corresponding to the index in the cache other than the FSA system (TB, TC) and one or more inactive cache lines exist in the FSA system cache (TA), the FSA system cache is used. (TA) If both caches other than the FSA method (TB, TC) has mishit, the F
Data stored in a certain cache line corresponding to the index in which the mishit has occurred in the non-SA cache (TB, TC) is transferred to one of the inactive cache lines of the FSA cache (TA). Then, the data fetched from the external memories (20, 21) due to the mishits of the two caches are transferred to the non-FSA type caches (TB, T) which are the data transfer source to the FSA type cache (TA).
C), the cache line (TB, TC) other than the FSA system has no inactive cache line corresponding to the index, and the FSA system cache (TA) is full of active cache lines. When the FSA cache (TA) and the non-FSA cache (TB, T
C), when both misses occur, the data stored in a certain cache line corresponding to the missed index of the cache (TB, TC) of the non-FSA cache becomes the minimum of the FSA cache (TA). And the data fetched from the external memories (20, 21) due to the mishits of the two caches is transferred to the FSA cache (TA).
An inactive cache line corresponding to the index is written to the cache line of the non-FSA type cache (TB, TC) that has become a data transfer source to the non-FSA type cache (TB, TC). The FSA cache (TA) and the F
If both the caches (TB, TC) other than the SA scheme miss-hit, the data fetched from the external memory (20, 21) due to the miss-hit of both caches will cause the caches (TB, TB, non-FSA scheme) to fetch. T
C) A cache system wherein data is written to an inactive cache line corresponding to the index of C).
【請求項2】 前記FSA方式キャッシュ(TA)のあ
るキャッシュラインがキャッシュヒットした場合には、
前記キャッシュヒットカウント管理手段はそのキャッシ
ュラインの前記キャッシュヒットカウント値を1つイン
クリメントし、 前記FSA方式キャッシュ(TA)と前記FSA方式以
外のキャッシュ(TB,TC)の両方がミスヒットした
場合には、前記キャッシュヒットカウント管理手段は前
記FSA方式キャッシュ(TA)の全キャッシュライン
の前記キャッシュヒットカウント値を一斉に1つデクリ
メントすることを特徴とする請求項1記載のキャッシュ
システム。
2. When a cache hit occurs in a certain cache line of the FSA cache (TA),
The cache hit count management means increments the cache hit count value of the cache line by one. 2. The cache system according to claim 1, wherein said cache hit count management means decrements said cache hit count value of all the cache lines of said FSA cache (TA) by one at a time.
【請求項3】 前記FSA方式キャッシュ(TA)のあ
るキャッシュラインがキャッシュヒットした場合には、
前記キャッシュヒットカウント管理手段はそのキャッシ
ュラインの前記キャッシュヒットカウント値を1つイン
クリメントし、 前記FSA方式キャッシュ(TA)がミスヒットした場
合には、前記キャッシュヒットカウント管理手段は前記
FSA方式キャッシュ(TA)の全キャッシュラインの
前記キャッシュヒットカウント値を一斉に1つデクリメ
ントすることを特徴とする請求項1記載のキャッシュシ
ステム。
3. When a cache line in the FSA cache (TA) has a cache hit,
The cache hit count management means increments the cache hit count value of the cache line by one. 2. The cache system according to claim 1, wherein the cache hit count values of all the cache lines are decremented by one at a time.
【請求項4】 前記FSA方式キャッシュ(TA)のあ
るキャッシュラインがキャッシュヒットした場合には、
前記キャッシュヒットカウント管理手段はそのキャッシ
ュラインの前記キャッシュヒットカウント値を1つイン
クリメントすることを特徴とする請求項1記載のキャッ
シュシステム。
4. When a cache line hits a certain cache line in the FSA cache (TA),
2. The cache system according to claim 1, wherein said cache hit count management means increments the cache hit count value of the cache line by one.
【請求項5】 前記FSA方式以外のキャッシュ(T
B,TC)として、ダイレクトマッピング方式キャッシ
ュ(TB)が用いられることを特徴とする請求項1から
4のうちのいずれか1項に記載のキャッシュシステム。
5. A cache other than the FSA system (T
The cache system according to any one of claims 1 to 4, wherein a direct mapping cache (TB) is used as (B, TC).
【請求項6】 前記FSA方式以外のキャッシュ(T
B,TC)として、Nウェイセットアソシアティブキャ
ッシュ(TC)(N=2,4,8,・・・)が用いられ
ることを特徴とする請求項1から4のうちのいずれか1
項に記載のキャッシュシステム。
6. The cache other than the FSA system (T
5. An apparatus according to claim 1, wherein an N-way set associative cache (TC) (N = 2, 4, 8,...) Is used as (B, TC).
The cache system according to the item.
【請求項7】 前記FSA方式キャッシュ(TA)の各
キャッシュラインに対応して設けられ、前記キャッシュ
ラインに生じた最新のキャッシュヒットの日時に関する
データを格納するキャッシュヒット日時格納手段をさら
に備え、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)が活性なキャ
ッシュラインで一杯な時に前記FSA方式キャッシュ
(TA)と前記FSA方式以外のキャッシュ(TB,T
C)の両方がミスヒットした前記場合には、前記キャッ
シュヒット日時格納手段に格納された前記データに基づ
いて前記FSA方式キャッシュ(TA)の前記最小のキ
ャッシュヒットカウント値を持つ前記キャッシュライン
の中から最近のキャッシュヒットが最も古いキャッシュ
ラインが選択され、その選択されたキャッシュラインが
前記FSA方式以外のキャッシュ(TB,TC)から前
記FSA方式キャッシュ(TA)への前記データ転送の
転送先として指定されることを特徴とする請求項1から
6のうちのいずれか1項に記載のキャッシュシステム。
7. A cache hit date and time storage means provided corresponding to each cache line of the FSA type cache (TA) and storing data relating to the date and time of the latest cache hit occurring in the cache line, When there is no inactive cache line corresponding to the index in the cache (TB, TC) other than the FSA type cache and the FSA type cache (TA) is full of active cache lines, the FSA type cache (TA) and the aforementioned Caches other than the FSA system (TB, T
C) In the case where both of the misses occur, the cache line having the minimum cache hit count value of the FSA type cache (TA) is determined based on the data stored in the cache hit date and time storage means. , A cache line having the oldest cache hit is selected, and the selected cache line is designated as a transfer destination of the data transfer from the non-FSA cache (TB, TC) to the FSA cache (TA). The cache system according to any one of claims 1 to 6, wherein the cache system is executed.
【請求項8】 各インデックスに対応して設けられ、そ
のインデックスに対応するN本のキャッシュラインの中
で最近のキャッシュヒットが最も古いキャッシュライン
を示すためのLRU(Least Recently
Used)値を格納するLRU格納手段をさらに備え、 前記Nウェイセットアソシアティブキャッシュ(TC)
に前記インデックスに対応する非活性なキャッシュライ
ンが存在せず前記FSA方式キャッシュ(TA)に1以
上の非活性なキャッシュラインが存在する時に前記FS
A方式キャッシュ(TA)と前記Nウェイセットアソシ
アティブキャッシュ(TC)の両方がミスヒットした前
記場合には、前記Nウェイセットアソシアティブキャッ
シュ(TC)のN本のミスヒットしたキャッシュライン
の中から前記LRU値により指定されたキャッシュライ
ンが選択され、その選択されたキャッシュラインに格納
されていたデータが前記FSA方式キャッシュ(TA)
の前記非活性なキャッシュラインのうちの一つに転送さ
れ、前記両方のキャッシュのミスヒットにより前記外部
メモリ(20,21)からフェッチされたデータは前記
FSA方式キャッシュ(TA)へのデータ転送元となっ
た前記Nウェイセットアソシアティブキャッシュ(T
C)の前記選択されたキャッシュラインに書き込まれ、 前記Nウェイセットアソシアティブキャッシュ(TC)
に前記インデックスに対応する非活性なキャッシュライ
ンが存在せず前記FSA方式キャッシュ(TA)が活性
なキャッシュラインで一杯な時に前記FSA方式キャッ
シュ(TA)と前記Nウェイセットアソシアティブキャ
ッシュ(TC)の両方がミスヒットした前記場合には、
前記Nウェイセットアソシアティブキャッシュ(TC)
のN本のミスヒットしたキャッシュラインの中から前記
LRU値により指定されたキャッシュラインが選択さ
れ、その選択されたキャッシュラインに格納されていた
データが前記FSA方式キャッシュ(TA)の前記最小
のキャッシュヒットカウント値を持つ前記キャッシュラ
インのうちの一つに転送され、前記両方のキャッシュの
ミスヒットにより前記外部メモリ(20,21)からフ
ェッチされたデータは前記FSA方式キャッシュ(T
A)へのデータ転送元となった前記Nウェイセットアソ
シアティブキャッシュ(TC)の前記選択されたキャッ
シュラインに書き込まれ、 前記Nウェイセットアソシアティブキャッシュ(TC)
に前記インデックスに対応する非活性なキャッシュライ
ンが1以上存在する時に前記FSA方式キャッシュ(T
A)と前記Nウェイセットアソシアティブキャッシュ
(TC)の両方がミスヒットした前記場合には、前記両
方のキャッシュのミスヒットにより前記外部メモリ(2
0,21)からフェッチされたデータは前記Nウェイセ
ットアソシアティブキャッシュ(TC)の前記インデッ
クスに対応する前記非活性なキャッシュラインのうちの
一つのキャッシュラインに書き込まれることを特徴とす
る請求項6記載のキャッシュシステム。
8. An LRU (Least Recently) provided for each index, wherein a latest cache hit among the N cache lines corresponding to the index indicates the oldest cache line.
Further comprising an LRU storage unit for storing a value of the N-way set associative cache (TC).
When there is no inactive cache line corresponding to the index and one or more inactive cache lines exist in the FSA cache (TA).
In the case where both the A-type cache (TA) and the N-way set associative cache (TC) have missed, the LRU is selected from the N missed cache lines of the N-way set associative cache (TC). The cache line specified by the value is selected, and the data stored in the selected cache line is stored in the FSA cache (TA).
And the data fetched from the external memories (20, 21) due to the mishits of both caches is the data transfer source to the FSA type cache (TA). Said N-way set associative cash (T
C) written to the selected cache line of the N-way set associative cache (TC)
When there is no inactive cache line corresponding to the index and the FSA cache (TA) is full of active cache lines, both the FSA cache (TA) and the N-way set associative cache (TC) In the case where
The N-way set associative cache (TC)
A cache line specified by the LRU value is selected from the N number of missed cache lines, and the data stored in the selected cache line is stored in the minimum cache of the FSA type cache (TA). The data transferred to one of the cache lines having a hit count value and fetched from the external memories (20, 21) due to the mishits of both caches are transferred to the FSA cache (T
A) is written to the selected cache line of the N-way set associative cache (TC) from which data is transferred to A), and the N-way set associative cache (TC) is written.
When one or more inactive cache lines corresponding to the index exist in the FSA cache (T
In the case where both A) and the N-way set associative cache (TC) miss-hit, the external memory (2
7. The data fetched from (0, 21) is written to one of the inactive cache lines corresponding to the index of the N-way set associative cache (TC). Cache system.
【請求項9】 前記FSA方式キャッシュ(TA)と前
記FSA方式以外のキャッシュ(TB,TC)からなる
一次キャッシュ(15)に付加して設けられた二次キャ
ッシュ(20)をさらに備えることを特徴とする請求項
1から8のうちのいずれか1項に記載のキャッシュシス
テム。
9. A secondary cache (20) provided in addition to a primary cache (15) comprising the FSA cache (TA) and the non-FSA cache (TB, TC). The cache system according to any one of claims 1 to 8, wherein
【請求項10】 キャッシュヒット率の高いキャッシュ
ラインの保持が可能なFSA(フルセットアソシアティ
ブ)方式キャッシュ(TA)と前記FSA方式キャッシ
ュ(TA)と同時にキャッシュヒット判定のためのタグ
比較を行うFSA方式以外のキャッシュ(TB,TC)
との組み合わせを用い、CPU(Central Pr
ocessing Unit)(50)、MPU(Mi
croProcessor Unit)等のデータ処理
ユニット(50)の、メインメモリ(21)等の外部メ
モリ(20,21)へのアクセス回数を削減するための
キャッシュ処理方法において、 入力アドレスデータから抽出された第1のタグ(#1)
が前記FSA方式キャッシュ(TA)の活性なキャッシ
ュラインに格納されていた複数の第1のタグ(#1)と
比較され、前記第1のタグ(#1)の一致が有った場合
に前記FSA方式キャッシュ(TA)がキャッシュヒッ
トしたと判定される第1のタグ比較工程と、 前記第1のタグ比較工程と同時に行われ、前記入力アド
レスデータから抽出された第2のタグ(#2)が前記F
SA方式以外のキャッシュ(TB,TC)の前記入力ア
ドレスデータから抽出されたインデックスに対応する1
以上の活性なキャッシュラインに格納されていた第2の
タグ(#2)と比較され、前記第2のタグ(#2)の一
致が有った場合に前記FSA方式以外のキャッシュ(T
B,TC)がキャッシュヒットしたと判定される第2の
タグ比較工程と、 前記FSA方式キャッシュ(TA)の各キャッシュライ
ンに起きたキャッシュヒットがカウントされ、前記FS
A方式キャッシュ(TA)の各キャッシュラインに対応
して設けられたキャッシュヒットカウント格納手段(A
C)に格納された各キャッシュライン毎のキャッシュヒ
ットカウント値が管理し更新されるキャッシュヒットカ
ウント管理工程と、 前記第1のタグ比較工程において前記FSA方式キャッ
シュ(TA)がキャッシュヒットした場合に、前記FS
A方式キャッシュ(TA)の前記一致した第1のタグ
(#1)に対応するキャッシュラインに格納されていた
データが、前記データ処理ユニット(50)によりキャ
ッシュデータとして読み込まれる第1のキャッシュデー
タ読み込み工程と、 前記第2のタグ比較工程において前記FSA方式以外の
キャッシュ(TB,TC)がキャッシュヒットした場合
に、前記FSA方式以外のキャッシュ(TB,TC)の
前記インデックスと前記一致した第2のタグ(#2)に
対応するキャッシュラインに格納されていたデータが、
前記データ処理ユニット(50)によりキャッシュデー
タとして読み込まれる第2のキャッシュデータ読み込み
工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)に1以上の非
活性なキャッシュラインが存在する時に前記FSA方式
キャッシュ(TA)と前記FSA方式以外のキャッシュ
(TB,TC)の両方がミスヒットした場合に、前記F
SA方式以外のキャッシュ(TB,TC)のミスヒット
した前記インデックスに対応するあるキャッシュライン
に格納されていたデータが前記FSA方式キャッシュ
(TA)の前記非活性なキャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリ(20,21)からフェッチされたデー
タが前記FSA方式キャッシュ(TA)へのデータ転送
元となった前記FSA方式以外のキャッシュ(TB,T
C)の前記キャッシュラインに書き込まれる第1のデー
タ転送工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)が活性なキャ
ッシュラインで一杯な時に前記FSA方式キャッシュ
(TA)と前記FSA方式以外のキャッシュ(TB,T
C)の両方がミスヒットした場合に、前記FSA方式以
外のキャッシュ(TB,TC)のミスヒットした前記イ
ンデックスに対応するあるキャッシュラインに格納され
ていたデータが前記FSA方式キャッシュ(TA)の最
小のキャッシュヒットカウント値を持つキャッシュライ
ンのうちの一つに転送され、前記両方のキャッシュのミ
スヒットにより前記外部メモリ(20,21)からフェ
ッチされたデータが前記FSA方式キャッシュ(TA)
へのデータ転送元となった前記FSA方式以外のキャッ
シュ(TB,TC)の前記キャッシュラインに書き込ま
れる第2のデータ転送工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在する時に前記FSA方式キャッシュ(TA)と前記F
SA方式以外のキャッシュ(TB,TC)の両方がミス
ヒットした場合に、前記両方のキャッシュのミスヒット
により前記外部メモリ(20,21)からフェッチされ
たデータが前記FSA方式以外のキャッシュ(TB,T
C)の前記インデックスに対応する非活性なキャッシュ
ラインに書き込まれる第3のデータ転送工程とを備える
ことを特徴とするキャッシュ処理方法。
10. An FSA (full set associative) cache (TA) capable of holding a cache line having a high cache hit rate and an FSA scheme for performing a tag comparison for cache hit determination simultaneously with the FSA cache (TA). Other caches (TB, TC)
CPU (Central Pr)
processing Unit) (50), MPU (Mi
In a cache processing method for reducing the number of accesses to an external memory (20, 21) such as a main memory (21) by a data processing unit (50) such as a croProcessor Unit), the first data extracted from input address data Tag (# 1)
Is compared with a plurality of first tags (# 1) stored in an active cache line of the FSA cache (TA), and when there is a match of the first tags (# 1), A first tag comparing step in which it is determined that the FSA cache (TA) has a cache hit; and a second tag (# 2) which is performed simultaneously with the first tag comparing step and is extracted from the input address data. Is the F
1 corresponding to the index extracted from the input address data of the cache (TB, TC) other than the SA system
The second tag (# 2) stored in the active cache line is compared with the second tag (# 2). If there is a match of the second tag (# 2), the cache (T
(B, TC) is determined to have a cache hit, and a cache hit occurring in each cache line of the FSA cache (TA) is counted.
A cache hit count storage means (A provided for each cache line of the A-type cache (TA)
C) a cache hit count management step in which the cache hit count value for each cache line stored in C) is managed and updated; and if the FSA cache (TA) has a cache hit in the first tag comparison step, The FS
A first cache data read in which data stored in a cache line corresponding to the matched first tag (# 1) of the A-system cache (TA) is read as cache data by the data processing unit (50). And if the cache (TB, TC) other than the FSA scheme has a cache hit in the second tag comparison step, the second index that matches the index of the cache (TB, TC) other than the FSA scheme. The data stored in the cache line corresponding to the tag (# 2)
A second cache data reading step of being read as cache data by the data processing unit (50); and an inactive cache line corresponding to the index does not exist in a cache (TB, TC) other than the FSA system, and the FSA If there is one or more inactive cache lines in the system cache (TA) and both the FSA system cache (TA) and the non-FSA system caches (TB, TC) miss-hit,
Data stored in a certain cache line corresponding to the missed index of the cache (TB, TC) other than the SA type cache is transferred to one of the inactive cache lines of the FSA type cache (TA). Then, the data fetched from the external memories (20, 21) due to the mishits of the two caches are transferred to the FSA cache (TA) by the non-FSA caches (TB, T).
C) a first data transfer step of writing to the cache line; and the non-FSA cache (TB, TC) has no inactive cache line corresponding to the index and the FSA cache (TA). Is full of active cache lines, the FSA cache (TA) and the non-FSA cache (TB, T
C), the data stored in a certain cache line corresponding to the mis-indexed cache (TB, TC) of the non-FSA cache (TB, TC) is the minimum of the FSA cache (TA). And the data fetched from the external memory (20, 21) due to the mishit of both caches is transferred to the FSA cache (TA).
A second data transfer step of writing to the cache line of the non-FSA-based cache (TB, TC) from which data has been transferred to the cache, and the index corresponding to the non-FSA-based cache (TB, TC) The FSA cache (TA) and the FSA cache when there is an inactive cache line
If both of the caches (TB, TC) other than the SA scheme miss-hit, the data fetched from the external memory (20, 21) due to the miss-hit of both caches causes the caches (TB, TC, TC) other than the FSA scheme. T
C) a third data transfer step of writing data to an inactive cache line corresponding to the index of C).
【請求項11】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされ、 前記FSA方式キャッシュ(TA)と前記FSA方式以
外のキャッシュ(TB,TC)の両方がミスヒットした
場合には、前記FSA方式キャッシュ(TA)の全キャ
ッシュラインの前記キャッシュヒットカウント値が一斉
に1つデクリメントされることを特徴とする請求項10
記載のキャッシュ処理方法。
11. In the cache hit count managing step, when a cache line in the FSA cache (TA) has a cache hit, the cache hit count value of the cache line is incremented by one. If both the cache (TA) and the caches (TB, TC) other than the FSA system have miss-hits, the cache hit count values of all the cache lines of the FSA system cache (TA) are decremented by one at a time. 11. The method according to claim 10, wherein
The cache processing method described.
【請求項12】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされ、 前記FSA方式キャッシュ(TA)がミスヒットした場
合には、前記FSA方式キャッシュ(TA)の全キャッ
シュラインの前記キャッシュヒットカウント値が一斉に
1つデクリメントされることを特徴とする請求項10記
載のキャッシュ処理方法。
12. In the cache hit count management step, when a cache line in the FSA cache (TA) has a cache hit, the cache hit count value of the cache line is incremented by one. 11. The cache processing method according to claim 10, wherein when the cache (TA) has a mishit, the cache hit count values of all the cache lines of the FSA cache (TA) are decremented by one at a time. .
【請求項13】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされることを特徴とする請求項10記載のキャ
ッシュ処理方法。
13. In the cache hit count managing step, when a cache hit occurs in a cache line of the FSA cache (TA), the cache hit count value of the cache line is incremented by one. The cache processing method according to claim 10, wherein
【請求項14】 前記FSA方式以外のキャッシュ(T
B,TC)として、ダイレクトマッピング方式キャッシ
ュ(TB)が用いられることを特徴とする請求項10か
ら13のうちのいずれか1項に記載のキャッシュ処理方
法。
14. A cache other than the FSA system (T
14. A cache processing method according to claim 10, wherein a direct mapping cache (TB) is used as (B, TC).
【請求項15】 前記FSA方式以外のキャッシュ(T
B,TC)として、Nウェイセットアソシアティブキャ
ッシュ(TC)(N=2,4,8,・・・)が用いられ
ることを特徴とする請求項10から13のうちのいずれ
か1項に記載のキャッシュ処理方法。
15. The cache other than the FSA system (T
14. The method according to claim 10, wherein an N-way set associative cache (TC) (N = 2, 4, 8,...) Is used as (B, TC). Cache processing method.
【請求項16】 前記FSA方式キャッシュ(TA)の
各キャッシュラインに生じた最新のキャッシュヒットの
日時に関するデータを、前記各キャッシュラインに対応
して設けられたキャッシュヒット日時格納手段に格納す
るキャッシュヒット日時格納工程をさらに備え、 前記第2のデータ転送工程においては、前記キャッシュ
ヒット日時格納手段に格納された前記データに基づいて
前記FSA方式キャッシュ(TA)の前記最小のキャッ
シュヒットカウント値を持つ前記キャッシュラインの中
から最近のキャッシュヒットが最も古いキャッシュライ
ンが選択され、その選択されたキャッシュラインが前記
FSA方式以外のキャッシュ(TB,TC)から前記F
SA方式キャッシュ(TA)への前記データ転送の転送
先として指定されることを特徴とする請求項10から1
5のうちのいずれか1項に記載のキャッシュ処理方法。
16. A cache hit which stores data relating to the date and time of the latest cache hit occurring in each cache line of said FSA type cache (TA) in a cache hit date and time storage means provided corresponding to each of said cache lines. A date / time storage step, wherein the second data transfer step has the minimum cache hit count value of the FSA cache (TA) based on the data stored in the cache hit date / time storage means. The cache line with the oldest cache hit is selected from the cache lines, and the selected cache line is transferred from the cache (TB, TC) other than the FSA system to the F line.
11. The data transfer method according to claim 10, wherein the transfer destination is specified as a transfer destination of the data transfer to an SA system cache.
6. The cache processing method according to any one of 5.
【請求項17】 各インデックスに対応するN本のキャ
ッシュラインの中で最近のキャッシュヒットが最も古い
キャッシュラインを示すためのLRU(Least R
ecently Used)値を各インデックスに対応
して設けられたLRU格納手段に格納するLRU格納工
程をさらに備え、 前記第1のデータ転送工程においては、前記Nウェイセ
ットアソシアティブキャッシュ(TC)のN本のミスヒ
ットしたキャッシュラインの中から前記LRU値により
指定されたキャッシュラインが選択され、その選択され
たキャッシュラインに格納されていたデータが前記FS
A方式キャッシュ(TA)の前記非活性なキャッシュラ
インのうちの一つに転送され、前記両方のキャッシュの
ミスヒットにより前記外部メモリ(20,21)からフ
ェッチされたデータは前記FSA方式キャッシュ(T
A)へのデータ転送元となった前記Nウェイセットアソ
シアティブキャッシュ(TC)の前記選択されたキャッ
シュラインに書き込まれ、 前記第2のデータ転送工程においては、前記Nウェイセ
ットアソシアティブキャッシュ(TC)のN本のミスヒ
ットしたキャッシュラインの中から前記LRU値により
指定されたキャッシュラインが選択され、その選択され
たキャッシュラインに格納されていたデータが前記FS
A方式キャッシュ(TA)の前記最小のキャッシュヒッ
トカウント値を持つ前記キャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリ(20,21)からフェッチされたデー
タは前記FSA方式キャッシュ(TA)へのデータ転送
元となった前記Nウェイセットアソシアティブキャッシ
ュ(TC)の前記選択されたキャッシュラインに書き込
まれ、 前記第3のデータ転送工程においては、前記両方のキャ
ッシュのミスヒットにより前記外部メモリ(20,2
1)からフェッチされたデータは前記Nウェイセットア
ソシアティブキャッシュ(TC)の前記インデックスに
対応する前記非活性なキャッシュラインのうちの一つの
キャッシュラインに書き込まれることを特徴とする請求
項15記載のキャッシュ処理方法。
17. An LRU (Least R.R.L.) for indicating that the latest cache hit indicates the oldest cache line among the N cache lines corresponding to each index.
LRU storing means for storing a newly used (U.S. recent used) value in an LRU storing means provided corresponding to each index. In the first data transfer step, N number of N-way set associative caches (TC) are provided. A cache line specified by the LRU value is selected from the cache lines that have been hit, and the data stored in the selected cache line is stored in the FS.
The data transferred to one of the inactive cache lines of the A-type cache (TA) and fetched from the external memories (20, 21) due to the mishit of both the caches is transferred to the FSA type cache (T
A) The data is written to the selected cache line of the N-way set associative cache (TC) that has been the data transfer source to A), and in the second data transfer step, the N-way set associative cache (TC) A cache line specified by the LRU value is selected from the N missed cache lines, and data stored in the selected cache line is stored in the FS.
Data transferred to one of the cache lines having the minimum cache hit count value of the A-type cache (TA) and fetched from the external memories (20, 21) due to both cache mishits is The data is written to the selected cache line of the N-way set associative cache (TC) that has been a data transfer source to the FSA type cache (TA). In the third data transfer step, both of the caches are written. The external memory (20, 2)
16. The cache according to claim 15, wherein the data fetched from 1) is written to one of the inactive cache lines corresponding to the index of the N-way set associative cache (TC). Processing method.
【請求項18】 前記FSA方式キャッシュ(TA)と
前記FSA方式以外のキャッシュ(TB,TC)の両方
がミスヒットした場合に、前記FSA方式キャッシュ
(TA)と前記FSA方式以外のキャッシュ(TB,T
C)からなる一次キャッシュ(15)に付加する形で設
けられた二次キャッシュ(20)へのアクセスが行われ
る二次キャッシュアクセス工程をさらに備えることを特
徴とする請求項10から17のうちのいずれか1項に記
載のキャッシュ処理方法。
18. When both the FSA cache (TA) and the non-FSA caches (TB, TC) have a mishit, the FSA cache (TA) and the non-FSA caches (TB, TC). T
18. The method according to claim 10, further comprising a secondary cache access step for accessing a secondary cache (20) provided in addition to the primary cache (15) comprising C). The cache processing method according to claim 1.
【請求項19】 キャッシュヒット率の高いキャッシュ
ラインの保持が可能なFSA(フルセットアソシアティ
ブ)方式キャッシュ(TA)と前記FSA方式キャッシ
ュ(TA)と同時にキャッシュヒット判定のためのタグ
比較を行うFSA方式以外のキャッシュ(TB,TC)
との組み合わせを用いてCPU(Central Pr
ocessing Unit)(50)、MPU(Mi
croProcessor Unit)等のデータ処理
ユニット(50)のメインメモリ(21)等の外部メモ
リ(20,21)へのアクセス回数を削減するためのキ
ャッシュ処理をコンピュータに実行させるためのプログ
ラムを格納した機械読み取り可能な記録媒体であり、前
記キャッシュ処理は、 前記FSA方式キャッシュ(TA)の各キャッシュライ
ンに起きたキャッシュヒットがカウントされ、前記FS
A方式キャッシュ(TA)の各キャッシュラインに対応
して設けられたキャッシュヒットカウント格納手段(A
C)に格納された各キャッシュライン毎のキャッシュヒ
ットカウント値が管理し更新されるキャッシュヒットカ
ウント管理工程と、 前記FSA方式キャッシュ(TA)がキャッシュヒット
した場合に、前記FSA方式キャッシュ(TA)のその
キャッシュヒットしたキャッシュラインに格納されてい
たデータが、前記データ処理ユニット(50)によりキ
ャッシュデータとして読み込まれる第1のキャッシュデ
ータ読み込み工程と、 前記FSA方式以外のキャッシュ(TB,TC)がキャ
ッシュヒットした場合に、前記FSA方式以外のキャッ
シュ(TB,TC)の、入力アドレスデータから抽出さ
れたインデックスに対応するそのキャッシュヒットした
キャッシュラインに格納されていたデータが、前記デー
タ処理ユニット(50)によりキャッシュデータとして
読み込まれる第2のキャッシュデータ読み込み工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)に1以上の非
活性なキャッシュラインが存在する時に前記FSA方式
キャッシュ(TA)と前記FSA方式以外のキャッシュ
(TB,TC)の両方がミスヒットした場合に、前記F
SA方式以外のキャッシュ(TB,TC)のミスヒット
した前記インデックスに対応するあるキャッシュライン
に格納されていたデータが前記FSA方式キャッシュ
(TA)の前記非活性なキャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリ(20,21)からフェッチされたデー
タが前記FSA方式キャッシュ(TA)へのデータ転送
元となった前記FSA方式以外のキャッシュ(TB,T
C)の前記キャッシュラインに書き込まれる第1のデー
タ転送工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在せず前記FSA方式キャッシュ(TA)が活性なキャ
ッシュラインで一杯な時に前記FSA方式キャッシュ
(TA)と前記FSA方式以外のキャッシュ(TB,T
C)の両方がミスヒットした場合に、前記FSA方式以
外のキャッシュ(TB,TC)のミスヒットした前記イ
ンデックスに対応するあるキャッシュラインに格納され
ていたデータが前記FSA方式キャッシュ(TA)の最
小のキャッシュヒットカウント値を持つキャッシュライ
ンのうちの一つに転送され、前記両方のキャッシュのミ
スヒットにより前記外部メモリ(20,21)からフェ
ッチされたデータが前記FSA方式キャッシュ(TA)
へのデータ転送元となった前記FSA方式以外のキャッ
シュ(TB,TC)の前記キャッシュラインに書き込ま
れる第2のデータ転送工程と、 前記FSA方式以外のキャッシュ(TB,TC)に前記
インデックスに対応する非活性なキャッシュラインが存
在する時に前記FSA方式キャッシュ(TA)と前記F
SA方式以外のキャッシュ(TB,TC)の両方がミス
ヒットした場合に、前記両方のキャッシュのミスヒット
により前記外部メモリ(20,21)からフェッチされ
たデータが前記FSA方式以外のキャッシュ(TB,T
C)の前記インデックスに対応する非活性なキャッシュ
ラインに書き込まれる第3のデータ転送工程とを備える
ことを特徴とする機械読み取り可能な記録媒体。
19. An FSA (full set associative) cache (TA) capable of holding a cache line having a high cache hit rate and an FSA scheme for performing a tag comparison for determining a cache hit simultaneously with the FSA cache (TA). Other caches (TB, TC)
CPU (Central Pr)
processing Unit) (50), MPU (Mi
machine reading that stores a program for causing a computer to execute a cache process for reducing the number of accesses to an external memory (20, 21) such as a main memory (21) of a data processing unit (50) such as a croProcessor Unit (50). The cache processing is a possible recording medium, wherein a cache hit occurring in each cache line of the FSA cache (TA) is counted,
A cache hit count storage means (A provided for each cache line of the A-type cache (TA)
C) a cache hit count management step of managing and updating the cache hit count value of each cache line stored in C), and, when the FSA cache (TA) has a cache hit, the cache hit count of the FSA cache (TA). A first cache data reading step in which the data stored in the cache line having the cache hit is read as cache data by the data processing unit (50); and a cache (TB, TC) other than the FSA type cache hit In this case, the data stored in the cache line corresponding to the index extracted from the input address data in the cache (TB, TC) other than the FSA system is stored in the data processing unit (50). Yo A second cache data reading step to be read as cache data; and an inactive cache line corresponding to the index does not exist in the non-FSA cache (TB, TC), and one or more in the FSA cache (TA). When both the FSA cache (TA) and the non-FSA cache (TB, TC) miss-hit when there is an inactive cache line of
Data stored in a certain cache line corresponding to the missed index of the cache (TB, TC) other than the SA type cache is transferred to one of the inactive cache lines of the FSA type cache (TA). Then, the data fetched from the external memories (20, 21) due to the mishits of the two caches are transferred to the FSA cache (TA) by the non-FSA caches (TB, T).
C) a first data transfer step of writing to the cache line; and the non-FSA cache (TB, TC) has no inactive cache line corresponding to the index and the FSA cache (TA). Is full of active cache lines, the FSA cache (TA) and the non-FSA cache (TB, T
C), the data stored in a certain cache line corresponding to the mis-indexed cache (TB, TC) of the non-FSA cache (TB, TC) is the minimum of the FSA cache (TA). And the data fetched from the external memory (20, 21) due to the mishit of both caches is transferred to the FSA cache (TA).
A second data transfer step of writing to the cache line of the non-FSA-based cache (TB, TC) from which data has been transferred to the cache, and the index corresponding to the non-FSA-based cache (TB, TC) The FSA cache (TA) and the FSA cache when there is an inactive cache line
If both of the caches (TB, TC) other than the SA scheme miss-hit, the data fetched from the external memory (20, 21) due to the miss-hit of both caches causes the caches (TB, TC, TC) other than the FSA scheme. T
C) a third data transfer step of writing data to an inactive cache line corresponding to the index of (C).
【請求項20】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされ、 前記FSA方式キャッシュ(TA)と前記FSA方式以
外のキャッシュ(TB,TC)の両方がミスヒットした
場合には、前記FSA方式キャッシュ(TA)の全キャ
ッシュラインの前記キャッシュヒットカウント値が一斉
に1つデクリメントされることを特徴とする請求項19
記載の機械読み取り可能な記録媒体。
20. In the cache hit count managing step, when a cache line in the FSA cache (TA) has a cache hit, the cache hit count value of the cache line is incremented by one. If both the cache (TA) and the caches (TB, TC) other than the FSA system have miss-hits, the cache hit count values of all the cache lines of the FSA system cache (TA) are decremented by one at a time. The method of claim 19, wherein
The machine-readable recording medium according to the above.
【請求項21】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされ、 前記FSA方式キャッシュ(TA)がミスヒットした場
合には、前記FSA方式キャッシュ(TA)の全キャッ
シュラインの前記キャッシュヒットカウント値が一斉に
1つデクリメントされることを特徴とする請求項19記
載の機械読み取り可能な記録媒体。
21. In the cache hit count managing step, when a cache line in the FSA cache (TA) has a cache hit, the cache hit count value of the cache line is incremented by one. 20. The machine-readable machine according to claim 19, wherein, when the cache (TA) has a mishit, the cache hit count value of all cache lines of the FSA cache (TA) is decremented by one at a time. Recording medium.
【請求項22】 前記キャッシュヒットカウント管理工
程において、 前記FSA方式キャッシュ(TA)のあるキャッシュラ
インがキャッシュヒットした場合には、そのキャッシュ
ラインの前記キャッシュヒットカウント値が1つインク
リメントされることを特徴とする請求項19記載の機械
読み取り可能な記録媒体。
22. In the cache hit count managing step, when a cache hit occurs in a cache line of the FSA cache (TA), the cache hit count value of the cache line is incremented by one. The machine-readable recording medium according to claim 19, wherein:
【請求項23】 前記FSA方式以外のキャッシュ(T
B,TC)として、ダイレクトマッピング方式キャッシ
ュ(TB)が用いられることを特徴とする請求項19か
ら22のうちのいずれか1項に記載の機械読み取り可能
な記録媒体。
23. A cache other than the FSA system (T
The machine-readable recording medium according to any one of claims 19 to 22, wherein a direct mapping cache (TB) is used as (B, TC).
【請求項24】 前記FSA方式以外のキャッシュ(T
B,TC)として、Nウェイセットアソシアティブキャ
ッシュ(TC)(N=2,4,8,・・・)が用いられ
ることを特徴とする請求項19から22のうちのいずれ
か1項に記載の機械読み取り可能な記録媒体。
24. A cache other than the FSA system (T
23. The method according to claim 19, wherein an N-way set associative cache (TC) (N = 2, 4, 8,...) Is used as (B, TC). A machine-readable recording medium.
【請求項25】 前記キャッシュ処理は、前記FSA方
式キャッシュ(TA)の各キャッシュラインに生じた最
新のキャッシュヒットの日時に関するデータを前記各キ
ャッシュラインに対応して設けられたキャッシュヒット
日時格納手段に格納するキャッシュヒット日時格納工程
をさらに備え、 前記第2のデータ転送工程においては、前記キャッシュ
ヒット日時格納手段に格納された前記データに基づいて
前記FSA方式キャッシュ(TA)の前記最小のキャッ
シュヒットカウント値を持つ前記キャッシュラインの中
から最近のキャッシュヒットが最も古いキャッシュライ
ンが選択され、その選択されたキャッシュラインが前記
FSA方式以外のキャッシュ(TB,TC)から前記F
SA方式キャッシュ(TA)への前記データ転送の転送
先として指定されることを特徴とする請求項19から2
4のうちのいずれか1項に記載の機械読み取り可能な記
録媒体。
25. The cache processing, wherein data relating to the date and time of the latest cache hit generated in each cache line of the FSA cache (TA) is stored in a cache hit date and time storage means provided for each cache line. A cache hit date and time storing step, wherein in the second data transfer step, the minimum cache hit count of the FSA cache (TA) is based on the data stored in the cache hit date and time storage means. The cache line having the oldest recent cache hit is selected from the cache lines having the values, and the selected cache line is transferred from the cache (TB, TC) other than the FSA system to the F line.
20. The transfer destination of the data transfer to the SA type cache (TA) is designated.
5. The machine-readable recording medium according to any one of 4.
【請求項26】 前記キャッシュ処理は、各インデック
スに対応するN本のキャッシュラインの中で最近のキャ
ッシュヒットが最も古いキャッシュラインを示すための
LRU(Least Recently Used)値
を各インデックスに対応して設けられたLRU格納手段
に格納するLRU格納工程をさらに備え、 前記第1のデータ転送工程においては、前記Nウェイセ
ットアソシアティブキャッシュ(TC)のN本のミスヒ
ットしたキャッシュラインの中から前記LRULRU値
により指定されたキャッシュラインが選択され、その選
択されたキャッシュラインに格納されていたデータが前
記FSA方式キャッシュ(TA)の前記非活性なキャッ
シュラインのうちの一つに転送され、前記両方のキャッ
シュのミスヒットにより前記外部メモリ(20,21)
からフェッチされたデータは前記FSA方式キャッシュ
(TA)へのデータ転送元となった前記Nウェイセット
アソシアティブキャッシュ(TC)の前記選択されたキ
ャッシュラインに書き込まれ、 前記第2のデータ転送工程においては、前記Nウェイセ
ットアソシアティブキャッシュ(TC)のN本のミスヒ
ットしたキャッシュラインの中から前記LRU値により
指定されたキャッシュラインが選択され、その選択され
たキャッシュラインに格納されていたデータが前記FS
A方式キャッシュ(TA)の前記最小のキャッシュヒッ
トカウント値を持つ前記キャッシュラインのうちの一つ
に転送され、前記両方のキャッシュのミスヒットにより
前記外部メモリ(20,21)からフェッチされたデー
タは前記FSA方式キャッシュ(TA)へのデータ転送
元となった前記Nウェイセットアソシアティブキャッシ
ュ(TC)の前記選択されたキャッシュラインに書き込
まれ、 前記第3のデータ転送工程においては、前記両方のキャ
ッシュのミスヒットにより前記外部メモリ(20,2
1)からフェッチされたデータは前記Nウェイセットア
ソシアティブキャッシュ(TC)の前記インデックスに
対応する前記非活性なキャッシュラインのうちの一つの
キャッシュラインに書き込まれることを特徴とする請求
項24記載の機械読み取り可能な記録媒体。
26. The cache processing according to claim 17, wherein an LRU (Least Recently Used) value for indicating a cache line whose latest cache hit is the oldest among N cache lines corresponding to each index is associated with each index. An LRU storing step of storing the LRURU value in the provided LRU storing means, wherein in the first data transfer step, the LRURU value is selected from N mis-hit cache lines of the N-way set associative cache (TC). Is selected, the data stored in the selected cache line is transferred to one of the inactive cache lines of the FSA type cache (TA), and both of the cache lines are selected. Of the external Mori (20, 21)
The data fetched from the cache is written to the selected cache line of the N-way set associative cache (TC) that has been a data transfer source to the FSA type cache (TA). In the second data transfer step, The cache line specified by the LRU value is selected from the N missed cache lines of the N-way set associative cache (TC), and the data stored in the selected cache line is stored in the FS.
Data transferred to one of the cache lines having the minimum cache hit count value of the A-type cache (TA) and fetched from the external memories (20, 21) due to both cache mishits is The data is written to the selected cache line of the N-way set associative cache (TC) that has been a data transfer source to the FSA type cache (TA). In the third data transfer step, both of the caches are written. The external memory (20, 2)
25. The machine of claim 24, wherein the data fetched from 1) is written to one of the inactive cache lines corresponding to the index of the N-way set associative cache (TC). A readable recording medium.
【請求項27】 前記キャッシュ処理は、前記FSA方
式キャッシュ(TA)と前記FSA方式以外のキャッシ
ュ(TB,TC)の両方がミスヒットした場合に前記F
SA方式キャッシュ(TA)と前記FSA方式以外のキ
ャッシュ(TB,TC)からなる一次キャッシュ(1
5)に付加する形で設けられた二次キャッシュ(20)
へのアクセスが行われる二次キャッシュアクセス工程を
さらに備えることを特徴とする請求項19から26のう
ちのいずれか1項に記載の機械読み取り可能な記録媒
体。
27. The cache processing according to claim 27, wherein both the FSA cache (TA) and the non-FSA cache (TB, TC) have a miss hit.
A primary cache (1) comprising an SA cache (TA) and a cache (TB, TC) other than the FSA cache.
Secondary cache (20) provided in addition to 5)
The machine-readable recording medium according to any one of claims 19 to 26, further comprising a secondary cache access step in which access is made to the storage medium.
JP11356678A 1998-12-15 1999-12-15 Cache system and cache processing method Pending JP2000235519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11356678A JP2000235519A (en) 1998-12-15 1999-12-15 Cache system and cache processing method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP35681598 1998-12-15
JP10-356815 1998-12-15
JP11356678A JP2000235519A (en) 1998-12-15 1999-12-15 Cache system and cache processing method

Publications (1)

Publication Number Publication Date
JP2000235519A true JP2000235519A (en) 2000-08-29

Family

ID=26580478

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11356678A Pending JP2000235519A (en) 1998-12-15 1999-12-15 Cache system and cache processing method

Country Status (1)

Country Link
JP (1) JP2000235519A (en)

Similar Documents

Publication Publication Date Title
KR100339904B1 (en) System and method for cache process
US8370577B2 (en) Metaphysically addressed cache metadata
US5465342A (en) Dynamically adaptive set associativity for cache memories
JP5876458B2 (en) SIMD vector synchronization
US7861055B2 (en) Method and system for on-chip configurable data ram for fast memory and pseudo associative caches
US9367472B2 (en) Observation of data in persistent memory
US7447868B2 (en) Using vector processors to accelerate cache lookups
US20070050594A1 (en) TLB lock indicator
US9244837B2 (en) Zero cycle clock invalidate operation
JP2735781B2 (en) Cache memory control system and method
US7284094B2 (en) Mechanism and apparatus allowing an N-way set associative cache, implementing a hybrid pseudo-LRU replacement algorithm, to have N L1 miss fetch requests simultaneously inflight regardless of their congruence class
US9529730B2 (en) Methods for cache line eviction
US7260674B2 (en) Programmable parallel lookup memory
JPH07311711A (en) Data processor and its operating method as well as operatingmethod of memory cache
US8977821B2 (en) Parallel processing of multiple block coherence operations
US7406579B2 (en) Selectively changeable line width memory
US7761665B2 (en) Handling of cache accesses in a data processing apparatus
US20070143548A1 (en) Cache memory and its controlling method
US20140019690A1 (en) Processor, information processing apparatus, and control method of processor
US20020194431A1 (en) Multi-level cache system
US8266379B2 (en) Multithreaded processor with multiple caches
JP2013016187A (en) Cache locking without interference from normal allocations
WO2006038258A1 (en) Data processor
US20040117555A1 (en) Method and system to overlap pointer load cache misses
WO2004061675A1 (en) Selectively changeable line width memory

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020730