JP2006285727A - Cache memory device - Google Patents

Cache memory device Download PDF

Info

Publication number
JP2006285727A
JP2006285727A JP2005105826A JP2005105826A JP2006285727A JP 2006285727 A JP2006285727 A JP 2006285727A JP 2005105826 A JP2005105826 A JP 2005105826A JP 2005105826 A JP2005105826 A JP 2005105826A JP 2006285727 A JP2006285727 A JP 2006285727A
Authority
JP
Japan
Prior art keywords
resident
cache memory
area
resident area
instruction code
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.)
Withdrawn
Application number
JP2005105826A
Other languages
Japanese (ja)
Inventor
Kazuhiro Nagasawa
和広 長澤
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2005105826A priority Critical patent/JP2006285727A/en
Publication of JP2006285727A publication Critical patent/JP2006285727A/en
Withdrawn legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To make an instruction code and data, which should be reside, resident in a cache memory 3 to improve a cache hit. <P>SOLUTION: This device comprises a CPU 1 for processing a program and data to operate a system, a main memory device 2 of a low speed and large capacity for housing the instruction code and data of the program, a cache memory 3 of a higher speed and a smaller capacity than those of the main memory device 2 for temporarily housing the instruction code and data, a cache memory control circuit 4 for replacing and reading the cache memory 3, and a replacement candidate control circuit 5 for eliminating an area of the instruction code and data resident in the cache memory 3 from a replacement object in replacement operation, and thus is provided with an area of the cache memory 3 where the instruction code and data to reside. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明はメモリアクセスを高速に行うためのキャッシュメモリ装置に関する。     The present invention relates to a cache memory device for performing memory access at high speed.

従来の一般的なキャッシュメモリ装置について、簡単に説明する。キャッシュメモリ装置は、図10に示すようにシステムを動作させるためのプログラムやデータの処理を行うCPU1と、プログラムの命令コードやデータを格納するための低速でかつ大容量の主記憶装置2と、主記憶装置2よりは小容量であるが高速なキャッシュメモリ3と、これらの動作制御を行うキャッシュメモリ制御回路4から構成される。   A conventional general cache memory device will be briefly described. As shown in FIG. 10, the cache memory device includes a CPU 1 for processing a program and data for operating the system, a low-speed and large-capacity main storage device 2 for storing instruction codes and data of the program, The cache memory 3 has a smaller capacity than the main storage device 2 but a high speed, and a cache memory control circuit 4 for controlling these operations.

キャッシュメモリ3は、CPU1と主記憶装置2とのアクセス時の待ち時間に相当する時間を減らし、処理速度を向上させるための緩衝メモリの一種である。通常、キャッシュメモリ3は、主記憶装置2に比べて小容量であるが、CPU1からのアクセスに対して高速応答可能なメモリを用い、時間的局所性(読み書きされたデータは近いうちにまた使われる可能性が高い)と、空間的局所性(読み書きされたデータの近くにあるデータは近いうちに使われる可能性が高い)という性質を利用し、システム全体としての処理速度の向上を可能とする。   The cache memory 3 is a kind of buffer memory for reducing the time corresponding to the waiting time when accessing the CPU 1 and the main storage device 2 and improving the processing speed. Normally, the cache memory 3 has a smaller capacity than the main storage device 2, but uses a memory capable of high-speed response to accesses from the CPU 1, and temporal locality (data read / written will be used again soon). ) And spatial locality (data near read / write data is likely to be used in the near future), and the overall system speed can be improved. To do.

命令コードやデータは、予め主記憶装置2に記憶されているが、初期状態(キャッシュメモリ3に何も記憶されていない状態)から任意のアドレスをCPU1がアクセスした場合、キャッシュメモリ3上にデータが存在しないため、初回のアクセスは低速な主記憶装置2に対して行われる。この時、同時にキャッシュメモリ3には、CPU1にアクセスされた主記憶装置2のアドレスとこのアドレスによって主記憶装置2から出力された命令コードやデータを記憶する。キャッシュメモリ制御装置4はCPU1が実行する記憶装置へのアクセスを常に監視しており、2回目以降の同一アドレス(記憶されたアドレス)へのアクセスが行われるとキャッシュメモリ制御回路4は低速な主記憶装置2へのアクセスをやめ(主記憶装置2への制御信号の出力はしない)、高速なキャッシュメモリ3から該当するアドレスに対応する命令コード又はデータをCPU1へ渡す。このことにより、CPU1の主記憶装置2へのアクセス時の待ち時間に相当する時間を減らし、処理速度を向上させる。以上のように、小容量ながらも高速なキャッシュメモリ3を持つことにより、CPU1が必要とするデータがキャッシュメモリ上に存在すれば低速な主記憶装置2にアクセスすることなく、高速に命令コードとデータを読み書きすることが可能である。   The instruction code and data are stored in the main storage device 2 in advance, but when the CPU 1 accesses an arbitrary address from the initial state (the state in which nothing is stored in the cache memory 3), the data is stored in the cache memory 3. Therefore, the first access is made to the low-speed main storage device 2. At the same time, the cache memory 3 stores the address of the main storage device 2 accessed by the CPU 1 and the instruction code and data output from the main storage device 2 based on this address. The cache memory control device 4 constantly monitors the access to the storage device executed by the CPU 1, and the cache memory control circuit 4 operates at a low speed when the same address (stored address) is accessed for the second and subsequent times. Access to the storage device 2 is stopped (no control signal is output to the main storage device 2), and the instruction code or data corresponding to the corresponding address is transferred from the high-speed cache memory 3 to the CPU 1. This reduces the time corresponding to the waiting time when the CPU 1 accesses the main storage device 2 and improves the processing speed. As described above, by having the small-capacity but high-speed cache memory 3, if the data required by the CPU 1 exists in the cache memory, the instruction code and the high-speed instruction can be transferred at high speed without accessing the low-speed main storage device 2. Data can be read and written.

最高速のシステムを実現しようとすれば、低速安価な主記憶装置2と、高速高価なキャッシュメモリ3を同じサイズにすることにより実現できる。しかしながらこれはコストの面から現実的でないため、主記憶装置2に比べるとキャッシュメモリ3は小さなサイズのものが搭載されることが一般的である。   If the highest speed system is to be realized, it can be realized by making the low-speed and inexpensive main storage device 2 and the high-speed and expensive cache memory 3 the same size. However, since this is not realistic from the viewpoint of cost, the cache memory 3 is generally mounted with a smaller size than the main storage device 2.

このようにキャッシュメモリ3が主記憶装置2に比べ小さいサイズであるため、主記憶装置2の中の一部のデータのみがキャッシュメモリ3上に記憶されることになる。   As described above, since the cache memory 3 is smaller in size than the main storage device 2, only a part of the data in the main storage device 2 is stored on the cache memory 3.

理想的なキャッシュメモリ3の動作としては、これからCPU1が必要とする確率の高い命令コードやデータを、CPU1が実際に使用する前にキャッシュメモリ3に記憶しておくことが望ましい。キャッシュメモリ3上に空きが無い場合には、CPU1が必要とする命令コードやデータと、最も必要でないと思われる命令コードやデータとを置き換える処理が取られる。しかしながら実際に、どの命令コードやデータをキャッシュメモリ3上に記憶あるいは置き換えするかは、キャッシュメモリ制御回路4の置き換え制御回路に依存しており、制御方法として代表的なものには、未使用の時間がもっとも長いブロックを置き換えの対象として選択するLRU(Least Recently Used)方式や、置き換えの対象を順番に変えていくRound−Robin方式、置き換えの対象がランダムなランダム方式といった方法が良く用いられている。キャッシュメモリ3は、通常、複数セットのタグ(キャッシュメモリ3の1ラインごとに記憶されている主記憶装置2のアドレスなどの情報)を持たせることで、同じエントリアドレスでも複数命令コード、或いはデータの格納を行うことが可能となる。このタグのセット(以下、ウエイ)の数を連想度と呼ぶ。   As an ideal operation of the cache memory 3, it is desirable to store instruction codes and data with a high probability required by the CPU 1 in the cache memory 3 before the CPU 1 actually uses them. When there is no free space on the cache memory 3, processing is performed to replace the instruction code and data required by the CPU 1 with the instruction code and data that is considered to be least necessary. However, which instruction code or data is actually stored or replaced on the cache memory 3 depends on the replacement control circuit of the cache memory control circuit 4 and is not used as a typical control method. Methods such as the LRU (Least Recently Used) method that selects the block with the longest time as the replacement target, the Round-Robin method that changes the replacement target in order, and the random random method that is the replacement target are often used. Yes. The cache memory 3 usually has a plurality of sets of tags (information such as the address of the main memory 2 stored for each line of the cache memory 3), so that a plurality of instruction codes or data can be stored even at the same entry address. Can be stored. The number of tag sets (hereinafter referred to as ways) is called association.

キャッシュメモリ3にCPU1が必要とする命令コード又はデータが格納されていない場合には、主記憶装置2からキャッシュメモリ3のラインに新しい命令コードやデータを主記憶装置2から転送する置き換え動作(ラインフェッチと呼ばれている)が必要である。キャッシュメモリ3上で選択されるラインは、パターソン&ヘネシー著の「コンピュータの構成と設計」に記載されている通り、一般的にCPU1が主記憶装置2にアクセスするアドレスの一部分をデコードすることによって決まる。このことについて、図11を用いて説明する。図11は、キャッシュメモリ内で置き換え動作が行われる際の置き換え候補のウエイを示す図である。置き換え動作が行われる際の置き換え候補12は、ウエイ0からウエイ3の全てが対象となり、この中から置き換え制御回路で選択されたウエイのラインに置き換えを行うことができる。     When the instruction code or data required by the CPU 1 is not stored in the cache memory 3, a replacement operation (line for transferring a new instruction code or data from the main storage device 2 to the line of the cache memory 3 from the main storage device 2. Called fetch). The line selected on the cache memory 3 is generally obtained by decoding a part of the address at which the CPU 1 accesses the main memory 2 as described in “Computer Configuration and Design” by Patterson & Hennessy. Determined. This will be described with reference to FIG. FIG. 11 is a diagram illustrating a replacement candidate way when a replacement operation is performed in the cache memory. The replacement candidate 12 when the replacement operation is performed covers all of the ways 0 to 3 and can be replaced with the way line selected by the replacement control circuit.

前述の通り必要な命令コードやデータはキャッシュメモリ3に常駐させておく方が効率的なことが多い。そのため、キャッシュメモリに常駐させるプログラムをライン上のタグ中のフラグビットに常駐フラグを付加することによりラインのデータ置き換えを禁止し、ヒット率を向上させる技術が提案され、特開平6−195267号公報に開示されている。この技術は、キャッシュメモリのラインごとに常駐フラグを設け、キャッシュヒット、ミスの判定時に常駐フラグを参照して、常駐フラグの状態に応じてキャッシュメモリ3の置き換えを制御する技術である。
特開平6−195267号公報 パターソン&ヘネシー著「コンピュータの構成と設計」日経BP出版、1998年9月25日、p421
As described above, it is often more efficient to make necessary instruction codes and data resident in the cache memory 3. For this reason, there has been proposed a technique for prohibiting line data replacement by adding a resident flag to a flag bit in a tag on a line for a program resident in a cache memory, thereby improving the hit rate. Is disclosed. In this technique, a resident flag is provided for each line of the cache memory, and the replacement of the cache memory 3 is controlled according to the state of the resident flag by referring to the resident flag when determining a cache hit or miss.
JP-A-6-195267 Patterson & Hennessy, "Computer Configuration and Design", Nikkei BP Publishing, September 25, 1998, p421

このような従来のキャッシュメモリ3の置き換え動作は、高速アクセスが要求される命令コードやデータであるか否かに関わらずプログラムやキャッシュメモリ制御回路4の置き換え制御回路に依存して行われるため、高速アクセスが要求される前記命令コードや前記データが常にキャッシュメモリ3に格納されている保証がない。その結果、キャッシュメモリ3の効果が期待するほど得られない場合があるという問題点があった。例えば、いずれか1つのウエイに追い出したくないプログラムが格納されていても、キャッシュメモリ制御回路4の置き換え制御回路に従って前記ウエイの該当ラインも置き換え候補になってしまうという問題点があった。   Such a replacement operation of the conventional cache memory 3 is performed depending on the program and the replacement control circuit of the cache memory control circuit 4 regardless of whether the instruction code or data is required to be accessed at high speed. There is no guarantee that the instruction code and the data for which high speed access is required are always stored in the cache memory 3. As a result, there is a problem that the effect of the cache memory 3 may not be obtained as expected. For example, even if a program that is not desired to be evicted is stored in any one of the ways, there is a problem that the corresponding line of the way becomes a replacement candidate according to the replacement control circuit of the cache memory control circuit 4.

また、異なる方法として、プログラミングによって、キャッシュのヒット率(必要な命令コード及びデータがキャッシュメモリ3になるべく存在するようにする)を向上させる方法もあるが、その際には、キャッシュメモリ3の仕様や動作を考慮したオブジェクトコードの生成が必要となり、現状のコンパイラやアセンブラではその部分の対策ができていないことが多い。加えて、キャッシュメモリ3を効果的に使うことができない場合には、その結果として主記憶装置2へのアクセスが多くなり、処理の高速化という観点から影響があるだけでなく、主記憶装置2への経路のパスが頻繁に活性化されるために状態変化が増加し、その結果、消費電力が増加するという問題点もあった。   In addition, as a different method, there is a method of improving the cache hit rate (so that necessary instruction codes and data exist in the cache memory 3 as much as possible) by programming. In this case, the specification of the cache memory 3 is used. It is necessary to generate object code that takes into account and operation, and current compilers and assemblers often fail to take measures against that part. In addition, when the cache memory 3 cannot be used effectively, access to the main storage device 2 increases as a result, which not only has an influence from the viewpoint of speeding up the processing, but also the main storage device 2. Since the path to the path is frequently activated, the state change increases, resulting in an increase in power consumption.

また、特開平6−195267号公報の発明では、キャッシュヒット、ミスの判定に常駐フラグをキャッシュメモリ3の1ラインずつ常に参照する必要があるため、その部分で回路の動作速度を減じてしまう可能性があり、高速アクセスが要求される命令コードやデータが常にキャッシュメモリ3に格納されていることは保証されるが、キャッシュメモリ3の性能が期待するほど得られない場合があるという問題点があった。   In the invention disclosed in Japanese Patent Laid-Open No. 6-195267, it is necessary to always refer to the resident flag line by line in the cache memory 3 for determination of cache hits and misses, so that the operation speed of the circuit can be reduced at that part. However, it is guaranteed that instruction codes and data that require high-speed access are always stored in the cache memory 3, but the performance of the cache memory 3 may not be obtained as expected. there were.

本発明のキャッシュメモリ装置は、少なくとも常駐領域を設定するための常駐命令コードを含む、命令コード或いはデータを処理するCPUと、前記命令コード或いはデータを一時的に記憶する2つ以上のウエイを有するキャッシュメモリと、前記キャッシュメモリの置き換え制御及び読み出し制御を行うためのキャッシュメモリ制御回路と、前記常駐命令コードにより、予め定められた領域に常駐領域を設定する置き換え候補制御手段を備えて構成する。   The cache memory device of the present invention has a CPU for processing an instruction code or data including at least a resident instruction code for setting a resident area, and two or more ways for temporarily storing the instruction code or data. The cache memory includes a cache memory, a cache memory control circuit for performing replacement control and read control of the cache memory, and replacement candidate control means for setting a resident area in a predetermined area by the resident instruction code.

また、前記置き換え候補制御手段は、前記常駐命令コードにより常駐領域を設定する常駐領域設定手段と、置き換え動作を行うためのウエイを選択するウエイ選択手段とを有する。   The replacement candidate control means has resident area setting means for setting a resident area by the resident instruction code, and way selection means for selecting a way for performing a replacement operation.

また、前記ウエイ選択手段は、前記常駐命令コード実行時には前記常駐領域候補のウエイが回路的に予め一意に決まっており、前記常駐命令コード非実行時で置き換え動作時には前記常駐領域を除外したウエイを選択する。   In addition, the way selection means is configured such that the way of the resident area candidate is uniquely determined in advance in the circuit when the resident instruction code is executed, and the way in which the resident area is excluded during the replacement operation when the resident instruction code is not executed. select.

また、前記予め定められた常駐領域は、前記ウエイ選択手段によって選択されたウエイ上の連続的なラインである。   The predetermined resident area is a continuous line on the way selected by the way selection means.

また、前記常駐領域設定手段が、常駐領域を決定するための先頭アドレス、及び領域のサイズ指定することである特徴とする。あるいは、前記常駐領域設定手段が、常駐領域を決定するための先頭アドレス、及び終了アドレスを指定する。   The resident area setting means designates a head address for determining a resident area and a size of the area. Alternatively, the resident area setting means designates a start address and an end address for determining the resident area.

また、前記置き換え候補制御手段内に、前記キャッシュメモリに常駐させる命令コード又はデータを格納されている領域設定の有効、無効を決定する設定手段を備え、前記設定手段を非アクティブにしたときに前記常駐領域設定手段による常駐設定が無効になる。   Further, the replacement candidate control means includes setting means for determining validity / invalidity of the area setting in which the instruction code or data to be resident in the cache memory is stored, and when the setting means is deactivated, The resident setting by the resident area setting means becomes invalid.

本発明により、常駐させる命令コードやデータを予め定められた領域に常駐させることで常駐させた命令コードやデータへのアクセス速度を向上させることができる。また、キャッシュメモリに常駐させる命令コードやデータを置き換え候補から除外することで、前記キャッシュメモリ上に常駐させることが可能となり、結果、キャッシュのヒット率が向上し、CPUが実行する命令コード、データ処理の高速化が達成される。更に主記憶装置へのアクセスを減ずることによりデータバス等の状態変化を低減することができる。結果、消費電力の低減に関しても良好な効果が期待できる。また予め回路的に決まったウエイから順番に置き換え候補を除外するため、実装に要する回路資源の簡素化も併せて達成することができる。   According to the present invention, it is possible to improve the access speed to the resident instruction code and data by making the resident instruction code and data resident in a predetermined area. Also, by excluding instruction codes and data that are resident in the cache memory from replacement candidates, it becomes possible to make them resident in the cache memory, resulting in an improved cache hit rate and instruction codes and data executed by the CPU. High speed processing is achieved. Further, the state change of the data bus or the like can be reduced by reducing the access to the main storage device. As a result, a favorable effect can be expected for reduction of power consumption. In addition, since replacement candidates are excluded in order from the way determined in advance in terms of circuit, simplification of circuit resources required for mounting can also be achieved.

図1は本実施形態のキャッシュメモリ装置の基本構成を示す。本実施形態のキャッシュメモリ装置は、システムを動作させるためのプログラムやデータの処理を行うCPU1と、プログラムの命令コードやデータを格納するための低速でかつ大容量の主記憶装置2と、主記憶装置2より小容量でかつ高速な、命令コードやデータを一時的に格納するためのキャッシュメモリ3と、キャッシュメモリ3の置き換えや読み出し動作を行うキャッシュメモリ制御回路4と、キャッシュメモリ3に常駐させた命令コードやデータの領域を置き換え動作時の置き換え対象から除外するための置き換え候補制御回路5とを備えて構成される。   FIG. 1 shows the basic configuration of the cache memory device of this embodiment. The cache memory device according to the present embodiment includes a CPU 1 that processes a program and data for operating the system, a low-speed and large-capacity main storage device 2 that stores program instruction codes and data, and a main memory. A cache memory 3 for temporarily storing instruction codes and data that is smaller and faster than the device 2, a cache memory control circuit 4 that performs replacement and read operations of the cache memory 3, and a cache memory 3 that is resident in the cache memory 3. And a replacement candidate control circuit 5 for excluding the instruction code and data areas from the replacement target during the replacement operation.

キャッシュメモリ制御回路4に内蔵された置き換え制御回路は、置き換え動作時に、LRU方式,Round−Robin方式、ランダム方式といった置き換え制御を行っている。   The replacement control circuit built in the cache memory control circuit 4 performs replacement control such as LRU method, Round-Robin method, and random method at the time of replacement operation.

さらに図2に本実施形態の置き換え候補制御回路5の構成図を示す。本実施形態の置き換え候補制御回路5は、常駐させる領域を設定する常駐領域設定レジスタ50と、CPU1から出力されたアドレス(以下、CPUアドレスと記す。)が前記常駐領域か否かを判定する比較器53と、ウエイ選択を制御するウエイ選択回路54で構成されている。   Further, FIG. 2 shows a configuration diagram of the replacement candidate control circuit 5 of the present embodiment. The replacement candidate control circuit 5 according to the present embodiment compares the resident area setting register 50 for setting an area to be resident and whether or not an address output from the CPU 1 (hereinafter referred to as a CPU address) is the resident area. And a way selection circuit 54 for controlling way selection.

本実施形態では、常駐領域を設定する際に、CPU1が常駐領域の設定を行うための命令コード(以下、常駐命令コード)を実行すると、CPU1が常駐領域設定レジスタ50に設定値を書き込まれ、更にその命令コードの実行がキャッシュミスであった場合は、主記憶装置2から常駐命令コードが読み出され、キャッシュメモリ3に置かれる。   In the present embodiment, when the CPU 1 executes an instruction code for setting the resident area (hereinafter referred to as resident instruction code) when setting the resident area, the CPU 1 writes the set value in the resident area setting register 50, Further, if the execution of the instruction code is a cache miss, the resident instruction code is read from the main storage device 2 and placed in the cache memory 3.

常駐領域設定レジスタ50は、常駐させる領域の先頭アドレスを設定するための常駐領域先頭アドレスレジスタ51と、常駐領域のサイズを設定するための常駐領域サイズレジスタ52で構成される。この2つのレジスタに設定値を書き込むことで、常駐領域を設定するための先頭アドレスとサイズが決まるため、常駐領域が設定される。   The resident area setting register 50 includes a resident area head address register 51 for setting the head address of the area to be resident and a resident area size register 52 for setting the size of the resident area. By writing the setting values in these two registers, the head address and size for setting the resident area are determined, so the resident area is set.

比較器53は、常駐領域先頭アドレス51の常駐領域先頭アドレスと常駐領域サイズレジスタ52の常駐領域サイズとCPUアドレスを比較し、常駐領域と同一ラインかどうか否かを判定する。   The comparator 53 compares the resident area head address of the resident area head address 51 with the resident area size of the resident area size register 52 and the CPU address, and determines whether or not the line is the same as the resident area.

ウエイ選択回路54は、比較器53での判定結果に基づいて、常駐命令コード実行時には特定のウエイを選択し、常駐命令コード非実行時で置き換え動作時には前記常駐領域を除外し、キャッシュメモリ制御回路4の置き換え制御回路に従ってウエイを選択する。   The way selection circuit 54 selects a specific way when the resident instruction code is executed based on the determination result of the comparator 53, excludes the resident area when the resident instruction code is not executed, and excludes the resident area. The way is selected according to the replacement control circuit 4.

キャッシュメモリ3に常駐領域が設定された後の常駐命令コード非実行時の置き換え動作は、常駐領域を除外した領域に対してキャッシュメモリ制御回路4の置き換え制御回路での置き換え動作が行われる。   The replacement operation when the resident instruction code is not executed after the resident area is set in the cache memory 3 is performed by the replacement control circuit of the cache memory control circuit 4 for the area excluding the resident area.

つまり、常駐命令コード実行時の置き換え動作では、現状のキャッシュメモリの状態の如何に関わらず、予め回路的に決まったウエイから順番に常駐させる領域が割り当てられる。また、常駐命令コード非実行時で置き換え動作時には、常駐領域を置き換え候補から除外して、キャッシュメモリ制御回路4の置き換え制御回路での置き換え動作が行われる。   In other words, in the replacement operation at the time of executing the resident instruction code, an area to be resident in order from a way determined in advance in a circuit is assigned regardless of the current state of the cache memory. Further, when the resident instruction code is not executed and the replacement operation is performed, the resident area is excluded from the replacement candidates, and the replacement operation in the replacement control circuit of the cache memory control circuit 4 is performed.

ここで、図1および図2を用いて、本実施形態のキャッシュメモリ装置の動作説明を行う。ここでは説明を簡単にするため、キャッシュメモリの連想度を4とし、常駐させる領域が割り当てられるウエイの順番がウエイ0、1、2、3の順となるようにウエイ選択回路54が構成されている場合について述べる。   Here, the operation of the cache memory device of this embodiment will be described with reference to FIGS. 1 and 2. Here, for simplicity of explanation, the way selection circuit 54 is configured so that the association degree of the cache memory is 4, and the order of the ways to which the area to be resident is assigned is the order of ways 0, 1, 2, and 3. Describe the case.

常駐領域を複数設定する場合には、常駐領域設定レジスタ50の数は複数個必要になると想定できるが、ここではその数が1つの場合についてまず説明する。   When a plurality of resident areas are set, it can be assumed that a plurality of resident area setting registers 50 are required. Here, the case where the number is one will be described first.

CPU1がプログラム実行中に常駐命令コードを実行すると、常駐領域設定レジスタ50に書き込みが行われる。ここでは、常駐される前の命令コードやデータがキャッシュメモリ3に書き込まれる前であるため、まだ物理的な常駐領域は設定されない。常駐命令コードを実行後、常駐される命令コードやデータをLRU方式,Round−Robin方式、ランダム方式といった、キャッシュメモリ制御回路4の置き換え制御回路とは無関係にウエイ0への置き換え動作が生じる。   When the CPU 1 executes the resident instruction code during program execution, the resident area setting register 50 is written. Here, since the instruction code and data before being resident are before being written to the cache memory 3, a physical resident area is not yet set. After executing the resident instruction code, the resident instruction code and data are replaced with way 0 regardless of the replacement control circuit of the cache memory control circuit 4 such as LRU method, Round-Robin method, and random method.

置き換え動作終了後、終了状態を回路的に判断して常駐領域の設定を反映する。常駐領域設定レジスタ50が設定されると、次回の置き換えからはCPUアドレスがキャッシュメモリ3内の常駐領域内と同一のラインを指した場合はウエイ0を除くウエイのみが置き換え候補となり、ウエイ1からウエイ3のうちから、キャッシュメモリ制御回路4の置き換え制御回路によってウエイの選択が行われ、そのウエイのライン上に置き換えした命令コードやデータを格納する。   After the replacement operation is completed, the end state is judged by a circuit and the setting of the resident area is reflected. When the resident area setting register 50 is set, from the next replacement, when the CPU address points to the same line as the resident area in the cache memory 3, only the way except way 0 becomes a replacement candidate. A way is selected from the way 3 by the replacement control circuit of the cache memory control circuit 4, and the replaced instruction code and data are stored on the way line.

以上のようにウエイ0に常駐領域が設定されると、キャッシュメモリ3内に常駐設定を行った領域に格納された命令コードやデータは、置き換え動作から除外することが可能となり、結果命令コードやデータのキャッシュメモリへの常駐が可能となる。これとは逆に前記常駐領域内と同一のライン以外を指した場合は、全てのウエイが置き換え候補となる。   As described above, when the resident area is set in the way 0, the instruction code and data stored in the area where the resident setting is set in the cache memory 3 can be excluded from the replacement operation. Data can be resident in the cache memory. On the other hand, when a line other than the same line as in the resident area is pointed out, all the ways become replacement candidates.

キャッシュメモリ3での前記置き換え候補を図で表したのが図3である。図3(a)は置き換え動作時にCPUアドレスが、常駐設定が既になされているウエイ0の領域と同一のラインを指す場合で、且つ常駐させるウエイを選択するウエイの順番がウエイ0、1、2、3の順であった場合の動作である。常駐領域11のあるウエイ0は置き換え候補から除外されているため置き換え候補12はウエイ1、2、3のいずれかになる。ウエイ1、2、3のいずれが選択されるかはウエイ0が選択されないことを除けば、LRU方式、Round Robin方式、ランダム方式といったキャッシュメモリ制御回路4の置き換え制御回路に従って選択される。   FIG. 3 is a diagram showing the replacement candidates in the cache memory 3. FIG. 3A shows a case where the CPU address indicates the same line as the area of way 0 for which the resident setting has already been made at the time of the replacement operation, and the way order for selecting the way to reside is way 0, 1, 2 3 is the operation when the order is 3. Since the way 0 having the resident area 11 is excluded from the replacement candidates, the replacement candidate 12 is any one of the ways 1, 2, and 3. Which of the ways 1, 2, and 3 is selected is selected according to the replacement control circuit of the cache memory control circuit 4 such as the LRU method, the Round Robin method, and the random method, except that the way 0 is not selected.

図3(b)は、CPUアドレスが、前記常駐領域とは異なるラインを指す場合である。置き換え候補12はウエイ0、1、2、3のいずれでもよく、キャッシュメモリ制御回路4の置き換え制御回路に依存して選択される。こうして、キャッシュメモリ3内に常駐設定を行った領域に格納された命令コードやデータの通常の置き換え動作から除外することが可能となり、結果命令コードやデータのキャッシュメモリへの常駐が可能となる。   FIG. 3B shows a case where the CPU address points to a line different from the resident area. The replacement candidate 12 may be any of the ways 0, 1, 2, and 3, and is selected depending on the replacement control circuit of the cache memory control circuit 4. In this way, it is possible to exclude the instruction code and data stored in the cache memory 3 from the normal replacement operation, and the result instruction code and data can be resident in the cache memory.

上記実施形態のキャッシュメモリ装置を使用したシステムを動作させるためのプログラムの流れを図4に示す。図4に示すようにプログラムは、常駐命令コード13と、その後に続く常駐させたい命令コードやデータで構成されている常駐領域14とを有している。CPU1は基本的にまず上から順番にプログラムを実行していくが、その途中で常駐命令コード13が実行されると常駐設定レジスタ50に常駐領域の先頭アドレスと領域サイズが書き込まれるが、この時点では常駐領域は形成されない。常駐命令コード13が実行後、常駐されるべきラインの命令コードやデータを有するプログラムがキャッシュメモリの予め回路的に一意に決められたウエイの連続的なラインに置き換えられるが、常駐領域設定レジスタが1つの場合は、常にウエイ0に置き換えられる。その置き換え動作の終了後は、常駐設定レジスタ50の設定が反映され、常駐領域14が形成される。以後、この常駐領域は、置き換え候補の対象から外れる。   FIG. 4 shows the flow of a program for operating the system using the cache memory device of the above embodiment. As shown in FIG. 4, the program has a resident instruction code 13 followed by a resident area 14 composed of instruction codes and data to be resident. The CPU 1 basically executes the program in order from the top, but when the resident instruction code 13 is executed in the middle, the head address and area size of the resident area are written in the resident setting register 50. In this case, no resident area is formed. After the resident instruction code 13 is executed, the program having the instruction code and data of the line to be resident is replaced with a continuous line of a way uniquely determined in advance in the cache memory. In one case, it is always replaced with way 0. After the replacement operation is completed, the setting of the resident setting register 50 is reflected and the resident area 14 is formed. Thereafter, the resident area is excluded from the candidates for replacement.

図5に常駐領域を複数設定できる場合の実施形態を示す。
常駐領域の設定を行える常駐領域設定レジスタ50を複数個持つ常駐領域設定レジスタ501と、複数個の常駐領域設定レジスタ50に対応させて比較器53が同数設けられた比較器531と、比較器531での判定結果に基づいてウエイを選択するウエイ選択回路541で構成されている。常駐領域設定レジスタ501は、常駐領域設定レジスタ50が複数個設けられ、比較器531も、比較器53が常駐領域設定レジスタ50に対応して同数設けられている。
FIG. 5 shows an embodiment in which a plurality of resident areas can be set.
A resident area setting register 501 having a plurality of resident area setting registers 50 capable of setting a resident area, a comparator 531 having the same number of comparators 53 corresponding to the plurality of resident area setting registers 50, and a comparator 531 The way selection circuit 541 for selecting the way based on the determination result in FIG. The resident area setting registers 501 are provided with a plurality of resident area setting registers 50, and the same number of comparators 531 are provided corresponding to the resident area setting registers 50.

ウエイ選択回路541は、比較器531での判定結果に基づいて、選択常駐命令コード実行時には特定のウエイを選択し、常駐命令コード非実行時で置き換え動作時には常駐領域を除外し、キャッシュメモリ制御回路4の置き換え制御回路に従ってウエイを選択するものである。   The way selection circuit 541 selects a specific way when executing the selected resident instruction code based on the determination result of the comparator 531 and excludes the resident area during the replacement operation when the resident instruction code is not executed. The way is selected according to the replacement control circuit 4.

常駐領域設定レジスタ501からそれぞれ出力される常駐領域先頭アドレスおよび常駐領域サイズにより、比較器531によってCPUアドレスが前記常駐領域か否かを判定し、その結果に基づいてウエイ選択回路541が置き換え候補を決定する。以上により常駐領域設定レジスタ501内のレジスタの数だけ常駐領域の設定が可能となる。   The comparator 531 determines whether or not the CPU address is the resident area based on the resident area head address and the resident area size output from the resident area setting register 501, respectively. Based on the result, the way selection circuit 541 selects a replacement candidate. decide. As described above, the resident areas can be set as many as the number of registers in the resident area setting register 501.

次に、前記実施形態を元に、複数の常駐領域を設定する例について説明する。図6(a)はラインが重なった場合の常駐ウエイの選択方法の例を示す図である。この場合、ウエイ0に常駐領域があるとした時に、新たな常駐領域を設定して、ウエイ0の常駐領域と同一ラインが1ラインでも重なった場合にはウエイ1が選択される。この方法はウエイ選択回路の実装が容易になるという利点がある。これら複数の常駐領域の排他的な制御は比較器531の出力結果に基づきウエイ選択回路541によって行われる。   Next, an example in which a plurality of resident areas are set will be described based on the embodiment. FIG. 6A is a diagram illustrating an example of a method for selecting a resident way when lines overlap. In this case, when there is a resident area in way 0, a new resident area is set, and if one line overlaps with the resident area of way 0, way 1 is selected. This method has an advantage that the way selection circuit can be easily mounted. The exclusive control of the plurality of resident areas is performed by the way selection circuit 541 based on the output result of the comparator 531.

図6(b)は、キャッシュの物理的な領域を効率的に使用するために、新たに常駐させたい領域がウエイ0の既に常駐設定がなされているラインに重なる例を示す図である。この場合、既に常駐設定がなされているラインに関してはウエイ1を選択し、常駐設定がなされていないラインはウエイ0を選択する方法も考えられる。もちろんどちらの方法を選択するかは実現すべき応用などに応じて回路設計時に決定すれば良い。さらに新たな常駐領域が設定された際にCPUアドレスが常駐領域内と同一のラインを指した場合で、且つウエイ0、1に既に常駐設定がなされている場合、次はウエイ2、さらにその次はウエイ3の順番になる。   FIG. 6B is a diagram illustrating an example in which an area to be newly resident overlaps a line in which way 0 has already been set to reside in order to efficiently use a physical area of the cache. In this case, a method may be considered in which way 1 is selected for a line for which resident setting has already been made, and way 0 is selected for a line for which resident setting has not been made. Of course, which method should be selected may be determined at the time of circuit design according to the application to be realized. Further, when a new resident area is set and the CPU address points to the same line as in the resident area, and the way 0 and 1 are already resident, the next is way 2 and the next. Becomes the order of way 3.

図6(c)は、CPUアドレスが指すラインが全ウエイにある常駐領域に重なる例を示す図である。この場合、キャッシュメモリ装置の動作は、キャッシュオフ時と同様の動作となり、主記憶装置2へのアクセスとなる。   FIG. 6C is a diagram illustrating an example in which the line indicated by the CPU address overlaps the resident area in all ways. In this case, the operation of the cache memory device is the same as that when the cache is turned off, and the main memory device 2 is accessed.

また、キャッシュの置き換えの自由度を持たせたい場合は常駐可能なウエイの数を制限するという方法も考えられる。常駐可能な領域の数は、実現すべき応用などに応じて回路設計時に決定すれば良い。もちろん常駐設定の際にどのウエイが選択されるかの順番は、予め一意に決まっていればどこから始まってもどういった順番でも良い。   In addition, in order to provide a degree of freedom for replacement of the cache, a method of limiting the number of ways that can be resident can be considered. The number of resident areas may be determined at the time of circuit design according to the application to be realized. Of course, the order of which way is selected at the time of resident setting may be any order regardless of where it starts as long as it is uniquely determined in advance.

次に、図7に示すフローチャートに基づいて本発明のキャッシュメモリ装置の置き換えフローについて説明する。   Next, a replacement flow of the cache memory device of the present invention will be described based on the flowchart shown in FIG.

CPU1から与えられる主記憶装置2へのアクセス要求により処理を開始し、最初にキャッシュメモリ制御回路4にてタグメモリの内容のチェックが行なわれ(S1)、アクセス要求のあった命令コードまたはデータがキャッシュメモリ3に存在するか否か、つまりキャッシュがヒットしているかミスをしているかを判別する(S2)。   Processing is started in response to an access request from the CPU 1 to the main storage device 2, and the cache memory control circuit 4 first checks the contents of the tag memory (S1). It is determined whether or not it exists in the cache memory 3, that is, whether or not the cache is hit or miss (S2).

アクセス要求のあった命令コードまたはデータがキャッシュメモリ3に存在する(ヒット) 場合は、キャッシュメモリ3からCPU1に所望の命令コードまたはデータの転送を行い、(S3)本処理を終了する。   If the instruction code or data requested for access exists in the cache memory 3 (hit), the desired instruction code or data is transferred from the cache memory 3 to the CPU 1 (S3), and this process is terminated.

アクセス要求のあった命令コードやデータがキャッシュメモリ3に存在しない(ミス)場合は、キャッシュメモリ制御回路4が命令コードやデータを主記憶装置2から読み出してキャッシュメモリ3に格納する。このとき主記憶装置2から読み出されキャッシュメモリ3に格納する命令コードまたはデータをキャッシュメモリ3に常駐させるための常駐命令コードが実行されているか否かで次の処理が異なり(S4)、図4のような常駐命令コード13の有無によって決定される。   If the instruction code or data requested to be accessed does not exist in the cache memory 3 (miss), the cache memory control circuit 4 reads the instruction code or data from the main memory 2 and stores it in the cache memory 3. At this time, the next processing differs depending on whether or not an instruction code or data that is read from the main storage device 2 and stored in the cache memory 3 is resident in the cache memory 3 (S4). 4 is determined by the presence / absence of a resident instruction code 13 such as 4.

キャッシュメモリ3に格納する命令コードまたはデータで常駐させる必要がない場合は、ウエイ選択回路54にて常駐領域を除外した領域のうちから、LRU方式、Round Robin方式、ランダム方式といった、キャッシュメモリ制御回路4での置き換え制御回路に従い、選択されたウエイのラインへの置き換え動作が行われる(S7)。   When there is no need to make the instruction code or data resident in the cache memory 3 resident, a cache memory control circuit such as an LRU method, a round robin method, or a random method is selected from the areas excluding the resident area by the way selection circuit 54 In accordance with the replacement control circuit in step 4, the replacement operation of the selected way to the line is performed (S7).

次に常駐命令コード13によりキャッシュメモリ3に格納する命令コードまたはデータがキャッシュメモリに常駐させるものであることが示された場合は、ウエイ選択回路54によって、LRU方式、Round Robin方式、ランダム方式といった置き換え制御回路とは無関係に、予め順番が決められているウエイへの常駐領域分の置き換え動作が行われ(S5)、前記置き換え動作の後、常駐領域設定レジスタ50の設定値が反映され、その設定された領域を次回の置き換え候補から除外し、結果その箇所が常駐領域となる(S6)。   Next, when the instruction code or data stored in the cache memory 3 is indicated by the resident instruction code 13 to be resident in the cache memory, the way selection circuit 54 causes the LRU method, the Round Robin method, the random method, etc. Regardless of the replacement control circuit, a replacement operation is performed for the resident area on the way whose order is determined in advance (S5). After the replacement operation, the setting value of the resident area setting register 50 is reflected, and The set area is excluded from the next replacement candidates, and as a result, the place becomes a resident area (S6).

キャッシュメモリの置き換えウエイを決めるキャッシュメモリ制御回路4の置き換え制御回路が採用している制御方式は、代表的なものにLRU方式、Round Robin方式、ランダム方式があることを従来の技術に示した通りであるが、本発明はいずれの方式においても適用可能である。   As shown in the prior art, the control methods employed by the replacement control circuit of the cache memory control circuit 4 for determining the replacement way of the cache memory include the LRU method, the Round Robin method, and the random method. However, the present invention can be applied to any method.

上記実施形態では、キャッシュメモリ装置によって設定される常駐領域は、常駐領域の先頭アドレスとサイズで決定されているが、常駐領域の先頭アドレスと最終アドレスで設定することでも実現できる。その実施形態を図8に示す。   In the above embodiment, the resident area set by the cache memory device is determined by the head address and the size of the resident area, but can also be realized by setting the head address and the last address of the resident area. The embodiment is shown in FIG.

図8に示されている置き換え候補制御回路5は、常駐する領域を設定する常駐領域設定レジスタ50と、CPUアドレスが前記常駐領域か否かを判定する比較器53と、ウエイ選択を制御するウエイ選択回路54で構成されている。   The replacement candidate control circuit 5 shown in FIG. 8 includes a resident area setting register 50 for setting a resident area, a comparator 53 for determining whether or not the CPU address is the resident area, and a way for controlling way selection. The selection circuit 54 is configured.

本実施形態では、図2の実施形態の常駐領域設定レジスタ50内にある常駐領域サイズレジスタ52の代わりに、常駐領域の最終アドレスを設定できる常駐領域最終アドレスレジスタ55に置き換えていることが特徴である。   The present embodiment is characterized in that instead of the resident area size register 52 in the resident area setting register 50 of the embodiment of FIG. 2, a resident area final address register 55 that can set the final address of the resident area is replaced. is there.

次に常駐設定を解除したい場合のその解除手段について述べる。常駐設定の解除手段としては様々な方法が考えられるが、その一例として図2の実施形態では常駐領域サイズレジスタ52の設定を‘0’、または図8の実施形態では常駐領域最終アドレスレジスタの設定と常駐領域先頭アドレスレジスタの設定と同じにするなどの方法で容易に実現可能である。また常駐領域の有効か無効の判別手段を設けることによっても実施可能である。   Next, how to cancel the resident setting will be described. Various methods can be considered as means for releasing the resident setting. As an example, the setting of the resident area size register 52 is set to “0” in the embodiment of FIG. 2, or the setting of the resident area final address register in the embodiment of FIG. It can be easily realized by the same method as the setting of the resident area start address register. It can also be implemented by providing means for determining whether the resident area is valid or invalid.

そこで、図2の実施形態に常駐領域有効レジスタを加えた実施形態を示す構成図を図9に示す。図9の実施形態に示されている置き換え候補制御回路5は、常駐させる領域を設定する常駐領域設定レジスタ50と、CPUアドレスが前記常駐領域か否かを判定する比較器53と、ウエイ選択を制御するウエイ選択回路54、常駐領域設定レジスタ50の設定を有効にするか無効にするかを設定する常駐領域有効レジスタ56、常駐領域設定レジスタ50の設定と常駐領域有効レジスタ56の設定の積をとるためのAND回路57で構成されている。   FIG. 9 shows a configuration diagram showing an embodiment in which a resident area valid register is added to the embodiment of FIG. The replacement candidate control circuit 5 shown in the embodiment of FIG. 9 includes a resident area setting register 50 for setting a resident area, a comparator 53 for determining whether or not the CPU address is the resident area, and way selection. The product of the setting of the way selection circuit 54 to be controlled, the setting of the resident area valid register 56 for setting whether to enable or disable the setting of the resident area setting register 50, and the setting of the resident area setting register 50. It is composed of an AND circuit 57 for taking.

本実施形態では、図2の実施形態に常駐領域有効レジスタ56を付加することで実現でき、常駐領域を有効にするか無効にするかは常駐領域有効レジスタ56の値によって決まる。常駐領域有効レジスタ56の設定が非アクティブ状態の時、つまり‘0’に設定されている時に常駐領域設定レジスタ50の設定が無効となる。また常駐領域有効レジスタ56の設定がアクティブ状態の時、つまり‘1’に設定されている時に常駐領域設定レジスタ50の設定が有効となる。   This embodiment can be realized by adding the resident area valid register 56 to the embodiment of FIG. 2, and whether the resident area is valid or invalid is determined by the value of the resident area valid register 56. When the setting of the resident area valid register 56 is in an inactive state, that is, when it is set to ‘0’, the setting of the resident area setting register 50 becomes invalid. Also, when the setting of the resident area valid register 56 is in an active state, that is, when it is set to “1”, the setting of the resident area setting register 50 becomes valid.

以上のように、本発明において、キャッシュメモリ3に常駐させる命令コードやデータを置き換え候補から除外し、常駐可能とすることで、キャッシュヒット率の向上につながり、命令、データ処理の高速化が達成される。更に主記憶装置2へのアクセスを減ずることによるデータバスの状態変化の低減、及び主記憶装置2へのアクセスの低減により、消費電力の低減に関しても良好な効果が期待できる。また、回路的に予め決まったウエイから順番に常駐領域を設定し、置き換え候補から除外することを特長とするため実装に要する回路資源の簡素化も併せて達成することができる。   As described above, in the present invention, by removing the instruction codes and data that are resident in the cache memory 3 from the replacement candidates and making them resident, the cache hit rate is improved and the processing of instructions and data is accelerated. Is done. Furthermore, by reducing the data bus state change by reducing the access to the main storage device 2 and reducing the access to the main storage device 2, it is possible to expect a good effect in terms of reducing the power consumption. In addition, since a resident area is set in order from a circuit-determined way and excluded from replacement candidates, simplification of circuit resources required for mounting can be achieved.

本発明のキャッシュメモリ装置の構成図である。It is a block diagram of the cache memory device of the present invention. 本発明の置き換え候補制御回路の実施形態を示す構成図である。It is a block diagram which shows embodiment of the replacement candidate control circuit of this invention. 本発明のキャッシュメモリ装置におけるキャッシュメモリの常駐領域を示す図である。It is a figure which shows the resident area | region of the cache memory in the cache memory apparatus of this invention. 本発明のキャッシュメモリ装置を使用したシステムを動作させるためのプログラムの流れを示す図である。It is a figure which shows the flow of the program for operating the system using the cache memory apparatus of this invention. 複数の常駐領域の設定を可能にする実施形態を示す構成図である。It is a block diagram which shows embodiment which enables the setting of a several residence area. 本発明のキャッシュメモリ装置におけるキャッシュメモリの常駐領域が重なった場合の動作を示す図である。It is a figure which shows operation | movement when the resident area | region of the cache memory overlaps in the cache memory apparatus of this invention. 本発明のキャッシュメモリ装置の動作フローチャートである。4 is an operation flowchart of the cache memory device of the present invention. 図2の実施形態から、常駐領域の末端を最終アドレス指定とした場合の実施形態を示す構成図である。FIG. 3 is a configuration diagram showing an embodiment when the end of the resident area is set as a final address designation from the embodiment of FIG. 2. 図2の実施形態に常駐領域有効レジスタを加えた実施形態を示す構成図である。It is a block diagram which shows embodiment which added the resident area | region effective register to embodiment of FIG. 従来のキャッシュメモリ装置の構成図である。It is a block diagram of the conventional cache memory device. 従来のキャッシュメモリ装置におけるキャッシュメモリの置き換え候補を示す図である。It is a figure which shows the replacement candidate of the cache memory in the conventional cache memory device.

符号の説明Explanation of symbols

1 CPU
2 主記憶装置
3 キャッシュメモリ
4 キャッシュメモリ制御回路
5 置き換え候補制御回路
11 キャッシュメモリ上の常駐領域
12 キャッシュメモリ上の置き換え候補
111 キャッシュメモリ上の1番目の常駐領域
112 キャッシュメモリ上の2番目の常駐領域
113 キャッシュメモリ上の3番目の常駐領域
114 キャッシュメモリ上の4番目の常駐領域
50 常駐領域設定レジスタ
51 常駐領域先頭アドレスレジスタ
52 常駐領域サイズレジスタ
53 比較器
54 ウエイ選択回路
55 常駐領域最終アドレスレジスタ
56 常駐領域有効レジスタ
57 AND回路
501 複数個の常駐領域設定レジスタ
531 複数個の比較器
541 ウエイ選択回路
1 CPU
2 Main storage device 3 Cache memory 4 Cache memory control circuit 5 Replacement candidate control circuit 11 Resident area on cache memory 12 Replacement candidate on cache memory 111 First resident area on cache memory 112 Second resident area on cache memory Area 113 Third resident area on cache memory 114 Fourth resident area on cache memory 50 Resident area setting register 51 Resident area head address register 52 Resident area size register 53 Comparator 54 Way selection circuit 55 Resident area last address register 56 Resident area valid register 57 AND circuit 501 Plural resident area setting register 531 Plural comparators 541 Way selection circuit

Claims (7)

少なくとも常駐領域を設定するための常駐命令コードを含む、命令コード或いはデータを処理する CPUと、
前記命令コード或いはデータを一時的に記憶する2つ以上のウエイを有するキャッシュメモリと、
前記キャッシュメモリの置き換え制御及び読み出し制御を行うためのキャッシュメモリ制御回路と、
前記常駐命令コードにより、予め定められた領域に常駐領域を設定する置き換え候補制御手段を備えたことを特徴とするキャッシュメモリ装置。
A CPU for processing instruction codes or data, including at least a resident instruction code for setting a resident area;
A cache memory having two or more ways for temporarily storing the instruction code or data;
A cache memory control circuit for performing replacement control and read control of the cache memory;
A cache memory device comprising replacement candidate control means for setting a resident area in a predetermined area by the resident instruction code.
前記置き換え候補制御手段は、前記常駐命令コードにより常駐領域を設定する常駐領域設定手段と、置き換え動作を行うためのウエイを選択するウエイ選択手段とを有することを特徴とする請求項1に記載のキャッシュメモリ装置。 The replacement candidate control means includes resident area setting means for setting a resident area by the resident instruction code, and way selection means for selecting a way for performing a replacement operation. Cache memory device. 前記ウエイ選択手段は、前記常駐命令コード実行時には前記常駐領域候補のウエイが回路的に予め一意に決まっており、前記常駐命令コード非実行時で置き換え動作時には前記常駐領域を除外したウエイを選択することを特徴とする請求項2に記載のキャッシュメモリ装置。 The way selection means uniquely selects the way of the resident area candidate in advance when executing the resident instruction code, and selects a way excluding the resident area during replacement operation when the resident instruction code is not executed. The cache memory device according to claim 2. 前記予め定められた常駐領域は、前記ウエイ選択手段によって選択されたウエイ上の連続的なラインであることを特徴とする請求項1から請求項3のいずれかに記載のキャッシュメモリ装置。 4. The cache memory device according to claim 1, wherein the predetermined resident area is a continuous line on the way selected by the way selection means. 前記常駐領域設定手段が、常駐領域を決定するための先頭アドレス、及び領域のサイズ指定することである特徴とする請求項2から請求項4のいずれかに記載のキャッシュメモリ装置。 5. The cache memory device according to claim 2, wherein the resident area setting means designates a head address for determining a resident area and a size of the area. 前記常駐領域設定手段が、常駐領域を決定するための先頭アドレス、及び終了アドレスを指定することである特徴とする請求項2から請求項4のいずれかに記載のキャッシュメモリ装置。 5. The cache memory device according to claim 2, wherein the resident area setting means designates a start address and an end address for determining a resident area. 前記置き換え候補制御手段内に、前記キャッシュメモリに常駐させる命令コード又はデータを格納されている領域設定の有効、無効を決定する設定手段を備え、前記設定手段を非アクティブにしたときに前記常駐領域設定手段による常駐設定が無効になることを特徴とする請求項5又は請求項6に記載のキャッシュメモリ装置。 The replacement candidate control means includes setting means for determining validity / invalidity of an area setting in which an instruction code or data to be resident in the cache memory is stored, and the resident area when the setting means is deactivated 7. The cache memory device according to claim 5, wherein the resident setting by the setting unit is invalidated.
JP2005105826A 2005-04-01 2005-04-01 Cache memory device Withdrawn JP2006285727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005105826A JP2006285727A (en) 2005-04-01 2005-04-01 Cache memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005105826A JP2006285727A (en) 2005-04-01 2005-04-01 Cache memory device

Publications (1)

Publication Number Publication Date
JP2006285727A true JP2006285727A (en) 2006-10-19

Family

ID=37407578

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005105826A Withdrawn JP2006285727A (en) 2005-04-01 2005-04-01 Cache memory device

Country Status (1)

Country Link
JP (1) JP2006285727A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152780A (en) * 2006-12-14 2008-07-03 Arm Ltd Lockdown control of multi-way set associative cache memory
JP2010191754A (en) * 2009-02-19 2010-09-02 Mitsubishi Electric Corp Cache storage
WO2014056201A1 (en) * 2012-10-12 2014-04-17 Mediatek Inc. Layout module for printed circuit board

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152780A (en) * 2006-12-14 2008-07-03 Arm Ltd Lockdown control of multi-way set associative cache memory
JP2010191754A (en) * 2009-02-19 2010-09-02 Mitsubishi Electric Corp Cache storage
WO2014056201A1 (en) * 2012-10-12 2014-04-17 Mediatek Inc. Layout module for printed circuit board
CN106227966A (en) * 2012-10-12 2016-12-14 联发科技股份有限公司 Printed circuit board (PCB), the method that layout designs is provided and the method for distribution coiling module

Similar Documents

Publication Publication Date Title
JP2554449B2 (en) Data processing system having cache memory
US9311246B2 (en) Cache memory system
JP4829191B2 (en) Cash system
US20180300258A1 (en) Access rank aware cache replacement policy
US9396117B2 (en) Instruction cache power reduction
US8180965B2 (en) System and method for cache access prediction
US6321328B1 (en) Processor having data buffer for speculative loads
US8364904B2 (en) Horizontal cache persistence in a multi-compute node, symmetric multiprocessing computer
US20090177842A1 (en) Data processing system and method for prefetching data and/or instructions
US8151058B2 (en) Vector computer system with cache memory and operation method thereof
KR20210011060A (en) Selective performance of pre-branch prediction based on the type of branch instruction
US9690707B2 (en) Correlation-based instruction prefetching
JP4009306B2 (en) Cache memory and control method thereof
JP2007272280A (en) Data processor
JP2011257800A (en) Cache memory device, program conversion device, cache memory control method, and program conversion method
JP2006285727A (en) Cache memory device
JP2007272681A (en) Cache memory device, and method for replacing cache line in same
JP5699854B2 (en) Storage control system and method, replacement method and method
US20110320747A1 (en) Identifying replacement memory pages from three page record lists
JPH11232171A (en) Information processing system
US20050268021A1 (en) Method and system for operating a cache memory
US20160210246A1 (en) Instruction cache with access locking
JP5116275B2 (en) Arithmetic processing apparatus, information processing apparatus, and control method for arithmetic processing apparatus
JP4765249B2 (en) Information processing apparatus and cache memory control method
US20170357585A1 (en) Setting cache entry age based on hints from another cache level

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080603