JPH0520193A - Cache memory device - Google Patents

Cache memory device

Info

Publication number
JPH0520193A
JPH0520193A JP3173964A JP17396491A JPH0520193A JP H0520193 A JPH0520193 A JP H0520193A JP 3173964 A JP3173964 A JP 3173964A JP 17396491 A JP17396491 A JP 17396491A JP H0520193 A JPH0520193 A JP H0520193A
Authority
JP
Japan
Prior art keywords
block
block address
address
adr
ways
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
JP3173964A
Other languages
Japanese (ja)
Inventor
Takashi Katsuyama
隆史 勝山
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP3173964A priority Critical patent/JPH0520193A/en
Publication of JPH0520193A publication Critical patent/JPH0520193A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To improve the program executing performance of a CPU by changing the number of ways and reducing the mishit frequency while the CPU is carrying out a program. CONSTITUTION:A comparator means 61 contained in a hit check means 60 compares with a block address included in a block address storage means 40 with a part corresponding to a block address part ADRa a necessary for selection of the selectable least number of ways. A comparator means 62 performs the comparison among the remaining part of the block address, the part ADRa corresponding to the remaining part of the block address, an element number EBN to which the means 60 belongs, and the number of ways set by a way number selecting/setting part 70. A deciding means 63 decides the coincidence or discordance between the comparison results of both means 61 and 62. Under such conditions, an access is given to the block data stored in a block data storage means 50.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、情報処理装置における
セット・アソシアティブ(Set Associati
ve)方式のキャッシュ・メモリ装置、特にプログラム
の実行中に複数のウェイ数に変更可能なキャッシュ・メ
モリ装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a set associative (Set Associate) in an information processing device.
The present invention relates to a ve) type cache memory device, and more particularly to a cache memory device capable of changing to a plurality of ways during the execution of a program.

【0002】[0002]

【従来の技術】従来、この種のキャッシュ・メモリ装置
に関する技術としては、例えば次のような文献に記載さ
れるものがあった。
2. Description of the Related Art Conventionally, as a technique relating to this type of cache memory device, for example, there is one described in the following document.

【0003】日経データプロ編“32ビットマイクロプ
ロセッサの全容−企業・戦略・技術・市場動向”、(昭
61−12−10)日経マグロウヒル(株)P.244
−245 キャッシュ・メモリ装置は、前記文献に記載されるよう
に、情報処理装置の中央処理装置(CPU)と主メモリ
との間におかれるアクセス時間の速いメモリである。こ
のキャッシュ・メモリ装置では、主メモリの内容の一部
を該キャッシュ・メモリ装置上にコピーして該主メモリ
へのアクセスのほとんどを該キャッシュ・メモリ装置へ
のアクセスで行えるようにすることで、CPUのプログ
ラム実行性能の向上を図るシステムである。
Nikkei DataPro, "32-bit Microprocessor Overview-Companies, Strategies, Technologies, Market Trends", (Sho 61-12-10) Nikkei McGraw-Hill Co., Ltd. 244
A -245 cache memory device is a fast access time memory located between a central processing unit (CPU) of an information processing device and a main memory, as described in the above document. In this cache memory device, by copying a part of the contents of the main memory onto the cache memory device so that most of the accesses to the main memory can be performed by accessing the cache memory device, This is a system for improving the program execution performance of the CPU.

【0004】セット・アソシアティブ方式のキャッシュ
・メモリ装置は、主メモリとキャッシュ・メモリ装置と
の内容の対応付けを行う方式の一つであり、その一構成
例を図2に示す。
The set associative cache memory device is one of the systems in which the contents of the main memory and the cache memory device are associated with each other, and one configuration example thereof is shown in FIG.

【0005】図2は、前記文献に記載された従来のセッ
ト・アソシアティブ方式のキャッシュ・メモリ装置の概
念を示す模式図である。
FIG. 2 is a schematic diagram showing the concept of the conventional set associative cache memory device described in the above document.

【0006】このキャッシュ・メモリ装置は、該キャッ
シュ・メモリ装置と主メモリとの対応を、予め定めた大
きさのブロック単位で行い、予め定められたウェイ数E
×セット数S分のブロック・アドレスを格納するアドレ
ス記憶部10と、予め定められたウェイ数E×セット数
S分のブロック・データを格納するデータ記憶部20と
を、備えている。アドレス記憶部10とデータ記憶部2
0は、一対一で対応付けられている。
In this cache memory device, the correspondence between the cache memory device and the main memory is performed in block units of a predetermined size, and a predetermined number of ways E is set.
An address storage unit 10 for storing block addresses for the number of sets S and a data storage unit 20 for storing block data for a predetermined number of ways E and the number of sets S are provided. Address storage unit 10 and data storage unit 2
0 is associated one-to-one.

【0007】この種のキャッシュ・メモリ装置では、主
メモリにおける実アドレスADR内のセット・アドレス
部ADRb でアドレス記憶部10をアクセスし、該アド
レス記憶部10から読出したブロック・アドレスBAD
と、実アドレスADRにおけるブロック・アドレス部A
DRa とを、複数の比較器30で比較を行う。この比較
で一致するものがあった場合をキャッシュ・ヒットと呼
び、アドレス記憶部10に対応するデータ記憶部20の
ブロック・データBDAを、実アドレスADRのブロッ
ク内アドレス部ADRc を使ってアクセスする。
In this type of cache memory device, the address storage unit 10 is accessed by the set address unit ADR b in the real address ADR in the main memory, and the block address BAD read from the address storage unit 10 is accessed.
And the block address part A in the real address ADR
A plurality of comparators 30 compare DR a . If there is a match in this comparison, it is called a cache hit, and the block data BDA of the data storage unit 20 corresponding to the address storage unit 10 is accessed using the in-block address unit ADR c of the real address ADR. ..

【0008】メモリ・アクセスの回数に占めるキャッシ
ュ・ヒットの回数の割合をヒット率と呼ぶ。もしもキャ
ッシュ・ヒットしなかった場合は、予め定められている
い方法で主メモリ、アドレス記憶部10、及びデータ記
憶部20の内容を更新する。CPUが主メモリへアクセ
スする実アドレスADRが、キャッシュ・メモリ装置に
ヒットし続ければ、CPUのプログラム実行性能の向上
を図ることができる。
The ratio of the number of cache hits to the number of memory accesses is called the hit rate. If there is no cache hit, the contents of the main memory, the address storage unit 10 and the data storage unit 20 are updated by a predetermined method. If the real address ADR at which the CPU accesses the main memory continues to hit the cache memory device, the program execution performance of the CPU can be improved.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、従来の
セット・アソシアティブ方式のキャッシュ・メモリ装置
では、アドレス記憶部10及びデータ記憶部20におけ
るウェイ数Eが固定されているので、CPUで実行する
プログラムによっては、ヒット率が低下して該CPUの
プログラム実行性能が落ちることがあり、それを解決す
ることが困難であった。
However, in the conventional set associative cache memory device, the number of ways E in the address storage unit 10 and the data storage unit 20 is fixed, so that the program executed by the CPU may be used. In some cases, the hit rate may decrease and the program execution performance of the CPU may deteriorate, which is difficult to solve.

【0010】本発明は、前記従来技術が持っていた課題
として、ウェイ数Eが固定されているのでヒット率が低
下するという点について解決したセット・アソシアティ
ブ方式のキャッシュ・メモリ装置を提供するものであ
る。
The present invention provides a set associative type cache memory device which solves the problem that the hit number decreases because the number of ways E is fixed as a problem that the prior art has. is there.

【0011】[0011]

【課題を解決するための手段】本発明は前記課題を解決
するために、ブロック・アドレス部、セット・アドレス
部及びブロック内アドレス部からなる実アドレスでアク
セスされる主メモリとの内容の対応付けを、セット・ア
ソシアティブ方式で行うキャッシュ・メモリ装置におい
て、選択可能な最大ウェイ数選択時に必要なビット幅の
ブロック・アドレス及びブロック・データをそれぞれ記
憶するブロック・アドレス記憶手段及びブロック・デー
タ記憶手段と、選択可能なウェイ数から1つのウェイ数
を選択・設定するウェイ数選択・設定手段と、選択可能
な最大ウェイ数と同数のヒット・チェック手段とを、備
えている。
In order to solve the above-mentioned problems, the present invention associates the contents with a main memory accessed by a real address consisting of a block address part, a set address part and an in-block address part. In a set associative cache memory device, a block address storage means and a block data storage means for respectively storing a block address and block data having a bit width required when selecting the maximum selectable number of ways. A way number selecting / setting means for selecting and setting one way number from the selectable number of ways, and hit checking means for the same number as the maximum selectable way number are provided.

【0012】ヒット・チェック手段は、第1,第2の比
較手段と判定手段とで構成されている。ここで、第1の
比較手段は、前記ブロック・アドレス記憶手段内のブロ
ック・アドレス、及び選択可能な最小ウェイ数選択時に
必要な前記ブロック・アドレス部に対応する部分を比較
する機能を有している。第2の比較手段は、前記ブロッ
ク・アドレスの残りの部分、その残りの部分に対応する
前記ブロック・アドレス部の部分、前記ヒット・チェッ
ク手段が属するエレメント番号、及び前記ウェイ数選択
・設定手段で設定されているウェイ数を比較する機能を
有している。判定手段は、前記第1と第2の比較手段の
両比較結果に対する一致/不一致の判定を行い、その一
致判定時に前記ブロック・データ記憶手段内のブロック
・データを前記ブロック内アドレス部を使ってアクセス
させる機能を有している。
The hit checking means is composed of first and second comparing means and a judging means. Here, the first comparing means has a function of comparing a block address in the block address storing means and a portion corresponding to the block address portion necessary when selecting the selectable minimum number of ways. There is. The second comparing means includes the remaining portion of the block address, the portion of the block address portion corresponding to the remaining portion, the element number to which the hit checking means belongs, and the way number selecting / setting means. It has a function to compare the number of ways set. The determination means determines whether the comparison results of both the first and second comparison means are coincident / non-coincidence, and at the time of the coincidence determination, the block data in the block data storage means is used by using the in-block address portion. It has the function to access.

【0013】[0013]

【作用】本発明によれば、以上のようにセット・アソシ
アティブ方式のキャッシュ・メモリ装置を構成したの
で、第1の比較手段は、ブロック・アドレス記憶手段内
のブロック・アドレスと、選択可能な最小ウェイ数選択
時に必要なブロック・アドレス部に対応する部分とを比
較し、その比較結果を判定手段へ送る。第2の比較手段
は、ブロック・アドレスの残りの部分と、その残りの部
分に対応するブロック・アドレス部の部分と、該ヒット
・チェック手段が属するエレメント番号と、ウェイ数選
択・設定手段で設定されているウェイ数とを比較し、そ
の比較結果を判定手段へ送る。
According to the present invention, since the set associative type cache memory device is configured as described above, the first comparing means has the block address in the block address storing means and the minimum selectable address. A portion corresponding to the block / address portion required when selecting the number of ways is compared, and the comparison result is sent to the judging means. The second comparing means sets the remaining part of the block address, the part of the block address part corresponding to the remaining part, the element number to which the hit checking means belongs, and the way number selecting / setting means. The number of ways is compared and the comparison result is sent to the judging means.

【0014】判定手段では、第1と第2の比較手段の両
比較結果に対する一致/不一致の判定を行う。この判定
手段による判定結果が一致の場合、実アドレスのブロッ
ク内アドレス部により、ブロック・データ記憶手段内の
ブロック・データがアクセスされる。これにより、キャ
ッシュ・メモリ装置のヒット率に影響を与える要因の一
つであるウェイ数の変更が、プログラムの実行中に行え
る。従って、前記課題を解決できるのである。
The judging means judges whether the comparison results of both the first and second comparing means are coincident or not. If the determination result by this determination means is a match, the block data in the block data storage means is accessed by the in-block address portion of the real address. As a result, the number of ways, which is one of the factors that affect the hit rate of the cache memory device, can be changed during execution of the program. Therefore, the above problem can be solved.

【0015】[0015]

【実施例】図1は、本発明の実施例を示すセット・アソ
シアティブ方式のキャッシュ・メモリ装置の基本構成を
示す機能ブロック図である。
FIG. 1 is a functional block diagram showing the basic configuration of a set associative cache memory device according to an embodiment of the present invention.

【0016】図示しない主メモリへのアクセス時に使わ
れる実アドレスADRは、ブロック・アドレス部ADR
a 、セット・アドレス部ADRb、及びブロック内アド
レス部ADRc に分けられる。ブロック・アドレス部A
DRa とセット・アドレス部ADRb は、選択されたウ
ェイ数に応じてそのビット幅が変わるが、ブロック内ア
ドレス部ADRc のビット幅は固定されている。
The real address ADR used when accessing the main memory (not shown) is the block address part ADR.
a , a set address part ADR b , and an in-block address part ADR c . Block address part A
The bit widths of the DR a and the set address part ADR b change according to the number of selected ways, but the bit width of the intra-block address part ADR c is fixed.

【0017】このアドレスADRによってアクセスされ
るキャッシュ・メモリ装置は、ブロック・アドレス記憶
手段40とブロック・データ記憶手段50と、ヒット・
チェック手段60とを備え、それらの手段40,50,
60で一つのエレメントが構成され、そのエレメントが
選択可能な最大ウェイ数分(0〜n)だけ設けられてい
る。各エレメント0〜n内のヒット・チェック手段60
の入力側には、共通のウェイ数選択・設定手段70が接
続されている。このウェイ数選択・設定手段70は、選
択・設定するウェイ数を例えばソフトウェアによって書
き込むことが可能な構成になっている。
The cache memory device accessed by the address ADR includes a block address storing means 40, a block data storing means 50, and a hit memory.
Check means 60, and means 40, 50,
One element is composed of 60, and the element is provided by the maximum number of ways (0 to n) that can be selected. Hit check means 60 in each element 0 to n
A common way number selection / setting means 70 is connected to the input side of. The way number selection / setting means 70 is configured to be able to write the number of ways to be selected / set by, for example, software.

【0018】ブロック・アドレス記憶手段40は、選択
可能な最大ウェイ数選択時に必要なビット幅のブロック
・アドレスを記憶できるブロック・アドレス記憶部41
を持つように構成されていて、実アドレスADRのセッ
ト・アドレス部ADRb に対応するブロック・アドレス
記憶部41に記憶されているブロック・アドレスをヒッ
ト・チェック手段60へ送出する機能を有している。こ
のブロック・アドレス記憶手段40とブロック・データ
記憶手段50とは、一対一で対応付けられている。
The block address storage means 40 is capable of storing a block address having a bit width required when selecting the maximum number of selectable ways.
And has a function of sending the block address stored in the block address storage section 41 corresponding to the set address section ADR b of the real address ADR to the hit check means 60. There is. The block / address storage means 40 and the block / data storage means 50 are associated one-to-one.

【0019】ヒット・チェック手段60は、第1,第2
の比較手段61,62、及び論理積(AND)をとる判
定手段63より構成されている。各エレメント0〜nに
おける判定手段63の出力は、論理和(OR)をとる判
定手段80に接続されている。
The hit check means 60 has first and second
Comparing means 61 and 62, and a judging means 63 taking a logical product (AND). The output of the judging means 63 in each of the elements 0 to n is connected to the judging means 80 which takes a logical sum (OR).

【0020】第1の比較手段61は、ブロック・アドレ
ス記憶手段40から送られてきたブロック・アドレス
と、選択可能な最小ウェイ数選択時に必要な実アドレス
ADRのブロック・アドレス部ADRa に対応する部分
とを比較し、その比較結果を判定手段63へ与える機能
を有している。第2の比較手段62は、ブロック・アド
レスの残りの部分と、それに対応する実アドレスADR
のブロック・アドレス部ADRa と、該ヒット・チェッ
ク手段60が属するエレメント番号EBNと、ウェイ数
選択・設定手段70で設定されているウェイ数とを比較
し、その比較結果を判定手段63へ与える機能を有して
いる。
The first comparing means 61 corresponds to the block address sent from the block address storing means 40 and the block address part ADR a of the real address ADR required when selecting the selectable minimum number of ways. It has a function of comparing the part and the comparison result to the judging means 63. The second comparing means 62 determines the remaining part of the block address and the corresponding real address ADR.
Of the block address part ADR a , the element number EBN to which the hit check means 60 belongs and the number of ways set by the way number selecting / setting means 70 are compared, and the comparison result is given to the judging means 63. It has a function.

【0021】判定手段63は、第1,第2の比較手段6
1,62のAND論理をとってその2つの比較結果が等
しいか否かを判定し、該判定結果を判定手段80へ与え
る機能を有している。この判定手段63で、第1,第2
の比較手段61,62の比較結果が両方とも等しいと判
定した場合に、該ヒット・チェック手段60が属するエ
レメントでキャッシュ・メモリ装置にヒットしたことに
なる。
The judging means 63 comprises the first and second comparing means 6
It has a function of taking an AND logic of 1 and 62 and judging whether or not the two comparison results are equal, and giving the judgment result to the judging means 80. With this determination means 63, the first and second
When it is determined that the comparison results of the comparing means 61 and 62 are the same, it means that the cache memory device is hit by the element to which the hit check means 60 belongs.

【0022】この種のキャッシュ・メモリ装置では、実
アドレスADRのセット・アドレス部ADRb に対応す
るブロック・アドレス記憶部40に記憶されているブロ
ック・アドレスを第1の比較手段61へ送る。第1の比
較手段61では、ブロック・アドレス記憶手段40から
送られてきたブロック・アドレスと、実アドレスADR
のブロック・アドレス部ADRa に対応する部分とを比
較し、その比較結果を判定手段63へ送る。また、第2
の比較手段62では、ブロック・アドレスの残りの部分
と、それに対応する実アドレスADRのブロック・アド
レス部ADRa と、エレメント番号EBNと、ウェイ数
選択・設定手段70で設定されているウェイ数とを比較
し、その比較結果を判定手段63へ送る。
In this type of cache memory device, the block address stored in the block address storage section 40 corresponding to the set address section ADR b of the real address ADR is sent to the first comparing means 61. The first comparison means 61 compares the block address sent from the block address storage means 40 with the real address ADR.
Of the block address part ADR a of FIG. Also, the second
In the comparison means 62, the remaining part of the block address, the block address part ADR a of the corresponding real address ADR, the element number EBN, and the number of ways set by the way number selection / setting means 70 Are compared, and the comparison result is sent to the judging means 63.

【0023】判定手段63では、第1,第2の比較手段
61,62の比較結果のAND論理をとってその2つの
比較結果が等しいか否かを判定する。2つの比較結果が
等しいと判定されると、このヒット・チェック手段60
が属するエレメントでキャッシュ・メモリ装置にヒット
したことになる。つまり、ブロック・アドレス記憶手段
40に対応するブロック・データ記憶手段50のブロッ
ク・データを、実アドレスADRのブロック内アドレス
部ADRc を使ってアクセスできる。
The judging means 63 takes the AND logic of the comparison results of the first and second comparing means 61 and 62 to judge whether or not the two comparison results are equal. When it is determined that the two comparison results are equal, the hit check means 60
It means that the cache memory device is hit by the element to which the element belongs. That is, the block data of the block data storage means 50 corresponding to the block address storage means 40 can be accessed using the in-block address part ADR c of the real address ADR.

【0024】判定手段63による比較が各エレメント0
〜nで同時に行われ、それらの比較結果を判定手段80
へ送る。判定手段80で、各判定手段63の比較結果の
OR論理をとって該キャッシュ・メモリ装置のヒット/
ミスヒットが決定される。
The comparison made by the judging means 63 is 0 for each element.
~ N are performed at the same time, and the comparison result thereof is determined by the determination means 80.
Send to. The judgment means 80 takes the OR logic of the comparison results of the respective judgment means 63 to hit / hit the cache memory device.
A mishit is decided.

【0025】ブロック・アドレス記憶部41の内容を変
更する場合には、ウェイ数選択・設定手段70により設
定されているウェイ数に関係なく、選択可能な最大ウェ
イ数選択時に必要なブロック・アドレスを書き込む。
When changing the contents of the block / address storage unit 41, the block / address necessary for selecting the maximum number of selectable ways is set regardless of the number of ways set by the way number selecting / setting means 70. Write.

【0026】図3は、図1の具体的な構成ブロック図で
ある。実アドレスADRは、例えば32ビットのバイト
・アドレス(ADR[31:00])で構成されてい
る。このキャッシュ・メモリ装置は、例えばプロセッサ
に内蔵されていて総容量が8Kバイトである。キャッシ
ュ・メモリ装置の1ブロックに記憶できるデータのバイ
ト数は、16バイトである。
FIG. 3 is a specific block diagram of the configuration shown in FIG. The real address ADR is composed of, for example, a 32-bit byte address (ADR [31:00]). This cache memory device is built in a processor, for example, and has a total capacity of 8 Kbytes. The number of bytes of data that can be stored in one block of the cache memory device is 16 bytes.

【0027】エレメントは8つあり、その各々にブロッ
ク・アドレス記憶手段40とブロック・データ記憶手段
50とヒット・チェック手段60とが設けられている。
各エレメントのブロック・アドレス記憶手段40は、最
大ウェイ数である8ウェイのときに必要な22ビット幅
のブロック・アドレスを64セット記憶できる。各エレ
メントのブロック・データ記憶手段50は、1Kバイト
の容量を持つ。各エレメントは0〜7までの独立した番
号が付けられており、3ビット(EBN[2:0])で
表される。
There are eight elements, each of which is provided with a block address storage means 40, a block data storage means 50 and a hit check means 60.
The block address storage means 40 of each element can store 64 sets of 22-bit width block addresses required when the maximum number of ways is 8 ways. The block data storage means 50 of each element has a capacity of 1 Kbyte. Each element is independently numbered from 0 to 7, and is represented by 3 bits (EBN [2: 0]).

【0028】ブロック・アドレス記憶手段40とブロッ
ク・データ記憶手段50とは、それぞれランダム・アク
セス・メモリ(RAM)で構成されている。
The block address storage means 40 and the block data storage means 50 are each constituted by a random access memory (RAM).

【0029】図1のウェイ数選択・設定手段70は、例
えばプロセッサに設けられた32ビット長のウェイレジ
スタ(WAYレジスタ)70Aで構成されている。選択
可能なウェイ数は2,4,8ウェイの3通りで、ウェイ
レジスタ70Aのビット1と0(WAY[1:0])に
書き込まれている値によって選択できる。また、図1に
おける第1,第2の比較手段61,62は、それぞれ比
較器61A,62Aで構成され、さらに判定手段63
が、ANDゲート63Aで構成されている。図1におけ
る各エレメント内の判定手段63の出力側に接続される
判定手段80は、図3ではORゲート80Aで構成され
ている。
The way number selection / setting means 70 of FIG. 1 is composed of, for example, a 32-bit long way register (WAY register) 70A provided in the processor. The number of ways that can be selected is three, that is, 2, 4, and 8 ways, and can be selected by the values written in bits 1 and 0 (WAY [1: 0]) of the way register 70A. Further, the first and second comparing means 61 and 62 in FIG. 1 are composed of comparators 61A and 62A, respectively, and the determining means 63 is further provided.
Is composed of an AND gate 63A. The judging means 80 connected to the output side of the judging means 63 in each element in FIG. 1 is composed of an OR gate 80A in FIG.

【0030】図4は、図3におけるWAY[1:0]
と、選択・設定されるウェイ数の関係を示す図である。
図5は、図4における各ウェイ数と、実アドレス(AD
R[31:00])のブロック・アドレス部ADRa
セット・アドレス部ADRb 、及びブロック内アドレス
部ADRc の各フィールドの関係を示す図である。図6
は、エレメントの番号と3ビット(EBN[2:0])
の関係を示す図である。図7は、図3中の各ヒット・チ
ェック手段60の構成例を示す図である。
FIG. 4 shows the WAY [1: 0] in FIG.
FIG. 3 is a diagram showing the relationship between the number of ways selected and set.
FIG. 5 shows the number of ways and the real address (AD
R [31:00]) block address part ADR a ,
It is a diagram showing the relationship between each field of the set address portion ADR b, and block address unit ADR c. Figure 6
Is the element number and 3 bits (EBN [2: 0])
It is a figure which shows the relationship of. FIG. 7 is a diagram showing a configuration example of each hit check means 60 in FIG.

【0031】このヒット・チェック手段60内の比較器
61Aは、選択可能な最小ウェイ数(2ウェイ)のとき
の実アドレスADRのブロック・アドレス部ADR
a (ADR[31:12])と、選択可能な最大ウェイ
数(8ウェイ)のときの実アドレスADRのセット・ア
ドレスADRb (ADR[09:04])によって選択
されたブロック・アドレス記憶手段40の内容の該当す
る部分(B−ADR[31:12])との比較を行う機
能を有している。
The comparator 61A in the hit check means 60 uses the block address part ADR of the real address ADR when the selectable minimum number of ways (two ways) is used.
a (ADR [31:12]) and the real address ADR of the set address ADR b (ADR [09:04]) block address storage means selected by the time of selectable maximum way number (8-way) It has a function of comparing with the corresponding portion (B-ADR [31:12]) of the content of 40.

【0032】比較器62Aは、ブロック・アドレス記憶
手段40の内容の残りの部分(B−ADR[11:1
0])と、実アドレスADRの該当する部分(ADR
[11:10])と、各エレメントのエレメント番号を
示す3ビットの下位2ビット(EBN[1:0])と、
設定されているウェイ数を示すウェイレジスタ70Aの
2ビット(WAY[1:0])との比較を行う機能を有
している。この比較器62Aは、排他的否定論理和(E
xNOR)ゲート91−1〜91−4、ANDゲート9
2−1〜92−3,93−1〜93−3、及びORゲー
ト94で構成されている。
The comparator 62A uses the remaining portion of the contents of the block address storage means 40 (B-ADR [11: 1
0]) and the corresponding part of the real address ADR (ADR
[11:10]) and the lower 2 bits of 3 bits (EBN [1: 0]) indicating the element number of each element,
It has a function of comparing with 2 bits (WAY [1: 0]) of the way register 70A indicating the set number of ways. This comparator 62A has an exclusive NOR (E
xNOR) gates 91-1 to 91-4, AND gate 9
2-1 to 92-3, 93-1 to 93-3, and an OR gate 94.

【0033】ANDゲート63Aは、比較器61Aと6
2Aとの比較を行い、両者が共に等しいという結果であ
れば、当該エレメントでキャッシュ・メモリ装置にヒッ
トをしたことになる。また、ブロック・アドレス記憶部
41の内容を変更する場合には、ウェイレジスタ70A
により設定されているウェイ数に関係なく、選択可能な
最大ウェイ数である8ウェイを選択したときに必要なブ
ロック・アドレス(ADR[31:10])を書き込
む。
The AND gate 63A includes comparators 61A and 6A.
2A is compared, and if both are the same, it means that the cache memory device is hit by the element. When changing the contents of the block / address storage unit 41, the way register 70A is used.
The block address (ADR [31:10]) required when selecting the maximum selectable number of 8 ways regardless of the number of ways set by is written.

【0034】次に、図3〜図7を参照しつつ、各ウェイ
数での動作(1)〜(3)について説明する。
Next, the operations (1) to (3) at each number of ways will be described with reference to FIGS. 3 to 7.

【0035】(1) 2ウェイが選択されている場合 図7の比較器61Aでは、実アドレスADRのセット・
アドレス部ADRb(ADR[11:04])の下位6
ビット(ADR[09:04])で示されるブロック・
アドレス記憶手段40に記憶されているブロック・アド
レス(B−ADR[31:10])の上位20ビット
(B−ADR[31:12])と、実アドレスADRの
ブロック・アドレス部ADRa (ADR[31:1
2])とを比較する。この比較と同時に、ExNORゲ
ート91−1,91−2により、実アドレスADRのセ
ット・アドレス部ADRb の上位2ビット(ADR[1
1:10])と、エレメント番号(EBN[2:0])
の下位2ビット(EBN[1:0])とが比較される。
(1) When 2-way is selected In the comparator 61A of FIG. 7, the real address ADR is set.
Lower 6 of address part ADR b (ADR [11:04])
Block indicated by bits (ADR [09:04])
The upper 20 bits (B-ADR [31:10]) of the block address (B-ADR [31:10]) stored in the address storage means 40 and the block address part ADR a (ADR) of the real address ADR. [31: 1
2]). The comparison with the same time, the ExNOR gates 91-1 and 91-2, the real address ADR set address portion ADR b upper 2 bits of (ADR [1
1:10]) and the element number (EBN [2: 0])
The lower 2 bits (EBN [1: 0]) of are compared.

【0036】ANDゲート63Aでは、比較器61Aの
比較結果とORゲート94の比較結果とを比較する。両
比較結果が共に等しいときには、このエレメントでキャ
ッシュ・ヒットしたことになる。これらの比較が8つの
エレメント0〜7で同時に行われ、それらの各ANDゲ
ート63Aからの比較結果を、図3のORゲート80A
で論理和をとり、キャッシュ・メモリ装置のヒット/ミ
スヒットを決定する。 (2) 4ウェイが選択されている場合 図7の比較器61Aにより、実アドレスADRのセット
・アドレス部ADRa (ADR[10:04])の下位
6ビット(ADR[09:04])で示されるブロック
・アドレス記憶手段40に記憶されているブロック・ア
ドレス(B−ADR[31:10])の上位20ビット
(B−ADR[31:12])と、実アドレスADRの
ブロック・アドレス部ADRa (ADR[31:1
1])の上位20ビット(ADR[31:12])とが
比較される。この比較と同時に、比較器62Aにより、
ADR[11]及びB−ADR[11]の比較と、AD
R[10]及びEBN[0]の比較が行われる。
The AND gate 63A compares the comparison result of the comparator 61A with the comparison result of the OR gate 94. When both comparison results are the same, it means that there is a cache hit in this element. These comparisons are simultaneously performed by the eight elements 0 to 7, and the comparison result from each of the AND gates 63A is used as the OR gate 80A in FIG.
Is ORed to determine the hit / miss hit of the cache memory device. (2) When 4-way is selected By the comparator 61A of FIG. 7, the lower 6 bits (ADR [09:04]) of the set address part ADR a (ADR [10:04]) of the real address ADR are used. The upper 20 bits (B-ADR [31:10]) of the block address (B-ADR [31:10]) stored in the block address storage means 40 shown and the block address part of the real address ADR. ADR a (ADR [31: 1
1]) higher 20 bits (ADR [31:12]) are compared. Simultaneously with this comparison, the comparator 62A
Comparison of ADR [11] and B-ADR [11] and AD
A comparison of R [10] and EBN [0] is done.

【0037】この比較器61Aと62Aの比較結果が、
ANDゲート63Aで比較され、それらの比較結果が全
て等しいときには、このエレメントでキャッシュ・ヒッ
トしたことになる。これらの比較が8つのエレメント0
〜7で同時に行われ、それらの比較結果をORゲート8
0Aで論理和を求め、キャッシュ・メモリ装置のヒット
/ミスヒットが決定される。
The comparison result of the comparators 61A and 62A is
When the AND gates 63A compare and the comparison results are all the same, it means that a cache hit occurs in this element. These comparisons are 8 elements 0
~ 7 are performed simultaneously, and the comparison result is OR gate 8
The logical sum is obtained at 0A to determine the hit / miss hit of the cache memory device.

【0038】(3) 8ウェイが選択されている場合 比較器61Aにより、実アドレスADRのセット・アド
レス部ADRb (ADR[09:04])で示されるブ
ロック・アドレス記憶手段40に記憶されているブロッ
ク・アドレス(B−ADR[31:10])の上位20
ビット(B−ADR[31:12])と、実アドレスA
DRのブロック・アドレス部ADRb (ADR[31:
10])の上位20ビット(ADR[31:12])と
が比較される。この比較と同時に、比較器62Aによ
り、ADR[11:10]とB−ADR[31:10]
と比較が行われる。
(3) When 8-way is selected By the comparator 61A, the data is stored in the block address storage means 40 indicated by the set address portion ADR b (ADR [09:04]) of the real address ADR. Upper 20 of existing block addresses (B-ADR [31:10])
Bit (B-ADR [31:12]) and real address A
Block address part of DR ADR b (ADR [31:
10]) and the higher 20 bits (ADR [31:12]) are compared. Simultaneously with this comparison, the comparator 62A causes the ADR [11:10] and the B-ADR [31:10].
And a comparison is made.

【0039】この比較器61Aと62Aの比較結果がA
NDゲート63Aで比較され、該比較器61Aと62A
の2つの比較結果が両方とも等しい場合は、このエレメ
ントでキャッシュ・ヒットしたことになる。これらの比
較が8つのエレメント0〜7で同時に行われ、それらの
比較結果をORゲート80Aで論理和をとってキャッシ
ュ・メモリ装置のヒット/ミスヒットが決定される。
The comparison result of the comparators 61A and 62A is A
The comparators 61A and 62A are compared by the ND gate 63A.
If the two comparison results in 1 are equal, it means that a cache hit has occurred in this element. These comparisons are simultaneously performed by the eight elements 0 to 7, and the comparison result is ORed by the OR gate 80A to determine the hit / miss hit of the cache memory device.

【0040】以上のように、本実施例では、セット・ア
ソシアティブ方式のキャッシュ・メモリ装置を持つ情報
処理装置において、あるプログラムを実行したときに最
もヒット率の高くなるウェイ数を、ウェイ数選択・設定
手段70(ウェイレジスタ70A)で選択・設定するこ
とにより、ミスヒットを減らすことができる。そのた
め、CPUのプログラム実行性能を向上させることがで
きる。
As described above, in the present embodiment, in the information processing apparatus having the set associative type cache memory device, the number of ways having the highest hit rate when a certain program is executed is selected as the number of ways. By selecting and setting by the setting means 70 (way register 70A), mishits can be reduced. Therefore, the program execution performance of the CPU can be improved.

【0041】なお、本発明は上記実施例に限定されず、
種々の変形が可能である。例えば、図1の第2の比較手
段62を、図7の比較器62A以外の回路で構成した
り、図1の判定手段63,80を、図3に示すゲート以
外の他のゲートで構成してもよい。さらに、図1のウェ
イ数選択・設定手段70は、図3のウェイレジスタ70
A以外の記憶手段等で構成してもよい。
The present invention is not limited to the above embodiment,
Various modifications are possible. For example, the second comparing means 62 in FIG. 1 may be configured by a circuit other than the comparator 62A in FIG. 7, or the determining means 63, 80 in FIG. 1 may be configured by a gate other than the gate shown in FIG. May be. Further, the way number selection / setting means 70 of FIG.
The storage means other than A may be used.

【0042】[0042]

【発明の効果】以上詳細に説明したように、本発明によ
れば、ブロック・アドレス記憶手段、ウェイ数選択・設
定手段、及びヒット・チェック手段とを備え、前記ヒッ
ト・チェック手段を、第1,第2の比較手段及び判定手
段で構成したので、該セット・アソシアティブ方式のキ
ャッシュ・メモリ装置を持つ情報処理装置で、あるプロ
グラムを実行したときに、そのプログラムの実行中にウ
ェイ数の変更を行うことができる。そのため、あるプロ
グラムを実行したときに最もヒット率の高くなるウェイ
数をウェイ数選択・設定手段で選択・設定することによ
り、ミスヒットを減らし、CPUのプログラム実行性能
の向上を図ることができる。
As described in detail above, according to the present invention, there is provided block / address storage means, way number selection / setting means, and hit check means. Since the information processing apparatus having the set associative cache memory device is configured to include the second comparing unit and the determining unit, the number of ways can be changed during execution of the program. It can be carried out. Therefore, by selecting and setting the number of ways having the highest hit rate when a certain program is executed by the way number selecting / setting means, mishits can be reduced and the program execution performance of the CPU can be improved.

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

【図1】本発明の実施例におけるセット・アソシアティ
ブ方式のキャッシュ・メモリ装置の基本構成を示す機能
ブロック図である。
FIG. 1 is a functional block diagram showing a basic configuration of a set associative cache memory device according to an embodiment of the present invention.

【図2】従来のキャッシュ・メモリ装置の概念を示す模
式図である。
FIG. 2 is a schematic diagram showing the concept of a conventional cache memory device.

【図3】図1の具体的な構成ブロック図である。FIG. 3 is a specific configuration block diagram of FIG. 1.

【図4】図2におけるWAY[1:0]と選択・設定さ
れるウェイ数の関係を示す図である。
4 is a diagram showing a relationship between WAY [1: 0] and the number of ways to be selected / set in FIG.

【図5】図3におけるウェイ数と実アドレス・フィール
ドの関係を示す図である。
5 is a diagram showing the relationship between the number of ways and the real address field in FIG.

【図6】図3におけるエレメント番号とEBN[2:
0]の関係を示す図である。
FIG. 6 shows the element numbers and EBN [2: in FIG.
It is a figure which shows the relationship of 0].

【図7】図3中の各ヒット・チェック手段60の構成例
を示す図である。
FIG. 7 is a diagram showing a configuration example of each hit check means 60 in FIG.

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

40 ブロック・アドレス記憶手段 41 ブロック・アドレス記憶部 50 ブロック・データ記憶手段 60 ヒット・チェック手段 61,62 第1,第2の比較手段 61A,62A 比較器 63,80 判定手段 63A ANDゲート 70 ウェイ数選択・設定手段 70A ウェイレジスタ 80A ORゲート ADR 実アドレス ADRa ブロック・アドレス部 ADRb セット・アドレス部 ADRc ブロック内アドレス部40 block address storage means 41 block address storage section 50 block data storage means 60 hit check means 61, 62 first and second comparing means 61A, 62A comparator 63, 80 judging means 63A AND gate 70 number of ways Selection / setting means 70A Way register 80A OR gate ADR Real address ADR a Block address part ADR b Set address part ADR c In- block address part

Claims (1)

【特許請求の範囲】 【請求項1】 ブロック・アドレス部、セット・アドレ
ス部及びブロック内アドレス部からなる実アドレスでア
クセスされる主メモリとの内容の対応付けを、セット・
アソシアティブ方式で行うキャッシュ・メモリ装置にお
いて、 選択可能な最大ウェイ数選択時に必要なビット幅のブロ
ック・アドレス及びブロック・データをそれぞれ記憶す
るブロック・アドレス記憶手段及びブロック・データ記
憶手段と、 選択可能なウェイ数から1つのウェイ数を選択・設定す
るウェイ数選択・設定手段と、 選択可能な最大ウェイ数と同数のヒット・チェック手段
とを備え、 前記ヒット・チェック手段は、 前記ブロック・アドレス記憶手段内のブロック・アドレ
ス、及び選択可能な最小ウェイ数選択時に必要な前記ブ
ロック・アドレス部に対応する部分を比較する第1の比
較手段と、 前記ブロック・アドレスの残りの部分、その残りの部分
に対応する前記ブロック・アドレス部の部分、前記ヒッ
ト・チェック手段が属するエレメント番号、及び前記ウ
ェイ数選択・設定手段で設定されているウェイ数を比較
する第2の比較手段と、 前記第1と第2の比較手段の両比較結果に対する一致/
不一致の判定を行い、その一致判定時に前記ブロック・
データ記憶手段内のブロック・データを前記ブロック内
アドレス部を使ってアクセスさせる判定手段とで、 構成したことを特徴とするキャッシュ・メモリ装置。
What is claimed is: 1. Correspondence of contents with a main memory accessed by a real address composed of a block address part, a set address part and an in-block address part is set.
In an associative cache memory device, a block address storage means and a block data storage means for respectively storing a block address and block data having a bit width required when selecting the maximum number of selectable ways, and selectable The number of ways is selected and set by one way number selection / setting means, and the same number of hit check means as the maximum number of selectable ways is provided. The hit check means is the block address storage means. In the block address and a part corresponding to the block address part required when selecting the selectable minimum number of ways, and the remaining part of the block address, and the remaining part The part of the corresponding block address part, the hit check means belongs to Second comparison means for comparing that element number, and the number of ways that are configured in the way number selection and setting means, a match for both the comparison result of the first and second comparison means /
When a mismatch is determined, the block
A cache memory device comprising: a determination unit for accessing block data in a data storage unit by using the address unit in the block.
JP3173964A 1991-07-15 1991-07-15 Cache memory device Withdrawn JPH0520193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3173964A JPH0520193A (en) 1991-07-15 1991-07-15 Cache memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3173964A JPH0520193A (en) 1991-07-15 1991-07-15 Cache memory device

Publications (1)

Publication Number Publication Date
JPH0520193A true JPH0520193A (en) 1993-01-29

Family

ID=15970305

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3173964A Withdrawn JPH0520193A (en) 1991-07-15 1991-07-15 Cache memory device

Country Status (1)

Country Link
JP (1) JPH0520193A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6488338B1 (en) 1994-06-30 2002-12-03 Aisin Seiki Kabushiki Kaisha Reclining mechanism for an automotive seat
US7330935B2 (en) 2004-03-31 2008-02-12 Nec Corporation Set associative cache system and control method for cache memories
US7437513B2 (en) 2004-04-30 2008-10-14 Nec Corporation Cache memory with the number of operated ways being changed according to access pattern
JP2010170292A (en) * 2009-01-22 2010-08-05 Nec Computertechno Ltd Cache memory control circuit and cache memory management method
JP2017503299A (en) * 2014-12-14 2017-01-26 ヴィア アライアンス セミコンダクター カンパニー リミテッド Multimode set associative cache memory that is dynamically configurable to selectively select one or more of the sets depending on the mode
JP2017503298A (en) * 2014-12-14 2017-01-26 ヴィア アライアンス セミコンダクター カンパニー リミテッド Dynamic cache replacement way selection based on address tag bits
JP2017507442A (en) * 2014-12-14 2017-03-16 ヴィア アライアンス セミコンダクター カンパニー リミテッド Multimode set associative cache memory that can be dynamically configured to be selectively assigned to all or a subset of ways depending on mode

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6488338B1 (en) 1994-06-30 2002-12-03 Aisin Seiki Kabushiki Kaisha Reclining mechanism for an automotive seat
US7330935B2 (en) 2004-03-31 2008-02-12 Nec Corporation Set associative cache system and control method for cache memories
US7437513B2 (en) 2004-04-30 2008-10-14 Nec Corporation Cache memory with the number of operated ways being changed according to access pattern
JP2010170292A (en) * 2009-01-22 2010-08-05 Nec Computertechno Ltd Cache memory control circuit and cache memory management method
JP2017503299A (en) * 2014-12-14 2017-01-26 ヴィア アライアンス セミコンダクター カンパニー リミテッド Multimode set associative cache memory that is dynamically configurable to selectively select one or more of the sets depending on the mode
JP2017503298A (en) * 2014-12-14 2017-01-26 ヴィア アライアンス セミコンダクター カンパニー リミテッド Dynamic cache replacement way selection based on address tag bits
JP2017507442A (en) * 2014-12-14 2017-03-16 ヴィア アライアンス セミコンダクター カンパニー リミテッド Multimode set associative cache memory that can be dynamically configured to be selectively assigned to all or a subset of ways depending on mode
US9798668B2 (en) 2014-12-14 2017-10-24 Via Alliance Semiconductor Co., Ltd. Multi-mode set associative cache memory dynamically configurable to selectively select one or a plurality of its sets depending upon the mode
US10698827B2 (en) 2014-12-14 2020-06-30 Via Alliance Semiconductor Co., Ltd. Dynamic cache replacement way selection based on address tag bits
US10719434B2 (en) 2014-12-14 2020-07-21 Via Alliance Semiconductors Co., Ltd. Multi-mode set associative cache memory dynamically configurable to selectively allocate into all or a subset of its ways depending on the mode

Similar Documents

Publication Publication Date Title
US6976126B2 (en) Accessing data values in a cache
US6425055B1 (en) Way-predicting cache memory
US6157980A (en) Cache directory addressing scheme for variable cache sizes
JPH0520193A (en) Cache memory device
JPH0786848B2 (en) Cache memory
US6240532B1 (en) Programmable hit and write policy for cache memory test
JPH03172947A (en) Microcomputer system
GB2250114A (en) Multiple processor data processing system with cache memory
JP2002140232A (en) Multiprocessor system and method for controlling cache
JPS6272041A (en) Cache memory controller
JPH02308349A (en) Buffer storage control system
JPH09218823A (en) Cache memory controller
JPH06103169A (en) Read data prefetching mechanism for central arithmetic processor
US6904500B2 (en) Cache controller
JPH02302853A (en) Improved type cash access method and apparatus
JPH04324194A (en) Rom circuit
JPH02176839A (en) Information processor
JPS6037932B2 (en) Cache memory control method
JP3068451B2 (en) Electronic computer
JPH08286974A (en) Cache memory device
JPH01228036A (en) Cache memory
JPH09282226A (en) Cache memory provided with registration eligible flag
JP3204098B2 (en) Dynamic address decode cache control method
JPH0775007B2 (en) Data access device
US20030149841A1 (en) Management of caches in a data processing apparatus

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: 19981008