JPH04268638A - Cache memory system - Google Patents

Cache memory system

Info

Publication number
JPH04268638A
JPH04268638A JP3029759A JP2975991A JPH04268638A JP H04268638 A JPH04268638 A JP H04268638A JP 3029759 A JP3029759 A JP 3029759A JP 2975991 A JP2975991 A JP 2975991A JP H04268638 A JPH04268638 A JP H04268638A
Authority
JP
Japan
Prior art keywords
data
address
cache memory
cpu
address tag
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
Application number
JP3029759A
Other languages
Japanese (ja)
Inventor
Kiyoto Miyazawa
宮沢 清人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP3029759A priority Critical patent/JPH04268638A/en
Publication of JPH04268638A publication Critical patent/JPH04268638A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To reduce the frequency in access to a main storage part by providing a CPU with a cache memory exclusive for stack and regarding data, to which a pop instruction is executed, to be not read again and using its storage area to not write data in the main storage part at the time of executing a push instruction to another data. CONSTITUTION:Data to be stacked is temporarily stored in a data block 3. The address of the data block 3 is stored in an address tag part 2. When new stack push occurs in one set, an LUR 1 determines the way whose data should be updated to new data. Though old data in the pertinent set is updated in the case of mishit, namely, write/read of data which does not exist in the cache memory, old data is not written in the main storage part on condition that the CPU does not require updated data.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、コンピュータシステム
において、メモリに対するアクセスを高速に行うための
キャッシュメモリ方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory method for accessing memory at high speed in a computer system.

【0002】0002

【従来の技術】コンピュータシステムにおいて、メモリ
に対するアクセスを高速に行うための従来のキャッシュ
メモリ方式は、ライトしたデータを直に主記憶部にライ
ト(ライトスルー)するか、または、ライト・ミス時に
入れ替えるために、最終的に主記憶部にライトするとい
う手段が採用されている。
[Background Art] Conventional cache memory methods for high-speed memory access in computer systems either write written data directly to the main memory (write-through) or replace it in the event of a write miss. Therefore, a method is adopted in which the data is finally written to the main memory.

【0003】0003

【発明が解決しようとする課題】上述したように、従来
のキャッシュメモリ方式は、メモリが一時的なレジスタ
用として使用される場合、すなわち、スタック用として
使用される場合やローカル変数用として使用される場合
は、キャッシュメモリと主記憶部とに半永久的に存在す
る必要がないにもかかわらず、主記憶部にライトしてい
る。
[Problems to be Solved by the Invention] As mentioned above, the conventional cache memory method is difficult to use when memory is used for temporary registers, that is, when it is used for stacks or for local variables. In this case, the data is written to the main memory even though it does not need to exist semi-permanently in the cache memory and the main memory.

【0004】すなわち、従来のキャッシュメモリ方式は
、ライトされたデータがキャッシュメモリ内でミスヒッ
トが続いたとき、それを主記憶部内に退避するが、この
ようにして退避したデータの中には、2度と使用しない
データがある。スタック用として使用されるデータやロ
ーカル変数用として使用される一時的に使用されるデー
タは、これに該当する。
That is, in the conventional cache memory method, when written data continues to have misses in the cache memory, it is saved in the main memory, but some of the data saved in this way is There is data that will never be used again. This includes data used for the stack and temporary data used for local variables.

【0005】これらのデータは、1度プッシュ(PUS
H)してメモリに書込んでから次にポップ(POP)し
てメモリから読出す迄の時間が、一般的に使用されてい
るメモリのライト/リード間隔よりもはるかに小さく、
しかも2度とリードを行わない場合が多いにも拘わらず
、そのデータを主記憶部にデータを書込んでいる。
[0005] These data are pushed once (PUS
H) The time from writing to memory to reading from memory by POP is much shorter than the write/read interval of commonly used memories.
Moreover, even though the data is often never read again, the data is written to the main memory.

【0006】主記憶部のアクセス時間はキャッシュメモ
リのアクセス時間よりも遅いため、従って上述のような
従来のキャッシュメモリ方式は、主記憶部に対するアク
セス回数が増え、システム全体の処理速度が低下すると
いう欠点を有している。
Since the access time of the main memory is slower than that of the cache memory, the conventional cache memory method described above has the disadvantage that the number of accesses to the main memory increases and the processing speed of the entire system decreases. It has drawbacks.

【0007】[0007]

【課題を解決するための手段】スタックされるデータを
一時的に記憶するデータ・ブロックと、前記データ・ブ
ロックのどのアドレスにデータを記憶しているかを示す
アドレス・タグ部と、一つのセット内で新たにスタック
のプッシュが発生したときにどのウエイのデータを新た
なデータに更新するかを決定するLURと、CPUから
のアクセスアドレスが前記アドレス・タグ部にあるアド
レスであるか否かを比較するアドレス・タグ・コンペア
と、前記データ・ブロックから前記CPUに送出するデ
ータを前記CPUからのアドレスおよび前記アドレス・
タグ・コンペアからの信号によってセレクトするワード
・セレクトおよびウエイ・セレクトと、アドレス・タグ
に対応してそのデータが更新時に主記憶部に書込む必要
があるか否かを示すバリッド・ビットとを備えるスタッ
ク専用のキャッシュメモリをCPU内に設け、ポップ命
令のあった一時記憶データは再度リードされないものと
みなし、他のデータのプッシュ命令を実行するとき、そ
の記憶領域を使用して主記憶部にデータを書込まないよ
うにしたものである。
[Means for Solving the Problem] A data block for temporarily storing data to be stacked, an address tag section indicating in which address of the data block the data is stored, and a data block in one set. When a new stack push occurs, compare the LUR that determines which way's data will be updated with new data and whether or not the access address from the CPU is the address in the address tag section. The data to be sent from the data block to the CPU is compared with the address from the CPU and the address tag compare.
It has a word select and a way select that are selected by signals from the tag compare, and a valid bit that corresponds to the address tag and indicates whether or not the data needs to be written to the main memory when updating. A cache memory dedicated to the stack is provided in the CPU, and temporary storage data with a pop instruction is assumed not to be read again, and when another data push instruction is executed, that storage area is used to transfer data to the main memory. This is done so that it is not written.

【0008】[0008]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments Next, embodiments of the present invention will be described with reference to the drawings.

【0009】図1は本発明の一実施例を示すブロック図
で、4ウエイセットアソシアティブ方式のキャッシュメ
モリを示すブロック図、図2は、図1の実施例において
データの更新時のCPUの命令の一例をを示す説明図で
ある。
FIG. 1 is a block diagram showing an embodiment of the present invention, and is a block diagram showing a 4-way set associative cache memory. FIG. 2 is a block diagram showing an example of a CPU instruction when updating data in the embodiment of FIG. It is an explanatory view showing an example.

【0010】図1において、CPU(図示省略)からは
、メモリアクセスがスタック命令によるものであるか否
かの信号が送出される。この信号が送出されたときのみ
、キャッシュメモリがイネーブルになり、他のメモリア
クセスのときは、他のキャッシュメモリが動作する。
In FIG. 1, a CPU (not shown) sends a signal indicating whether a memory access is by a stack instruction. A cache memory is enabled only when this signal is sent, and other cache memories operate during other memory accesses.

【0011】データ・ブロック3はスタックされるデー
タを一時的に記憶する部分であり、アドレス・タグ部2
はデータ・ブロック3のどのアドレスにデータを記憶し
ているかを示す。LUR1は、一つのセット内で新たに
スタックのプッシュ(PUSH)が発生したとき、どの
ウエイのデータを新たなデータに更新するかを決定する
。基本的には、最も使用されていないウエイのデータを
捨てるか、または主記憶部に書込んだあとに新たなデー
タに更新する。アドレス・タグ・コンペア4は、CPU
からのアクセスアドレスがアドレス・タグ部2にあるア
ドレスであるか否かを比較するところであり、ワード・
セレクト5およびウエイ・セレクト6は、データ・ブロ
ック3からCPUに送出するデータを、CPUからのア
ドレスとアドレス・タグ・コンペア4からの信号によっ
てセレクトする部分である。
The data block 3 is a part that temporarily stores stacked data, and the address tag part 2
indicates at which address in data block 3 the data is stored. LUR1 determines which way's data is updated to new data when a new stack push (PUSH) occurs within one set. Basically, the data of the least used way is either discarded or updated with new data after being written to the main memory. Address tag compare 4 is CPU
This is where the access address from is compared to see if it is the address in the address tag section 2.
The select 5 and way select 6 are parts that select data to be sent from the data block 3 to the CPU based on the address from the CPU and the signal from the address tag compare 4.

【0012】上述のように構成した本実施例の従来のキ
ャッシュメモリ方式と異なる点は、ミスヒットしたとき
、すなわち、キャッシュメモリ内にないデータをライト
/リードするときの動作である。このとき、LUR1で
該当するセット内の古いデータを更新するが、CPUが
必要としないデータである条件(条件1)のとき、古い
データは主記憶部に書込まない。
The difference between the present embodiment configured as described above and the conventional cache memory system is the operation when a miss occurs, that is, when writing/reading data that is not in the cache memory. At this time, the old data in the set corresponding to LUR1 is updated, but when the condition (condition 1) is that the data is not required by the CPU, the old data is not written to the main storage.

【0013】条件1とは次の条件である。すなわち、図
2に示すように、CPUがPUSHしてから次にPOP
したときアドレスCが更新の対象であるとき、実行B以
降ならば条件1を満たし、実行Aと実行Bとの間ならば
条件1を満たさない。このため、アドレス・タグに対応
してそのデータが更新時に主記憶部に書込む必要がある
か否かを示すバリッド・ビット2aを設け、データの更
新時にそれを参照する。
Condition 1 is the following condition. That is, as shown in Figure 2, the CPU performs a PUSH and then a POP.
When address C is an update target, condition 1 is satisfied if it is after execution B, and condition 1 is not satisfied if it is between execution A and execution B. For this reason, a valid bit 2a is provided corresponding to the address tag to indicate whether or not the data needs to be written to the main memory when updating, and is referred to when updating the data.

【0014】キャッシュメモリの大きさを、スタックの
最もよく使用する量にすれば、主記憶部に退避を行わな
いためのキャッシュメモリの大きさの目安となる。
[0014] If the size of the cache memory is set to the most frequently used amount of the stack, it becomes a guideline for the size of the cache memory without saving data to the main memory.

【0015】[0015]

【発明の効果】以上説明したように、本発明のキャッシ
ュメモリ方式は、スタック専用のキャッシュメモリをC
PU内に設けることにより、主記憶部に対するアクセス
の回数を低減することができるという効果があり、従っ
てシステム全体のパフォーマンスを向上させることがで
きるという効果がある。特に、スタックの使用回数の多
いシステムや、割込み処理の多いシステムに対して有効
である。
Effects of the Invention As explained above, the cache memory method of the present invention uses Cache memory exclusively for stacks.
By providing it in the PU, there is an effect that the number of accesses to the main memory section can be reduced, and therefore, the performance of the entire system can be improved. This is particularly effective for systems in which the stack is used many times or systems in which interrupt processing is frequently performed.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の一実施例を示すブロック図で、4ウエ
イセットアソシアティブ方式のキャッシュメモリを示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of the present invention, and is a block diagram showing a 4-way set associative type cache memory.

【図2】図1の実施例において、データの更新時のCP
Uの命令の一例をを示す説明図である。
[Fig. 2] In the embodiment of Fig. 1, CP at the time of data update
It is an explanatory diagram showing an example of a command of U.

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

1    LUR 2    アドレス・タグ部 2a    バリッド・ビット 3    データ・ブロック 4    アドレス・タグ・コンペア 5    ワード・セレクト 6    ウエイ・セレクト 1 LUR 2 Address tag section 2a Valid bit 3 Data block 4 Address tag compare 5. Word selection 6 Way Select

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】  スタックされるデータを一時的に記憶
するデータ・ブロックと、前記データ・ブロックのどの
アドレスにデータを記憶しているかを示すアドレス・タ
グ部と、一つのセット内で新たにスタックのプッシュが
発生したときにどのウエイのデータを新たなデータに更
新するかを決定するLURと、CPUからのアクセスア
ドレスが前記アドレス・タグ部にあるアドレスであるか
否かを比較するアドレス・タグ・コンペアと、前記デー
タ・ブロックから前記CPUに送出するデータを前記C
PUからのアドレスおよび前記アドレス・タグ・コンペ
アからの信号によってセレクトするワード・セレクトお
よびウエイ・セレクトと、アドレス・タグに対応してそ
のデータが更新時に主記憶部に書込む必要があるか否か
を示すバリッド・ビットとを備えるスタック専用のキャ
ッシュメモリをCPU内に設けことを特徴とするキャッ
シュメモリ方式。
1. A data block for temporarily storing data to be stacked, an address tag section indicating in which address of the data block the data is stored, and a newly stacked data block in one set. LUR that determines which way data is updated to new data when a push occurs, and an address tag that compares whether the access address from the CPU is the address in the address tag section.・Compare and send data from the data block to the CPU by the C
Word select and way select that are selected based on the address from the PU and the signal from the address tag compare, and whether or not the data needs to be written to the main memory when updating, corresponding to the address tag. A cache memory method characterized in that a cache memory dedicated to a stack is provided in a CPU and has a valid bit indicating a valid bit.
【請求項2】  スタックされるデータを一時的に記憶
するデータ・ブロックと、前記データ・ブロックのどの
アドレスにデータを記憶しているかを示すアドレス・タ
グ部と、一つのセット内で新たにスタックのプッシュが
発生したときにどのウエイのデータを新たなデータに更
新するかを決定するLURと、CPUからのアクセスア
ドレスが前記アドレス・タグ部にあるアドレスであるか
否かを比較するアドレス・タグ・コンペアと、前記デー
タ・ブロックから前記CPUに送出するデータを前記C
PUからのアドレスおよび前記アドレス・タグ・コンペ
アからの信号によってセレクトするワード・セレクトお
よびウエイ・セレクトと、アドレス・タグに対応してそ
のデータが更新時に主記憶部に書込む必要があるか否か
を示すバリッド・ビットとを備えるスタック専用のキャ
ッシュメモリをCPU内に設け、ポップ命令のあった一
時記憶データは再度リードされないものとみなし、他の
データのプッシュ命令を実行するとき、その記憶領域を
使用して主記憶部にデータを書込まないようにしたこと
を特徴とするキャッシュメモリ方式。
2. A data block for temporarily storing data to be stacked, an address tag section indicating in which address of the data block the data is stored, and a data block for newly stacking data in one set. LUR that determines which way data is updated to new data when a push occurs, and an address tag that compares whether the access address from the CPU is the address in the address tag section.・Compare and send data from the data block to the CPU by the C
Word select and way select that are selected based on the address from the PU and the signal from the address tag compare, and whether or not the data needs to be written to the main memory when updating, corresponding to the address tag. A cache memory dedicated to the stack is provided in the CPU with a valid bit indicating the pop instruction, and the temporary storage data where the pop instruction was received is assumed not to be read again, and when a push instruction for other data is executed, the storage area is A cache memory method that is characterized in that data is not written to the main memory using the cache memory.
JP3029759A 1991-02-25 1991-02-25 Cache memory system Pending JPH04268638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3029759A JPH04268638A (en) 1991-02-25 1991-02-25 Cache memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3029759A JPH04268638A (en) 1991-02-25 1991-02-25 Cache memory system

Publications (1)

Publication Number Publication Date
JPH04268638A true JPH04268638A (en) 1992-09-24

Family

ID=12285004

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3029759A Pending JPH04268638A (en) 1991-02-25 1991-02-25 Cache memory system

Country Status (1)

Country Link
JP (1) JPH04268638A (en)

Similar Documents

Publication Publication Date Title
JP3512678B2 (en) Cache memory control device and computer system
US6131145A (en) Information processing unit and method for controlling a hierarchical cache utilizing indicator bits to control content of prefetching operations
EP1110151B1 (en) Buffering system bus for external-memory accesses
EP1399823B1 (en) Using an l2 directory to facilitate speculative loads in a multiprocessor system
US6701393B1 (en) Systems and methods for managing storage location descriptors
US5214766A (en) Data prefetching based on store information in multi-processor caches
US6678789B2 (en) Memory device
US7191319B1 (en) System and method for preloading cache memory in response to an occurrence of a context switch
US5724548A (en) System including processor and cache memory and method of controlling the cache memory
US11176039B2 (en) Cache and method for managing cache
US9645825B2 (en) Instruction cache with access locking
JPH04268638A (en) Cache memory system
JP2000047942A (en) Device and method for controlling cache memory
EP0787326B1 (en) System and method for processing of memory data and communication system comprising such system
JPH04264641A (en) Cache memory system
JPS5847784B2 (en) key storage system
JPS63101943A (en) Cache move-in control system
US6279082B1 (en) System and method for efficient use of cache to improve access to memory of page type
JPH0628258A (en) Microprocessor
CN110058783B (en) Temporary memory processing method, temporary memory program and storage device
JPH0447350A (en) Main storage read/response control
JPH05257807A (en) Cache memory controller
JPH07101412B2 (en) Data pre-fetching method and multiprocessor system
JPS6063650A (en) Buffer memory coincidence control system
JPH0528414B2 (en)