JPH11338772A - Cache memory - Google Patents

Cache memory

Info

Publication number
JPH11338772A
JPH11338772A JP10141456A JP14145698A JPH11338772A JP H11338772 A JPH11338772 A JP H11338772A JP 10141456 A JP10141456 A JP 10141456A JP 14145698 A JP14145698 A JP 14145698A JP H11338772 A JPH11338772 A JP H11338772A
Authority
JP
Japan
Prior art keywords
memory
data
attribute
cache
temporary area
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.)
Granted
Application number
JP10141456A
Other languages
Japanese (ja)
Other versions
JP3331592B2 (en
Inventor
Satoshi Tagaya
聡 多賀谷
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 JP14145698A priority Critical patent/JP3331592B2/en
Publication of JPH11338772A publication Critical patent/JPH11338772A/en
Application granted granted Critical
Publication of JP3331592B2 publication Critical patent/JP3331592B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To decrease communication between a cache memory related to a temporary variable and an external memory and to contribute to improvement in the performance of a processor. SOLUTION: A data memory 2 is composed of plural cache lines, a tag memory 3 registers the tag address of data, a valid memory 4 stores the valid bit of data and an attribute memory 5 stores an attribute bit showing data are secured as a temporary area not to be reflected with updating in the external memory or not. A hit discriminating means 6 discriminates cache hit by comparing the address index part of data with the tag address in the tag memory 3 and when a temporary area securing instruction and a temporary area releasing instruction are executed, an attribute operating means 7 operates the attribute bit in the attribute memory 5. Based on the attribute bit in the attribute memory 5, a replacing means 8 performs the replacing processing of data when data on the cache line can be replaced.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はキャッシュメモリに
関し、特に実メモリ(主記憶)あるいは下位キャッシュ
メモリ(例えば、1次キャッシュメモリに対する2次キ
ャッシュメモリをいう)へのデータの書き戻し(置き換
え)を選択的に行うことができるキャッシュメモリに関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory, and more particularly, to writing back (replacement) data to a real memory (main memory) or a lower cache memory (for example, a secondary cache memory for a primary cache memory). The present invention relates to a cache memory that can be selectively performed.

【0002】[0002]

【従来の技術】従来のマイクロプロセッサでは、比較的
小さな高速キャッシュメモリを用いることで、実行する
プログラムにおけるアクセスデータの時間的および空間
的局所性に基づいてデータに対する平均アクセス時間を
短縮し、マイクロプロセッサの性能向上に寄与するよう
にしている。しかし、キャッシュメモリは実メモリある
いは下位キャッシュメモリ(以下、実メモリあるいは下
位キャッシュメモリを総称して外部メモリという)のメ
モリ空間の射影として用いられるため、一般的にはキャ
ッシュメモリ上にあるデータが更新されると、将来的に
必ず外部メモリに反映されていた。すなわち、キャッシ
ュメモリから外部メモリヘの通信が行われていた。
2. Description of the Related Art Conventional microprocessors use a relatively small high-speed cache memory to reduce the average access time to data based on the temporal and spatial locality of access data in a program to be executed. To improve the performance of However, since the cache memory is used as a projection of the memory space of the real memory or the lower cache memory (hereinafter, the real memory or the lower cache memory is collectively referred to as an external memory), data in the cache memory is generally updated. Then, it was always reflected in the external memory in the future. That is, communication from the cache memory to the external memory has been performed.

【0003】一方、プログラム中には、一時的に発生し
て極めて短い時間だけ参照あるいは更新され、その後に
その存在の必要がなくなる変数(以下、一時的変数とい
う)が存在する。一時的変数を格納する領域には、一般
的には、マイクロプロセッサ内の汎用レジスタが用いら
れるが、この汎用レジスタも従来のマイクロプロセッサ
では256本程度と少なく、一時的変数を全て格納でき
ないケースが生じていた。汎用レジスタに格納できない
一時的変数は全て一旦キャッシュメモリ中にその領域を
確保されるが、これらのキャッシュメモリ上に格納され
た一時的変数はすぐに消滅してしまうにもかかわらず、
外部メモリ空間上にその領域をとっているために、将来
的にはデータの置き換えのためにキャッシュメモリ−外
部メモリ間の不必要な通信を発生させてしまう。この不
必要な通信が、特に共有バス型のマルチプロセッサシス
テムではそのバス占有率を上げてしまうためにバス競合
を引き起こし、システム全体の性能低下につながってい
た。
On the other hand, in a program, there is a variable (hereinafter referred to as a temporary variable) which is generated temporarily, is referred to or updated for a very short time, and thereafter does not need to exist. Generally, a general-purpose register in a microprocessor is used for an area for storing a temporary variable. However, the number of such general-purpose registers is as small as about 256 in a conventional microprocessor, and in some cases, all temporary variables cannot be stored. Had occurred. All temporary variables that cannot be stored in general-purpose registers are temporarily allocated in the cache memory, but the temporary variables stored in these cache memories disappear immediately,
Since the area is allocated in the external memory space, unnecessary communication between the cache memory and the external memory will occur in the future to replace data. This unnecessary communication increases the bus occupancy in a shared bus type multiprocessor system, particularly in a shared bus type multiprocessor system, and causes bus contention, leading to a reduction in the performance of the entire system.

【0004】この問題に対して、特開平3−18693
5号公報では、1つのデータバッファをデータキャッシ
ュとしても、特定アドレスのメモリとしても用いること
ができる構成を提供している。これにより、ローカルメ
モリとして使用できる領域は外部メモリとの通信をしな
くてもよい制御ができる可能性がある。しかし、この構
成においては、データバッファを特定アドレスのメモリ
として用いるので、マルチプロセス環境においては、ク
リティカルリージョンとなるため、そのメモリ領域を各
々のプロセスが自由に用いることはできず、オペレーテ
ィングシステムによる複雑な管理が必要となって性能向
上が阻害されるおそれがあった。また、プログラムの特
性によっては、一時的変数を格納する領域を大量に用い
るものやそうでないものがあるのに対して柔軟性がなか
った。さらに、特定アドレスのメモリとして用いること
ができる領域を設定すると、キャッシュメモリの容量が
少なくなる、あるいはなくなってしまうため、性能向上
が阻害されるおそれがあった。
To solve this problem, Japanese Patent Application Laid-Open No. 3-18693 has been proposed.
Japanese Patent Application Laid-Open No. 5 (1999) -2005 provides a configuration in which one data buffer can be used both as a data cache and as a memory at a specific address. As a result, there is a possibility that an area that can be used as a local memory can be controlled without having to communicate with an external memory. However, in this configuration, since the data buffer is used as a memory of a specific address, in a multi-process environment, the region becomes a critical region. There is a risk that proper management is required and performance improvement is hindered. In addition, depending on the characteristics of the program, there is no flexibility in using a large area for storing a temporary variable in some cases and in others not using a large area. Furthermore, when an area that can be used as a memory at a specific address is set, the capacity of the cache memory is reduced or eliminated, and there is a risk that performance improvement will be hindered.

【0005】[0005]

【発明が解決しようとする課題】第1の問題点は、従来
のキャッシュメモリでは、プログラムの実行時におい
て、一時的変数のための領域を外部メモリ空間にとる
と、一時的変数に関するキャッシュメモリ−外部メモリ
間の不必要な通信が発生し、これがプロセッサの性能低
下につながることである。その理由は、キャッシュメモ
リが外部メモリ空間の射影として構成されているため、
キャッシュメモリ上で一時的変数の値を変更すると、そ
の値の更新が全て外部メモリに反映されるためである。
A first problem is that, in the conventional cache memory, when an area for a temporary variable is taken in an external memory space at the time of executing a program, the cache memory relating to the temporary variable Unnecessary communication between external memories occurs, which leads to a decrease in processor performance. The reason is that the cache memory is configured as a projection of the external memory space,
This is because, when the value of the temporary variable is changed on the cache memory, all updates of the value are reflected on the external memory.

【0006】第2の問題点は、第1の問題点による性能
低下を緩和するため、プログラムによって、外部メモリ
空間上の特定の領域に一時的変数を格納するための領域
を設け、キャッシュメモリ上にその領域が載っている時
間を増やしたとしても、他のデータがキャッシュメモリ
を用いることによる置き換えが発生し、一時的変数を格
納するための領域の更新する必要のないと考えられる一
時的変数に関してもやはり通信が発生してしまうことで
ある。その理由は、一時的変数であるか否か、置き換え
をするか否かを指定する手段が、従来のキャッシュメモ
リには存在しなかったからである。
A second problem is that an area for storing temporary variables is provided in a specific area in the external memory space by a program in order to alleviate the performance degradation caused by the first problem. Even if the time for which the area is stored is increased, other data is replaced by using the cache memory, and it is not necessary to update the area for storing the temporary variable. Is that communication occurs again. The reason is that there is no means for designating whether or not the variable is a temporary variable and whether or not to perform replacement, in the conventional cache memory.

【0007】本発明の目的は、一時的変数に関するキャ
ッシュメモリ−外部メモリ間の通信を減少させ、プロセ
ッサの性能向上に寄与できるキャッシュメモリを提供す
ることにある。
An object of the present invention is to provide a cache memory capable of reducing communication between a cache memory and an external memory relating to temporary variables and contributing to an improvement in processor performance.

【0008】[0008]

【課題を解決するための手段】本発明のキャッシュメモ
リは、2ウエイ以上のセットアソシアティブ構成をとる
キャッシュメモリにおいて、データの更新を外部メモリ
に反映しない一時的領域を、データメモリのキャッシュ
ライン毎に選択的に指定できることを特徴とする。
According to the present invention, there is provided a cache memory having a two-way or more set associative configuration, wherein a temporary area in which data update is not reflected in an external memory is provided for each cache line of the data memory. It can be specified selectively.

【0009】また、本発明のキャッシュメモリは、2ウ
エイ以上のセットアソシアティブ構成をとるキャッシュ
メモリにおいて、キャッシュしたデータを格納する複数
のキャッシュラインから構成される複数ウエイのデータ
メモリと、これらデータメモリの各キャッシュラインに
対応して該キャッシュラインのデータのタグアドレスを
登録する複数ウエイのタグメモリと、前記データメモリ
の各キャッシュラインに対応して該キャッシュラインの
データの有効性を示す有効ビットを格納する複数ウエイ
の有効メモリと、前記データメモリの各キャッシュライ
ンに対応して該キャッシュラインがデータの更新を外部
メモリに反映しない一時的領域として確保されているか
否かを示す属性ビットを格納する複数ウエイの属性メモ
リと、アクセスするデータのアドレスインデックス部と
前記タグメモリのタグアドレスとを比較してキャッシュ
ヒットの判定を行うヒット判定手段と、一時的領域確保
命令および一時的領域解放命令が実行されたときに前記
属性メモリの属性ビットを操作する属性操作手段と、前
記属性メモリの属性ビットをもとに前記データメモリの
キャッシュラインのデータが置き換え可能か否かを判定
して置き換えが可能であればデータの置き換え処理を行
う置き換え手段とを有することを特徴とする。
A cache memory according to the present invention is a cache memory having a two-way or more set associative configuration, a multiple-way data memory comprising a plurality of cache lines for storing cached data, A multi-way tag memory for registering a tag address of data of the cache line corresponding to each cache line, and a valid bit indicating validity of data of the cache line corresponding to each cache line of the data memory are stored. And a plurality of attribute bits indicating whether or not the cache line is secured as a temporary area that does not reflect the update of data in the external memory in correspondence with each cache line of the data memory. Way attribute memory and access Hit judging means for judging a cache hit by comparing an address index part of data with a tag address of the tag memory; and an attribute of the attribute memory when a temporary area securing instruction and a temporary area releasing instruction are executed. An attribute operating means for operating a bit; and a replacement for determining whether data of a cache line of the data memory can be replaced based on attribute bits of the attribute memory and performing a data replacement process if the replacement is possible. Means.

【0010】さらに、本発明のキャッシュメモリは、2
ウエイのセットアソシアティブ構成をとるキャッシュメ
モリにおいて、キャッシュしたデータを格納する複数の
キャッシュラインから構成される一対のデータメモリ
と、これらデータメモリの各キャッシュラインに対応し
て該キャッシュラインのデータのタグアドレスを登録す
る一対のタグメモリと、前記データメモリの各キャッシ
ュラインに対応して該キャッシュラインのデータの有効
性を示す有効ビットを格納する一対の有効メモリと、前
記データメモリの各キャッシュラインに対応して該キャ
ッシュラインがデータの更新を外部メモリに反映しない
一時的領域として確保されているか否かを示す属性ビッ
トを格納する一対の属性メモリと、アクセスするデータ
のアドレスのインデックス部と前記タグメモリのタグア
ドレスとを比較してキャッシュヒットの判定を行うヒッ
ト判定手段と、一時的領域確保命令および一時的領域解
放命令が実行されたときに前記属性メモリの属性ビット
を操作する属性操作手段と、前記属性メモリの属性ビッ
トをもとに前記データメモリのキャッシュラインのデー
タが置き換え可能か否かを判定して置き換えが可能であ
ればデータの置き換え処理を行う置き換え手段とを有す
ることを特徴とする。
Further, the cache memory of the present invention has a
In a cache memory having a set associative way configuration, a pair of data memories each including a plurality of cache lines for storing cached data, and a tag address of data of the cache line corresponding to each cache line of the data memories A pair of tag memories, a pair of valid memories storing valid bits indicating validity of data of the cache line corresponding to each cache line of the data memory, and a pair of valid memory corresponding to each cache line of the data memory. A pair of attribute memories for storing attribute bits indicating whether or not the cache line is secured as a temporary area that does not reflect data updates in an external memory; an index portion of an address of data to be accessed; and the tag memory Comparison with the tag address of Hit determining means for determining a cache hit; attribute operating means for operating attribute bits of the attribute memory when a temporary area securing instruction and a temporary area releasing instruction are executed; And a replacement means for determining whether or not the data in the cache line of the data memory can be replaced and performing a data replacement process if the replacement is possible.

【0011】[0011]

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

【0012】図1は、本発明の一実施の形態に係るキャ
ッシュメモリ1の構成を示す回路ブロック図である。本
実施の形態に係るキャッシュメモリ1は、キャッシュし
たデータを格納する複数のキャッシュラインから構成さ
れる複数ウエイのデータメモリ2と、対応するキャッシ
ュライン上のデータのタグアドレスを登録する複数ウエ
イのタグメモリ3と、対応するキャッシュライン上のデ
ータの有効性を示す有効ビットを格納する複数ウエイの
有効メモリ4と、キャッシュライン毎に一時的変数を格
納するための領域(以下、一時的領域と略記する)とし
て確保されているか否かを示す属性ビットを格納する複
数ウエイの属性メモリ5と、アクセスするデータに対す
るキャッシュヒットの判定を行うヒット判定手段6と、
属性メモリ5に対して属性ビットを登録する属性操作手
段7と、属性メモリ5に登録された属性ビットをもとに
キャッシュライン上のデータの置き換え可否を判断して
置き換え可能であればデータの置き換え処理を行う置き
換え手段8とから構成されている。
FIG. 1 is a circuit block diagram showing a configuration of a cache memory 1 according to one embodiment of the present invention. A cache memory 1 according to the present embodiment includes a multi-way data memory 2 including a plurality of cache lines for storing cached data, and a multi-way tag for registering tag addresses of data on corresponding cache lines. A memory 3, a plurality of ways of valid memory 4 for storing valid bits indicating the validity of data on the corresponding cache line, and an area for storing temporary variables for each cache line (hereinafter abbreviated as a temporary area) A plurality of ways of attribute memory 5 for storing attribute bits indicating whether or not the data is secured as data, and a hit determination means 6 for determining a cache hit for data to be accessed.
Attribute operation means 7 for registering attribute bits in the attribute memory 5; and determining whether or not data on the cache line can be replaced based on the attribute bits registered in the attribute memory 5, and replacing the data if possible. And a replacement means 8 for performing processing.

【0013】本実施の形態に係るキャッシュメモリ1で
は、一時的領域は、プログラム内のコードによって明示
的に外部メモリ空間の一部をキャッシュライン単位で選
択的に確保および解放される。以下、一時的領域を確保
する命令を一時的領域確保命令(VRSV命令)とい
い、一時的領域を解放する命令を一時的領域解放命令
(VREL命令)という。なお、一時的領域確保命令お
よび一時的領域解放命令は、ソースプログラム中で使用
する変数が一時的変数であることをコンパイラによって
静的に抽出することにより、コンパイラによってオブジ
ェクトプログラム中に挿入されることが望ましい。
In the cache memory 1 according to the present embodiment, a temporary area is explicitly secured and released by a code in a program, a part of the external memory space being explicitly selected in units of cache lines. Hereinafter, the instruction for securing the temporary area is referred to as a temporary area securing instruction (VRSV instruction), and the instruction for releasing the temporary area is referred to as a temporary area release instruction (VREL instruction). The temporary area allocation instruction and temporary area release instruction must be inserted into the object program by the compiler by statically extracting by the compiler that the variables used in the source program are temporary variables. Is desirable.

【0014】図2は、一時的領域確保命令(VRSV命
令)および一時的領域解放命令(VREL命令)を説明
する図である。一時的領域確保命令および一時的領域解
放命令は、データメモリ2のキャッシュラインの先頭ア
ドレスを引数として、そのキャッシュラインを一時的領
域として確保および解放する命令である。図2中では、
キャッシュラインAの先頭アドレス10000を引数と
することにより、VRSV命令およびVREL命令によ
ってキャッシュラインAが一時的領域として確保および
解放されている。キャッシュラインAが一時的領域とし
て確保されている状態では、属性メモリ5の対応するエ
ントリに属性ビット1がセットされ、キャッシュライン
Aが一時的領域として確保されていない状態(解放され
ている状態)では、属性メモリ5の対応するエントリの
属性ビットが0にリセットされている。
FIG. 2 is a diagram for explaining a temporary area reservation instruction (VRSV instruction) and a temporary area release instruction (VREL instruction). The temporary area securing instruction and the temporary area releasing instruction are instructions for securing and releasing the cache line as a temporary area using the head address of the cache line in the data memory 2 as an argument. In FIG.
By using the start address 10000 of the cache line A as an argument, the cache line A is secured and released as a temporary area by the VRSV instruction and the VREL instruction. When the cache line A is reserved as a temporary area, the attribute bit 1 is set in the corresponding entry of the attribute memory 5, and the cache line A is not reserved as a temporary area (released state). In, the attribute bit of the corresponding entry in the attribute memory 5 is reset to 0.

【0015】次に、このように構成された本実施の形態
に係るキャッシュメモリ1の動作について説明する。
Next, the operation of the cache memory 1 thus configured according to the present embodiment will be described.

【0016】まず、キャッシュラインAを一時的領域と
して確保するための一時的領域確保命令(VRSV命
令)が実行されると、引数(アドレス)および一時的領
域確保要求がキャッシュメモリ1に与えられる。
First, when a temporary area securing instruction (VRSV instruction) for securing the cache line A as a temporary area is executed, an argument (address) and a temporary area securing request are given to the cache memory 1.

【0017】すると、キャッシュメモリ1では、アドレ
スのうちのインデックス部によってデータメモリ2,タ
グメモリ3,有効メモリ4および属性メモリ5のエント
リ(該当エントリ)が指示されるとともに、ヒット判定
手段6がアドレスのタグ部と各ウエイのタグメモリ3の
該当エントリのタグアドレスとを比較してキャッシュヒ
ットを判定する。キャッシュヒットしていれば、キャッ
シュヒットしたウエイ(該当ウエイ)のデータメモリ2
の該当エントリのキャッシュライン上のデータが出力さ
れるとともに、該当ウエイ番号が属性操作手段7および
置き換え手段8に通知される。
Then, in the cache memory 1, the entries of the data memory 2, tag memory 3, valid memory 4 and attribute memory 5 (applicable entries) are indicated by the index part of the address, and the hit determination means 6 Is compared with the tag address of the corresponding entry in the tag memory 3 of each way to determine a cache hit. If there is a cache hit, the data memory 2 of the way that hit the cache (the corresponding way)
The data on the cache line of the corresponding entry is output, and the corresponding way number is notified to the attribute operating means 7 and the replacing means 8.

【0018】属性操作手段7は、該当ウエイの属性メモ
リ5の該当エントリの属性ビットをを1にセットして、
該当ウエイのデータメモリ2の該当エントリのキャッシ
ュラインを一時的領域として確保する。
The attribute operating means 7 sets the attribute bit of the corresponding entry in the attribute memory 5 of the corresponding way to 1, and
The cache line of the corresponding entry in the data memory 2 of the corresponding way is secured as a temporary area.

【0019】一時的領域として一旦確保されたキャッシ
ュラインAは、一時的領域解放命令(VREL命令)が
実行されるまでデータメモリ2上に一時的領域として存
在し続ける。また、キャッシュラインAの一時的領域か
らの解放時に、キャッシュラインAに存在する一時的変
数については、キャッシュメモリ1から外部メモリヘ書
き戻しは行われない。すなわち、キャッシュメモリ1か
ら外部メモリへのデータの転送は行われない。
The cache line A once secured as a temporary area continues to exist in the data memory 2 as a temporary area until a temporary area release instruction (VREL instruction) is executed. When the cache line A is released from the temporary area, the temporary variables existing in the cache line A are not written back from the cache memory 1 to the external memory. That is, data is not transferred from the cache memory 1 to the external memory.

【0020】属性メモリ5は、対応するキャッシュライ
ンが一時的領域として確保されたことを示す。属性メモ
リ5の属性ビットが一時的領域であることを示している
ならば、そのキャッシュライン上のデータは置き換え対
象から外される。なお、属性メモリ5の属性ビットは、
一時的領域解放命令(VREL命令)が実行されるまで
値1を変化させない。
The attribute memory 5 indicates that the corresponding cache line has been secured as a temporary area. If the attribute bit of the attribute memory 5 indicates that it is a temporary area, the data on the cache line is excluded from the replacement target. Note that the attribute bits of the attribute memory 5 are
The value 1 is not changed until the temporary area release instruction (VREL instruction) is executed.

【0021】置き換え手段8は、属性メモリ5の属性ビ
ットおよびその他の情報からキャッシュラインのデータ
の置き換えを行う。
The replacement means 8 replaces the cache line data from the attribute bits of the attribute memory 5 and other information.

【0022】なお、一時的領域確保命令によりデータメ
モリ2のキャッシュラインを一時的領域として一旦確保
すると、一時的領域解放命令が実行されるまで置き換え
対象とならないため、ウエイ数がlのキャッシュメモリ
を使用すると、そのキャッシュラインに対応する外部メ
モリ空間上のデータがキャッシュメモリに載ることがで
きなくなるため、キャッシュメモリ1は、ウエイ数が2
以上であることが望ましい。
If the cache line of the data memory 2 is temporarily secured as a temporary area by the temporary area securing instruction, the cache line is not replaced until the temporary area release instruction is executed. If it is used, data in the external memory space corresponding to the cache line cannot be stored in the cache memory.
It is desirable that it is above.

【0023】また、一時的領域の確保は、ある外部メモ
リ空間に対して行われる。例えば、2ウエイセットアソ
シアティブ構成のキャッシュメモリ1において、2つの
キャッシュラインを一時的領域として確保したとき、も
し2つのキャッシュラインのタグアドレスが一致してし
まい、異なるウエイのデータメモリ2の同一エントリの
2つのキャッシュラインが一時的領域としてデータメモ
リ2の該エントリを占有してしまい、同一エントリの全
てのキャッシュラインが置き換え対象外となってしまう
と、プログラム中の他のメモリアクセスでかつそのキャ
ッシュラインに対応するメモリアドレスに対するデータ
をキャッシュメモリ1上に載せることができなくなる。
そのため、一時的領域の確保は、少なくとも1ウエイ分
のキャッシュラインの空きを保証するものとする。すな
わち、同一のタグアドレスのキャッシュラインを一時的
領域として確保することを要求する、ウエイ数以上の一
時的領域確保命令は、その全てが確保に成功するわけで
はなく、多くとも(キャッシュメモリ1のウエイ数−
1)個しか確保されない。なお、失敗した一時的領域確
保命令については、置き換え対象のデータとして扱わ
れ、対応するメモリアドレスに対する一時的領域解放命
令は無視される。
The provision of a temporary area is performed for a certain external memory space. For example, in a cache memory 1 having a two-way set associative configuration, when two cache lines are reserved as temporary areas, if the tag addresses of the two cache lines match, the same entry in the data memory 2 of a different way is stored. If two cache lines occupy the entry of the data memory 2 as a temporary area, and all the cache lines of the same entry are excluded from replacement, another memory access in the program and the cache line Can not be loaded on the cache memory 1 for the memory address corresponding to.
For this reason, securing a temporary area guarantees a vacancy of a cache line for at least one way. That is, all temporary area reservation instructions that are equal to or larger than the number of ways that request the reservation of a cache line with the same tag address as a temporary area do not always succeed, but at most (in the cache memory 1). Number of ways-
1) Only the number is secured. Note that the failed temporary area reservation instruction is treated as data to be replaced, and the temporary area release instruction for the corresponding memory address is ignored.

【0024】一時的領域として確保されたキャッシュラ
インAを解放するために一時的領域解放命令が実行され
ると、キャッシュライン単位で一時的領域の解放が行わ
れる。
When a temporary area release instruction is executed to release the cache line A secured as a temporary area, the temporary area is released in cache line units.

【0025】本実施の形態に係るキャッシュメモリ1
は、一時的領域確保命令および一時的領域解放命令のた
めに2クロックサイクル余分な動作が必要になるもの
の、置き換え時にキャッシュメモリ1内のデータを外部
メモリに書き出すことがないため、そのためのデータ転
送時間が短縮される。一般的に、ライトバックポリシに
よる置き換えを行うものとすると、1つのキャッシュラ
イン上のデータを外部メモリに書き出すには数10サイ
クルが必要である。このため、本実施の形態に係るキャ
ッシュメモリ1では、その分のペナルティを削減でき、
プロセッサの性能向上に寄与することができる。
The cache memory 1 according to the present embodiment
Although the extra operation of two clock cycles is required for the temporary area reservation instruction and the temporary area release instruction, the data in the cache memory 1 is not written out to the external memory at the time of replacement. Time is reduced. Generally, if replacement by a write-back policy is performed, writing data on one cache line to an external memory requires several tens of cycles. Therefore, in the cache memory 1 according to the present embodiment, the penalty can be reduced, and
This can contribute to improving the performance of the processor.

【0026】[0026]

【実施例】次に、本実施の形態に係るキャッシュメモリ
の一実施例について、図3ないし図5を参照して詳細に
説明する。
Next, an example of the cache memory according to the present embodiment will be described in detail with reference to FIGS.

【0027】図3は、本実施例のキャッシュメモリ1の
構成を示す回路ブロック図である。本実施例のキャッシ
ュメモリ1は、プロセッサおよび1次キャッシュメモリ
を含むプロセッサコア(図示せず)に対して接続された
2次キャッシュメモリであって、2ウエイセットアソシ
アティブ構成をとるものである。なお、ウエイ番号は、
ウエイ0と、ウエイ1であるものとする。以下、本実施
例では、全メモリ空間は、32ビットで表現できるもの
とする。
FIG. 3 is a circuit block diagram showing the configuration of the cache memory 1 of the present embodiment. The cache memory 1 of the present embodiment is a secondary cache memory connected to a processor core (not shown) including a processor and a primary cache memory, and has a two-way set associative configuration. The way number is
It is assumed that way 0 and way 1. Hereinafter, in the present embodiment, it is assumed that the entire memory space can be represented by 32 bits.

【0028】データメモリ2は、キャッシュされたデー
タを格納するためのキャッシュラインから構成され、ウ
エイ数(2)だけ用意されている。各キャッシュライン
のサイズは、256バイト(B)×256エントリであ
る。データは、データメモリ2にキャッシュライン単位
に書き込まれる。
The data memory 2 is composed of cache lines for storing cached data, and is prepared by the number of ways (2). The size of each cache line is 256 bytes (B) × 256 entries. Data is written to the data memory 2 in cache line units.

【0029】タグメモリ3は、データメモリ2の各キャ
ッシュライン上のデータのタグアドレスを格納するもの
であり、サイズが17ビット×256エントリで、ウエ
イ数(2)だけ用意されている。タグアドレスは、アク
セスする外部メモリのアドレス32ビットの上位17ビ
ットとする。
The tag memory 3 stores a tag address of data on each cache line of the data memory 2 and has a size of 17 bits × 256 entries and is prepared for the number of ways (2). The tag address is the upper 17 bits of the 32-bit address of the external memory to be accessed.

【0030】有効メモリ4は、データメモリ2の各キャ
ッシュラインの有効性を示す有効ビットを格納するもの
であり、サイズが1ビット×256エントリで、ウエイ
数(2)だけ用意されている。
The valid memory 4 stores valid bits indicating the validity of each cache line of the data memory 2. The valid memory 4 has a size of 1 bit × 256 entries and is prepared for the number of ways (2).

【0031】属性メモリ5は、データメモリ2の各キャ
ッシュライン上のデータが置き換え対象でないこと(キ
ャッシュラインが一時的領域であること)を示す属性ビ
ットを書き込むものであり、サイズがlビット×256
エントリで、ウエイ数(2)だけ用意される。例えば、
ウエイ0の属性メモリ5のエントリ3Fの属性ビットが
1であり、ウエイ0の有効メモリ4のエントリ3Fの有
効ビットが1であり、ウエイ0のタグメモリ3のエント
リ3FのタグアドレスがFFであったならば、外部メモ
リ空間上のアドレスFF3F00から256バイトは一
時的領域のために確保されたということになる。
The attribute memory 5 is for writing attribute bits indicating that data on each cache line of the data memory 2 is not to be replaced (the cache line is a temporary area), and has a size of 1 bit × 256.
In the entry, the number of ways (2) is prepared. For example,
The attribute bit of the entry 3F of the attribute memory 5 of the way 0 is 1, the valid bit of the entry 3F of the valid memory 4 of the way 0 is 1, and the tag address of the entry 3F of the tag memory 3 of the way 0 is FF. This means that 256 bytes from address FF3F00 in the external memory space have been reserved for the temporary area.

【0032】ヒット判定手段6は、データメモリ2に格
納されたデータに対するキャッシュヒットの判定を行う
ものであり、比較器61および62,アンドゲート63
および64,ならびにセレクタ65とを含んで構成され
ている。
The hit judging means 6 judges a cache hit for the data stored in the data memory 2 and includes comparators 61 and 62 and an AND gate 63.
And 64, and a selector 65.

【0033】属性操作手段7は、属性メモリ5の属性ビ
ットを操作するのためのものであり、属性メモリ5を構
成するRAM(Random Access Memo
ry)を制御する制御回路である属性メモリ制御部71
と、オアゲート72と、アンドゲート73とを含んで構
成されている。なお、ナンドゲート72およびアンドゲ
ート73は、両ウエイの属性メモリ5の該当エントリの
属性ビットがともに1となる故障時に、プロセッサコア
からの一時的領域確保要求が属性メモリ制御部71に入
力されないように阻止する役目をするものである。
The attribute operating means 7 is for operating attribute bits of the attribute memory 5, and is a RAM (Random Access Memory) constituting the attribute memory 5.
ry), which is a control circuit for controlling
, An OR gate 72, and an AND gate 73. The NAND gate 72 and the AND gate 73 are designed to prevent a temporary area reservation request from the processor core from being input to the attribute memory control unit 71 when the attribute bit of the corresponding entry in the attribute memory 5 of both ways becomes 1. It serves to prevent it.

【0034】置き換え手段8は、キャッシュライン上の
データの置き換えを行うためのものであり、LRU(L
east Recently Used)情報を格納す
るLRUメモリ81と、データメモリ2,タグメモリ3
および有効メモリ4を制御するメモリ制御部82とを含
んで構成されている。LRUメモリ81は、サイズが1
ビット×256エントリで、各エントリの内容として
「一番最近アクセスされたウエイ番号」を格納する。
The replacement means 8 is for replacing data on a cache line, and is used for replacing LRU (L
east recently used) information, an LRU memory 81, a data memory 2, and a tag memory 3.
And a memory control unit 82 for controlling the effective memory 4. The LRU memory 81 has a size of 1
A “bit × 256 entry” stores “the most recently accessed way number” as the content of each entry.

【0035】図4を参照すると、本実施例のキャッシュ
メモリ1における一時的領域確保命令(VRSV命令)
の実行時の属性操作手段7および置き換え手段8の処理
は、属性ビット読み出しステップS101と、両ウエイ
一時的領域確保判定ステップS102と、有効ビット読
み出しステップS103と、空きウエイ有無判定ステッ
プS104と、データ追い出しステップS105と、属
性ビット1設定ステップS106と、ウエイ0空き判定
ステップS107と、ウエイ0有効ビット1設定ステッ
プS108と、ウエイ0属性ビット1設定ステップS1
09と、ウエイ1有効ビット1設定ステップS110
と、ウエイ1属性ビット1設定ステップS111と、一
時的領域確保失敗ステップS112とからなる。
Referring to FIG. 4, a temporary area reservation instruction (VRSV instruction) in the cache memory 1 according to the present embodiment.
The processing of the attribute operating means 7 and the replacing means 8 at the time of execution of the process includes an attribute bit readout step S101, a two-way temporary area securing determination step S102, a valid bit readout step S103, an empty way existence determination step S104, Ejection step S105, attribute bit 1 setting step S106, way 0 empty determination step S107, way 0 valid bit 1 setting step S108, and way 0 attribute bit 1 setting step S1
09 and way 1 valid bit 1 setting step S110
And a way 1 attribute bit 1 setting step S111, and a temporary area securing failure step S112.

【0036】図5を参照すると、本実施例に係るキャッ
シュメモリ1における一時的領域解放命令(VREL命
令)の実行時の属性操作手段7および置き換え手段8の
処理は、属性ビット読み出しステップS201と、属性
ビット1判定ステップS202と、属性ビット0復元ス
テップS203と、有効ビット0復元ステップS204
と、データ有無判定ステップS205と、有効ビット0
復元ステップS206と、無処理ステップS207とか
らなる。
Referring to FIG. 5, when the temporary area release instruction (VREL instruction) in the cache memory 1 according to the present embodiment is executed, the processing of the attribute operating unit 7 and the replacing unit 8 includes an attribute bit reading step S201, Attribute bit 1 determination step S202, attribute bit 0 restoration step S203, and valid bit 0 restoration step S204
, Data presence / absence determination step S205, and valid bit 0
It comprises a restoration step S206 and a no-processing step S207.

【0037】次に、このように構成された本実施例のキ
ャッシュメモリ1の動作について説明する。
Next, the operation of the thus configured cache memory 1 of this embodiment will be described.

【0038】まず、プロセッサコアによって一時的領域
確保命令(VRSV命令)が実行されると、プロセッサ
コアから引数(アドレス)および一時的領域確保要求が
キャッシュメモリ1に与えられる。
First, when a temporary area securing instruction (VRSV instruction) is executed by the processor core, an argument (address) and a temporary area securing request are given to the cache memory 1 from the processor core.

【0039】すると、キャッシュメモリ1では、アドレ
スのうちのインデックス部によってデータメモリ2,タ
グメモリ3,有効メモリ4,属性メモリ5およびLRU
メモリ81のエントリ(以下、このエントリを該当エン
トリという)が指示されるとともに、ヒット判定手段6
がアドレスの上位17ビットのタグ部と両ウエイのタグ
メモリ3の該当エントリのタグアドレスとを比較器61
および62により比較し、比較器61および62の出力
と両ウエイの有効メモリ4の該当エントリの有効ビット
とをアンドゲート63および64により論理積してキャ
ッシュヒットを判定する。キャッシュヒットしていれ
ば、アンドゲート63または64の出力が1となるので
(両出力が1となるケースは故障)、キャッシュヒット
したウエイ(該当ウエイ)のデータメモリ2の該当エン
トリのキャッシュライン上のデータがセレクタ65によ
り選択されてプロセッサコアに出力されるとともに、有
効ウエイ番号が属性操作手段7の属性メモリ制御部71
および置き換え手段8のメモリ制御部82に通知され
る。
Then, in the cache memory 1, the data memory 2, the tag memory 3, the valid memory 4, the attribute memory 5, and the LRU
An entry in the memory 81 (hereinafter, this entry is referred to as a corresponding entry) is designated, and the hit determination means 6
Compares the tag portion of the upper 17 bits of the address with the tag address of the corresponding entry in the tag memory 3 of both ways.
Then, the outputs of the comparators 61 and 62 are ANDed with the valid bits of the corresponding entry in the valid memory 4 of both ways by AND gates 63 and 64 to determine a cache hit. If there is a cache hit, the output of the AND gate 63 or 64 becomes 1 (the case where both outputs become 1 is a failure). Is selected by the selector 65 and output to the processor core, and the effective way number is stored in the attribute memory control unit 71 of the attribute operating unit 7.
And the memory control unit 82 of the replacement unit 8 is notified.

【0040】一方、属性操作手段7は、アンドゲート7
3を介して一時的領域確保要求が与えられると、属性メ
モリ制御部71により両ウエイの属性メモリ5の該当エ
ントリから属性ビットを読み出し(ステップS10
1)、両ウエイのデータメモリ2の該当エントリのキャ
ッシュラインがともに一時的領域としてすでに確保され
ていないかどうかを判定する(ステップS102)。少
なくともどちらかのウエイのキャッシュラインが一時的
領域としてすでに確保されていたならば、属性メモリ制
御部71は、一時的領域の確保が失敗したとして、何も
しないで処理を終了する(ステップS112)。
On the other hand, the attribute operating means 7 comprises an AND gate 7
When a temporary area reservation request is given via the attribute memory 3, the attribute bit is read from the corresponding entry of the attribute memory 5 of both ways by the attribute memory control unit 71 (step S 10).
1) It is determined whether both cache lines of the corresponding entry in the data memory 2 of both ways have already been secured as temporary areas (step S102). If the cache line of at least one of the ways has already been secured as a temporary area, the attribute memory control unit 71 determines that the securing of the temporary area has failed and ends the process without doing anything (step S112). .

【0041】ステップS102で、両ウエイのデータメ
モリ2の該当エントリのキャッシュラインがともに一時
的領域として確保されていなければ、属性メモリ制御部
71は、両ウエイの有効メモリ4の該当エントリから有
効ビットを読み出し(ステップS103)、有効でない
(空いている)ウエイがあるかどうかを判定する(ステ
ップS104)。
In step S102, if the cache line of the corresponding entry in the data memory 2 of both ways is not secured as a temporary area, the attribute memory control unit 71 determines from the corresponding entry of the valid memory 4 of both ways the valid bit. Is read (step S103), and it is determined whether or not there is an invalid (vacant) way (step S104).

【0042】有効でないウエイがなければ、属性メモリ
制御部71は、その旨を置き換え手段8のメモリ制御部
82に通知する。
If there is no invalid way, the attribute memory control unit 71 notifies the memory control unit 82 of the replacement unit 8 of the fact.

【0043】メモリ制御部82は、LRUメモリ81を
参照して最新に使用されたのではない(古い)ウエイの
データメモリ2の該当エントリのキャッシュライン上の
データを外部メモリに追い出す(ステップS105)。
なお、データを外部メモリに追い出す経路等については
図示していない。
The memory control unit 82 refers to the LRU memory 81 and drives out the data on the cache line of the corresponding entry in the data memory 2 of the way which is not used most recently (old) to the external memory (step S105). .
It should be noted that a path for flushing data to the external memory is not shown.

【0044】データの外部メモリへの追い出し後、属性
操作手段7の属性メモリ制御部71は、該当ウエイの属
性メモリ5の該当エントリの属性ビットを1とする(ス
テップS106)。これにより、該当ウエイのデータメ
モリ2の該当エントリのキャッシュラインが一時的領域
として確保されたことになる。
After the data has been flushed to the external memory, the attribute memory control unit 71 of the attribute operating means 7 sets the attribute bit of the entry in the attribute memory 5 of the way to 1 (step S106). As a result, the cache line of the corresponding entry in the data memory 2 of the corresponding way is secured as a temporary area.

【0045】他方、ステップS104で有効でないウエ
イがあれば、属性操作手段7は、属性メモリ制御部71
により、ウエイ0が空いているかどうかを判定する(ス
テップS107)。
On the other hand, if there is an invalid way in step S104, the attribute operating means 7
It is determined whether way 0 is free (step S107).

【0046】ウエイ0が空いていれば、置き換え手段8
は、メモリ制御部82により、ウエイ0の有効メモリ4
の該当エントリの有効ビットを1とする(ステップS1
08)。
If way 0 is free, replacement means 8
Is the effective memory 4 of the way 0 by the memory control unit 82.
Is set to 1 (step S1).
08).

【0047】次に、属性メモリ制御部71は、ウエイ0
の属性メモリ5の該当エントリの属性ビットを1とする
(ステップS109)。これにより、ウエイ0のデータ
メモリ2の該当エントリのキャッシュラインが一時的領
域として確保されたことになる。
Next, the attribute memory control unit 71
The attribute bit of the corresponding entry in the attribute memory 5 is set to 1 (step S109). As a result, the cache line of the corresponding entry in the data memory 2 of way 0 is secured as a temporary area.

【0048】また、ステップS107でウエイ0が空い
ていなければ、メモリ制御部82は、ウエイ1の有効メ
モリ4の該当エントリの有効ビットを1とする(ステッ
プS110)。
If the way 0 is not empty at the step S107, the memory control unit 82 sets the valid bit of the corresponding entry of the valid memory 4 of the way 1 to 1 (step S110).

【0049】次に、属性メモリ制御部71は、ウエイ1
の属性メモリ5の該当エントリの属性ビットを1とする
(ステップS111)。これにより、ウエイ1のデータ
メモリ2の該当エントリのキャッシュラインが一時的領
域として確保されたことになる。
Next, the attribute memory control unit 71
The attribute bit of the corresponding entry in the attribute memory 5 is set to 1 (step S111). As a result, the cache line of the corresponding entry in the data memory 2 of the way 1 is secured as a temporary area.

【0050】フェッチ時には、従来のキャッシュメモリ
と同様の動作を行うので、詳しい動作の説明は割愛す
る。
At the time of fetching, the same operation as that of the conventional cache memory is performed, and the detailed description of the operation is omitted.

【0051】一時的領域が確保された後に、プロセッサ
コアによって一時的領域解放命令が実行されると、プロ
セッサコアからキャッシュメモリ1に引数(アドレス)
および一時的領域解放要求が与えられる。
When a temporary area release instruction is executed by the processor core after the temporary area is secured, an argument (address) is stored in the cache memory 1 from the processor core.
And a temporary area release request.

【0052】すると、キャッシュメモリ1では、アドレ
スのうちのインデックス部によってデータメモリ2,タ
グメモリ3,有効メモリ4,属性メモリ5およびLRU
メモリ81のエントリ(該当エントリ)が指示されると
ともに、ヒット判定手段6がアドレスの上位17ビット
のタグ部と両ウエイのタグメモリ3の該当エントリのタ
グアドレスとを比較器61および62により比較し、比
較器61および62の出力と両ウエイの有効メモリ4の
該当エントリの有効ビットとをアンドゲート63および
64により論理積してキャッシュヒットを判定する。キ
ャッシュヒットしていれば、アンドゲート63または6
4の出力が1となるので(両出力が1となるケースは故
障)、キャッシュヒットしたウエイ(該当ウエイ)のデ
ータメモリ2の該当エントリのキャッシュライン上のデ
ータがセレクタ65により選択されてプロセッサコアに
出力されるとともに、有効ウエイ番号が属性操作手段7
の属性メモリ制御部71および置き換え手段8のメモリ
制御部82に通知される。
Then, in the cache memory 1, the data memory 2, the tag memory 3, the valid memory 4, the attribute memory 5, and the LRU
The entry of the memory 81 (corresponding entry) is specified, and the hit determination means 6 compares the tag portion of the upper 17 bits of the address with the tag address of the corresponding entry in the tag memory 3 of both ways by the comparators 61 and 62. , AND gates 63 and 64 AND the outputs of comparators 61 and 62 and the valid bits of the corresponding entry in valid memory 4 of both ways to determine a cache hit. If there is a cache hit, AND gate 63 or 6
4 becomes 1 (the case where both outputs become 1 is a failure), the data on the cache line of the corresponding entry of the data memory 2 of the way (the corresponding way) which hit the cache is selected by the selector 65 and the processor core Is output to the attribute operation means 7
To the attribute memory control unit 71 and the memory control unit 82 of the replacement unit 8.

【0053】属性操作手段7の属性メモリ制御部71
は、一時的領域解放要求が与えられると、該当ウエイの
属性メモリ5の該当エントリから属性ビットを読み出し
(ステップS201)、属性ビットが1かどうかを判定
する(ステップS202)。
Attribute memory control unit 71 of attribute operation means 7
When the temporary area release request is given, the attribute bit is read from the corresponding entry in the attribute memory 5 of the corresponding way (step S201), and it is determined whether the attribute bit is 1 (step S202).

【0054】属性ビットが1であれば、属性メモリ制御
部71は、該当ウエイの属性メモリ5の該当エントリの
属性ビットを0に戻す(ステップS203)。これによ
り、該当ウエイのデータメモリ2の該当エントリのキャ
ッシュラインが一時的領域から解放されたことになる。
If the attribute bit is 1, the attribute memory control unit 71 returns the attribute bit of the entry in the attribute memory 5 of the way to 0 (step S203). As a result, the cache line of the corresponding entry in the data memory 2 of the corresponding way is released from the temporary area.

【0055】次に、置き換え手段8のメモリ制御部82
は、該当ウエイの有効メモリ4の該当エントリの有効ビ
ットを0に戻す(ステップS204)。
Next, the memory controller 82 of the replacing means 8
Returns the valid bit of the corresponding entry of the valid memory 4 of the corresponding way to 0 (step S204).

【0056】ステップS202で属性ビットが1でなけ
れば、置き換え手段8は、メモリ制御部82により、対
応する一時的変数がキャッシュライン上にあるかどうか
を判定し(ステップS205)、あれば該当ウエイの属
性メモリ5の該当エントリの有効ビットを0に戻す(ス
テップS206)。ステップ205で、対応する一時的
変数がキャッシュライン上になければ、置き換え手段8
は、何もしないで(ステップS207)、処理を終了す
る。
If the attribute bit is not 1 in step S202, the replacing means 8 determines whether the corresponding temporary variable is on the cache line by the memory control unit 82 (step S205). The valid bit of the corresponding entry in the attribute memory 5 is reset to 0 (step S206). In step 205, if the corresponding temporary variable is not on the cache line, the replacing means 8
Does nothing (step S207) and ends the process.

【0057】[0057]

【発明の効果】本発明の効果は、キャッシュメモリ−外
部メモリ間の通信を減少させ、プロセッサの性能向上に
寄与できることである。その理由は、プログラム実行中
に発生する一時的変数のための領域(一時的領域)をキ
ャッシュメモリに用意できるようにし、その一時的領域
のデータに対して行われる更新を外部メモリに反映しな
いようにしたからである。
An advantage of the present invention is that the communication between the cache memory and the external memory can be reduced and the performance of the processor can be improved. The reason is that an area (temporary area) for a temporary variable generated during the execution of the program can be prepared in the cache memory, and the update performed on the data in the temporary area is not reflected in the external memory. Because it was.

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

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

【図2】図1中のデータメモリおよび属性メモリと説明
用のプログラム例を示す図である。
FIG. 2 is a diagram showing a data memory and an attribute memory in FIG. 1 and a program example for explanation.

【図3】本実施の形態に係るキャッシュメモリの一実施
例の構成を示す回路ブロック図である。
FIG. 3 is a circuit block diagram showing a configuration of an example of a cache memory according to the present embodiment.

【図4】本実施例のキャッシュメモリにおける一時的領
域確保命令(VRSV命令)実行時の属性操作手段およ
び置き換え手段の処理を示すフローチャートである。
FIG. 4 is a flowchart illustrating processing of an attribute operation unit and a replacement unit when a temporary area securing instruction (VRSV instruction) in a cache memory according to the present embodiment is executed.

【図5】本実施例のキャッシュメモリにおける一時的領
域解放命令(VREL命令)実行時の属性操作手段およ
び置き換え手段の処理を示すフローチャートである。
FIG. 5 is a flowchart illustrating processing of an attribute operation unit and a replacement unit when a temporary area release instruction (VREL instruction) is executed in the cache memory according to the embodiment.

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

1 キャッシュメモリ 2 データメモリ 3 タグメモリ 4 有効メモリ 5 属性メモリ 6 ヒット判定手段 7 属性操作手段 8 置き換え手段 61,62 比較器 63,64 アンドゲート 65 セレクタ 71 属性メモリ制御部 72 ナンドゲート 73 アンドゲート 81 LRUメモリ 82 メモリ制御部 DESCRIPTION OF SYMBOLS 1 Cache memory 2 Data memory 3 Tag memory 4 Valid memory 5 Attribute memory 6 Hit determination means 7 Attribute operation means 8 Replacement means 61, 62 Comparator 63, 64 AND gate 65 Selector 71 Attribute memory control unit 72 NAND gate 73 AND gate 81 LRU Memory 82 Memory control unit

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 2ウエイ以上のセットアソシアティブ構
成をとるキャッシュメモリにおいて、データの更新を外
部メモリに反映しない一時的領域を、データメモリのキ
ャッシュライン毎に選択的に指定できることを特徴とす
るキャッシュメモリ。
1. A cache memory having a two-way or more set associative configuration, wherein a temporary area in which data update is not reflected in an external memory can be selectively designated for each cache line of the data memory. .
【請求項2】 前記データメモリのキャッシュライン毎
にデータの更新を外部メモリに反映しない一時的領域で
あることを示す属性ビットを格納する属性メモリと、前
記属性メモリの属性ビットを参照する手段とを持つ請求
項1記載のキャッシュメモリ。
2. An attribute memory for storing an attribute bit indicating a temporary area in which data update is not reflected in an external memory for each cache line of the data memory, and means for referring to the attribute bit of the attribute memory. 2. The cache memory according to claim 1, comprising:
【請求項3】 前記属性メモリの属性ビットを参照して
キャッシュライン毎にデータの置き換えの可否を選択で
きる置き換え手段を持つ請求項2記載のキャッシュメモ
リ。
3. The cache memory according to claim 2, further comprising replacement means for selecting whether or not data can be replaced for each cache line by referring to attribute bits of said attribute memory.
【請求項4】 前記一時的領域の確保および解放のため
のプログラムないし専用命令をプロセッサが実行したと
きに、プロセッサから一時的領域確保要求および一時的
領域解放要求を受け取り、前記一時的領域の確保および
解放を行うために前記属性メモリの属性ビットを操作す
る属性操作手段を持つ請求項3記載のキャッシュメモ
リ。
4. A temporary area securing request and a temporary area releasing request are received from the processor when the processor executes a program or a dedicated instruction for securing and releasing the temporary area, and securing the temporary area. 4. The cache memory according to claim 3, further comprising attribute operation means for operating attribute bits of said attribute memory to perform release.
【請求項5】 2ウエイ以上のセットアソシアティブ構
成をとるキャッシュメモリにおいて、キャッシュしたデ
ータを格納する複数のキャッシュラインから構成される
複数ウエイのデータメモリと、これらデータメモリの各
キャッシュラインに対応して該キャッシュラインのデー
タのタグアドレスを登録する複数ウエイのタグメモリ
と、前記データメモリの各キャッシュラインに対応して
該キャッシュラインのデータの有効性を示す有効ビット
を格納する複数ウエイの有効メモリと、前記データメモ
リの各キャッシュラインに対応して該キャッシュライン
がデータの更新を外部メモリに反映しない一時的領域と
して確保されているか否かを示す属性ビットを格納する
複数ウエイの属性メモリと、アクセスするデータのアド
レスインデックス部と前記タグメモリのタグアドレスと
を比較してキャッシュヒットの判定を行うヒット判定手
段と、一時的領域確保命令および一時的領域解放命令が
実行されたときに前記属性メモリの属性ビットを操作す
る属性操作手段と、前記属性メモリの属性ビットをもと
に前記データメモリのキャッシュラインのデータが置き
換え可能か否かを判定して置き換えが可能であればデー
タの置き換え処理を行う置き換え手段とを有することを
特徴とするキャッシュメモリ。
5. A cache memory having a two-way or more set associative configuration, a plurality of ways of data memory comprising a plurality of cache lines for storing cached data, and a plurality of way data memories corresponding to each of the cache lines. A multi-way tag memory for registering the tag address of the data of the cache line, and a multi-way effective memory for storing a valid bit indicating the validity of the data of the cache line corresponding to each cache line of the data memory; A multi-way attribute memory for storing an attribute bit indicating whether or not the cache line is reserved as a temporary area that does not reflect data update to an external memory, corresponding to each cache line of the data memory; Address index part of the data Hit determining means for comparing a tag address of the tag memory with a tag address to determine a cache hit; and attribute operation for operating attribute bits of the attribute memory when a temporary area securing instruction and a temporary area releasing instruction are executed. Means for determining whether data in the cache line of the data memory is replaceable based on attribute bits of the attribute memory and performing replacement processing of the data if replacement is possible. Characteristic cache memory.
【請求項6】 2ウエイのセットアソシアティブ構成を
とるキャッシュメモリにおいて、キャッシュしたデータ
を格納する複数のキャッシュラインから構成される一対
のデータメモリと、これらデータメモリの各キャッシュ
ラインに対応して該キャッシュラインのデータのタグア
ドレスを登録する一対のタグメモリと、前記データメモ
リの各キャッシュラインに対応して該キャッシュライン
のデータの有効性を示す有効ビットを格納する一対の有
効メモリと、前記データメモリの各キャッシュラインに
対応して該キャッシュラインがデータの更新を外部メモ
リに反映しない一時的領域として確保されているか否か
を示す属性ビットを格納する一対の属性メモリと、アク
セスするデータのアドレスのインデックス部と前記タグ
メモリのタグアドレスとを比較してキャッシュヒットの
判定を行うヒット判定手段と、一時的領域確保命令およ
び一時的領域解放命令が実行されたときに前記属性メモ
リの属性ビットを操作する属性操作手段と、前記属性メ
モリの属性ビットをもとに前記データメモリのキャッシ
ュラインのデータが置き換え可能か否かを判定して置き
換えが可能であればデータの置き換え処理を行う置き換
え手段とを有することを特徴とするキャッシュメモリ。
6. In a cache memory having a two-way set associative configuration, a pair of data memories including a plurality of cache lines for storing cached data, and a cache corresponding to each cache line of the data memories A pair of tag memories for registering tag addresses of line data, a pair of valid memories for storing valid bits indicating validity of data of the cache line corresponding to each cache line of the data memory, and the data memory A pair of attribute memories for storing attribute bits indicating whether or not the cache line is secured as a temporary area that does not reflect the update of data in the external memory, corresponding to each of the cache lines; Index part and tag address of the tag memory Hit determining means for determining a cache hit by comparing the attribute memory with an attribute memory for operating an attribute bit of the attribute memory when a temporary area securing instruction and a temporary area releasing instruction are executed; A cache memory comprising: a replacement unit that determines whether data in a cache line of the data memory is replaceable based on an attribute bit of the memory and performs a data replacement process if the replacement is possible. .
【請求項7】 前記ヒット判定手段が、アクセスするデ
ータのアドレスのインデックス部と前記タグメモリのタ
グアドレスとを比較する一対の比較器と、これら比較器
の出力と前記有効メモリの有効ビットとを論理積する一
対のアンドゲートと、これらアンドゲートの出力に応じ
て前記一対のデータメモリのいずれか一方のキャッシュ
ラインからのデータを選択するセレクタとを含む請求項
6記載のキャッシュメモリ。
7. A pair of comparators for comparing an index part of an address of data to be accessed with a tag address of the tag memory, and an output of the comparator and a valid bit of the valid memory. 7. The cache memory according to claim 6, further comprising: a pair of AND gates for performing an AND operation, and a selector for selecting data from one of the cache lines of the pair of data memories in accordance with an output of the AND gate.
【請求項8】 前記属性操作手段が、前記一対の属性メ
モリの属性ビットの論理積を反転するナンドゲートと、
このナンドゲートの出力と一時的領域確保要求とを論理
積するアンドゲートと、このアンドゲートの出力および
一時的領域解放要求に応じて前記一対の属性メモリの属
性ビットを操作する属性メモリ制御部とを含む請求項6
記載のキャッシュメモリ。
8. A NAND gate for inverting a logical product of attribute bits of the pair of attribute memories;
An AND gate for ANDing the output of the NAND gate and the temporary area reservation request; and an attribute memory control unit for operating the attribute bits of the pair of attribute memories in response to the output of the AND gate and the temporary area release request. Claim 6 including
The cache memory as described.
【請求項9】 前記置き換え手段が、前記一対のデータ
メモリの各キャッシュラインに対応して一番最近アクセ
スされたウエイ番号を格納するLRUメモリと、前記ヒ
ット判定手段の出力に応じて前記一対の属性メモリの属
性ビットを参照し前記一対のデータメモリ,前記一対の
タグメモリおよび前記一対の有効メモリを制御するメモ
リ制御部とを含む請求項6記載のキャッシュメモリ。
9. An LRU memory for storing a way number most recently accessed corresponding to each cache line of said pair of data memories, and said pair of data memories in response to an output of said hit judging means. 7. The cache memory according to claim 6, further comprising: a memory control unit that controls the pair of data memories, the pair of tag memories, and the pair of valid memories by referring to attribute bits of the attribute memory.
JP14145698A 1998-05-22 1998-05-22 Cache memory Expired - Fee Related JP3331592B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14145698A JP3331592B2 (en) 1998-05-22 1998-05-22 Cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14145698A JP3331592B2 (en) 1998-05-22 1998-05-22 Cache memory

Publications (2)

Publication Number Publication Date
JPH11338772A true JPH11338772A (en) 1999-12-10
JP3331592B2 JP3331592B2 (en) 2002-10-07

Family

ID=15292332

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14145698A Expired - Fee Related JP3331592B2 (en) 1998-05-22 1998-05-22 Cache memory

Country Status (1)

Country Link
JP (1) JP3331592B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009163450A (en) * 2007-12-28 2009-07-23 Fujitsu Ltd Cache memory having sector function
US8078801B2 (en) 2006-12-27 2011-12-13 Intel Corporation Obscuring memory access patterns

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7991965B2 (en) 2006-02-07 2011-08-02 Intel Corporation Technique for using memory attributes

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8078801B2 (en) 2006-12-27 2011-12-13 Intel Corporation Obscuring memory access patterns
JP2009163450A (en) * 2007-12-28 2009-07-23 Fujitsu Ltd Cache memory having sector function
US8583872B2 (en) 2007-12-28 2013-11-12 Fujitsu Limited Cache memory having sector function

Also Published As

Publication number Publication date
JP3331592B2 (en) 2002-10-07

Similar Documents

Publication Publication Date Title
US6868472B1 (en) Method of Controlling and addressing a cache memory which acts as a random address memory to increase an access speed to a main memory
US8131894B2 (en) Method and system for a sharing buffer
US7676632B2 (en) Partial cache way locking
US6748501B2 (en) Microprocessor reservation mechanism for a hashed address system
JP2554449B2 (en) Data processing system having cache memory
US7447845B2 (en) Data processing system, processor and method of data processing in which local memory access requests are serviced by state machines with differing functionality
EP0950222B1 (en) Prefetch management in cache memory
EP0438211A2 (en) Cache memory system
US5713038A (en) Microprocessor having register file
US20080189487A1 (en) Control of cache transactions
JP7340326B2 (en) Perform maintenance operations
JP4803983B2 (en) Arithmetic processing unit
US20060161735A1 (en) Multithread controller and control method
US20070005906A1 (en) Information processing apparatus and cache memory control method
KR20210019584A (en) Multi-table branch target buffer
JPH1185618A (en) Method for controlling virtual memory conversion
EP1298532A2 (en) Processor and method of arithmetic processing thereof
US7461212B2 (en) Non-inclusive cache system with simple control operation
US6434670B1 (en) Method and apparatus for efficiently managing caches with non-power-of-two congruence classes
JP3936672B2 (en) Microprocessor
CN114217861A (en) Data processing method and device, electronic device and storage medium
US8266379B2 (en) Multithreaded processor with multiple caches
JP3331592B2 (en) Cache memory
JPH07248967A (en) Memory control system
JP2001249846A (en) Cache memory device and data processing system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070726

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080726

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090726

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100726

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110726

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110726

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120726

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120726

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130726

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees