JPH0756809A - Cache prefetching device - Google Patents

Cache prefetching device

Info

Publication number
JPH0756809A
JPH0756809A JP5201672A JP20167293A JPH0756809A JP H0756809 A JPH0756809 A JP H0756809A JP 5201672 A JP5201672 A JP 5201672A JP 20167293 A JP20167293 A JP 20167293A JP H0756809 A JPH0756809 A JP H0756809A
Authority
JP
Japan
Prior art keywords
address
instruction
data
history holding
holding means
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.)
Granted
Application number
JP5201672A
Other languages
Japanese (ja)
Other versions
JP2638434B2 (en
Inventor
Toshiichi Marushima
敏一 丸島
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 JP5201672A priority Critical patent/JP2638434B2/en
Publication of JPH0756809A publication Critical patent/JPH0756809A/en
Application granted granted Critical
Publication of JP2638434B2 publication Critical patent/JP2638434B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To perform control to a cache memory so as to transfer data from a storage device to the cache memory by predicting the address of those data to be accessed in the future. CONSTITUTION:This device is composed of instruction address history holding means 20-2N for storing the instruction addresses of load instructions executed in the past, data address history holding means 30-3N for storing the data addresses of those instructions, address comparator circuits 40-4N for respectively comparing the respective addresses from the means 20-2N with the present instruction address, address selecting circuit 60 for selecting one of addresses in the means 30-3N based on the compared results of these circuits 40-4N, address generating circuit 70 for generating the predictive address from the address from this circuit 60 and the present address, and cache control means 80 for instructing data transfer to the cache memory by using this predictive address.

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 control device for controlling data transfer from a storage device to a cache memory, and more particularly to a cache control for transferring data that will be needed in the future to the cache memory. The present invention relates to a prefetch device.

【0002】[0002]

【従来の技術】従来この種のキャッシュメモリ制御装置
では、必要なデータがキャッシュメモリ内に存在しない
という事象(以下、キャッシュミスという)が生起した
際に、記憶装置からキャッシュメモリに対して必要なデ
ータを転送するように制御していた。例えば、特開昭5
9−96585公報には、キャッシュミス時にキャッシ
ュメモリと記憶装置の双方にデータ要求を出すキャッシ
ュメモリ制御装置が記載されている。
2. Description of the Related Art Conventionally, in this type of cache memory control device, when an event that necessary data does not exist in the cache memory (hereinafter referred to as a cache miss) occurs, the data is required from the storage device to the cache memory. Controlled to transfer data. For example, JP-A-5
Japanese Patent Laid-Open No. 9-96585 discloses a cache memory control device which issues a data request to both the cache memory and the storage device at the time of a cache miss.

【0003】また、ソフトウェアからキャッシュメモリ
を制御する方式としては、将来必要となるであろうデー
タをソフトウェア命令によって指定し、予め記憶装置か
らキャッシュメモリに対して必要なデータを転送するよ
うに制御していた。例えば、『1992年2 月、アイトリプ
ルイー・コンプコン92論文集 (C.Dowdell andL.Thaye
r : "Scalable Graphics Enhancements for PA-RISC Wo
rkstations",Proc. of IEEE COMPCON 92, pp.122-128,
Feb. 1992.) 』には、データキャッシュに32バイトの
データをブロック転送するよう指示するキャッシュプリ
フェッチ命令(fetch32 )が記載されている。
As a method of controlling the cache memory from software, data that will be needed in the future is specified by a software instruction, and the necessary data is transferred from the storage device to the cache memory in advance. Was there. For example, “February 1992, C. Dowdell and L. Thaye
r: "Scalable Graphics Enhancements for PA-RISC Wo
rkstations ", Proc. of IEEE COMPCON 92, pp.122-128,
Feb. 1992.) "describes a cache prefetch instruction (fetch32) for instructing a block transfer of 32 bytes of data to a data cache.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、前者の
従来のキャッシュメモリ制御装置では、キャッシュミス
を契機に記憶装置へのアクセスを開始するため、中央処
理装置がデータを受け取るまでに時間を要し、そのデー
タを必要とする命令を続行することができないという問
題があった。また、近年の中央処理装置はパイプライン
構成を採用することによりスループット性能向上を目指
しているが、キャッシュミスのためにパイプライン全体
を止めざるを得ない場合があり、このことが中央処理装
置の実効性能向上にとって弊害となっていた。
However, in the former conventional cache memory control device, since the access to the storage device is started by the cache miss, it takes time until the central processing unit receives the data, There was a problem that the instruction that needed the data could not be continued. In addition, recent central processing units aim to improve throughput performance by adopting a pipeline configuration, but there are cases in which the entire pipeline must be stopped due to a cache miss. It was a hindrance to the improvement of effective performance.

【0005】また、後者の従来のキャッシュプリフェッ
チ命令による方法では、このプリフェッチ命令によって
プログラム上で明示的にプリフェッチ操作を指示しなけ
ればならないため、プログラム量が増加して命令供給を
阻害し、実効性能に悪影響を与える結果になる。さら
に、記憶装置にアクセスするアドレスをプログラム実行
前に完全に把握することは一般的には不可能なため、コ
ンパイル時にプリフェッチ命令をプログラム上の適切な
位置に生成することが困難であった。
Further, in the latter method by the conventional cache prefetch instruction, since the prefetch operation must be explicitly instructed on the program by this prefetch instruction, the program amount increases and the instruction supply is hindered, and the effective performance is reduced. Will have a negative effect on. Furthermore, since it is generally impossible to completely grasp the address for accessing the storage device before executing the program, it is difficult to generate the prefetch instruction at an appropriate position on the program during compilation.

【0006】[0006]

【課題を解決するための手段】上述した問題点を解決す
るために、本願発明のキャッシュプリフェッチ装置は、
記憶装置からデータを取り出すロード命令について、命
令アドレスを保持する命令アドレス履歴保持手段とデー
タアドレスを保持するデータアドレス履歴保持手段とを
含むアドレス履歴保持手段と;このアドレス履歴保持手
段の命令アドレス履歴保持手段からの命令アドレスと入
力されているロード命令の命令アドレスとを比較して一
致を検出する命令アドレス比較手段と;この命令アドレ
ス比較手段での比較結果に基づいて前記アドレス履歴保
持手段のデータアドレス履歴保持手段からのデータアド
レスと前記入力されているロード命令のデータアドレス
とから予測データアドレスを生成する予測アドレス生成
手段と;前記入力されているロード命令の命令アドレス
とデータアドレスとをそれぞれ前記命令アドレス履歴保
持手段と前記データアドレス履歴保持手段に格納する更
新手段と;を有し、前記入力されているロード命令を次
回実行する際にアクセスされるであろうデータアドレス
を予測してキャッシュメモリに予め当該データを記憶装
置から転送しておくように制御する。
In order to solve the above-mentioned problems, the cache prefetch device of the present invention is
An address history holding unit including an instruction address history holding unit holding an instruction address and a data address history holding unit holding a data address for a load instruction for fetching data from a storage device; instruction address history holding of the address history holding unit Instruction address comparison means for comparing the instruction address from the means with the instruction address of the input load instruction to detect a match; and a data address of the address history holding means based on the comparison result by the instruction address comparison means. Prediction address generating means for generating a prediction data address from the data address from the history holding means and the data address of the input load instruction; and the instruction address and the data address of the input load instruction, respectively. Address history holding means and the data Updating means for storing the address history holding means ;; predicting a data address to be accessed when the input load instruction is executed next time, and storing the data in advance in a cache memory from a storage device. Control to transfer.

【0007】また、前記アドレス履歴保持手段は、複数
の前記命令アドレス履歴保持手段と、これら命令アドレ
ス履歴保持手段に対応する複数の前記データアドレス履
歴保持手段とを含み;前記命令アドレス比較手段は、前
記複数の命令アドレス履歴保持手段の各々の命令アドレ
スと前記入力されているロード命令の命令アドレスとの
比較をそれぞれ行う複数のアドレス比較回路と、これら
複数のアドレス比較回路の比較結果に基づいていずれで
一致していたかを判断するエントリ選択回路とを含み;
前記予測アドレス生成手段は、前記複数のデータアドレ
ス履歴保持手段からのデータアドレスから高々1つを前
記エントリ選択回路からのアドレス一致情報によって選
択するアドレス選択回路と、このアドレス選択回路から
のデータアドレスと入力されているロード命令のデータ
アドレスとから予測アドレスを生成するアドレス生成回
路とを含む。
The address history holding means includes a plurality of the instruction address history holding means and a plurality of the data address history holding means corresponding to the instruction address history holding means; the instruction address comparing means, A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether they match.
The predictive address generation means selects an address selection circuit that selects at most one of the data addresses from the plurality of data address history holding means based on the address matching information from the entry selection circuit, and a data address from this address selection circuit. An address generation circuit that generates a predicted address from the data address of the input load instruction is included.

【0008】また、前記アドレス履歴保持手段は、複数
の前記命令アドレス履歴保持手段と、この命令アドレス
履歴保持手段に対応する複数の前記データアドレス履歴
保持手段とを含み;前記命令アドレス比較手段は、前記
複数の命令アドレス履歴保持手段の各々の命令アドレス
と前記入力されているロード命令の命令アドレスとの比
較をそれぞれ行う複数のアドレス比較回路と、これら複
数のアドレス比較回路の比較結果に基づいていずれで一
致していたかを判断するエントリ選択回路とを含み;前
記予測アドレス生成手段は、前記複数のデータアドレス
履歴保持手段の各々に対応して前記入力されているロー
ド命令のデータアドレスとから各々予測アドレスを生成
する複数のアドレス生成回路と、この複数のアドレス生
成回路からの予測アドレスから高々1つを前記エントリ
選択回路からのアドレス一致情報によって選択するアド
レス選択回路とを含む。
Further, the address history holding means includes a plurality of the instruction address history holding means and a plurality of the data address history holding means corresponding to the instruction address history holding means; the instruction address comparing means, A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether or not they match each other; the predictive address generating means predicts each from a data address of the load instruction input corresponding to each of the plurality of data address history holding means. Address generation circuits that generate addresses and predictions from the address generation circuits And an address selection circuit for selecting the address coincidence information of the most one of the dress from the entry selection circuit.

【0009】また、前記アドレス履歴保持手段は、複数
のワードから構成される複数の前記命令アドレス履歴保
持手段と、これら命令アドレス履歴保持手段に対応する
複数のワードから構成される複数の前記データアドレス
履歴保持手段とを含み;前記命令アドレス比較手段は、
前記複数の命令アドレス履歴保持手段の各々の命令アド
レスと前記入力されているロード命令の命令アドレスと
の比較をそれぞれ行う複数のアドレス比較回路と、これ
ら複数のアドレス比較回路の比較結果に基づいていずれ
で一致していたかを判断するエントリ選択回路とを含
み;前記予測アドレス生成手段は、前記複数のデータア
ドレス履歴保持手段の各々のデータアドレスと前記入力
されているロード命令のデータアドレスとから予測アド
レスを生成する複数のアドレス生成回路と、この複数の
アドレス生成回路からの予測アドレスから高々1つを前
記エントリ選択回路からのアドレス一致情報によって選
択するアドレス選択回路とを含む。
Further, the address history holding means includes a plurality of instruction address history holding means composed of a plurality of words and a plurality of data addresses formed of a plurality of words corresponding to the instruction address history holding means. History holding means; the instruction address comparing means,
A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether or not they match with each other; the predicted address generation means determines a predicted address from each data address of the plurality of data address history holding means and the data address of the input load instruction. And a plurality of address generating circuits for generating the address, and an address selecting circuit for selecting at most one predicted address from the plurality of address generating circuits by the address matching information from the entry selecting circuit.

【0010】また、前記アドレス履歴保持手段は、複数
のワードから構成される複数の前記命令アドレス履歴保
持手段と、これら命令アドレス履歴保持手段に対応する
複数のワードから構成される複数の前記データアドレス
履歴保持手段とを含み;前記命令アドレス比較手段は、
前記複数の命令アドレス履歴保持手段の各々の命令アド
レスと前記入力されているロード命令の命令アドレスと
の比較をそれぞれ行う複数のアドレス比較回路と、これ
ら複数のアドレス比較回路の比較結果に基づいていずれ
で一致していたかを判断するエントリ選択回路とを含
み;前記予測アドレス生成手段において前記複数のデー
タアドレス履歴保持手段からのデータアドレスから高々
1つを前記エントリ選択回路からのアドレス一致情報に
よって選択するアドレス選択回路と、このアドレス選択
回路からのデータアドレスと入力されているロード命令
のデータアドレスとから予測アドレスを生成するアドレ
ス生成回路とを含む。
The address history holding means comprises a plurality of instruction address history holding means composed of a plurality of words, and a plurality of data addresses composed of a plurality of words corresponding to the instruction address history holding means. History holding means; the instruction address comparing means,
A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether or not they match each other; in the predicted address generation means, at most one of the data addresses from the plurality of data address history holding means is selected by the address matching information from the entry selection circuit. It includes an address selection circuit and an address generation circuit that generates a predicted address from the data address from the address selection circuit and the data address of the input load instruction.

【0011】また、前記アドレス履歴保持手段は、複数
のワードから構成される1つの前記命令アドレス履歴保
持手段と、この命令アドレス履歴保持手段に対応する複
数のワードから構成される1つの前記データアドレス履
歴保持手段とを含む。
The address history holding means includes one instruction address history holding means composed of a plurality of words and one data address formed of a plurality of words corresponding to the instruction address history holding means. And history holding means.

【0012】また、前記予測アドレス生成手段は、前記
アドレス選択回路からのデータアドレスと入力されてい
るロード命令のデータアドレスとからデータアドレスの
一致を検出する一致検出回路をさらに有する。
Further, the predicted address generating means further has a coincidence detection circuit for detecting a coincidence of the data address from the data address from the address selection circuit and the data address of the input load instruction.

【0013】また、前記予測アドレス生成手段は、前記
複数のデータアドレス履歴保持手段からのデータアドレ
スの各々に対応して前記入力されているロード命令のデ
ータアドレスとからデータアドレスの一致を検出する複
数の一致検出回路と、この複数の一致検出回路からの一
致検出情報から高々1つを前記エントリ選択回路からの
アドレス一致情報によって選択する一致検出選択回路を
さらに有する。
The predictive address generating means detects a match of data addresses from the data addresses of the input load instructions corresponding to the data addresses from the plurality of data address history holding means. And a match detection and selection circuit that selects at most one of the match detection information from the plurality of match detection circuits according to the address match information from the entry selection circuit.

【0014】また、前記予測アドレス生成手段は、前記
複数のデータアドレス履歴保持手段からのデータアドレ
スの各々に対応して前記入力されているロード命令のデ
ータアドレスとからデータアドレスの一致を検出する複
数の一致検出回路と、この複数の一致検出回路からの一
致検出情報から高々1つを前記エントリ選択回路からの
アドレス一致情報によって選択する一致検出選択回路を
さらに有する。
Further, the predicted address generation means detects a plurality of data address coincidences from the data addresses of the input load instructions corresponding to the respective data addresses from the plurality of data address history holding means. And a match detection and selection circuit that selects at most one of the match detection information from the plurality of match detection circuits according to the address match information from the entry selection circuit.

【0015】また、前記予測アドレス生成手段は、前記
アドレス選択回路からのデータアドレスと入力されてい
るロード命令のデータアドレスとからデータアドレスの
一致を検出する一致検出回路をさらに有する。
Further, the predicted address generating means further has a coincidence detection circuit for detecting a coincidence of the data address from the data address from the address selection circuit and the data address of the input load instruction.

【0016】また、前記予測アドレス生成手段は、前記
データアドレス履歴保持手段からのデータアドレスと入
力されているロード命令のデータアドレスとからデータ
アドレスの一致を検出する一致検出回路をさらに有す
る。
Further, the predicted address generating means further has a coincidence detecting circuit for detecting a coincidence of the data addresses from the data address from the data address history holding means and the data address of the input load instruction.

【0017】上記本願発明の構成は、繰り返し構造を持
つプログラムにおいて、同一命令アドレスに格納される
メモリ参照命令を実行するたびにメモリ参照アドレスが
等間隔ずつ変化していく場合が多いことに着目したもの
であり、過去にメモリ参照のあったアドレス履歴を保持
しておくことにより、将来必要となるであろうデータの
データアドレスを予測する機能を有するものである。
It has been noted that in the above-described configuration of the present invention, in a program having a repeating structure, the memory reference address often changes at equal intervals each time the memory reference instruction stored at the same instruction address is executed. It has a function of predicting a data address of data that will be needed in the future, by holding an address history in which a memory reference was made in the past.

【0018】[0018]

【実施例】次に本願発明のキャッシュプリフェッチ装置
の一実施例について図面を参照して詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of the cache prefetch device of the present invention will be described in detail with reference to the drawings.

【0019】図1を参照すると、本願発明の一実施例の
キャッシュプリフェッチ装置は、過去に実行されたメモ
リロード命令の命令アドレスとそのメモリロード命令の
オペランドアドレス(データアドレス)とを対にして記
憶しておいて、指定された命令アドレスと対になるデー
タアドレスを連想的に読み出せるように、過去の命令ア
ドレスを記憶する命令アドレス履歴保持手段20〜2N
と、過去のデータアドレスを記憶するデータアドレス履
歴保持手段30〜3Nとを有している。また、このデー
タアドレス履歴保持手段30〜3Nと前記命令アドレス
履歴保持手段20〜2Nとを現在の命令アドレスと現在
のデータアドレスとでそれぞれ更新する更新手段10を
有している。さらに、前記命令アドレス履歴保持手段2
0〜2Nからの各アドレスと現在の命令アドレスとを各
々比較するアドレス比較回路40〜4Nと、これらアド
レス比較回路40〜4Nの比較結果に基づいていずれで
一致していたかを判断するエントリ選択回路50と、こ
のエントリ選択回路50の指示に従い前記データアドレ
ス履歴保持手段30〜3Nの内一つを選択するアドレス
選択回路60と、このアドレス選択回路60からのアド
レスと現在のデータアドレスとから次にアクセスされる
であろう予測データアドレスを生成するアドレス生成回
路70と、このアドレス生成回路70からの予測データ
アドレスを用いてキャッシュメモリにデータ転送を指示
するキャッシュ制御手段80とを有している。
Referring to FIG. 1, a cache prefetch apparatus according to an embodiment of the present invention stores a pair of an instruction address of a memory load instruction executed in the past and an operand address (data address) of the memory load instruction. The instruction address history holding means 20 to 2N that stores past instruction addresses so that the data address paired with the designated instruction address can be read associatively.
And data address history holding means 30 to 3N for storing past data addresses. Further, it has an updating means 10 for updating the data address history holding means 30 to 3N and the instruction address history holding means 20 to 2N with the current instruction address and the current data address, respectively. Further, the instruction address history holding means 2
Address comparing circuits 40 to 4N for respectively comparing the respective addresses from 0 to 2N with the current instruction address, and an entry selecting circuit for judging which of the address comparing circuits 40 to 4N is matched based on the comparison result of these address comparing circuits 40 to 4N. 50, an address selection circuit 60 for selecting one of the data address history holding means 30 to 3N in accordance with an instruction from the entry selection circuit 50, an address from the address selection circuit 60 and a current data address It has an address generation circuit 70 for generating a predicted data address to be accessed, and a cache control means 80 for instructing data transfer to a cache memory using the predicted data address from this address generation circuit 70.

【0020】命令アドレス履歴保持手段20〜2Nとデ
ータアドレス履歴保持手段30〜3Nは、各々1つのア
ドレスを保持し、それぞれ20と30、21と31、2
2と32、のように対になって構成されている。例え
ば、命令アドレス履歴保持手段20が保持する命令アド
レスに対応するデータアドレスがデータアドレス履歴保
持手段30に格納される。この命令アドレス履歴保持手
段とデータアドレス履歴保持手段の対は任意の数備える
ことが可能である(本実施例では、N+1組としてい
る)。
The instruction address history holding means 20 to 2N and the data address history holding means 30 to 3N each hold one address, and are 20 and 30, 21 and 31, 2 respectively.
2 and 32 are paired. For example, a data address corresponding to the instruction address held by the instruction address history holding means 20 is stored in the data address history holding means 30. It is possible to provide an arbitrary number of pairs of the instruction address history holding means and the data address history holding means (in this embodiment, there are N + 1 sets).

【0021】本実施例ではアドレス比較回路40〜4N
もN+1個備え、命令アドレス履歴保持手段20〜2N
から過去の命令アドレスをそれぞれ受け取り、現在の命
令アドレスとの一致を検出する。この結果はエントリ選
択回路50を介してアドレス選択回路60において、デ
ータアドレス履歴保持手段30〜3Nからのデータアド
レスを選択するために使用される。このアドレス選択回
路60で選択された過去のデータアドレス(以下、「直
前のデータアドレス」という))は信号線670によっ
てアドレス生成回路70に供給され、また、このアドレ
ス生成回路70には現在のデータアドレスが信号線17
0によって供給される。アドレス生成回路70はこれら
直前のデータアドレスと現在のデータアドレスとから予
測データアドレスを生成して、信号線780によってキ
ャッシュ制御手段80に転送する。
In this embodiment, the address comparison circuits 40 to 4N
Also, N + 1 pieces are provided, and instruction address history holding means 20 to 2N
Each of the past instruction addresses is received from and the match with the current instruction address is detected. This result is used by the address selection circuit 60 via the entry selection circuit 50 to select the data address from the data address history holding means 30 to 3N. The past data address selected by the address selection circuit 60 (hereinafter, referred to as “previous data address”) is supplied to the address generation circuit 70 by the signal line 670, and the address generation circuit 70 also receives the current data. Address is signal line 17
Supplied by 0. The address generation circuit 70 generates a predicted data address from the immediately previous data address and the current data address, and transfers the predicted data address to the cache control means 80 via the signal line 780.

【0022】命令アドレス履歴保持手段20〜2Nの中
に現在の命令アドレスと一致するものがなければ、アド
レス選択回路60では何も選択しない。従って、アドレ
ス生成回路70でも予測アドレスを生成せず、キャッシ
ュ制御手段80もキャッシュメモリにデータ転送を指示
しない。
If none of the instruction address history holding means 20 to 2N matches the current instruction address, the address selection circuit 60 selects nothing. Therefore, the address generation circuit 70 does not generate the predicted address, and the cache control unit 80 does not instruct the cache memory to transfer the data.

【0023】更新手段10は、アドレス比較回路40〜
4Nにおいて一致を検出すれば、その一致した命令アド
レス履歴保持手段に対応するデータアドレス履歴保持手
段に、現在のデータアドレスを格納する。すなわち、次
の検索に備えてデータアドレス履歴保持手段を更新す
る。また、命令アドレス履歴保持手段20〜2Nの中に
現在の命令アドレスと一致するものがなければ、命令ア
ドレス履歴保持手段とデータアドレス履歴保持手段とを
一組分確保して、現在の命令アドレスを命令アドレス履
歴保持手段に、現在のデータアドレスをデータアドレス
履歴保持手段にそれぞれ格納する。この際、全ての命令
アドレス履歴保持手段とデータアドレス履歴保持手段が
使用中であれば、何らかの方法で一組分を無効化して、
空きを作る必要がある。いずれを無効化するかを決定す
るためには、キャッシュメモリで一般的に使用されてい
るLRUアルゴリズムなどを利用することができる。
The updating means 10 includes address comparing circuits 40 to 40.
If a match is detected in 4N, the current data address is stored in the data address history holding means corresponding to the matched instruction address history holding means. That is, the data address history holding means is updated in preparation for the next search. If none of the instruction address history holding means 20 to 2N matches the current instruction address, one set of the instruction address history holding means and one set of the data address history holding means are secured to set the current instruction address. The current data address is stored in the instruction address history holding means, respectively. At this time, if all the instruction address history holding means and the data address history holding means are in use, one set is invalidated by some method,
You need to make room. In order to determine which is invalidated, the LRU algorithm generally used in the cache memory can be used.

【0024】次に本願発明の上記実施例の動作について
図面を参照して詳細に説明する。
Next, the operation of the above embodiment of the present invention will be described in detail with reference to the drawings.

【0025】まず図2(a)を参照すると、本実施例に
適用するプログラムは、配列Bの各要素にスカラー変数
Cの値を加えたものを配列Aの各要素に格納している。
この配列Bが倍精度であると仮定すると、例えば図2
(b)のように、配列Bの各要素は8バイト毎に連続し
たアドレスを有することになる。仮に、ループの1周目
でB(1)のアドレスが5000番地であったとする
と、2周目ではB(2)の5008番地にアクセスし、
3周目ではB(3)の5016番地にアクセスする。こ
の性質を利用すれば、B(2)をアクセスした際に、B
(1)のアドレスからの増分値をB(2)のアドレスに
加算することによりB(3)のアドレスを予測すること
ができる。但し、プログラム中で記憶装置にアクセスす
る命令は各所にあり、これらを一意に識別するためにそ
の命令の命令アドレスを使用する。
First, referring to FIG. 2A, the program applied to this embodiment stores in each element of the array A the value of the scalar variable C added to each element of the array B.
Assuming that this array B has double precision, for example, as shown in FIG.
As shown in (b), each element of array B has a continuous address every 8 bytes. If the address of B (1) is 5000 at the first lap of the loop, the address of 5008 of B (2) is accessed at the second lap,
On the third lap, access to address 5016 of B (3). If this property is used, when B (2) is accessed, B
The address of B (3) can be predicted by adding the increment value from the address of (1) to the address of B (2). However, there are instructions to access the storage device in various places in the program, and the instruction address of the instruction is used to uniquely identify them.

【0026】図2(c)を参照すると、図2(a)のプ
ログラムのオブジェクトコードは、配列Bの一つの要素
を記憶装置からロードするロード命令の命令アドレスは
9000番地で、BとCの加算をしてAに格納する浮動
小数点加算命令の命令アドレスは9004番地で、Aを
記憶装置にストアするストア命令の命令アドレスは90
08番地で、インデックスカウンタIをカウントアップ
する固定小数点加算命令の命令アドレスは9012番地
で、所定のループ回数を実行したかを判断する分岐命令
の命令アドレスは9016番地である。
Referring to FIG. 2 (c), the object code of the program of FIG. 2 (a) is such that the instruction address of a load instruction for loading one element of the array B from the storage device is 9000, and B and C The instruction address of the floating point addition instruction for adding and storing in A is 9004, and the instruction address of the store instruction for storing A in the storage device is 90.
At address 08, the instruction address of the fixed-point addition instruction that counts up the index counter I is address 9012, and the instruction address of the branch instruction that determines whether a predetermined number of loops has been executed is address 9016.

【0027】図3を参照すると、上記配列Bのデータア
ドレスを予測するために、ロード命令の命令アドレスで
ある9000番地と配列Bの前回のデータアドレス50
00番地とが対になって、それぞれ命令アドレス履歴保
持手段とデータアドレス履歴保持手段に保持されてい
る。ここでは、現在の命令として、命令アドレス900
0番地のロード命令がチェック対象となっており、この
ロード命令のオペランドアドレス(データアドレス)が
5008番地となっている。アドレス比較回路40は、
現在の命令アドレスと命令アドレス履歴保持手段20か
らの命令アドレスとを比較して、共に9000番地であ
り一致することをアドレス選択回路60に伝える。この
アドレス選択回路60は、接続されている複数のデータ
アドレス履歴保持手段30〜3Nの中からデータアドレ
ス履歴保持手段30を選択して、保持されている前回の
データアドレス5000番地を信号線670によってア
ドレス生成回路70に転送する。このアドレス生成回路
70では、現在の命令であるロード命令のデータアドレ
ス5008番地を信号線170によって受け取り、この
現在のデータアドレス5008番地と前回のデータアド
レス5000番地とから、次にアクセスされるであろう
予測データアドレスを生成して信号線780によってキ
ャッシュ制御手段80に転送する。
Referring to FIG. 3, in order to predict the data address of the array B, the instruction address 9000 of the load instruction and the previous data address 50 of the array B are used.
Address 00 is paired and held in the instruction address history holding means and the data address history holding means, respectively. Here, as the current instruction, the instruction address 900
The load instruction at address 0 is to be checked, and the operand address (data address) of this load instruction is at address 5008. The address comparison circuit 40
The current instruction address and the instruction address from the instruction address history holding means 20 are compared, and both are address 9000, and it is notified to the address selection circuit 60 that they match. The address selection circuit 60 selects the data address history holding means 30 from the plurality of connected data address history holding means 30 to 3N and uses the signal line 670 to select the previously held data address 5000 address. It is transferred to the address generation circuit 70. In the address generation circuit 70, the data address 5008 of the load instruction which is the current instruction is received by the signal line 170, and the next access is made from the current data address 5008 and the previous data address 5000. A wax prediction data address is generated and transferred to the cache control means 80 by the signal line 780.

【0028】図4を参照すると、アドレス生成回路70
の一実施例において、信号線670上の前回のデータア
ドレスXと、信号線170上の現在のデータアドレスY
とを使用して、まず前回から今回への増分値を求めるた
めに減算器701でY−Xを生成して、これに今回のデ
ータアドレスを加算器702で加算することによって信
号線780から予測データアドレス(2×Y−X)を出
力している。
Referring to FIG. 4, the address generation circuit 70
In one embodiment, the previous data address X on signal line 670 and the current data address Y on signal line 170.
Using and, first, Y−X is generated by the subtractor 701 to obtain the increment value from the previous time, and the data address of this time is added to this by the adder 702 to predict from the signal line 780. The data address (2 × Y−X) is output.

【0029】図4(b)はアドレス生成回路70の他の
実施例であり、まず、現在のデータアドレスYの2倍を
求めるためにシフタ703を備えている。このシフタ7
03は、実際には信号線170と減算器704の接続を
1ビット上位方向にずらして最下位ビットとしてゼロを
補うもので、図4(a)の構成に比べて簡単化されてい
る。いずれにせよ、信号線780から出力(2×Y−
X)を得ることができる。
FIG. 4B shows another embodiment of the address generation circuit 70. First, a shifter 703 is provided to obtain twice the current data address Y. This shifter 7
Reference numeral 03 actually shifts the connection between the signal line 170 and the subtractor 704 by one bit in the upper direction to compensate for zero as the least significant bit, and is simplified as compared with the configuration of FIG. In any case, output from the signal line 780 (2 × Y−
X) can be obtained.

【0030】次に本願発明の上記実施例の動作タイミン
グについてタイムチャートを参照して詳細に説明する。
Next, the operation timing of the above embodiment of the present invention will be described in detail with reference to the time chart.

【0031】図5を参照すると、時刻T1において現在
の命令アドレスとして8096番地が入力されている。
次の時刻T2において図2(c)の命令アドレス900
0番地のロード命令が入力されている。このロード命令
のデータアドレスは5000番地を指している。この命
令がロード命令であるため、ロード命令デコード信号が
その旨を示している。このロード命令デコード信号によ
って、命令アドレスの9000番地とデータアドレスの
5000番地とをそれぞれ命令アドレス履歴保持手段2
0とデータアドレス履歴保持手段30に格納する。この
格納した値は次の時刻T3から反映される。時刻T3では
命令アドレス9004番地の命令が入力され、続く時刻
T4では命令アドレス9008番地の命令が入力されて
いく。
Referring to FIG. 5, at time T1, address 8096 is input as the current instruction address.
At the next time T2, the instruction address 900 of FIG.
A load instruction at address 0 has been input. The data address of this load instruction points to the address 5000. Since this instruction is a load instruction, the load instruction decode signal indicates that. By the load instruction decode signal, the instruction address history holding means 2 is provided for each of the instruction address 9000 and the data address 5000.
0 and stored in the data address history holding means 30. The stored value is reflected from the next time T3. At time T3, the instruction at the instruction address 9004 is input, and at subsequent time T4, the instruction at the instruction address 9008 is input.

【0032】図2(c)のオブジェクトコードで命令ア
ドレス9016番地の分岐命令が実行されると、所定の
回数(100回)に満たないことから、命令アドレス9
000番地のロード命令に分岐する。図5のタイミング
チャートでは、時刻T7において命令アドレス9000
番地のロード命令が入力され、このロード命令のデータ
アドレスは5008番地を指している。このロード命令
の命令アドレス9000番地と命令アドレス履歴保持手
段20の命令アドレス9000番地とが一致するため、
アドレス比較回路40の出力が”一致”を示す。これに
より、アドレス選択回路60では、命令アドレス履歴保
持手段20と対になるデータアドレス履歴保持手段30
のデータアドレス5000番地を選択し、信号線670
によってアドレス生成回路70に転送する。また、この
ロード命令のデータアドレスは信号線170によってア
ドレス生成回路70に転送され、このアドレス生成回路
70で予測データアドレス5016番地が生成されて、
信号線780から出力される。さらに、更新手段10に
よって、このロード命令のデータアドレス5008番地
がデータアドレス履歴保持手段30に格納される。この
格納された値は次の時刻T8から反映される。
When the branch instruction at the instruction address 9016 is executed with the object code of FIG. 2C, it does not reach the predetermined number (100 times), so the instruction address 9
Branch to the load instruction at address 000. In the timing chart of FIG. 5, the instruction address 9000 at time T7
An address load instruction is input, and the data address of this load instruction points to address 5008. Since the instruction address 9000 of this load instruction and the instruction address 9000 of the instruction address history holding means 20 match,
The output of the address comparison circuit 40 indicates "match". As a result, in the address selection circuit 60, the data address history holding means 30 paired with the instruction address history holding means 20.
Select the data address 5000 of the
To the address generation circuit 70. The data address of this load instruction is transferred to the address generation circuit 70 by the signal line 170, and the predicted data address 5016 is generated by this address generation circuit 70.
It is output from the signal line 780. Further, the updating means 10 stores the data address 5008 of the load instruction in the data address history holding means 30. The stored value is reflected from the next time T8.

【0033】以降、T12でもT7と同様の動作により、
予測データアドレスが生成され、データアドレス履歴保
持手段30が更新されていく。
After that, at T12, by the same operation as at T7,
The predicted data address is generated and the data address history holding unit 30 is updated.

【0034】以上の説明からわかるように本願発明で
は、それぞれアドレス比較回路を備える命令アドレス履
歴保持手段とデータアドレス保持手段の対を複数設ける
ことにより、アドレス空間上を一定間隔でアクセスする
ロード命令のデータアドレスを予測して、キャッシュメ
モリにプリフェッチすることができる。
As can be seen from the above description, in the present invention, by providing a plurality of pairs of instruction address history holding means and data address holding means each having an address comparison circuit, a load instruction for accessing the address space at regular intervals is provided. The data address can be predicted and prefetched into the cache memory.

【0035】次に本願発明のキャッシュプリフェッチ装
置の第2の実施例について図面を参照して詳細に説明す
る。
Next, a second embodiment of the cache prefetch device of the present invention will be described in detail with reference to the drawings.

【0036】図6を参照すると、本願発明の第2の実施
例のキャッシュプリフェッチ装置は、過去に実行された
メモリロード命令の命令アドレスとそのメモリロード命
令のデータアドレスとを対にして記憶しておいて、指定
された命令アドレスと対になるデータアドレスを連想的
に読み出せるように、過去の命令アドレスを記憶する命
令アドレス履歴保持手段20〜2Nと、過去のデータア
ドレスを記憶するデータアドレス履歴保持手段30〜3
Nとを有している。また、このデータアドレス履歴保持
手段30〜3Nと前記命令アドレス履歴保持手段20〜
2Nとを現在の命令アドレスと現在のデータアドレスと
でそれぞれ更新する更新手段10を有している。さら
に、前記データアドレス履歴保持手段30〜3Nからの
データアドレスと現在のデータアドレスとから次にアク
セスされるであろう予測データアドレスを各々生成する
アドレス生成回路70〜7Nと、前記命令アドレス履歴
保持手段20〜2Nからの各アドレスと現在の命令アド
レスとを各々比較するアドレス比較回路40〜4Nと、
これらアドレス比較回路40〜4Nの比較結果に基づい
ていずれで一致していたかを判断するエントリ選択回路
50と、このエントリ選択回路50の指示に従い前記ア
ドレス生成回路70〜7Nの内一つを選択するアドレス
選択回路60と、このアドレス選択回路60からの予測
データアドレスを用いてキャッシュメモリにデータ転送
を指示するキャッシュ制御手段80とを有している。
Referring to FIG. 6, the cache prefetch device of the second embodiment of the present invention stores the instruction address of the memory load instruction executed in the past and the data address of the memory load instruction as a pair and stores them. In order to associatively read the data address paired with the designated command address, the command address history holding means 20 to 2N for storing the past command address and the data address history for storing the past data address. Holding means 30-3
N and. Further, the data address history holding means 30 to 3N and the instruction address history holding means 20 to
2N is updated with a current instruction address and a current data address, respectively. Further, address generating circuits 70 to 7N for respectively generating predicted data addresses which will be accessed next from the data address from the data address history holding means 30 to 3N and the current data address, and the instruction address history holding. Address comparing circuits 40 to 4N for respectively comparing the respective addresses from the means 20 to 2N with the current instruction address,
An entry selection circuit 50 that determines which of the address comparison circuits 40 to 4N has a match based on the comparison result, and one of the address generation circuits 70 to 7N is selected according to an instruction from the entry selection circuit 50. It has an address selection circuit 60 and a cache control means 80 for instructing the cache memory to transfer data using the predicted data address from the address selection circuit 60.

【0037】図6の本願発明の第2の実施例では、過去
に実行されたメモリロード命令の命令アドレスとそのメ
モリロード命令のデータアドレスとを対にして記憶する
ことは、本願発明の第1の実施例と異同ないが、これら
を記憶する命令アドレス履歴保持手段20〜2Nとデー
タアドレス履歴保持手段30〜3Nが各々複数のワード
から構成されている点で異なる。これに伴い、入力され
た命令アドレスの内、数ビット分が命令アドレス履歴保
持手段20〜2Nおよびデータアドレス履歴保持手段3
0〜3Nのワードを選択するために使用され、残りの部
分が命令アドレス履歴保持手段20〜2Nに保持される
と共にアドレス比較回路40〜4Nでの比較対象とな
る。例えば、命令アドレス履歴保持手段20〜2Nおよ
びデータアドレス履歴保持手段30〜3Nのワード数を
各々256ワードとすると、命令アドレスの内8ビット
分が命令アドレス履歴保持手段20〜2Nおよびデータ
アドレス履歴保持手段30〜3Nのワード選択に使用さ
れることになる。
In the second embodiment of the invention of FIG. 6, storing the instruction address of the memory load instruction executed in the past and the data address of the memory load instruction as a pair is the first embodiment of the invention of the present application. However, the difference is that the instruction address history holding means 20 to 2N and the data address history holding means 30 to 3N for storing them are each composed of a plurality of words. Along with this, several bits of the input instruction address are included in the instruction address history holding means 20 to 2N and the data address history holding means 3.
It is used to select a word of 0 to 3N, and the remaining part is held in the instruction address history holding means 20 to 2N and becomes a comparison target in the address comparison circuits 40 to 4N. For example, assuming that the number of words in each of the instruction address history holding means 20 to 2N and the data address history holding means 30 to 3N is 256 words, 8 bits of the instruction address correspond to the instruction address history holding means 20 to 2N and the data address history holding. It will be used for word selection of means 30-3N.

【0038】図7を参照すると本願発明の第2の実施例
の要部において、命令アドレスの上位部分がアドレス比
較回路40〜43の比較対象となり、その下位の部分が
命令アドレス履歴保持手段20〜23およびデータアド
レス履歴保持手段30〜33のワード選択に使用されて
いる。なお、さらに下位の部分が使用されていないの
は、各命令アドレスが例えば4バイト単位等に境界付け
されていることを前提としたものである。また、アドレ
ス生成回路70〜73がデータアドレス履歴保持手段3
0〜33の各々に設けられているが、データアドレス履
歴保持手段30〜33のデータアドレスをアドレス選択
回路60で選択して、この選択されたデータアドレスと
現在のデータアドレスとからアドレスを生成するように
構成することも可能である。
Referring to FIG. 7, in the main part of the second embodiment of the present invention, the upper part of the instruction address is the comparison target of the address comparison circuits 40 to 43, and the lower part thereof is the instruction address history holding means 20 to. 23 and the data address history holding means 30 to 33 are used for word selection. The lower part is not used on the assumption that each instruction address is demarcated in units of 4 bytes, for example. In addition, the address generation circuits 70 to 73 make the data address history holding means 3
Although provided in each of 0 to 33, the data address of the data address history holding means 30 to 33 is selected by the address selection circuit 60, and an address is generated from the selected data address and the current data address. It can also be configured as follows.

【0039】本願発明の第2の実施例においては、いず
れかのアドレス生成回路においてアドレス一致を検出し
た場合、更新手段10は、そのアドレス一致を検出した
アドレス生成回路に対応するデータアドレス履歴保持手
段を現在のデータアドレスで更新する。また、ロード命
令であるにも拘らずアドレス一致を検出しなかった場合
には、第1の発明と同様に何らかのアルゴリズムに基づ
き、いずれかの命令アドレス履歴保持手段とデータアド
レス履歴保持手段の対を選択する。選択された命令アド
レス履歴保持手段とデータアドレス履歴保持手段のどの
ワードを使用するかは、既述のように命令アドレスによ
り一意に定められる。
In the second embodiment of the present invention, when an address match is detected in any of the address generation circuits, the updating means 10 causes the data address history holding means corresponding to the address generation circuit in which the address match is detected. With the current data address. If the address match is not detected despite the load instruction, one of the instruction address history holding means and the data address history holding means is paired based on some algorithm as in the first invention. select. Which word of the selected instruction address history holding means and data address history holding means is used is uniquely determined by the instruction address as described above.

【0040】この本願発明の第2の実施例によれば、各
命令アドレス履歴保持手段が保持する命令アドレスは元
の命令アドレスの一部分のみであるため、本願発明の第
1の実施例と比較して、より少ない記憶容量で構成する
ことができる。また本願発明の第2の実施例によれば、
アドレス比較回路を複数の命令アドレス毎に備えるた
め、全命令アドレス毎にアドレス比較回路を備える本願
発明の第1の実施例と比較して、より少ない個数でしか
もよりビット幅の狭いアドレス比較回路で構成すること
ができる。
According to the second embodiment of the present invention, since the instruction address held by each instruction address history holding means is only a part of the original instruction address, it is compared with the first embodiment of the present invention. And can be configured with a smaller storage capacity. According to the second embodiment of the present invention,
Since the address comparison circuit is provided for each of a plurality of instruction addresses, the number of the address comparison circuits is smaller and the bit width is narrower than that of the first embodiment of the present invention in which the address comparison circuit is provided for every instruction address. Can be configured.

【0041】次に本願発明のキャッシュプリフェッチ装
置の第3の実施例について図面を参照して詳細に説明す
る。
Next, a third embodiment of the cache prefetch device of the present invention will be described in detail with reference to the drawings.

【0042】図8を参照すると、本願発明の第3の実施
例のキャッシュプリフェッチ装置は、過去に実行された
メモリロード命令の命令アドレスとそのメモリロード命
令のデータアドレスとを対にして記憶しておいて、指定
された命令アドレスと対になるデータアドレスを連想的
に読み出せるように、過去の命令アドレスを記憶する命
令アドレス履歴保持手段20と、過去のデータアドレス
を記憶するデータアドレス履歴保持手段30と、このデ
ータアドレス履歴保持手段30と前記命令アドレス履歴
保持手段20とを現在の命令アドレスと現在のデータア
ドレスとでそれぞれ更新する更新手段10と、前記デー
タアドレス履歴保持手段30からのデータアドレスと現
在のデータアドレスとから次にアクセスされるであろう
予測データアドレスを各々生成するアドレス生成回路7
0と、前記命令アドレス履歴保持手段20からの命令ア
ドレスと現在の命令アドレスとを比較するアドレス比較
回路40と、これらアドレス比較回路40の比較結果と
前記アドレス生成回路70からの予測データアドレスと
を用いてキャッシュメモリにデータ転送を指示するキャ
ッシュ制御手段80とから構成される。
Referring to FIG. 8, the cache prefetch device of the third embodiment of the present invention stores the instruction address of the memory load instruction executed in the past and the data address of the memory load instruction as a pair and stores them. In order to associatively read the data address paired with the designated instruction address, the instruction address history holding means 20 for storing the past instruction address and the data address history holding means for storing the past data address. 30, an updating unit 10 for updating the data address history holding unit 30 and the instruction address history holding unit 20 with a current instruction address and a current data address, and a data address from the data address history holding unit 30. And the current data address and the predicted data address that will be accessed next. Generating each address generation circuit 7
0, an address comparison circuit 40 that compares the instruction address from the instruction address history holding unit 20 with the current instruction address, a comparison result of these address comparison circuits 40, and a predicted data address from the address generation circuit 70. The cache control means 80 is used to instruct data transfer to the cache memory.

【0043】図8の本願発明の第3の一実施例では、過
去に実行されたメモリロード命令の命令アドレスとその
メモリロード命令のデータアドレスとを対にして記憶す
ることは、本願発明の第2の実施例と異同ないが、これ
らを記憶する命令アドレス履歴保持手段20とデータア
ドレス履歴保持手段30が1つずつしか設けられていな
い点で異なる。すなわち、本願発明の第2の実施例では
命令アドレスの内、ワード選択に用いる部分が等しい命
令アドレス同士を同時に記憶しておくことができるが、
本願発明の第3の実施例ではこれができない。しかし、
アドレス選択回路などを必要せず、更新手段10におい
ていずれの命令アドレス履歴保持手段とデータアドレス
履歴保持手段の対を使用すべきかを判断する必要がない
ため、本願発明の第2の実施例よりも簡単な構成で実現
でき、命令アドレス履歴保持手段20およびデータアド
レス履歴保持手段30のワード数を大きくとることがで
きるという利点がある。
In the third embodiment of the present invention of FIG. 8, storing the instruction address of the memory load instruction executed in the past and the data address of the memory load instruction as a pair is the same as the first embodiment of the present invention. Although not different from the second embodiment, it is different in that only one instruction address history holding means 20 and one data address history holding means 30 for storing these are provided. That is, in the second embodiment of the present invention, among the instruction addresses, the instruction addresses having the same portion used for word selection can be stored at the same time.
This cannot be done in the third embodiment of the present invention. But,
Since it is not necessary to determine which pair of instruction address history holding means and data address history holding means should be used in the updating means 10 without requiring an address selection circuit, etc. There is an advantage that it can be realized with a simple configuration and the number of words of the instruction address history holding means 20 and the data address history holding means 30 can be made large.

【0044】次に本願発明のキャッシュプリフェッチ装
置の第4〜6の実施例について図面を参照して説明す
る。
Next, fourth to sixth embodiments of the cache prefetch device of the present invention will be described with reference to the drawings.

【0045】図9を参照すると、本願発明の第4の実施
例のキャッシュプリフェッチ装置は、図8の本願発明の
第3の実施例に一致検出回路90を付加した構成になっ
ている。この一致検出回路90は、データアドレス履歴
保持手段30からのデータアドレスと現在のデータアド
レスとを比較して、もし両者が一致していればデータア
ドレスに変化がないことを検出することができる。これ
により、ループ中でアドレスの変化しないロード命令に
ついては状況に応じてキャッシュのプリフェッチを抑制
するように制御することが可能になる。もっとも、この
ような場合には、コンパイラによりそのデータをレジス
タに割り付けておくようにすることが望ましいが、レジ
スタ数の制約によって割り付けられない場合には上述の
ようなロード命令が生成されてしまうのである。
Referring to FIG. 9, the cache prefetch device according to the fourth embodiment of the present invention has a configuration in which a coincidence detection circuit 90 is added to the third embodiment of the present invention shown in FIG. The coincidence detection circuit 90 can compare the data address from the data address history holding unit 30 with the current data address and detect that the data address has not changed if the two coincide. As a result, it becomes possible to control the cache prefetch to be suppressed depending on the situation for the load instruction whose address does not change in the loop. However, in such a case, it is desirable that the compiler allocates the data to the register, but if the data cannot be allocated due to the constraint of the number of registers, the above load instruction will be generated. is there.

【0046】図10および図11は、それぞれ本願発明
の第2の実施例および本願発明の第1の実施例に一致検
出回路を付加した構成になっており、図8の本願発明の
第4の実施例と同様の働きをするものである。
10 and 11 show a configuration in which a coincidence detection circuit is added to the second embodiment of the present invention and the first embodiment of the present invention, respectively. It functions similarly to the embodiment.

【0047】[0047]

【発明の効果】以上説明したように本願発明のキャッシ
ュプリフェッチ装置によれば、現在のデータアドレスと
前回のデータアドレスとから次回にアクセスされるであ
ろうデータアドレスを予測して、キャッシュメモリに対
して予めそのデータを転送しておくように制御すること
ができるため、中央処理装置がプログラムを実行する際
の実効性能を向上させるという効果がある。
As described above, according to the cache prefetch device of the present invention, the data address that will be accessed next time is predicted from the current data address and the previous data address, and the cache memory is stored in the cache memory. Since it can be controlled so that the data is transferred in advance, there is an effect of improving the effective performance when the central processing unit executes the program.

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

【図1】本願発明のキャッシュプリフェッチ装置の第1
の一実施例の構成図である。
FIG. 1 is a first cache prefetch device according to the present invention.
It is a block diagram of one Example.

【図2】本願発明に適用される一プログラム例である。FIG. 2 is an example of a program applied to the present invention.

【図3】本願発明のキャッシュプリフェッチ装置の概念
図である。
FIG. 3 is a conceptual diagram of a cache prefetch device of the present invention.

【図4】本願発明におけるアドレス生成回路である。FIG. 4 is an address generation circuit according to the present invention.

【図5】本願発明の第1の実施例によるタイミング図で
ある。
FIG. 5 is a timing diagram according to the first embodiment of the present invention.

【図6】本願発明のキャッシュプリフェッチ装置の第2
の実施例の構成図である。
FIG. 6 shows a second cache prefetch device according to the present invention.
It is a block diagram of the Example of.

【図7】本願発明の第2の一実施例の要部の構成図であ
る。
FIG. 7 is a configuration diagram of a main part of a second embodiment of the present invention.

【図8】本願発明のキャッシュプリフェッチ装置の第3
の実施例の構成図である。
FIG. 8 is a third example of the cache prefetch device of the present invention.
It is a block diagram of the Example of.

【図9】本願発明のキャッシュプリフェッチ装置の第4
の実施例の構成図である。
FIG. 9 is a fourth example of the cache prefetch device of the present invention.
It is a block diagram of the Example of.

【図10】本願発明のキャッシュプリフェッチ装置の第
5の実施例の構成図である。
FIG. 10 is a configuration diagram of a fifth embodiment of the cache prefetch device of the present invention.

【図11】本願発明のキャッシュプリフェッチ装置の第
6の実施例の構成図である。
FIG. 11 is a configuration diagram of a sixth embodiment of the cache prefetch device of the present invention.

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

10 更新手段 20〜2N 命令アドレス履歴保持手段 30〜3N データアドレス履歴保持手段 40〜4N アドレス比較回路 50 エントリ選択回路 60 アドレス選択回路 70〜7N アドレス生成回路 80 キャッシュ制御手段 90〜9N 一致検出回路 100 一致検出選択回路 170 現在のデータアドレス 670 直前のデータアドレス 780 予測データアドレス 10 update means 20-2N instruction address history holding means 30-3N data address history holding means 40-4N address comparison circuit 50 entry selection circuit 60 address selection circuit 70-7N address generation circuit 80 cache control means 90-9N coincidence detection circuit 100 Match detection selection circuit 170 Current data address 670 Previous data address 780 Predicted data address

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 記憶装置からデータを取り出すロード命
令について、命令アドレスを保持する命令アドレス履歴
保持手段とデータアドレスを保持するデータアドレス履
歴保持手段とを含むアドレス履歴保持手段と;このアド
レス履歴保持手段の命令アドレス履歴保持手段からの命
令アドレスと入力されているロード命令の命令アドレス
とを比較して一致を検出する命令アドレス比較手段と;
この命令アドレス比較手段での比較結果に基づいて前記
アドレス履歴保持手段のデータアドレス履歴保持手段か
らのデータアドレスと前記入力されているロード命令の
データアドレスとから予測データアドレスを生成する予
測アドレス生成手段と;前記入力されているロード命令
の命令アドレスとデータアドレスとをそれぞれ前記命令
アドレス履歴保持手段と前記データアドレス履歴保持手
段に格納する更新手段と;を有し、前記入力されている
ロード命令を次回実行する際にアクセスされるであろう
データアドレスを予測してキャッシュメモリに予め当該
データを記憶装置から転送しておくように制御するキャ
ッシュプリフェッチ装置。
1. An address history holding unit including an instruction address history holding unit holding an instruction address and a data address history holding unit holding a data address for a load instruction for fetching data from a storage device; Instruction address comparing means for comparing the instruction address from the instruction address history holding means with the instruction address of the input load instruction to detect a match;
Prediction address generating means for generating a prediction data address from the data address from the data address history holding means of the address history holding means and the data address of the input load instruction based on the comparison result of the instruction address comparing means. And; updating means for storing the instruction address and the data address of the input load instruction in the instruction address history holding means and the data address history holding means, respectively; A cache prefetch device that predicts a data address to be accessed next time and executes control so that the data is transferred to the cache memory in advance from the storage device.
【請求項2】 前記アドレス履歴保持手段は、複数の前
記命令アドレス履歴保持手段と、これら命令アドレス履
歴保持手段に対応する複数の前記データアドレス履歴保
持手段とを含み;前記命令アドレス比較手段は、前記複
数の命令アドレス履歴保持手段の各々の命令アドレスと
前記入力されているロード命令の命令アドレスとの比較
をそれぞれ行う複数のアドレス比較回路と、これら複数
のアドレス比較回路の比較結果に基づいていずれで一致
していたかを判断するエントリ選択回路とを含み;前記
予測アドレス生成手段は、前記複数のデータアドレス履
歴保持手段からのデータアドレスから高々1つを前記エ
ントリ選択回路からのアドレス一致情報によって選択す
るアドレス選択回路と、このアドレス選択回路からのデ
ータアドレスと入力されているロード命令のデータアド
レスとから予測アドレスを生成するアドレス生成回路と
を含むことを特徴とする請求項1に記載のキャッシュプ
リフェッチ装置。
2. The address history holding means includes a plurality of the instruction address history holding means and a plurality of the data address history holding means corresponding to the instruction address history holding means; the instruction address comparing means, A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether or not they match each other; the predictive address generation means selects at most one of the data addresses from the plurality of data address history holding means according to the address matching information from the entry selection circuit. Address selection circuit, and data address and input from this address selection circuit 2. The cache prefetch device according to claim 1, further comprising an address generation circuit that generates a predicted address from the data address of the loaded load instruction.
【請求項3】 前記アドレス履歴保持手段は、複数の前
記命令アドレス履歴保持手段と、この命令アドレス履歴
保持手段に対応する複数の前記データアドレス履歴保持
手段とを含み;前記命令アドレス比較手段は、前記複数
の命令アドレス履歴保持手段の各々の命令アドレスと前
記入力されているロード命令の命令アドレスとの比較を
それぞれ行う複数のアドレス比較回路と、これら複数の
アドレス比較回路の比較結果に基づいていずれで一致し
ていたかを判断するエントリ選択回路とを含み;前記予
測アドレス生成手段は、前記複数のデータアドレス履歴
保持手段の各々に対応して前記入力されているロード命
令のデータアドレスとから各々予測アドレスを生成する
複数のアドレス生成回路と、この複数のアドレス生成回
路からの予測アドレスから高々1つを前記エントリ選択
回路からのアドレス一致情報によって選択するアドレス
選択回路とを含むことを特徴とする請求項1に記載のキ
ャッシュプリフェッチ装置。
3. The address history holding means includes a plurality of the instruction address history holding means and a plurality of the data address history holding means corresponding to the instruction address history holding means; the instruction address comparing means, A plurality of address comparison circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction; and, based on the comparison results of the plurality of address comparison circuits, And an entry selection circuit for determining whether or not they match each other; the predictive address generating means predicts each from a data address of the load instruction input corresponding to each of the plurality of data address history holding means. A plurality of address generation circuits that generate addresses and prediction addresses from the plurality of address generation circuits. 2. The cache prefetch device according to claim 1, further comprising an address selection circuit that selects at most one of the addresses according to the address matching information from the entry selection circuit.
【請求項4】 前記アドレス履歴保持手段は、複数のワ
ードから構成される複数の前記命令アドレス履歴保持手
段と、これら命令アドレス履歴保持手段に対応する複数
のワードから構成される複数の前記データアドレス履歴
保持手段とを含み;前記命令アドレス比較手段は、前記
複数の命令アドレス履歴保持手段の各々の命令アドレス
と前記入力されているロード命令の命令アドレスとの比
較をそれぞれ行う複数のアドレス比較回路と、これら複
数のアドレス比較回路の比較結果に基づいていずれで一
致していたかを判断するエントリ選択回路とを含み;前
記予測アドレス生成手段は、前記複数のデータアドレス
履歴保持手段の各々のデータアドレスと前記入力されて
いるロード命令のデータアドレスとから予測アドレスを
生成する複数のアドレス生成回路と、この複数のアドレ
ス生成回路からの予測アドレスから高々1つを前記エン
トリ選択回路からのアドレス一致情報によって選択する
アドレス選択回路とを含むことを特徴とする請求項1に
記載のキャッシュプリフェッチ装置。
4. The address history holding means comprises a plurality of instruction address history holding means composed of a plurality of words, and a plurality of data addresses composed of a plurality of words corresponding to the instruction address history holding means. History holding means; the instruction address comparing means includes a plurality of address comparing circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction. An entry selection circuit that determines which of the plurality of address comparison circuits is the same based on the comparison result of the plurality of address comparison circuits; A plurality of addresses for generating a predicted address from the data address of the input load instruction 2. The cache according to claim 1, further comprising a response generation circuit and an address selection circuit that selects at most one of the predicted addresses from the plurality of address generation circuits according to the address matching information from the entry selection circuit. Prefetch device.
【請求項5】 前記アドレス履歴保持手段は、複数のワ
ードから構成される複数の前記命令アドレス履歴保持手
段と、これら命令アドレス履歴保持手段に対応する複数
のワードから構成される複数の前記データアドレス履歴
保持手段とを含み;前記命令アドレス比較手段は、前記
複数の命令アドレス履歴保持手段の各々の命令アドレス
と前記入力されているロード命令の命令アドレスとの比
較をそれぞれ行う複数のアドレス比較回路と、これら複
数のアドレス比較回路の比較結果に基づいていずれで一
致していたかを判断するエントリ選択回路とを含み;前
記予測アドレス生成手段において前記複数のデータアド
レス履歴保持手段からのデータアドレスから高々1つを
前記エントリ選択回路からのアドレス一致情報によって
選択するアドレス選択回路と、このアドレス選択回路か
らのデータアドレスと入力されているロード命令のデー
タアドレスとから予測アドレスを生成するアドレス生成
回路とを含むことを特徴とする請求項1に記載のキャッ
シュプリフェッチ装置。
5. The address history holding means comprises a plurality of instruction address history holding means composed of a plurality of words, and a plurality of data addresses composed of a plurality of words corresponding to the instruction address history holding means. History holding means; the instruction address comparing means includes a plurality of address comparing circuits for respectively comparing the instruction addresses of the plurality of instruction address history holding means with the instruction address of the input load instruction. An entry selection circuit that determines which of the plurality of address comparison circuits has a match based on the comparison result of the plurality of address comparison circuits; the predicted address generation means includes at most 1 from the data addresses from the plurality of data address history holding means. Address selection information, which is selected according to the address matching information from the entry selection circuit. 2. The cache prefetch device according to claim 1, further comprising a selection circuit and an address generation circuit that generates a predicted address from the data address from the address selection circuit and the data address of the input load instruction.
【請求項6】 前記アドレス履歴保持手段は、複数のワ
ードから構成される1つの前記命令アドレス履歴保持手
段と、この命令アドレス履歴保持手段に対応する複数の
ワードから構成される1つの前記データアドレス履歴保
持手段とを含むことを特徴とする請求項1に記載のキャ
ッシュプリフェッチ装置。
6. The address history holding means comprises one instruction address history holding means composed of a plurality of words and one data address composed of a plurality of words corresponding to the instruction address history holding means. The cache prefetch device according to claim 1, further comprising history holding means.
【請求項7】 前記予測アドレス生成手段は、前記アド
レス選択回路からのデータアドレスと入力されているロ
ード命令のデータアドレスとからデータアドレスの一致
を検出する一致検出回路をさらに有することを特徴とす
る請求項2に記載のキャッシュプリフェッチ装置。
7. The predictive address generating means further comprises a coincidence detection circuit for detecting a coincidence of the data address from the data address from the address selection circuit and the data address of the input load instruction. The cache prefetch device according to claim 2.
【請求項8】 前記予測アドレス生成手段は、前記複数
のデータアドレス履歴保持手段からのデータアドレスの
各々に対応して前記入力されているロード命令のデータ
アドレスとからデータアドレスの一致を検出する複数の
一致検出回路と、この複数の一致検出回路からの一致検
出情報から高々1つを前記エントリ選択回路からのアド
レス一致情報によって選択する一致検出選択回路をさら
に有することを特徴とする請求項3に記載のキャッシュ
プリフェッチ装置。
8. The predictive address generating means detects a plurality of data addresses from a data address of the input load instruction corresponding to each of the data addresses from the plurality of data address history holding means. 4. The match detection circuit according to claim 3, further comprising a match detection selection circuit for selecting at most one of the match detection information from the plurality of match detection circuits according to the address match information from the entry selection circuit. The described cache prefetch device.
【請求項9】 前記予測アドレス生成手段は、前記複数
のデータアドレス履歴保持手段からのデータアドレスの
各々に対応して前記入力されているロード命令のデータ
アドレスとからデータアドレスの一致を検出する複数の
一致検出回路と、この複数の一致検出回路からの一致検
出情報から高々1つを前記エントリ選択回路からのアド
レス一致情報によって選択する一致検出選択回路をさら
に有することを特徴とする請求項4に記載のキャッシュ
プリフェッチ装置。
9. The predictive address generating means detects a match of data addresses from the data address of the input load instruction corresponding to each of the data addresses from the plurality of data address history holding means. 5. The coincidence detection circuit according to claim 4, further comprising a coincidence detection selection circuit for selecting at most one of the coincidence detection information from the plurality of coincidence detection circuits according to the address coincidence information from the entry selection circuit. The described cache prefetch device.
【請求項10】 前記予測アドレス生成手段は、前記ア
ドレス選択回路からのデータアドレスと入力されている
ロード命令のデータアドレスとからデータアドレスの一
致を検出する一致検出回路をさらに有することを特徴と
する請求項5に記載のキャッシュプリフェッチ装置。
10. The predictive address generating means further comprises a coincidence detection circuit for detecting a coincidence of the data address from the data address from the address selection circuit and the data address of the input load instruction. The cache prefetch device according to claim 5.
【請求項11】 前記予測アドレス生成手段は、前記デ
ータアドレス履歴保持手段からのデータアドレスと入力
されているロード命令のデータアドレスとからデータア
ドレスの一致を検出する一致検出回路をさらに有するこ
とを特徴とする請求項6に記載のキャッシュプリフェッ
チ装置。
11. The predictive address generating means further comprises a coincidence detecting circuit for detecting a coincidence of the data address from the data address from the data address history holding means and the data address of the input load instruction. The cache prefetch device according to claim 6.
JP5201672A 1993-08-13 1993-08-13 Cache prefetch device Expired - Lifetime JP2638434B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5201672A JP2638434B2 (en) 1993-08-13 1993-08-13 Cache prefetch device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5201672A JP2638434B2 (en) 1993-08-13 1993-08-13 Cache prefetch device

Publications (2)

Publication Number Publication Date
JPH0756809A true JPH0756809A (en) 1995-03-03
JP2638434B2 JP2638434B2 (en) 1997-08-06

Family

ID=16444990

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5201672A Expired - Lifetime JP2638434B2 (en) 1993-08-13 1993-08-13 Cache prefetch device

Country Status (1)

Country Link
JP (1) JP2638434B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7436689B2 (en) * 2006-08-18 2008-10-14 Fujitsu Limited Non-volatile semiconductor memory
US8166252B2 (en) 2007-06-18 2012-04-24 Fujitsu Limited Processor and prefetch support program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7436689B2 (en) * 2006-08-18 2008-10-14 Fujitsu Limited Non-volatile semiconductor memory
US8166252B2 (en) 2007-06-18 2012-04-24 Fujitsu Limited Processor and prefetch support program

Also Published As

Publication number Publication date
JP2638434B2 (en) 1997-08-06

Similar Documents

Publication Publication Date Title
US5781752A (en) Table based data speculation circuit for parallel processing computer
JP3098071B2 (en) Computer system for efficient execution of programs with conditional branches
JP3175675B2 (en) Prefetch control device
US5687360A (en) Branch predictor using multiple prediction heuristics and a heuristic identifier in the branch instruction
US4524416A (en) Stack mechanism with the ability to dynamically alter the size of a stack in a data processing system
CA1212476A (en) Data processing apparatus and method employing instruction flow prediction
US4725947A (en) Data processor with a branch target instruction storage
US5367703A (en) Method and system for enhanced branch history prediction accuracy in a superscalar processor system
JP2744890B2 (en) Branch prediction data processing apparatus and operation method
US5581721A (en) Data processing unit which can access more registers than the registers indicated by the register fields in an instruction
JP3594506B2 (en) Microprocessor branch instruction prediction method.
US5297281A (en) Multiple sequence processor system
US7743238B2 (en) Accessing items of architectural state from a register cache in a data processing apparatus when performing branch prediction operations for an indirect branch instruction
EP0125855B1 (en) Buffer-storage control system
US5905881A (en) Delayed state writes for an instruction processor
EP0305639B1 (en) Vector computer
JP2006520964A (en) Method and apparatus for branch prediction based on branch target
US5335330A (en) Information processing apparatus with optimization programming
US7143272B2 (en) Using computation histories to make predictions
US5940857A (en) Instruction cache memory apparatus with advanced read function that predicts whether to read out a next instruction block including an address register, a counter and a selector
KR100317240B1 (en) Branch predictor using branch prediction accuracy history
JP2638434B2 (en) Cache prefetch device
JP2954178B1 (en) Variable cache method
US7447884B2 (en) Multi-table branch prediction circuit for predicting a branch's target address based on the branch's delay slot instruction address
US6035392A (en) Computer with optimizing hardware for conditional hedge fetching into cache storage

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19970318