JPH06100980B2 - Cache memory - Google Patents

Cache memory

Info

Publication number
JPH06100980B2
JPH06100980B2 JP62279917A JP27991787A JPH06100980B2 JP H06100980 B2 JPH06100980 B2 JP H06100980B2 JP 62279917 A JP62279917 A JP 62279917A JP 27991787 A JP27991787 A JP 27991787A JP H06100980 B2 JPH06100980 B2 JP H06100980B2
Authority
JP
Japan
Prior art keywords
bit
address
index
data
cache memory
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.)
Expired - Lifetime
Application number
JP62279917A
Other languages
Japanese (ja)
Other versions
JPH01121956A (en
Inventor
隆 辰巳
直佳 中野
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP62279917A priority Critical patent/JPH06100980B2/en
Publication of JPH01121956A publication Critical patent/JPH01121956A/en
Publication of JPH06100980B2 publication Critical patent/JPH06100980B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、キヤツシユメモリに関するものであり、特
に、キヤツシユメモリへのデータ登録に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory, and more particularly to data registration in the cache memory.

〔従来の技術〕[Conventional technology]

従来のキヤツシユメモリについては、岩波講座マイクロ
エレクトロニクス5「マイクロコンピユータのハードウ
エア」岩波書店,PP.136〜PP.144に掲載されているが、
一例を第5図に示す。第5図は、メインメモリのアドレ
スを示す図である。第5図において、該アドレスは、メ
インメモリ中のデータ1バイトに対して付けられ、32ビ
ツト幅を持つ。(13)は該アドレス中下位2ビツト目か
ら11ビツト目までの10ビツトのインデツクス、(14)は
該アドレス中の上位から20ビツトのタグである。第6図
はキヤツシユの構成を示すブロツク図である。(2)は
1K個エントリを持ち、1エントリはタグ(21)とデータ
(22)から成るキヤツシユメモリであり、その容量は4K
バイトである。
For the conventional cache memory, see Iwanami Course Microelectronics 5 "Hardware of Micro Computer", Iwanami Shoten, PP.136-PP.144.
An example is shown in FIG. FIG. 5 is a diagram showing addresses in the main memory. In FIG. 5, the address is attached to 1 byte of data in the main memory and has a width of 32 bits. (13) is an index of 10 bits from the lower 2nd bit to 11th bit in the address, and (14) is a tag of the upper 20 bits in the address. FIG. 6 is a block diagram showing the structure of the cache. (2) is
It has 1K entries and one entry is a cache memory consisting of tags (21) and data (22), and its capacity is 4K.
It is a byte.

上記従来のキヤツシユメモリでは、まず、メインメモリ
中の4バイトのデータとそれに対応する32ビツトのアド
レスが入力され、該アドレスの2ビツト目から11ビツト
目までの10ビツトのインデツクス(13)をデコードし、
その結果により指定されたキヤツシユメモリ(2)内の
タグ(21)とデータ(22a),(22b),(22c),(22
d)から成る1つのエントリに、該アドレスの12ビツト
目から31ビツト目までの20ビツトのタグ(14)とメイン
メモリ内のデータが格納される。
In the conventional cache memory, first, 4-byte data in the main memory and the corresponding 32-bit address are input, and the 10-bit index (13) from the 2nd bit to the 11th bit of the address is input. Decode,
Tags (21) and data (22a), (22b), (22c), (22) in the cache memory (2) specified by the result
One entry consisting of d) stores the 20-bit tag (14) from the 12th bit to the 31st bit of the address and the data in the main memory.

このようにすると、アドレス中のインデツクス(13)が
等しくなるメインメモリ中のデータは複数個存在する
が、キヤツシユメモリ(2)へは1つしか登録できない
ため、これらを同時には登録できない。
In this way, although there are a plurality of data in the main memory in which the index (13) in the address is the same, only one can be registered in the cache memory (2), so these cannot be registered at the same time.

読み出しでは、まず、アドレスが入力され、該アドレス
の2ビツト目から11ビツト目までのインデツクス(13)
をデコードし、その結果により指定されたキヤツシユメ
モリ(2)内の1つのエントリのタグ(21)とアドレス
中のタグ(14)が一致していればキヤツシユヒツトとな
り、読み出されたデータは処理装置に供給される。
In reading, first, an address is input, and the index (13) from the 2nd bit to the 11th bit of the address is input.
Is decoded, and if the tag (21) of one entry in the cache memory (2) specified by the result matches the tag (14) in the address, it becomes a cache hit and the read data is processed. Supplied to the device.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

プログラムがモジユール化されており、それぞれのモジ
ユールがメインメモリ中のどのアドレスから格納されて
いるかわかつており、該アドレス中のインデツクス(1
3)が等しい場合、これらの等しいインデツクス(13)
を持つメインメモリ中のデータを同時にキヤツシユメモ
リ(2)へ登録する方が、キヤツシユのヒツト率が高く
なる場合がある。
The program is modularized, and it is known from which address in the main memory each module is stored, and the index (1
If 3) are equal, then these equal indexes (13)
There is a case where the cache hit rate becomes higher when the data in the main memory having the same is registered in the cache memory (2) at the same time.

しかし、従来のキヤツシユでは、アドレス中の何ビツト
目から何ビツト目までがインデツクス(13)かが固定さ
れており、このインデツクス(13)が等しいメインメモ
リ中のデータを同時に、キヤツシユメモリ(2)に登録
することができないとう問題があつた。
However, in the conventional cache, the index (13) from the bit number to the bit number in the address is fixed, and the data in the main memory having the same index (13) is simultaneously stored in the cache memory (2). There was a problem that I could not register to.

本発明は上記のような問題点を解決するためになされた
もので、メインメモリのnビットのアドレスからiビツ
トのインデツクスを複数個選択可能とし、メインメモリ
中のデータのキヤツシユメモリへの登録形態を変更可能
にすることを目的とする。
The present invention has been made in order to solve the above-mentioned problems, and makes it possible to select a plurality of i-bit indexes from an n-bit address in the main memory and register the data in the main memory in the cache memory. The purpose is to be able to change the form.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、キヤツシユにおいてnビツトのアドレス中の
iビツトのインデツクスの設定を可変にし、キヤツシユ
メモリへ登録するメインメモリ中のデータをコントロー
ル信号により指定可能にする選択手段を設けたものであ
る。
According to the present invention, the setting of the index of the i-bit in the address of the n-bit is made variable in the cache, and the selecting means is provided so that the data in the main memory to be registered in the cache memory can be designated by the control signal.

〔作用〕[Action]

本発明では、nビットのアドレス中のiビットのインデ
ツクスが可変となる。
In the present invention, the i-bit index in the n-bit address is variable.

〔発明の実施例〕Example of Invention

以下、本発明の一実施例を図について説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第1図はこの発明の一実施例によるキヤツシユの構成を
示すブロツク図である。この実施例で、(1)はセレク
タ、(2)は1K個エントリを持ち、1エントリは、タグ
(21)とデータ(22a),(22b),(22c),(22d)か
ら成るキヤツシユメモリであり、その容量は4Kバイトで
ある。メインメモリのアドレスは、メインメモリ中のデ
ータ1バイトに対して付けられ、32ビツト幅を持ち、
(3),(4)はメインメモリのアドレス中の10ビツト
のインデツクス(11)の設定を選択するためにセレクタ
(1)に入力されるコントロール信号線である。
FIG. 1 is a block diagram showing the construction of a cache according to an embodiment of the present invention. In this embodiment, (1) is a selector, (2) has 1K entries, and one entry is a cache consisting of tags (21) and data (22a), (22b), (22c), (22d). It is a memory and its capacity is 4K bytes. The address of the main memory is attached to 1 byte of data in the main memory and has a width of 32 bits.
Control signal lines (3) and (4) are input to the selector (1) for selecting the setting of the 10-bit index (11) in the address of the main memory.

第2図は第1図実施例に使用されるセレクタ(1)の回
路図である。この例においてインデツクス(11)の設定
の選択が可能な6ビツト目から17ビツト目までのセレク
タ(1)の回路図を示している。(5)〜(10)は横方
向に並んでいるトランスミツシヨンゲート群を示してい
る。
FIG. 2 is a circuit diagram of the selector (1) used in the embodiment shown in FIG. In this example, there is shown a circuit diagram of the selector (1) from the 6th bit to the 17th bit capable of selecting the setting of the index (11). (5) to (10) show a group of transmission gates arranged side by side.

第3図はインデツクス(11)の選択が可能な4つのモー
ドを示す図である。
FIG. 3 is a diagram showing four modes in which the index (11) can be selected.

第4図は第3図の4つのモードに対応するインデツクス
(11)の選択例を示す図である。メインメモリのアドレ
スは、メインメモリ中のデータ1バイトに対して付けら
れ、32ビツト幅を持ち、(11)は32ビツトのアドレス中
10ビツトのインデツクス、(12)は32ビツトのアドレス
中20ビツトのタグである。
FIG. 4 is a diagram showing an example of selecting the index (11) corresponding to the four modes of FIG. The address of the main memory is assigned to 1 byte of data in the main memory and has a width of 32 bits. (11) is the address of 32 bits.
A 10-bit index, (12) is a 20-bit tag in a 32-bit address.

次に、上記実施例の動作を第1図から第4図を参照しな
がら説明する。まず、メインメモリ中の4バイトのデー
タとそれに対応するアドレスが入力される。該アドレス
が、後で説明するセレクタ(1)により、該アドレス中
10ビツトのインデツクス(11)と20ビツトのタグ(12)
に分割される。
Next, the operation of the above embodiment will be described with reference to FIGS. First, 4-byte data in the main memory and the address corresponding thereto are input. The address is stored in the address by the selector (1) described later.
10-bit index (11) and 20-bit tag (12)
Is divided into

セレクタ(1)は、第3図に示す4つのモードを持つ。
モード1は、コントロール信号線(3)に“0"、コント
ロール信号線(4)に“0"が入力される場合、モード2
はコントロール信号線(3)に“0"、コントロール信号
線(4)に“1"が入力される場合、モード3は、コント
ロール信号線(3)に“1"、コントロール信号線(4)
に“0"が入力される場合、モード4は、コントロール信
号線(3)に“1"、コントロール信号線(4)に“1"が
入力される場合である。モード1において、第2図のト
ランスミツシヨンゲート群(8),(9),(10)がオ
ン状態となり第4図のモード1のように分割される。モ
ード2において、第2図のトランスミツシヨンゲート群
(7),(9),(10)がオン状態となり第4図のモー
ド2のように分割される。モード3において、第2図の
トランスミツシヨン群(6),(10)がオン状態とな
り、第4図のモード3のように分割される。モード4に
おいて、第2図のトランスミツシヨン群(5)がオン状
態となり、第4図のモード4のように分割される。
The selector (1) has four modes shown in FIG.
Mode 1 is mode 2 when “0” is input to the control signal line (3) and “0” is input to the control signal line (4).
When "0" is input to the control signal line (3) and "1" is input to the control signal line (4), the mode 3 is "1" to the control signal line (3), the control signal line (4)
When "0" is input to, the mode 4 is a case where "1" is input to the control signal line (3) and "1" is input to the control signal line (4). In mode 1, the transmission gate groups (8), (9), (10) in FIG. 2 are turned on, and are divided as in mode 1 in FIG. In mode 2, the transmission gate groups (7), (9), (10) in FIG. 2 are turned on, and are divided as in mode 2 in FIG. In mode 3, the transmission groups (6) and (10) in FIG. 2 are turned on, and the transmission is divided as in mode 3 in FIG. In mode 4, the transmission group (5) in FIG. 2 is turned on and the transmission group (5) is divided as in mode 4 in FIG.

以上のようにして選択されたインデツクス(11)をデコ
ードし、その結果により指定されたキヤツシユメモリ
(2)内のタグ(21)とデータ(22a),(22b),(22
c),(22d)から成る1つのエントリにタグ(12)とメ
インメモリ中のデータが格納される。
The index (11) selected as described above is decoded, and the tag (21) and data (22a), (22b), (22) in the cache memory (2) designated by the result are decoded.
The tag (12) and the data in the main memory are stored in one entry consisting of c) and (22d).

読み出しでは、ます、アドレスが入力され、該アドレス
中の10ビツトのインデツクス(11)とタグ(12)に登録
時と同様に分割される。次に分割されたインデツクス
(11)をデコードし、その結果により指定されたキヤツ
シユメモリ(2)内のタグ(21)と、アドレス中のイン
デツクス(11)と同時に分割されたタグ(12)が一致す
れば、データがキヤツシユメモリ(2)に存在すること
になり、読み出されたデータは処理装置へ送られる。
In reading, an address is input first, and the address is divided into a 10-bit index (11) and a tag (12) in the same manner as at the time of registration. Next, the divided index (11) is decoded, and the tag (21) in the cache memory (2) specified by the result and the tag (12) that is divided at the same time as the index (11) in the address are divided. If they match, the data exists in the cache memory (2), and the read data is sent to the processing device.

〔発明の効果〕〔The invention's effect〕

以上のように、この発明によれば、nビツトのアドレス
中のiビツトのインデツクスの設定を可変にし、キヤツ
シユメモリへ登録するメインメモリ中のデータの選択を
指定可能にすることによつて、キヤツシングの方法を最
適化できる。
As described above, according to the present invention, the setting of the i-bit index in the n-bit address is made variable, and the selection of the data in the main memory to be registered in the cache memory can be designated. The method of caching can be optimized.

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

第1図はこの発明の一実施例によるキヤツシユの構成と
メインメモリを示すブロツク図、第2図は選択手段の回
路例、第3図は選択手段の4つのモード例を示す図、第
4図は選択手段によるインデツクスの選択例を示す図、
第5図は従来のメインメモリのアドレスを示す図、第6
図は従来のキヤツシユの構成を示すブロツク図である。 図において、(1)はセレクタ、(2)はキヤツシユメ
モリ、(3),(4)はコントロール信号線、(5)〜
(10)はトランスミツシヨンゲート群である。 なお、図中同一符号は同一又は相当、部分を示す。
FIG. 1 is a block diagram showing the configuration of a cache and a main memory according to an embodiment of the present invention, FIG. 2 is a circuit example of a selecting means, FIG. 3 is a diagram showing four modes of the selecting means, and FIG. Is a diagram showing an example of selecting an index by the selecting means,
FIG. 5 is a diagram showing addresses of a conventional main memory, and FIG.
The figure is a block diagram showing the structure of a conventional cache. In the figure, (1) is a selector, (2) is a cache memory, (3) and (4) are control signal lines, and (5) to
(10) is a group of transmission gates. In the drawings, the same reference numerals indicate the same or corresponding parts.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】nビツトのアドレスと、該アドレスに対応
するmビツトのデータが入力され、 該nビツトのアドレスがiビツト(0<i<n)のイン
デツクスとn−iビツトのタグに分割され、 該iビツトのアドレスインデツクスをデコードして指定
可能な2i個のエントリを持ち、1エントリに付き該n−
iビツトのアドレスタグと1つ又は複数の該mビツトの
データを格納することができる記憶手段と、 該nビツトのアドレスより2種類以上のiビツトのイン
デツクスを切り出すことが可能な選択手段を備えたこと
を特徴とするキヤツシユメモリ。
1. An n-bit address and m-bit data corresponding to the address are input, and the n-bit address is divided into an i-bit (0 <i <n) index and an ni bit tag. The address index of the i-bit is decoded to have 2 i entries that can be specified, and the n-th entry
An i-bit address tag, a storage means capable of storing one or more m-bit data, and a selection means capable of cutting out two or more kinds of i-bit indexes from the n-bit address are provided. A cache memory featuring that.
JP62279917A 1987-11-05 1987-11-05 Cache memory Expired - Lifetime JPH06100980B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62279917A JPH06100980B2 (en) 1987-11-05 1987-11-05 Cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62279917A JPH06100980B2 (en) 1987-11-05 1987-11-05 Cache memory

Publications (2)

Publication Number Publication Date
JPH01121956A JPH01121956A (en) 1989-05-15
JPH06100980B2 true JPH06100980B2 (en) 1994-12-12

Family

ID=17617710

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62279917A Expired - Lifetime JPH06100980B2 (en) 1987-11-05 1987-11-05 Cache memory

Country Status (1)

Country Link
JP (1) JPH06100980B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0754482B2 (en) * 1990-08-07 1995-06-07 株式会社日立製作所 Computer system

Also Published As

Publication number Publication date
JPH01121956A (en) 1989-05-15

Similar Documents

Publication Publication Date Title
CA1181866A (en) Multiword memory data storage and addressing technique and apparatus
JP2003509733A5 (en)
KR100322366B1 (en) Word width selection for sram cache
JP3093807B2 (en) cache
US4800535A (en) Interleaved memory addressing system and method using a parity signal
US4942521A (en) Microprocessor with a cache memory in which validity flags for first and second data areas are simultaneously readable
US4639894A (en) Data transferring method
US5206942A (en) Partially storing control circuit used in a memory unit
JP4004847B2 (en) Associative memory device
JPS644207B2 (en)
JPH06100980B2 (en) Cache memory
KR100517765B1 (en) Cache memory and control method thereof
JPS61123954A (en) Associated cash memory contruction
JP2001216193A (en) Cache mechanism and operation control method of cache mechanism
US6567320B2 (en) Data write circuit
JP2650789B2 (en) Cache memory device
JP2622553B2 (en) Microcomputer
JPH0821001B2 (en) Cache memory control method
JP3031581B2 (en) Random access memory and information processing device
JP2692180B2 (en) Microcomputer
JPS63129438A (en) Memory controller
JPS607678A (en) Memory constitution system
JPH05127893A (en) Microprogram control system
JPH0778722B2 (en) Register file method
JPH0330036A (en) Semiconductor storage device