JPH1055308A - Cache memory - Google Patents
Cache memoryInfo
- Publication number
- JPH1055308A JPH1055308A JP8211156A JP21115696A JPH1055308A JP H1055308 A JPH1055308 A JP H1055308A JP 8211156 A JP8211156 A JP 8211156A JP 21115696 A JP21115696 A JP 21115696A JP H1055308 A JPH1055308 A JP H1055308A
- Authority
- JP
- Japan
- Prior art keywords
- valid bit
- page
- data
- register
- read
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
(57)【要約】
【課題】キャッシュメモリの全容量だけループ・プログ
ラムを格納してループ処理する場合でも、ループ・プロ
グラムの配置状況に依存するキャッシュ・ミスの発生を
防止し、広い範囲のループ・プログラムに対応してヒッ
ト率を高める。
【解決手段】2個の上位アドレスレジスタ111,112 と、
複数ワード格納用のデータメモリ12と、2個の有効ビッ
トレジスタ131,132 と、2個のコンパレータ141,142
と、コンパレータが一致判定し、データメモリからの読
み出し対象ワードの有効ビットが有効の場合にデータメ
モリ出力を通過させる2個のゲート回路151,152 と、2
個の有効ビットレジスタのどちらが現頁のタグであるか
を示す頁フラグ回路16と、コンパレータの判定結果に応
じてデータメモリに対する読み出し/格納および有効ビ
ットレジスタのフラグ、頁フラグ回路のフラグを制御す
るキャッシュ制御回路17とを具備する。
(57) [Summary] [PROBLEMS] To prevent occurrence of a cache miss depending on the arrangement state of a loop program and to store a loop program in a wide range even when a loop program is stored by the entire capacity of a cache memory and loop processing is performed.・ Improve the hit rate corresponding to the program. SOLUTION: Two upper address registers 111 and 112,
Data memory 12 for storing a plurality of words, two valid bit registers 131 and 132, and two comparators 141 and 142
And two comparators 151 and 152 that pass the data memory output when the valid bit of the word to be read from the data memory is valid.
A page flag circuit 16 indicating which of the valid bit registers is the tag of the current page, and reading / storing the data memory and controlling the flag of the valid bit register and the flag of the page flag circuit in accordance with the judgment result of the comparator And a cache control circuit 17.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、キャッシュメモリ
に係り、特に有効ビット制御用のレジスタを設けた有効
ビット制御方式のキャッシュメモリに関するもので、例
えばコンピュータシステムに使用されるものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory, and more particularly to a cache memory of a valid bit control system provided with a register for controlling a valid bit, which is used, for example, in a computer system.
【0002】[0002]
【従来の技術】コンピュータシステムにおいて、マイク
ロプロセッサ(MPU)の動作速度とメインメモリの動
作速度との乖離は大きくなる一方であり、両者の間のデ
ータ転送速度がシステム全体の性能を左右するボトルネ
ックになっている。これを解消するための様々な改良が
なされており、その代表的なものは、MPUのサイクル
タイムとメインメモリのアクセス時間との差を埋めるた
めに両者の間に置かれ、MPUの使用効率の向上を可能
とする高速メモリ(キャッシュメモリ)の採用である。2. Description of the Related Art In a computer system, the difference between the operating speed of a microprocessor (MPU) and the operating speed of a main memory is increasing, and the data transfer speed between the two affects the performance of the entire system. It has become. Various improvements have been made to solve this problem. A typical example is placed between the MPU to fill the difference between the cycle time of the MPU and the access time of the main memory. This is the adoption of a high-speed memory (cache memory) that enables improvement.
【0003】現在、キャッシュメモリは3種類が知られ
ており、第1は、MPUからもメインメモリからも独立
したスタティック型メモリ(SRAM)で構成するもの
であり、第2は、MPUチップ上に搭載されるオンチッ
プキャッシュあるいはエンベデッドメモリと称されるS
RAMで構成するもの(実際は、キャッシュメモリを搭
載したMPUが、さらに、別チップのSRAMキャッシ
ュを持つ場合もある。)であり、第3は、ダイナミック
型メモリ(DRAM)のチップ上に搭載されるSRAM
セルで構成するものである。上記3種類のキャッシュメ
モリのうちでは、第2あるいは第3の構成が、コンパク
トであるので、ワークステーションやパーソナル・コン
ピュータの高級機などに用いられる。At present, three types of cache memories are known. The first type is a static type memory (SRAM) which is independent from the MPU and the main memory, and the second type is a cache type memory on the MPU chip. S called on-chip cache or embedded memory mounted
The memory is composed of a RAM (actually, an MPU having a cache memory may further have an SRAM cache of another chip). The third is mounted on a dynamic memory (DRAM) chip. SRAM
It consists of cells. Of the above three types of cache memories, the second or third configuration is compact, and is therefore used for workstations and high-end personal computers.
【0004】図2ないし図4は、キャッシュメモリの3
通りの基本的な構成(ダイレクトマップ方式、2ウエイ
セット・アソシアティブ方式、フル・アソシアティブ方
式)を示している。以下、キャッシュメモリの容量を1
28ワードと仮定して説明する。FIGS. 2 to 4 show the cache memory 3.
3 shows a basic configuration (direct map system, 2-way set associative system, full associative system). Hereinafter, the capacity of the cache memory is set to 1
The description will be made assuming 28 words.
【0005】図2に示すダイレクトマップ方式のキャッ
シュメモリにおいて、命令アドレスレジスタ50は、外
部記憶装置(図示せず)から読み出されたプログラム命
令のうち、次に実行すべき命令を一群として指定するた
めの上位アドレス(タグアドレス)および前記上位アド
レスで指定される一群の命令の各々を指定する下位アド
レスで構成されるアドレスを格納するものである。In the direct map type cache memory shown in FIG. 2, an instruction address register 50 designates, as a group, instructions to be executed next among program instructions read from an external storage device (not shown). And an address composed of a lower address for designating each of a group of instructions designated by the upper address.
【0006】複数の上位アドレスレジスタ(タグアドレ
スレジスタ)51は、前記命令アドレスレジスタ50か
ら供給されるタグアドレスを記憶する。複数のデータメ
モリ(本来のキャッシュメモリ部)52は、前記複数の
タグアドレスレジスタ51に対応して設けられ、タグア
ドレスで指定される一群の命令を先取りして記憶し、記
憶した一群の命令の各々が命令アドレスレジスタ50か
ら供給される下位アドレスに応じて指定される。[0006] A plurality of upper address registers (tag address registers) 51 store tag addresses supplied from the instruction address register 50. A plurality of data memories (original cache memory units) 52 are provided corresponding to the plurality of tag address registers 51, prefetch and store a group of instructions specified by a tag address, and store a group of instructions stored therein. Each is specified according to the lower address supplied from the instruction address register 50.
【0007】コンパレータ53は、前記複数のタグアド
レスレジスタ51のうちの選択指定されたタグアドレス
レジスタに記憶されているタグアドレスと前記命令アド
レスレジスタ50から供給されるタグアドレスとを比較
し、両タグアドレスの一致/不一致(ヒット/ミス)を
判定する。A comparator 53 compares a tag address stored in a tag address register selected and designated among the plurality of tag address registers 51 with a tag address supplied from the instruction address register 50, and compares both tag addresses. Judgment of address match / mismatch (hit / miss).
【0008】さらに、コンパレータ53の判定結果が一
致である場合には、当該一致に係るタグアドレスを記憶
していたタグアドレスレジスタ51に対応するデータメ
モリ52を命令アドレスレジスタ50から供給される下
位アドレスに応じて指定して当該データメモリ52に記
憶されている命令の1つを出力し、コンパレータ53の
判定結果が不一致である場合には、命令アドレスレジス
タ50から供給されるアドレスに応じて外部記憶装置か
ら命令を読み出して出力するとともに、この読み出した
命令を当該不一致に係るタグアドレスを記憶していたタ
グアドレスレジスタ51に対応するデータメモリ52に
記憶させるように制御するキャッシュ制御回路(図示せ
ず)が設けられている。Further, when the result of the determination by the comparator 53 is a match, the data memory 52 corresponding to the tag address register 51 storing the tag address corresponding to the match is stored in the lower address supplied from the instruction address register 50. , And outputs one of the instructions stored in the data memory 52. If the result of the determination by the comparator 53 does not match, the external storage is performed according to the address supplied from the instruction address register 50. A cache control circuit (not shown) that reads and outputs an instruction from the device and controls the read instruction to be stored in the data memory 52 corresponding to the tag address register 51 that stores the tag address related to the mismatch. ) Is provided.
【0009】なお、前記各データメモリ52は、外部記
憶装置から読み出されたデータを1ワード単位で記憶す
る容量を有する。即ち、上記ダイレクトマップ方式のキ
ャッシュメモリは、命令アドレスレジスタ50に格納さ
れたアドレスの下位ビットを使ってタグアドレスレジス
タ51の位置を指定し、指定されたタグアドレスレジス
タの記憶内容と命令アドレスレジスタ50に格納された
アドレスの上位ビット(タグアドレス)とをコンパレー
タ53で比較する。Each of the data memories 52 has a capacity to store data read from an external storage device in word units. That is, the direct map type cache memory specifies the position of the tag address register 51 using the lower bits of the address stored in the instruction address register 50, and stores the contents of the specified tag address register and the instruction address register 50. Are compared by the comparator 53 with the upper bit (tag address) of the address stored in.
【0010】そして、上記コンパレータ53の比較結果
が一致(ヒット)時、つまり、記憶装置にアクセスしよ
うとするタグアドレスがタグレジスタに割り当てられて
いる場合には、データメモリ52に格納されている情報
を出力するように制御する。When the comparison result of the comparator 53 matches (hit), that is, when the tag address for accessing the storage device is assigned to the tag register, the information stored in the data memory 52 is used. Is controlled to be output.
【0011】これに対して、判定の結果が不一致(ミ
ス)時、つまり、データメモリ52に格納されていない
情報が必要な場合には、必要な情報を記憶している外部
記憶装置内の別の位置からデータを読み出し、これをデ
ータメモリ52に格納すると共に出力するように制御す
る。On the other hand, when the result of the determination is a mismatch (miss), that is, when information that is not stored in the data memory 52 is required, another information is stored in the external storage device storing the required information. Is read from the position, and is controlled so as to be stored in the data memory 52 and output.
【0012】しかし、上記したようなダイレクトマップ
方式は、下位数ビットが共通なアドレスを複数参照する
時やそのアドレスを往復してプログラムがジャンプする
時に競合が起りこるという問題がある。However, the direct map method as described above has a problem in that when a plurality of lower bits refer to a plurality of common addresses or when a program jumps back and forth between the addresses, a conflict occurs.
【0013】図3に示す2ウエイセット・アソシアティ
ブ方式のキャッシュメモリは、ダイレクトマップ方式に
おける複数のタグアドレスレジスタ51および複数のデ
ータメモリ52を2組に分割し、2組にそれぞれコンパ
レータ53を設けることにより、下位数ビットが共通な
アドレスを2つまで競合を避けて格納し得るように拡張
したものである。The cache memory of the two-way set associative system shown in FIG. 3 is obtained by dividing a plurality of tag address registers 51 and a plurality of data memories 52 in a direct map system into two sets and providing a comparator 53 in each of the two sets. Thus, the lower few bits are expanded so that up to two common addresses can be stored while avoiding contention.
【0014】図4に示すフル・アソシアティブ方式は、
ダイレクトマップ方式における複数のタグアドレスレジ
スタ51および複数のデータメモリ52を各一個づつの
組合わせからなる複数組に分割し、複数組にそれぞれコ
ンパレータ53を設けることにより、下位数ビットが共
通なアドレスの全てを格納し得るように拡張したもので
ある。The full associative method shown in FIG.
The plurality of tag address registers 51 and the plurality of data memories 52 in the direct map system are divided into a plurality of sets each including one combination, and the plurality of sets are provided with the comparators 53, respectively. It is an extension that can store everything.
【0015】上記各方式のキャッシュメモリを実現する
ためには、データメモリ52のほかに、ダイレクトマッ
プ方式ではタグアドレスレジスタ51を必要とし、アソ
シアティブ方式ではタグドレスレジスタ51およびコン
パレータ53を必要とする。In order to realize the cache memory of each of the above-described methods, in addition to the data memory 52, the tag address register 51 is required in the direct map method, and the tag address register 51 and the comparator 53 are required in the associative method.
【0016】しかし、キャッシュメモリの実装に本来必
要なのはデータメモリ52であり、そのほかに必要とす
る資源(タグアドレスレジスタ51やコンパレータ5
3)はオーバーヘッドであるので、なるべく減らすこと
が望ましい。そこで、データメモリ52で複数のデータ
を一括して扱うように変更すると、その分、タグアドレ
スレジスタ51やコンパレータ53の数を減らすことが
できる。However, the data memory 52 is essentially required for mounting the cache memory, and other necessary resources (the tag address register 51 and the comparator 5) are required.
Since 3) is overhead, it is desirable to reduce as much as possible. Therefore, when the data memory 52 is changed to handle a plurality of data collectively, the number of tag address registers 51 and comparators 53 can be reduced accordingly.
【0017】図5ないし図7は、上記の事実に着目して
構成されたキャッシュメモリとして、それぞれ対応して
図2ないし図4に示したダイレクトマップ方式、2ウエ
イセット・アソシアティブ方式、フル・アソシアティブ
方式のキャッシュメモリにおけるデータメモリを例えば
4ワード単位でラインメモリとして実装した例を示して
いる。FIGS. 5 to 7 show a cache memory constructed by focusing on the above facts, as a direct map system, a two-way set associative system, and a full associative system shown in FIGS. 2 to 4, respectively. 1 shows an example in which a data memory in a cache memory of a system is implemented as a line memory in units of, for example, four words.
【0018】このように1つのタグアドレスレジスタ5
1に対応するデータメモリ52のワード数を増やしてい
けば、タグアドレスレジスタ51の数を減らすことがで
きる。即ち、図3ないし図7に示す各方式とも、図2な
いし図4に示した各方式と比べて、タグアドレスレジス
タ51の数を1/4に減らすことができるが、図7の4
ワード単位のフル・アソシアティブ方式は、図4に示し
たフル・アソシアティブ方式と比べて、コンパレータ5
3の数も1/4に減らすことができる。As described above, one tag address register 5
If the number of words in the data memory 52 corresponding to 1 is increased, the number of tag address registers 51 can be reduced. That is, in each of the systems shown in FIGS. 3 to 7, the number of tag address registers 51 can be reduced to 1/4 as compared with each of the systems shown in FIGS.
The word-based full associative method is different from the full associative method shown in FIG.
The number of 3 can also be reduced to 1/4.
【0019】しかし、1つのタグアドレスレジスタ51
に対応するデータメモリ52で余りにも多くのデータを
一括して扱うことによりヒット/ミスを判定していたの
では、無駄が多すぎるので、各ワード毎に有効/無効判
定フラグ(ヒット/ミス判定フラグ)用の1ビットを追
加することが考えられる。However, one tag address register 51
If the hit / miss is determined by collectively handling too much data in the data memory 52 corresponding to the data memory 52, there is too much waste. Therefore, a valid / invalid determination flag (hit / miss determination It is conceivable to add one bit for (flag).
【0020】このような考えにより、フル・アソシアテ
ィブ方式を拡張していくと、図8に示すような構成のキ
ャッシュメモリが考えられる。図8に示すキャッシュメ
モリは、タグアドレスレジスタ51、多くのワード数の
データ(例えば64ワード単位)を一括して扱うデータ
メモリ52a、コンパレータ53の組合わせを2組設け
るとともに、各データメモリ52aに対応して有効ビッ
ト(バリッドビット)制御用のレジスタ71を設けたも
のである。When the full associative method is extended based on such a concept, a cache memory having a configuration as shown in FIG. 8 can be considered. The cache memory shown in FIG. 8 is provided with two combinations of a tag address register 51, a data memory 52a that collectively handles a large number of words of data (for example, in units of 64 words), and a comparator 53. Correspondingly, a register 71 for controlling a valid bit (valid bit) is provided.
【0021】このように有効ビット制御用のレジスタを
設けた有効ビット制御方式のキャッシュメモリは、外部
記憶装置内の連続した2ページ分の記憶領域にまたがる
アクセスがあった時に、タグアドレスレジスタ51が1
個ではページをまたいだ瞬間に全てのデータメモリ52
aの内容が無効となるので、これを避けるためにはタグ
アドレスレジスタ51を2個より少ない数に減らせな
い。As described above, in the cache memory of the effective bit control system provided with the register for the effective bit control, the tag address register 51 is used when the access is made over the storage area of two consecutive pages in the external storage device. 1
Individually, all data memory 52
Since the content of a becomes invalid, the tag address register 51 cannot be reduced to less than two in order to avoid this.
【0022】ところで、コンピュータ・プログラムは、
ループの処理に多くの時間を費やすので、ループ処理に
際してのキャッシュメモリのヒット率は重要であり、小
容量のキャッシュメモリであってもなるべく広い範囲の
ループに対応しておきたい。前記したように128ワー
ドの容量で有効ビット制御方式のキャッシュメモリを構
成すると、最大128ワードのループ・プログラムの全
てをキャッシュメモリに記憶することができる。但し、
これは、図9(a)に示すように、外部記憶装置内の連
続した2ページ分の記憶領域61内にループ・プログラ
ムが配置されて格納されている場合に限られ、図9
(b)に示すように、外部記憶装置内の連続した3ペー
ジ分の記憶領域61内にまたがってループ・プログラム
が配置されて格納されている場合には、ループ・プログ
ラムの総量が128ワード以内であっても、キャッシュ
動作にミスが生じる。By the way, the computer program is:
Since a lot of time is spent in loop processing, the hit rate of the cache memory during the loop processing is important, and even a small-capacity cache memory should support a wide range of loops as much as possible. When the effective bit control type cache memory is configured with a capacity of 128 words as described above, all of the loop program having a maximum of 128 words can be stored in the cache memory. However,
This is limited to the case where the loop program is arranged and stored in the storage area 61 for two consecutive pages in the external storage device as shown in FIG.
As shown in (b), when the loop program is arranged and stored in the storage area 61 for three consecutive pages in the external storage device, the total amount of the loop program is within 128 words. However, a miss occurs in the cache operation.
【0023】このような問題を解決するために、キャッ
シュメモリの容量自体を増やすことにより対応するのは
簡単であるが、キャッシュメモリの容量自体を増やすこ
となく、キャッシュメモリの全容量だけループ・プログ
ラムを格納し得る方式が望ましい。In order to solve such a problem, it is easy to cope with the problem by increasing the capacity of the cache memory itself. However, without increasing the capacity of the cache memory itself, the loop program is increased by the entire capacity of the cache memory. Is desirable.
【0024】[0024]
【発明が解決しようとする課題】上記したように従来の
有効ビット制御用のレジスタを設けた有効ビット制御方
式のキャッシュメモリは、キャッシュメモリの全容量以
下のループ・プログラムを格納した場合でも、ループ・
プログラムの配置状況によってはループ処理に際してキ
ャッシュ・ミスが生じるという問題があった。As described above, the conventional effective bit control type cache memory provided with the effective bit control register has a large number of loop programs even when a loop program of less than the full capacity of the cache memory is stored.・
There is a problem that a cache miss occurs during loop processing depending on the arrangement of programs.
【0025】本発明は上記の問題点を解決すべくなされ
たもので、キャッシュメモリの全容量だけループ・プロ
グラムを格納してループ処理する際に、ループ・プログ
ラムの配置状況に依存するキャッシュ・ミスの発生を防
止し、広い範囲のループ・プログラムに対応してヒット
率を高めることができ、パターン占有面積の一層の小型
化、チップコストの低減および動作の高速化を図り得る
有効ビット制御方式のキャッシュメモリを提供すること
を目的とする。The present invention has been made in order to solve the above-described problem. When a loop program is stored by the entire capacity of the cache memory and loop processing is performed, a cache miss depending on the arrangement state of the loop program is performed. Of the effective bit control method that can prevent the occurrence of a pattern, increase the hit rate corresponding to a wide range of loop programs, and further reduce the pattern occupation area, reduce the chip cost and increase the operation speed. It is an object to provide a cache memory.
【0026】[0026]
【課題を解決するための手段】本発明のキャッシュメモ
リは、外部記憶装置から読み出されたプログラム命令の
うち、次に実行すべき命令を一群として指定するための
上位アドレスおよび前記上位アドレスで指定される一群
の命令の各々を指定する下位アドレスで構成されるアド
レスデータを格納する命令アドレスレジスタと、前記命
令アドレスレジスタから供給される上位アドレスを記憶
するための第1の上位アドレスレジスタおよび第2の上
位アドレスレジスタと、前記命令アドレスレジスタに格
納されている上位アドレスで指定される1頁分の一群の
命令を記憶する容量を有し、前記外部記憶装置から読み
出された一群の命令を先取りして記憶し、記憶した一群
の命令の各々が前記命令アドレスレジスタから供給され
る下位アドレスに応じて指定される複数ワード格納用の
データメモリと、前記2個の上位アドレスレジスタに対
応して設けられ、前記外部記憶装置から読み出されて前
記データメモリに格納される各ワード毎に対応し付加さ
れている有効/無効ビットの一群を前記外部記憶装置か
ら読み出されるデータの頁切換に応じて交互に格納する
第1の有効ビットレジスタおよび第2の有効ビットレジ
スタと、前記2個の上位アドレスレジスタに対応して設
けられ、前記2個の上位アドレスレジスタにそれぞれ対
応して記憶されている上位アドレスと前記命令アドレス
レジスタから供給される上位アドレスとを比較し、両上
位アドレスの一致/不一致を判定する第1のコンパレー
タおよび第2のコンパレータと、前記第1のコンパレー
タの比較判定結果および前記データメモリからの読み出
し対象であるワードに対応して前記第1の有効ビットレ
ジスタに格納されている有効ビットが入力し、比較判定
入力が一致、有効ビット入力が有効の場合に前記データ
メモリからの読み出し出力を通過させる第1のゲート回
路と、前記第2のコンパレータの比較判定結果および前
記データメモリからの読み出し対象であるワードに対応
して前記第2の有効ビットレジスタに格納されている有
効ビットが入力し、比較判定入力が一致、有効ビット入
力が有効の場合に前記データメモリからの読み出し出力
を通過させる第2のゲート回路と、前記2個の有効ビッ
トレジスタのどちらが現頁のタグの役割を果たしている
かを示す頁フラグを出力する頁フラグ回路と、前記2個
のコンパレータのうちで判定対象となるコンパレータの
判定結果が一致である場合には、前記命令アドレスレジ
スタから供給される前記下位アドレスに応じて前記デー
タメモリに記憶されている命令の1つを読み出して出力
し、前記コンパレータの判定結果が不一致である場合に
は、前記命令アドレスレジスタから供給されるアドレス
に応じて前記外部記憶装置から命令を読み出して出力す
るとともに、この読み出した命令を前記データメモリに
記憶させるように制御するキャッシュ制御回路とを具備
することを特徴とする。SUMMARY OF THE INVENTION A cache memory according to the present invention comprises an upper address for designating, as a group, instructions to be executed next among program instructions read from an external storage device, and a higher address for designating the instructions. Instruction address register for storing address data composed of lower addresses designating each of a group of instructions to be executed, a first upper address register for storing an upper address supplied from the instruction address register, and a second upper address register for storing an upper address. And a capacity for storing a group of instructions for one page specified by an upper address stored in the instruction address register, and prefetching a group of instructions read from the external storage device. Each of the stored group of instructions is stored in a lower address supplied from the instruction address register. A data memory for storing a plurality of words specified in advance and a corresponding one of the two upper address registers are provided corresponding to each word read from the external storage device and stored in the data memory. A first valid bit register and a second valid bit register for alternately storing a group of added valid / invalid bits according to page switching of data read from the external storage device; and the two upper addresses A register is provided corresponding to a register, and an upper address stored in correspondence with each of the two upper address registers is compared with an upper address supplied from the instruction address register. A first comparator and a second comparator to be determined, a comparison determination result of the first comparator, and the data A valid bit stored in the first valid bit register is input corresponding to the word to be read from the memory, and when the comparison determination input matches and the valid bit input is valid, the data is read from the data memory. A first gate circuit for passing an output, a comparison result of the second comparator, and a valid bit stored in the second valid bit register corresponding to a word to be read from the data memory. The second gate circuit that passes the read output from the data memory when the comparison determination input matches and the valid bit input is valid, and which of the two valid bit registers plays the role of the tag of the current page A page flag circuit for outputting a page flag indicating whether or not the comparison is being performed; If the determination result is a match, one of the instructions stored in the data memory is read and output in accordance with the lower address supplied from the instruction address register, and if the determination result of the comparator does not match, A cache control circuit that reads and outputs an instruction from the external storage device in accordance with an address supplied from the instruction address register, and controls the read instruction to be stored in the data memory. It is characterized by having.
【0027】[0027]
【発明の実施の形態】以下、図面を参照して本発明の実
施の形態を詳細に説明する。図1は、本発明の第1の実
施の形態に係るコンピュータシステムにおける有効ビッ
ト制御方式のキャッシュメモリ(容量が例えば128ワ
ードである)およびそれと外部記憶装置20との接続関
係を示している。Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 shows a cache memory (capacity is, for example, 128 words) of a valid bit control method in a computer system according to a first embodiment of the present invention, and a connection relationship between the cache memory and an external storage device 20.
【0028】図1において、キャッシュメモリは、命令
アドレスレジスタ10、2個の上位アドレスレジスタ
(タグレジスタ)111、112、データメモリ12、
2個の有効ビットレジスタ131、132、2個のコン
パレータ141、142、2個のゲート回路151、1
52、頁フラグ回路16およびキャッシュ制御部17を
具備する。In FIG. 1, the cache memory includes an instruction address register 10, two upper address registers (tag registers) 111 and 112, a data memory 12,
Two valid bit registers 131, 132, two comparators 141, 142, two gate circuits 151, 1
52, a page flag circuit 16 and a cache control unit 17.
【0029】前記命令アドレスレジスタ10は、キャッ
シュ制御部17により読み出し制御される外部記憶装置
20からバス18に読み出されるプログラム命令のう
ち、次に実行すべき命令を一群として指定するための上
位アドレス(タグアドレス)および前記上位アドレスで
指定される一群の命令の各々を指定する下位アドレスで
構成されるアドレスデータ(例えば32ビット)を格納
するものである。本例では、前記上位アドレスは、外部
記憶装置20のデータの1頁分を指定するページアドレ
スである。The instruction address register 10 is a high-order address for designating, as a group, instructions to be executed next among program instructions read from the external storage device 20 and controlled by the cache control unit 17 to the bus 18. A tag address) and address data (for example, 32 bits) composed of a lower address designating each of the group of instructions designated by the upper address. In this example, the upper address is a page address that specifies one page of data in the external storage device 20.
【0030】前記2個の上位アドレスレジスタ(第1の
上位アドレスレジスタ111および第2の上位アドレス
レジスタ112)は、それぞれ前記命令アドレスレジス
タ10から供給されるタグアドレスを記憶する。The two upper address registers (the first upper address register 111 and the second upper address register 112) store the tag address supplied from the instruction address register 10, respectively.
【0031】前記データメモリ12は、本来のキャッシ
ュメモリ部であり、前記命令アドレスレジスタ10に格
納されているタグアドレスにより指定される1頁分の一
群の命令(128ワード分)を記憶する容量を有し、外
部記憶装置20から読み出された一群の命令を先取りし
て記憶し、記憶した一群の命令の各々が前記命令アドレ
スレジスタ10から供給される下位アドレスに応じて指
定される。The data memory 12 is an original cache memory unit, and has a capacity for storing a group of instructions (128 words) for one page specified by a tag address stored in the instruction address register 10. A group of instructions read from the external storage device 20 is prefetched and stored, and each of the stored group of instructions is designated according to a lower address supplied from the instruction address register 10.
【0032】前記2個の有効ビットレジスタ(第1の有
効ビットレジスタ131および第2の有効ビットレジス
タ132)は、外部記憶装置20から読み出されて前記
データメモリに格納される各ワード毎に対応し付加され
ている有効ビット(ヒット/ミス判定フラグビット)の
一群を外部記憶装置20から読み出されるデータの頁切
換に応じて交互に格納するものである。The two valid bit registers (the first valid bit register 131 and the second valid bit register 132) correspond to each word read from the external storage device 20 and stored in the data memory. A group of added valid bits (hit / miss determination flag bits) is alternately stored in accordance with page switching of data read from the external storage device 20.
【0033】前記2個のコンパレータ(第1のコンパレ
ータ141および第2のコンパレータ142)は、それ
ぞれ対応して前記2個の上位アドレスレジスタ111、
112に記憶されているタグアドレスと前記命令アドレ
スレジスタ10から供給されるタグアドレスとを比較
し、両タグアドレスの一致/不一致(ヒット/ミス)を
判定するものである。The two comparators (the first comparator 141 and the second comparator 142) correspond to the two upper address registers 111,
The tag address stored in the register address 112 is compared with the tag address supplied from the instruction address register 10 to determine a match / mismatch (hit / miss) between the two tag addresses.
【0034】前記2個のゲート回路のうちの第1のゲー
ト回路151は、前記第1のコンパレータ141の比較
判定結果およびデータメモリ12からの読み出し対象で
あるワードに対応して第1の有効ビットレジスタ131
に格納されている有効ビットが入力し、比較判定入力が
一致、有効ビット入力が有効の場合にデータメモリ12
からの読み出し出力を通過させて実行ユニット(例えば
MPU)に送り出すものである。A first gate circuit 151 of the two gate circuits has a first valid bit corresponding to the comparison result of the first comparator 141 and a word to be read from the data memory 12. Register 131
When the valid bit stored in the data memory 12 is input, the comparison determination input matches, and the valid bit input is valid, the data memory 12
And sends it to an execution unit (for example, an MPU) through the read output from the MPU.
【0035】前記2個のゲート回路のうちの第2のゲー
ト回路152は、前記第2のコンパレータ142の比較
判定結果およびデータメモリ12からの読み出し対象で
あるワードに対応して第2の有効ビットレジスタ132
に格納されている有効ビットが入力し、比較判定入力が
一致、有効ビット入力が有効の場合にデータメモリ12
からの読み出し出力を通過させて実行ユニットに送り出
すものである。The second gate circuit 152 of the two gate circuits has a second valid bit corresponding to the comparison result of the second comparator 142 and the word to be read from the data memory 12. Register 132
When the valid bit stored in the data memory 12 is input, the comparison determination input matches, and the valid bit input is valid, the data memory 12
And sends it to the execution unit by passing the read output from the execution unit.
【0036】前記頁フラグ回路16は、前記2個の有効
ビットレジスタ131、132のどちらが現頁のタグの
役割を果たしているかを示す頁フラグを出力するもので
あり、例えばフリップフロップ回路(FF)が使用さ
れ、その出力(頁フラグ)が頁切換毎に反転するように
制御される。The page flag circuit 16 outputs a page flag indicating which of the two valid bit registers 131 and 132 plays the role of the tag of the current page. For example, a flip-flop circuit (FF) And the output (page flag) is controlled so as to be inverted every time the page is switched.
【0037】前記キャッシュ制御部17は、次の各機能
および必要に応じてライトバック機能を備えている。 (1)前記2個のコンパレータ141、142のうちの
判定対象となるコンパレータの判定結果が一致である場
合には、命令アドレスレジスタ10から供給される下位
アドレスに応じてデータメモリ12に記憶されている命
令の1つを読み出して出力する第1の制御機能。The cache control unit 17 has the following functions and, if necessary, a write-back function. (1) If the judgment results of the comparators to be judged out of the two comparators 141 and 142 are coincident, they are stored in the data memory 12 according to the lower address supplied from the instruction address register 10. A first control function for reading and outputting one of the instructions present.
【0038】(2)前記2個のコンパレータ141、1
42のうちの判定対象となるコンパレータの判定結果が
不一致である場合には、命令アドレスレジスタ10から
供給されるアドレスに応じて外部記憶装置20から命令
を読み出して出力するとともに、この読み出した命令を
データメモリ12に記憶させるように制御する第2の制
御機能。(2) The two comparators 141, 1
When the judgment result of the comparator to be judged out of 42 is not coincident, the instruction is read out from the external storage device 20 in accordance with the address supplied from the instruction address register 10, and is output. A second control function for controlling the data to be stored in the data memory 12;
【0039】(3)外部記憶装置20から読み出される
データの頁切換に応じて2個の有効ビットレジスタ13
1、132に交互に有効/無効ビットの一群を格納する
ように制御する第3の制御機能。(3) Two valid bit registers 13 according to page switching of data read from the external storage device 20
A third control function for controlling a group of valid / invalid bits to be alternately stored in 1, 132.
【0040】(4)外部記憶装置20から読み出される
データの頁切換毎に頁フラグ回路16の頁フラグ出力が
反転するように制御する第4の制御機能。また、前記デ
ータメモリ12の読みだし出力は出力バッファ回路(図
示せず)に入り、この出力バッファ回路をコンパレータ
141あるいは142の一致信号出力により活性化する
ように構成してもよい。また、コンパレータ141ある
いは142の不一致信号出力をバッファ回路(図示せ
ず)を介してウエイト信号として出力することによりM
PUをウエイト状態にするように構成してもよい。(4) A fourth control function for controlling the page flag output of the page flag circuit 16 to be inverted every time the page of data read from the external storage device 20 is switched. Further, the read output of the data memory 12 may enter an output buffer circuit (not shown), and the output buffer circuit may be activated by the output of a coincidence signal from the comparator 141 or 142. By outputting the mismatch signal output of the comparator 141 or 142 as a wait signal via a buffer circuit (not shown),
The PU may be configured to be in the wait state.
【0041】上記した構成のキャッシュメモリにおいて
は、2個の上位アドレスレジスタ111、112および
2個の有効ビットレジスタ131、132に対して、1
個のデータメモリ12を共用しているので、見掛け上は
各タグアドレスに対応するワード数が前述した従来例の
64ワードの倍の128ワードになっているが、従来例
の有効ビット制御方式よりも制御が若干複雑になる。In the cache memory having the above-described configuration, one upper address register 111, 112 and two valid bit registers 131, 132
Since the number of data memories 12 is shared, the number of words corresponding to each tag address is apparently 128 words, which is twice the 64 words of the above-described conventional example. Also, the control becomes slightly complicated.
【0042】具体的には、一方の有効ビットレジスタ1
31あるいは132において現頁のデータでヒットして
いるワードの有効ビットが有効状態(例えば“1”状
態)にセットされる毎に、他方の有効ビットレジスタ1
32あるいは131において対応するワードの有効ビッ
トを強制的にリセット状態(例えば“0”状態)にクリ
アしなければならない。つまり、1個のデータメモリ1
2を共用する2個の有効ビットレジスタ131、132
における各有効ビットを排他的に有効状態にセットする
必要がある。More specifically, one valid bit register 1
Each time the valid bit of the word hit by the data of the current page in 31 or 132 is set to a valid state (for example, "1" state), the other valid bit register 1
At 32 or 131, the valid bit of the corresponding word must be forcibly cleared to the reset state (for example, "0" state). That is, one data memory 1
2 effective bit registers 131 and 132 sharing
Must be exclusively set to the valid state.
【0043】このような制御により、単純なループ・プ
ログラムの場合には、外部記憶装置20から読み出され
るデータが別の頁のデータに切り替わった場合でも、直
前に使用されていた頁のデータ(命令)を有効に活用す
ることが可能になる。With this control, in the case of a simple loop program, even if the data read from the external storage device 20 is switched to the data of another page, the data (instruction) of the page used immediately before ) Can be used effectively.
【0044】ここで、上記キャッシュメモリは命令用キ
ャッシュメモリであり、外部記憶装置20への書込みは
発生しないものと仮定して具体的な動作例を説明する。
2個の有効ビットレジスタ131、132は、データメ
モリ12に対称的に接続されているので、リセット直後
にはどちらが現頁用となってもよく、キャッシュ動作時
に現頁/前頁のタグの役割を交互に交替しながら働く。Here, a specific operation example will be described on the assumption that the cache memory is an instruction cache memory and writing to the external storage device 20 does not occur.
Since the two valid bit registers 131 and 132 are symmetrically connected to the data memory 12, whichever may be used for the current page immediately after reset, the role of the tag of the current page / previous page during the cache operation. Work alternately.
【0045】頁フラグ回路16は、頁切換毎に出力が反
転するように制御されるので、その出力を2個の有効ビ
ットレジスタ131、132のどちらが現頁のタグの役
割を果たしているかを示す頁フラグとして使用できる。Since the page flag circuit 16 is controlled so that the output is inverted every time the page is switched, the output of the page flag circuit 16 indicates which of the two valid bit registers 131 and 132 plays the role of the tag of the current page. Can be used as a flag.
【0046】キャッシュ制御部17は、次の(1)〜
(4)に述べるような制御を行う。 (1)現頁/前頁ともミスの場合(リセット直後などが
該当する)。 今まで前頁のデータに対応していた一方の有効ビットレ
ジスタ131あるいは132の全ての有効ビットを一括
クリアして現頁のデータに対応させ、今まで現頁のデー
タに対応していた他方の有効ビットレジスタ132ある
いは131の全ての有効ビットを一括クリアして前頁の
データに対応させる。この後、外部記憶装置20からデ
ータを読み込み、更新したワードに対応する現頁用の有
効ビットレジスタの有効ビットを有効状態セットし、そ
れに対応する前頁用の有効ビットレジスタの有効ビット
をクリアする。 (2)現頁はヒットしたが、ワードはミスの場合(プロ
グラムが後方へジャンプせずに順次実行している場合な
どが該当する)。The cache control unit 17 performs the following (1) to
The control as described in (4) is performed. (1) When both the current page and the previous page are misses (such as immediately after reset). All valid bits of one valid bit register 131 or 132 corresponding to the data of the previous page are collectively cleared to correspond to the data of the current page, and the other of the valid bits corresponding to the data of the current page until now is cleared. All the valid bits of the valid bit register 132 or 131 are collectively cleared to correspond to the data of the previous page. Thereafter, data is read from the external storage device 20, the valid bit of the current page valid bit register corresponding to the updated word is set to a valid state, and the corresponding valid bit of the previous page valid bit register is cleared. . (2) When the current page is hit, but the word is missed (this is the case when the program is sequentially executed without jumping backward).
【0047】新たな番地に対応するデータはデータメモ
リ12内に存在しないので、外部記憶装置20からデー
タを読み込み、更新したワードに対応する現頁用の有効
ビットレジスタの有効ビットをセットし、それに対応す
る前頁用の有効ビットレジスタの有効ビットをクリアす
る。 (3)現頁がヒットし、ワードもヒットした場合(プロ
グラムが後方を参照してジャンプした後、あるいは、ル
ープ・プログラムの実行中などが該当する)。Since the data corresponding to the new address does not exist in the data memory 12, the data is read from the external storage device 20 and the valid bit of the current page valid bit register corresponding to the updated word is set. The corresponding valid bit of the valid bit register for the previous page is cleared. (3) When the current page is hit and the word is also hit (this applies after the program jumps by referring to the back, or during execution of a loop program).
【0048】キャッシュヒットであるので、外部記憶装
置20へアクセスすることなく、対応するデータメモリ
12からデータを実行部へ供給する。 (4)前頁がヒットし、ワードもヒットした場合(プロ
グラムが複数頁をまたいで後方を参照してジャンプした
後、あるいは、ループ・プログラムが実行された場合な
どが該当する)。Since this is a cache hit, data is supplied from the corresponding data memory 12 to the execution unit without accessing the external storage device 20. (4) When the previous page hits and the word hits (this applies after the program jumps by referring to the rear across a plurality of pages, or when a loop program is executed).
【0049】キャッシュヒットであるので、外部記憶装
置20へアクセスすることなく、対応するデータメモリ
12からデータを実行部へ供給する。また、前頁用の有
効ビットレジスタと現頁用の有効ビットレジスタとの役
割を交替させる。これにより、次回のアクセス時には前
記(3)に記載したようになるはずである。Since this is a cache hit, data is supplied from the corresponding data memory 12 to the execution unit without accessing the external storage device 20. Also, the roles of the valid bit register for the previous page and the valid bit register for the current page are switched. Thus, the next access should be as described in (3) above.
【0050】上記したようなキャッシュ制御動作によ
り、外部記憶装置20内の連続した2ページ分の記憶領
域内にループ・プログラムが配置されて格納されている
場合に限らず、図9(b)に示したように、外部記憶装
置20内の連続した3ページ分の記憶領域内にまたがっ
てループ・プログラムが配置されて格納されている場合
でも、データメモリ12内でのプログラムの格納位置に
かかわらずに常に128ワード分を後方参照することが
可能になるので、キャッシュ動作にミスが生じなくな
る。The cache control operation as described above is not limited to the case where the loop program is arranged and stored in the storage area for two consecutive pages in the external storage device 20. As shown, even when the loop program is arranged and stored in the storage area for three consecutive pages in the external storage device 20, regardless of the storage location of the program in the data memory 12, , It is possible to always refer backward to 128 words, so that no cache operation miss occurs.
【0051】即ち、上記キャッシュメモリによれば、デ
ータメモリ12の全容量だけループ・プログラムを格納
して広い範囲のループ・プログラムに対応してヒット率
を高めることが可能になり、しかも、キャッシュメモリ
の容量自体を増やす必要がないので、パターン占有面積
の一層の小型化、チップコストの増大の抑制、動作の高
速化を図ることが可能になる。In other words, according to the cache memory, it is possible to store the loop program by the entire capacity of the data memory 12 and to increase the hit rate corresponding to a wide range of the loop program. Since it is not necessary to increase the capacitance itself, it is possible to further reduce the pattern occupation area, suppress an increase in chip cost, and increase the operation speed.
【0052】[0052]
【発明の効果】上述したように本発明によれば、キャッ
シュメモリの全容量だけループ・プログラムを格納した
場合でも、ループ・プログラムの配置状況によってルー
プ処理に際してキャッシュ・ミスが生じなくなり、広い
範囲のループ・プログラムに対応してヒット率を高める
ことが可能になり、パターン占有面積の一層の小型化、
チップコストの抑制および動作の高速化を図り得る有効
ビット制御方式のキャッシュメモリを提供することがで
きる。As described above, according to the present invention, even when the loop program is stored by the entire capacity of the cache memory, a cache miss does not occur at the time of the loop processing depending on the arrangement state of the loop program. It is possible to increase the hit rate in response to loop programs, further reduce the pattern occupation area,
It is possible to provide an effective bit control type cache memory capable of suppressing chip cost and increasing operation speed.
【図面の簡単な説明】[Brief description of the drawings]
【図1】本発明の第1の実施の形態に係るキャッシュメ
モリを示すブロック図。FIG. 1 is a block diagram showing a cache memory according to a first embodiment of the present invention.
【図2】従来のキャッシュメモリの基本的な構成の一例
を示すブロック図。FIG. 2 is a block diagram showing an example of a basic configuration of a conventional cache memory.
【図3】従来のキャッシュメモリの基本的な構成の他の
例を示すブロック図。FIG. 3 is a block diagram showing another example of the basic configuration of a conventional cache memory.
【図4】従来のキャッシュメモリの基本的な構成のさら
に他の例を示すブロック図。FIG. 4 is a block diagram showing still another example of the basic configuration of the conventional cache memory.
【図5】図2のキャッシュメモリにおけるデータメモリ
を4ワード単位でラインメモリとして実装した例を示す
ブロック図。FIG. 5 is a block diagram showing an example in which the data memory in the cache memory of FIG. 2 is implemented as a line memory in units of four words.
【図6】図3のキャッシュメモリにおけるデータメモリ
を4ワード単位でラインメモリとして実装した例を示す
ブロック図。FIG. 6 is a block diagram showing an example in which the data memory in the cache memory of FIG. 3 is implemented as a line memory in units of four words.
【図7】図4のキャッシュメモリにおけるデータメモリ
を4ワード単位でラインメモリとして実装した例を示す
ブロック図。FIG. 7 is a block diagram showing an example in which the data memory in the cache memory of FIG. 4 is implemented as a line memory in units of four words.
【図8】図7中のフル・アソシアティブ方式のキャッシ
ュメモリを拡張して従来考えられている有効ビット制御
方式のキャッシュメモリを示すブロック図。FIG. 8 is a block diagram showing an effective bit control type cache memory that is conventionally considered by expanding the full associative type cache memory in FIG. 7;
【図9】図8の有効ビット制御方式のキャッシュメモリ
にループ・プログラムを記憶して処理する際、記憶装置
内のループ・プログラムの配置によって正常にキャッシ
ュ動作が行われる例とキャッシュミスが生じる例とを説
明するために示す図。9 shows an example in which a cache operation is normally performed and an example in which a cache miss occurs due to the arrangement of the loop program in the storage device when a loop program is stored and processed in the effective bit control type cache memory of FIG. FIG.
10…命令アドレスレジスタ、 111、112…上位アドレスレジスタ、 12…データメモリ(本来のキャッシュメモリ部)、 131、132…有効ビットレジスタ、 141、142…コンパレータ、 151、152…ゲート回路、 16…頁フラグ回路、 17…キャッシュ制御部、 20…外部記憶装置。 Reference numeral 10: Instruction address register, 111, 112: Upper address register, 12: Data memory (original cache memory unit), 131, 132: Valid bit register, 141, 142: Comparator, 151, 152: Gate circuit, 16: Page Flag circuit, 17: cache control unit, 20: external storage device.
Claims (3)
ム命令のうち、次に実行すべき命令を一群として指定す
るための上位アドレスおよび前記上位アドレスで指定さ
れる一群の命令の各々を指定する下位アドレスで構成さ
れるアドレスデータを格納する命令アドレスレジスタ
と、 前記命令アドレスレジスタから供給される上位アドレス
を記憶するための第1の上位アドレスレジスタおよび第
2の上位アドレスレジスタと、 前記命令アドレスレジスタに格納されている上位アドレ
スで指定される1頁分の一群の命令を記憶する容量を有
し、前記外部記憶装置から読み出された一群の命令を先
取りして記憶し、記憶した一群の命令の各々が前記命令
アドレスレジスタから供給される下位アドレスに応じて
指定される複数ワード格納用のデータメモリと、 前記2個の上位アドレスレジスタに対応して設けられ、
前記外部記憶装置から読み出されて前記データメモリに
格納される各ワード毎に対応し付加されている有効/無
効ビットの一群を格納する第1の有効ビットレジスタお
よび第2の有効ビットレジスタと、 前記2個の上位アドレスレジスタに対応して設けられ、
前記2個の上位アドレスレジスタにそれぞれ対応して記
憶されている上位アドレスと前記命令アドレスレジスタ
から供給される上位アドレスとを比較し、両上位アドレ
スの一致/不一致(ヒット/ミス)を判定する第1のコ
ンパレータおよび第2のコンパレータと、 前記第1のコンパレータの比較判定結果および前記デー
タメモリからの読み出し対象であるワードに対応して前
記第1の有効ビットレジスタに格納されている有効ビッ
トが入力し、比較判定入力が一致、有効ビット入力が有
効の場合に前記データメモリから読み出し対象であるワ
ードを選択して出力する第1のゲート回路と、 前記第2のコンパレータの比較判定結果および前記デー
タメモリからの読み出し対象であるワードに対応して前
記第2の有効ビットレジスタに格納されている有効ビッ
トが入力し、比較判定入力が一致、有効ビット入力が有
効の場合に前記データメモリから読み出し対象であるワ
ードを選択して出力する第2のゲート回路と、 前記2個の有効ビットレジスタのどちらが現頁のタグの
役割を果たしているかを示す頁フラグを出力する頁フラ
グ回路と、 前記2個のコンパレータのうちで判定対象となるコンパ
レータの判定結果が一致である場合には、前記命令アド
レスレジスタから供給される下位アドレスに応じてデー
タメモリに記憶されている命令の1つを読み出して出力
する第1の制御機能と、前記コンパレータの判定結果が
不一致である場合には、前記命令アドレスレジスタから
供給されるアドレスに応じて前記外部記憶装置から命令
を読み出して出力するとともに、この読み出した命令を
前記データメモリに記憶させるように制御する第2の制
御機能と、前記外部記憶装置から読み出されるデータの
頁切換に応じて前記2個の有効ビットレジスタに交互に
前記有効/無効ビットの一群を格納するように制御する
第3の制御機能、前記外部記憶装置から読み出されるデ
ータの頁切換毎に前記頁フラグ回路の頁フラグ出力が反
転するように制御する第4の制御機能とを備えたキャッ
シュ制御回路とを具備することを特徴とするキャッシュ
メモリ。1. An upper address for designating, as a group, instructions to be executed next among program instructions read from an external storage device, and a lower address for designating each of a group of instructions designated by the upper address. An instruction address register for storing address data composed of addresses; a first upper address register and a second upper address register for storing an upper address supplied from the instruction address register; It has a capacity to store a group of instructions for one page specified by the stored upper address, stores a group of instructions read out from the external storage device in advance, and stores the group of instructions. A data memory for storing a plurality of words each designated according to a lower address supplied from the instruction address register. And Li, provided corresponding to the two upper address register,
A first valid bit register and a second valid bit register for storing a group of valid / invalid bits added corresponding to each word read from the external storage device and stored in the data memory; Provided corresponding to the two upper address registers,
The upper address stored in correspondence with each of the two upper address registers is compared with the upper address supplied from the instruction address register, and a match / mismatch (hit / miss) of both upper addresses is determined. 1 and a second comparator, and a comparison result of the first comparator and a valid bit stored in the first valid bit register corresponding to a word to be read from the data memory. A first gate circuit that selects and outputs a word to be read from the data memory when the comparison determination input matches and the valid bit input is valid; a comparison determination result of the second comparator and the data; Stored in the second valid bit register corresponding to the word to be read from the memory. A second gate circuit that selects and outputs a word to be read from the data memory when the valid bit input is input, the comparison determination input matches, and the valid bit input is valid; and the two valid bits A page flag circuit that outputs a page flag indicating which of the registers plays the role of the tag of the current page; and if the determination result of the comparator to be determined among the two comparators is the same, the instruction A first control function for reading and outputting one of the instructions stored in the data memory according to the lower address supplied from the address register, and the instruction address when the determination result of the comparator does not match. A command is read and output from the external storage device according to the address supplied from the register, and the read command is read. A second control function for controlling the data to be stored in the data memory; and a group of the valid / invalid bits alternately stored in the two valid bit registers in accordance with page switching of data read from the external storage device. And a fourth control function of controlling the page flag output of the page flag circuit to be inverted every time a page of data read from the external storage device is switched. And a circuit.
一致である場合には、今まで前頁のデータに対応してい
た一方の有効ビットレジスタの全ての有効ビットを一括
クリアして現頁のデータに対応させ、今まで現頁のデー
タに対応していた他方の有効ビットレジスタの全ての有
効ビットを一括クリアして前頁のデータに対応させた
後、前記外部記憶装置からデータを読み込み、更新した
ワードに対応する現頁用の有効ビットレジスタの有効ビ
ットをセットし、それに対応する前頁用の有効ビットレ
ジスタの有効ビットをクリアする制御機能、 (2)前記コンパレータの判定結果が現頁は一致し、ワ
ードは不一致である場合には、前記外部記憶装置からデ
ータを読み込み、更新したワードに対応する現頁用の有
効ビットレジスタの有効ビットをセットし、それに対応
する前頁用の有効ビットレジスタの有効ビットをクリア
する制御機能、 (3)前記コンパレータの判定結果が現頁、ワードとは
一致した場合には、前記外部記憶装置へアクセスするこ
となく、対応するデータメモリからデータを実行部へ供
給する制御機能、 (4)前記コンパレータの判定結果が前頁、ワードとも
一致した場合には、前記外部記憶装置へアクセスするこ
となく、対応するデータメモリからデータを実行部へ供
給し、前頁用の有効ビットレジスタと現頁用の有効ビッ
トレジスタとの役割を交替させる制御機能を具備するこ
とを特徴とする請求項1記載のキャッシュメモリ。2. The cache control circuit according to claim 1, further comprising: (1) if the judgment result of said comparator does not match the current page / previous page, one of the valid bits corresponding to the data of the previous page. All the valid bits of the register are collectively cleared to correspond to the data of the current page, and all the valid bits of the other valid bit register corresponding to the data of the current page are collectively cleared to the data of the previous page. After the correspondence, the data is read from the external storage device, the valid bit of the current page valid bit register corresponding to the updated word is set, and the corresponding valid bit of the previous page valid bit register is cleared. (2) When the judgment result of the comparator is that the current page matches and the word does not match, the data is read from the external storage device and the updated word is read. A control function of setting the valid bit of the corresponding valid bit register for the current page and clearing the valid bit of the corresponding valid bit register for the previous page; (3) the judgment result of the comparator is the current page or word. A control function for supplying data from the corresponding data memory to the execution unit without access to the external storage device when the values match, and (4) when the determination result of the comparator also matches the previous page and word. A control function for supplying data from the corresponding data memory to the execution unit without accessing the external storage device, and for switching the role of the valid bit register for the previous page and the role of the valid bit register for the current page. The cache memory according to claim 1, wherein:
反転するように制御されるフリップフロップ回路である
ことを特徴とする請求項1または2記載のキャッシュメ
モリ。3. The cache memory according to claim 1, wherein the page flag circuit is a flip-flop circuit whose output is controlled every time a page is switched.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8211156A JPH1055308A (en) | 1996-08-09 | 1996-08-09 | Cache memory |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8211156A JPH1055308A (en) | 1996-08-09 | 1996-08-09 | Cache memory |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH1055308A true JPH1055308A (en) | 1998-02-24 |
Family
ID=16601325
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8211156A Pending JPH1055308A (en) | 1996-08-09 | 1996-08-09 | Cache memory |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH1055308A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004310739A (en) * | 2003-03-26 | 2004-11-04 | Matsushita Electric Ind Co Ltd | Semiconductor device |
| KR100486252B1 (en) * | 2002-08-12 | 2005-05-03 | 삼성전자주식회사 | Cash device and cash control method therefor |
| JP2022156719A (en) * | 2021-03-31 | 2022-10-14 | ラピステクノロジー株式会社 | Semiconductor memory device and instruction code reading method |
-
1996
- 1996-08-09 JP JP8211156A patent/JPH1055308A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100486252B1 (en) * | 2002-08-12 | 2005-05-03 | 삼성전자주식회사 | Cash device and cash control method therefor |
| JP2004310739A (en) * | 2003-03-26 | 2004-11-04 | Matsushita Electric Ind Co Ltd | Semiconductor device |
| JP2022156719A (en) * | 2021-03-31 | 2022-10-14 | ラピステクノロジー株式会社 | Semiconductor memory device and instruction code reading method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3323212B2 (en) | Data prefetching method and apparatus | |
| JP3236287B2 (en) | Multiprocessor system | |
| JPH0452741A (en) | Cache memory device | |
| JP2523814B2 (en) | Moveout system | |
| JPH07129464A (en) | Information processing equipment | |
| JPH1055308A (en) | Cache memory | |
| JP2003131945A (en) | Cache memory device | |
| EP0787326B1 (en) | System and method for processing of memory data and communication system comprising such system | |
| CA1299767C (en) | Cache memory control system | |
| US6279082B1 (en) | System and method for efficient use of cache to improve access to memory of page type | |
| JP2002041358A (en) | Processor system | |
| JPH0421222B2 (en) | ||
| JP3039391B2 (en) | Memory system | |
| JPH05158793A (en) | Parallel cache memory | |
| JP2972451B2 (en) | Cache memory control method by hardware control software | |
| JPH0652056A (en) | Cash memory system | |
| JPS61214039A (en) | Cache memory | |
| JPH04315235A (en) | Cache data replace method and cache data replace device for cache memory | |
| JPH07152650A (en) | Cache control unit | |
| JPH04205154A (en) | Microprocessor system | |
| JPH07219850A (en) | Main memory key storage method | |
| JPH02226447A (en) | Computer system and memory access therefor | |
| JPH0877072A (en) | Cache memory device | |
| JPH05225058A (en) | Storage controller | |
| JPH10133948A (en) | Cache memory device |