JP2003030046A - Cache controller having pre-fetch mechanism of instruction cache - Google Patents

Cache controller having pre-fetch mechanism of instruction cache

Info

Publication number
JP2003030046A
JP2003030046A JP2001210926A JP2001210926A JP2003030046A JP 2003030046 A JP2003030046 A JP 2003030046A JP 2001210926 A JP2001210926 A JP 2001210926A JP 2001210926 A JP2001210926 A JP 2001210926A JP 2003030046 A JP2003030046 A JP 2003030046A
Authority
JP
Japan
Prior art keywords
instruction
prefetch
cache
information
block
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
JP2001210926A
Other languages
Japanese (ja)
Inventor
Kazuhiko Tanaka
和彦 田中
Toru Nojiri
徹 野尻
Kiyokazu Nishioka
清和 西岡
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2001210926A priority Critical patent/JP2003030046A/en
Publication of JP2003030046A publication Critical patent/JP2003030046A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a cache controller with which coherency between a cache and a main memory is maintained even when a pre-fetch address is dynamically changed. SOLUTION: Pre-fetch information 2100 recorded in a predetermined area in a read instruction block 2000 is stored in a storage area separate from the cache and the pre-fetch of other instruction blocks is performed on the basis of the pre-fetch information 2100.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、命令をメモリから
プリフェッチしてキャッシュに格納するキャッシュ制御
装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache controller for prefetching instructions from a memory and storing them in a cache.

【0002】[0002]

【従来の技術】近年、LSIの実装技術の進歩によりL
SI内部の動作周波数は大幅に向上しており、1GHz
を上回る動作周波数を実現しているプロセッサも登場し
ている。一方、プロセッサの外部に接続されるメモリの
動作周波数の向上のペースは、LSI内部の動作周波数
向上のペースに比べて遅く、プロセッサ内部の動作周波
数と外部に接続されたメモリの動作周波数の差は開く一
方である。このため、プロセッサ内部の動作周波数を向
上させても、外部メモリからの読み出しが性能向上のボ
トルネックとなる事態が起きている。
2. Description of the Related Art In recent years, L
The operating frequency inside SI has been greatly improved to 1 GHz.
There are also processors that have achieved operating frequencies that exceed this. On the other hand, the pace of improvement in the operating frequency of the memory connected to the outside of the processor is slower than the pace of improving the operating frequency in the LSI, and the difference between the operating frequency inside the processor and the operating frequency of the memory connected to the outside is It is opening. Therefore, even if the operating frequency inside the processor is improved, reading from the external memory becomes a bottleneck for performance improvement.

【0003】これを解決する手段として、キャッシュメ
モリを使用する方法がある。これは、一度、外部メモリ
から読み込んだ、命令やデータをプロセッサ内部にある
高速なキャッシュメモリに保存しておくことで、低速な
外部メモリに対するアクセス頻度を減らすものである。
As a means for solving this, there is a method of using a cache memory. This is to reduce the frequency of access to the low-speed external memory by storing the instructions and data once read from the external memory in the high-speed cache memory inside the processor.

【0004】しかし、プロセッサに大容量のキャッシュ
メモリを搭載するとコストが上昇するため、プロセッサ
搭載可能なキャッシュメモリの容量には限度がある。こ
の場合、キャッシュに必要な命令やデータを全て保存し
ておくことができない。
However, if a large-capacity cache memory is mounted on the processor, the cost rises, and therefore the capacity of the cache memory that can be mounted on the processor is limited. In this case, it is not possible to store all necessary instructions and data in the cache.

【0005】キャッシュメモリ中に次の命令の実行に必
要な命令やデータが存在しない場合(キャッシュミス)
には、プロセッサの動作を停止して外部メモリへアクセ
スを行う必要が生じる。プロセッサの処理性能向上のた
めには、このキャッシュミスの頻度を減らすことが必要
である。
When there is no instruction or data necessary for executing the next instruction in the cache memory (cache miss)
Therefore, it is necessary to stop the operation of the processor and access the external memory. In order to improve the processing performance of the processor, it is necessary to reduce the frequency of this cache miss.

【0006】その対策として、プリフェッチと呼ばれる
手法がある。これは、プログラム実行中に、今後、必要
になると思われる命令やデータを、先行してキャッシュ
に読み込んでおくものである。具体的には、プリフェッ
チを行なう命令群のアドレス(プリフェッチアドレス)
を指定したプリフェッチ命令を命令列中に含ませてお
き、プロセッサの命令実行ユニットがその命令を解釈し
て、指定されたアドレスの命令群をキャッシュに読み込
むことでプリフェッチを行なうようにしている。
As a countermeasure, there is a method called prefetch. This is to read in advance instructions and data that will be needed in the cache during execution of the program. Specifically, the address of the prefetch instruction group (prefetch address)
The prefetch instruction designating "?" Is included in the instruction sequence, and the instruction execution unit of the processor interprets the instruction and reads the instruction group at the designated address into the cache to perform prefetch.

【0007】[0007]

【発明が解決しようとする課題】ところで、条件分岐の
ように、プログラムの実行順序がプログラム実行時に動
的に変わる場合には、プリフェッチすべき命令群をあら
かじめ定めておくことはできない。このため、命令キャ
ッシュを搭載したプロセッサにおいて、命令のプリフェ
ッチを効率良く行うためには、プログラム実行中に、そ
のコントロールフローの変化に伴い、命令のプリフェッ
チアドレスを動的に変える必要がある。しかし、従来の
手法によれば、プリフェッチアドレスがプリフェッチ命
令とともに命令キャッシュに読み込まれているため、プ
リフェッチアドレスを変更する場合には、主メモリとの
整合性をとる必要があり、キャッシュの無効化等の制御
が煩雑になったり、処理性能が低下するという問題点が
生じる。
By the way, when the execution order of programs dynamically changes during program execution, such as conditional branching, it is not possible to predetermine the instruction group to be prefetched. Therefore, in order to efficiently prefetch an instruction in a processor equipped with an instruction cache, it is necessary to dynamically change the prefetch address of the instruction according to the change of the control flow during the execution of the program. However, according to the conventional method, since the prefetch address is read into the instruction cache together with the prefetch instruction, it is necessary to take consistency with the main memory when changing the prefetch address. There is a problem that the control of is complicated and the processing performance is deteriorated.

【0008】また、プロセッサの命令実行ユニットが、
命令列中のプリフェッチ命令にしたがってプリフェッチ
を行なうことは、実行サイクルが増加することになる。
Also, the instruction execution unit of the processor is
Performing the prefetch according to the prefetch instruction in the instruction sequence increases the execution cycle.

【0009】本発明の目的は、プリフェッチアドレスを
動的に変更した場合にも、キャッシュと主メモリとのコ
ヒーレンシーが保たれるキャッシュ制御装置を提供する
ことにある。
An object of the present invention is to provide a cache control device in which coherency between the cache and the main memory is maintained even when the prefetch address is dynamically changed.

【0010】さらに、本発明の別目的は、実行サイクル
を増加させることなくプリフェッチを実行することを可
能とする構成のキャッシュ制御装置を提供することにあ
る。
Another object of the present invention is to provide a cache control device having a structure capable of executing prefetch without increasing the number of execution cycles.

【0011】[0011]

【課題を解決するための手段】上記課題を解決するた
め、本発明によれば、記憶装置からデータを、連続した
アドレスに格納された複数個のデータの集合であるブロ
ック単位で読み込んで、キャッシュに格納するキャッシ
ュ制御装置であって、読み込んだブロック中のあらかじ
め定めた領域に記録されたプリフェッチ情報を、前記キ
ャッシュとは別の記憶領域に格納する手段と、前記格納
したプリフェッチ情報に基づいて、他のブロックの前記
キャッシュへの格納を行なうプリフェッチ手段とを備え
ることを特徴とするキャッシュ制御装置が提供される。
In order to solve the above problems, according to the present invention, data is read from a storage device in block units, which is a set of a plurality of data stored at consecutive addresses, and cached. A cache control device for storing the prefetch information recorded in a predetermined area in the read block, based on the means for storing the prefetch information in a storage area different from the cache, and the stored prefetch information, A cache control device is provided, which comprises a prefetch means for storing another block in the cache.

【0012】[0012]

【発明の実施の形態】本発明の実施の形態について、図
面を参照して説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described with reference to the drawings.

【0013】図1は、本発明を適用したプロセッサの構
成例を説明するためのブロック図である。
FIG. 1 is a block diagram for explaining a configuration example of a processor to which the present invention is applied.

【0014】本図において、プロセッサ1が、メモリバ
ス3を介してメモリ2に接続されている。プロセッサ1
は、メモリ2に格納されているプログラムから命令およ
びデータを読み出し、読み出した命令に従って演算処理
等を行い、処理結果のデータ等をメモリ2に書き込む。
本例では、メモリ2は、プロセッサ1の外部に置いてあ
るが、プロセッサ1と同一チップ内に搭載することもで
きる。また、汎用のプロセッサと同様に、プロセッサ1
とメモリ2との間に2次キャッシュを搭載するようにし
てもよい。
In the figure, a processor 1 is connected to a memory 2 via a memory bus 3. Processor 1
Reads instructions and data from the program stored in the memory 2, performs arithmetic processing and the like according to the read instruction, and writes the processing result data and the like in the memory 2.
In this example, the memory 2 is placed outside the processor 1, but it may be mounted in the same chip as the processor 1. Also, like the general-purpose processor, the processor 1
A secondary cache may be mounted between the memory 2 and the memory 2.

【0015】図示するようにプロセッサ1は、命令キャ
ッシュ12、命令制御ユニット13、命令実行ユニット
14、データキャッシュ15、データ制御ユニット1
6、メモリ制御ユニット17等を備えて構成される。
As shown, the processor 1 includes an instruction cache 12, an instruction control unit 13, an instruction execution unit 14, a data cache 15, and a data control unit 1.
6, a memory control unit 17 and the like.

【0016】命令キャッシュ12、データキャッシュ1
5は、キャッシュメモリであり、内部に高速なメモリを
備えている。命令キャッシュ12内のメモリには、メモ
リ2に格納されている命令のコピーが置かれ、データキ
ャッシュ15内のメモリには、メモリ2に格納されてい
るデータのコピーが置かれる。
Instruction cache 12 and data cache 1
A cache memory 5 has a high-speed memory inside. A copy of the instruction stored in the memory 2 is placed in the memory in the instruction cache 12, and a copy of the data stored in the memory 2 is placed in the memory in the data cache 15.

【0017】命令制御ユニット13は、命令キャッシュ
12からの命令読み出し制御を行うとともに、命令実行
ユニット14から送られてくる分岐要求などを参照しな
がら、命令キャッシュ12に対するアクセスアドレス
(プログラムカウンタ)を更新する。また、キャッシュ
ミス時には命令キャッシュ12への書き込み制御も行
う。
The instruction control unit 13 controls the instruction read from the instruction cache 12 and updates the access address (program counter) to the instruction cache 12 while referring to the branch request sent from the instruction execution unit 14. To do. In addition, when a cache miss occurs, write control to the instruction cache 12 is also performed.

【0018】命令実行ユニット14は、メモリ2に格納
されている命令に従って演算処理等を実行する。
The instruction execution unit 14 executes arithmetic processing and the like according to the instructions stored in the memory 2.

【0019】データ制御ユニット16は、命令実行ユニ
ット14からの指示に従ってデータキャッシュ15に対
するデータの読み書きの制御を行う。また、キャッシュ
ミス時にはデータキャッシュ15への書き込み制御も行
う。
The data control unit 16 controls reading / writing of data from / to the data cache 15 in accordance with an instruction from the instruction execution unit 14. Further, when a cache miss occurs, the write control to the data cache 15 is also performed.

【0020】メモリ制御ユニット17は、命令制御ユニ
ット13等からの指示に従って、メモリ2からデータを
読み出したり、メモリ2にデータを書き込んだりする。
The memory control unit 17 reads data from the memory 2 or writes data in the memory 2 according to an instruction from the instruction control unit 13 or the like.

【0021】また、プロセッサ1の内部には、信号の伝
送路であるプロセッサ内部バス910が設けられてい
る。プロセッサ内部バス910は、データを伝送するデ
ータ信号線911と、アドレス、制御信号等を伝送する
制御信号線912とを備えている。
A processor internal bus 910, which is a signal transmission path, is provided inside the processor 1. The processor internal bus 910 includes a data signal line 911 for transmitting data and a control signal line 912 for transmitting an address, a control signal and the like.

【0022】データ信号線911は、命令キャッシュ1
2、命令制御ユニット13、データキャッシュ15、メ
モリ制御ユニット17に接続される。制御信号線912
は、アドレス線、リードリクエスト線、ライトリクエス
ト線、データ有効線等を含み、命令制御ユニット13、
データ制御ユニット16、メモリ制御ユニット17に接
続される。なお、プロセッサ内部バス910の調停を行
う信号群および調停用の回路等については図示および説
明を省略する。
The data signal line 911 is used for the instruction cache 1
2. Connected to the instruction control unit 13, the data cache 15, and the memory control unit 17. Control signal line 912
Includes an address line, a read request line, a write request line, a data valid line, etc., and the instruction control unit 13,
It is connected to the data control unit 16 and the memory control unit 17. It should be noted that illustration and description of a signal group for performing arbitration of the processor internal bus 910, an arbitration circuit, and the like are omitted.

【0023】命令キャッシュ12から命令実行ユニット
14へは、信号線901により命令が送られる。データ
キャッシュ15と命令実行ユニット14との間では、信
号線902によりデータがやり取りされる。
An instruction is sent from the instruction cache 12 to the instruction execution unit 14 via a signal line 901. Data is exchanged between the data cache 15 and the instruction execution unit 14 via a signal line 902.

【0024】命令制御ユニット13は、信号線903を
用いて命令キャッシュ12を制御する。データ制御ユニ
ット16は、信号線906を用いてデータキャッシュ1
5を制御する。また命令実行ユニット14は、命令制御
ユニット13、データ制御ユニット14と情報のやりと
りを、それぞれ信号線904、905を用いて行う。
The instruction control unit 13 controls the instruction cache 12 using the signal line 903. The data control unit 16 uses the signal line 906 to
Control 5 The instruction execution unit 14 exchanges information with the instruction control unit 13 and the data control unit 14 using signal lines 904 and 905, respectively.

【0025】命令制御ユニット13についてさらに説明
する。図2は、本実施例における命令制御ユニット13
の構成例を説明するためのブロック図である。本図に示
すように、命令制御ユニット13は、命令のプリフェッ
チに使用する情報を格納するプリフェッチバッファ13
0、命令キャッシュ12のヒット判定を行う命令キャッ
シュヒット判定ユニット131、命令のプリフェッチに
関する制御を行うプリフェッチ制御ユニット132、命
令キャッシュ12およびプロセッサ内部バス910の制
御を行う命令キャッシュ制御ユニット133、実行中の
命令アドレスを格納するプログラムカウンタ本体および
それを制御する回路を含むプログラムカウンタ制御ユニ
ット134を備えて構成される。プログラムカウンタ制
御ユニット134の構成例については後述する。
The instruction control unit 13 will be further described. FIG. 2 shows the instruction control unit 13 in this embodiment.
3 is a block diagram for explaining an example of the configuration of FIG. As shown in the figure, the instruction control unit 13 includes a prefetch buffer 13 that stores information used for prefetching instructions.
0, an instruction cache hit determination unit 131 that performs a hit determination of the instruction cache 12, a prefetch control unit 132 that controls an instruction prefetch, an instruction cache control unit 133 that controls the instruction cache 12 and the processor internal bus 910, A program counter control unit 134 including a program counter body for storing instruction addresses and a circuit for controlling the program counter body is configured. A configuration example of the program counter control unit 134 will be described later.

【0026】次に、本実施例におけるメモリ2内のプロ
グラムの格納形式について図3を用いて説明する。
Next, the storage format of the program in the memory 2 in this embodiment will be described with reference to FIG.

【0027】本実施例では、メモリ2に格納されている
プログラム(命令列)を256バイト単位で分割して管
理する。分割された各単位を命令ブロックと呼ぶ。命令
のプリフェッチは、この命令ブロックを最小単位として
行う。
In this embodiment, a program (instruction string) stored in the memory 2 is divided into 256 bytes and managed. Each divided unit is called an instruction block. Instruction prefetch is performed using this instruction block as the minimum unit.

【0028】各命令ブロックの先頭は256バイト境界
にアラインされており、先頭アドレスの下位8ビットは
常に0であるとする。
The head of each instruction block is aligned on a 256-byte boundary, and the lower 8 bits of the head address are always 0.

【0029】図示するように、各命令ブロック2000
の所定の領域、例えば、先頭の4バイトには、プリフェ
ッチ情報2100が格納される。そして、残りの252
バイトに、命令コードが格納される。プリフェッチ情報
2100は、プリフェッチを行なう命令ブロックの指定
およびプリフェッチの必要の有無等を示す情報である。
プリフェッチ情報2100は、命令実行ユニット14に
は読み込まれず、実行されない。プリフェッチ情報21
00以外の命令コードは、命令実行ユニット14に読み
込まれ、実行される通常の命令コードである。
As shown, each instruction block 2000
Prefetch information 2100 is stored in a predetermined area of, for example, the first 4 bytes. And the remaining 252
The instruction code is stored in the byte. The prefetch information 2100 is information indicating the designation of an instruction block to be prefetched, the necessity of prefetching, and the like.
The prefetch information 2100 is neither read nor executed by the instruction execution unit 14. Prefetch information 21
The instruction code other than 00 is a normal instruction code that is read and executed by the instruction execution unit 14.

【0030】本図において、プリフェッチ情報2100
は、プリフェッチアドレス2200と、プリフェッチイ
ネーブル2201とを備えて構成される。
In this figure, prefetch information 2100
Comprises a prefetch address 2200 and a prefetch enable 2201.

【0031】プリフェッチアドレス2200は、次にプ
リフェッチすべき命令ブロックの先頭アドレスを示す情
報である。本実施例では、命令ブロックの先頭アドレス
の下位8ビットは0になっているので、プリフェッチア
ドレス2200はプリフェッチ対象の命令ブロックの先
頭アドレスの上位24ビットのみを指定すれば十分であ
る。また、プリフェッチアドレス2200に格納する値
として、絶対アドレスではなく、現在の命令ブロックに
対する相対アドレスとすれば、プリフェッチアドレス2
200に必要なビット幅を少なくすることができる。
The prefetch address 2200 is information indicating the start address of the instruction block to be prefetched next. In this embodiment, since the lower 8 bits of the start address of the instruction block are 0, it is sufficient for the prefetch address 2200 to specify only the upper 24 bits of the start address of the instruction block to be prefetched. If the value stored in the prefetch address 2200 is not an absolute address but a relative address with respect to the current instruction block, the prefetch address 2
The bit width required for 200 can be reduced.

【0032】プリフェッチイネーブル2201は、現在
の命令ブロック2000のキャッシュフィル動作が終了
した後に、プリフェッチアドレス2200から開始され
る命令ブロックのキャッシュフィルを行うかどうかを表
す1ビットのフラグである。プリフェッチアドレス22
00に、例えば、オール0のような特殊な値が格納され
ていた場合に、プリフェッチを行わないというようなル
ールを設けておき、プリフェッチイネーブル2201は
省略するようにしてもよい。
The prefetch enable 2201 is a 1-bit flag indicating whether or not to perform the cache fill of the instruction block starting from the prefetch address 2200 after the cache fill operation of the current instruction block 2000 is completed. Prefetch address 22
The prefetch enable 2201 may be omitted by providing a rule that prefetching is not performed when a special value such as all 0 is stored in 00.

【0033】次に、本実施形態におけるプロセッサ1の
プリフェッチ処理について図13のフロー図を参照して
説明する。
Next, the prefetch process of the processor 1 in this embodiment will be described with reference to the flow chart of FIG.

【0034】プログラム実行中に、命令実行ユニット1
4は、実行すべき命令のコピーが命令キャッシュ12に
あれば、命令キャッシュ12から命令を取り出し実行す
る。実行する命令が命令キャッシュ12中に見つかるこ
とを、命令キャッシュ12がヒットしたという。逆に、
命令キャッシュ12中に実行する命令が見つからないこ
とを、命令キャッシュ12が(キャッシュ)ミスしたと
いう。
During execution of the program, the instruction execution unit 1
If there is a copy of the instruction to be executed in the instruction cache 12, 4 retrieves the instruction from the instruction cache 12 and executes it. When the instruction to be executed is found in the instruction cache 12, the instruction cache 12 is hit. vice versa,
The fact that the instruction to be executed cannot be found in the instruction cache 12 is said to have (cache) missed.

【0035】命令キャッシュ12がヒットしている限
り、プロセッサ1はメモリ2より命令を読み出す必要が
無く、常に命令キャッシュ12から命令を読み出して実
行することになる。命令キャッシュ12はメモリ2より
も高速にアクセスできるため、命令キャッシュ12がヒ
ットしているときには、メモリ2から命令を読んで実行
するときよりも高い処理性能を達成することができる。
As long as the instruction cache 12 is hit, the processor 1 does not need to read the instruction from the memory 2, and always reads the instruction from the instruction cache 12 and executes it. Since the instruction cache 12 can be accessed faster than the memory 2, it is possible to achieve higher processing performance when the instruction cache 12 is hit than when the instruction is read from the memory 2 and executed.

【0036】命令キャッシュ12がキャッシュミスを起
こした場合、命令実行ユニット14へ必要な命令を供給
できなくなるため、命令実行ユニット14を停止させる
必要が生じる。このように、命令実行ユニット14が停
止させられているとき、命令実行ユニット14はストー
ルしているという。ストール中、命令実行ユニット14
は、命令を実行できないため、ストールをしている時間
が長いほど、プロセッサ1の処理性能は低下することに
なる。このため、プロセッサ1の処理性能向上のために
は、ストールしている時間を減らすことが非常に重要で
ある。
When the instruction cache 12 causes a cache miss, it becomes impossible to supply the necessary instruction to the instruction execution unit 14, so it is necessary to stop the instruction execution unit 14. Thus, when the instruction execution unit 14 is stopped, the instruction execution unit 14 is said to be stalled. Instruction execution unit 14 during stall
Cannot execute an instruction, so that the longer the stall time is, the lower the processing performance of the processor 1. Therefore, in order to improve the processing performance of the processor 1, it is very important to reduce the stall time.

【0037】命令キャッシュ12がキャッシュミスを起
こすと(S101)、命令制御ユニット13は、メモリ
制御ユニット17に対して、メモリ2からの命令ブロッ
ク読み出しリクエストを発行する。このときに、命令制
御ユニット13は、メモリ制御ユニット17に、読み出
すべき命令ブロック2000の先頭アドレス(上位24
ビット)も送る。これらは、プロセッサ内部バス910
を経由して行われる。
When the instruction cache 12 causes a cache miss (S101), the instruction control unit 13 issues an instruction block read request from the memory 2 to the memory control unit 17. At this time, the instruction control unit 13 notifies the memory control unit 17 of the start address (upper 24 bits) of the instruction block 2000 to be read.
Send a bit). These are the processor internal bus 910.
Done via.

【0038】このリクエストを受け取ったメモリ制御ユ
ニット17は、送られてきた先頭アドレスで特定される
命令ブロック2000を、メモリ2から読み込む(S1
02)。そして、命令制御ユニット13は、読み込んだ
命令ブロック2000に含まれる命令を、命令キャッシ
ュ12に書き込む。この一連の転送をキャッシュフィル
と呼ぶ。
Upon receiving this request, the memory control unit 17 reads the instruction block 2000 specified by the sent start address from the memory 2 (S1).
02). Then, the instruction control unit 13 writes the instruction included in the read instruction block 2000 into the instruction cache 12. This series of transfers is called cache fill.

【0039】この際に、命令ブロック2000に含まれ
るプリフェッチ情報2100は命令制御ユニット13の
プリフェッチバッファ130に書き込み、命令キャッシ
ュ12には書き込まないようにする(S103)。な
お、これらのキャッシュフィル動作はメモリ制御ユニッ
ト17が行なうようにしてもよい。
At this time, the prefetch information 2100 included in the instruction block 2000 is written in the prefetch buffer 130 of the instruction control unit 13 and is not written in the instruction cache 12 (S103). The cache control operation may be performed by the memory control unit 17.

【0040】プリフェッチ制御ユニット132は、プリ
フェッチバッファ130に格納されたプリフェッチ情報
2100のプリフェッチイネーブル2201を参照し、
プリフェッチアドレス2200で示される命令ブロック
のプリフェッチが必要かどうかを判断する(S10
4)。
The prefetch control unit 132 refers to the prefetch enable 2201 of the prefetch information 2100 stored in the prefetch buffer 130,
It is determined whether prefetch of the instruction block indicated by the prefetch address 2200 is necessary (S10).
4).

【0041】そして、プリフェッチが必要な場合には、
プリフェッチアドレス2200で示される命令ブロック
のプリフェッチ要求を、命令キャッシュ制御ユニット1
33へ発行する。命令キャッシュ制御ユニット133
は、現在の命令ブロックの転送が終わると、発行された
プリフェッチ制御ユニット132からの要求にしたが
い、次のキャッシュフィル(プリフェッチ)動作を開始
して、命令ブロックを読み込む(S102)。
When prefetch is necessary,
The instruction cache control unit 1 issues a prefetch request for the instruction block indicated by the prefetch address 2200.
Issue to 33. Instruction cache control unit 133
When the transfer of the current instruction block is completed, the next cache fill (prefetch) operation is started according to the issued request from the prefetch control unit 132, and the instruction block is read (S102).

【0042】一方、プリフェッチが不要な場合には、プ
リフェッチ要求は発行しない。その後は、命令キャッシ
ュ12がミスした場合に、前述のキャッシュフィル動作
においてプリフェッチの必要の有無を判断する処理を行
なう。
On the other hand, if the prefetch is unnecessary, the prefetch request is not issued. After that, when the instruction cache 12 misses, a process of determining whether or not prefetch is necessary in the above-described cache fill operation is performed.

【0043】キャッシュミスを発生させた命令を含む命
令ブロックが命令キャッシュ12に格納されると、命令
キャッシュヒット判定ユニット131は、キャッシュが
ヒット状態になったことを、命令キャッシュ制御ユニッ
ト133へ通知する。これにより命令実行ユニット14
のストールは解除される。
When the instruction block including the instruction causing the cache miss is stored in the instruction cache 12, the instruction cache hit determination unit 131 notifies the instruction cache control unit 133 that the cache is in the hit state. . This enables the instruction execution unit 14
Stall is canceled.

【0044】なお、プリフェッチを行おうとしている命
令ブロック2000がすでに命令キャッシュ12内に存
在している場合には、プリフェッチ要求を発行しないよ
うにすることで、メモリ2およびプロセッサ内部バス9
10の転送バンド幅を節約することができる。これは、
例えば、キャッシュフィルを行なった命令ブロック20
00のプリフェッチイネーブル2201をクリアするこ
とにより実現することができる。
If the instruction block 2000 to be prefetched already exists in the instruction cache 12, the prefetch request is not issued so that the memory 2 and the processor internal bus 9 are not issued.
A transfer bandwidth of 10 can be saved. this is,
For example, the instruction block 20 that has been cache-filled
This can be realized by clearing the prefetch enable 2201 of 00.

【0045】このように、本実施例によれば、プリフェ
ッチ情報2100に基づいてプリフェッチ処理を行なう
ことにより、プリフェッチ命令自体は、命令実行ユニッ
ト14によって実行されないので、プリフェッチによる
プロセッサ1の実行サイクルの増加を防ぐことができ
る。
As described above, according to the present embodiment, by performing the prefetch processing based on the prefetch information 2100, the prefetch instruction itself is not executed by the instruction execution unit 14, so that the execution cycle of the processor 1 by the prefetch is increased. Can be prevented.

【0046】なお、命令ブロック2000のプリフェッ
チ情報2100は、命令実行ユニット14が実行しない
情報であるため、プログラムをシーケンシャルに実行す
る際には、プリフェッチ情報2100をスキップする必
要がある。これは、例えば、プログラムカウンタ制御ユ
ニット134の一部を、図4に示した回路で構成するこ
とにより実現することができる。
Since the prefetch information 2100 of the instruction block 2000 is information that the instruction execution unit 14 does not execute, it is necessary to skip the prefetch information 2100 when executing the program sequentially. This can be realized, for example, by configuring a part of the program counter control unit 134 with the circuit shown in FIG.

【0047】本図において、プログラムカウンタ134
0は、現在の命令のアドレスを格納する記憶素子であ
る。命令長加算回路1341はプログラムカウンタ13
40の出力値に、プリフェッチ情報2100の大きさ、
例えば、4バイトを加算する回路である。この部分を変
更することで他の大きさにも対応可能となる。
In this figure, the program counter 134
0 is a storage element that stores the address of the current instruction. The instruction length addition circuit 1341 uses the program counter 13
The output value of 40, the size of the prefetch information 2100,
For example, a circuit that adds 4 bytes. By changing this part, other sizes can be accommodated.

【0048】プリフェッチ情報飛び越し回路1342
は、プリフェッチ情報2100をスキップするための回
路であり、例えば、命令長加算回路1341の出力のビ
ット7〜2が全て0であった場合に、これに4を加算す
るようになっている。ここで、命令長加算回路1341
の出力はビット31が最上位ビットであり、ビット0が
最下位ビットのバイトアドレスであるとする。これによ
り、プリフェッチ情報飛び越し回路1342は、常にプ
リフェッチ情報2100以外の場所を指すことになる。
Prefetch information skipping circuit 1342
Is a circuit for skipping the prefetch information 2100. For example, when bits 7 to 2 of the output of the instruction length addition circuit 1341 are all 0, 4 is added to this. Here, the instruction length addition circuit 1341
It is assumed that bit 31 is the most significant bit and bit 0 is the least significant bit byte address. As a result, the prefetch information skip circuit 1342 always points to a place other than the prefetch information 2100.

【0049】アドレス切り替え回路1343は、分岐命
令実行時に、プリフェッチ情報飛び越し回路1342の
出力の代わりに、命令実行ユニット14から送られてく
る分岐先アドレスをプログラムカウンタ1340の入力
として使用することにより、分岐を実現する回路であ
る。
When the branch instruction is executed, the address switching circuit 1343 uses the branch destination address sent from the instruction execution unit 14 as the input of the program counter 1340 instead of the output of the prefetch information skip circuit 1342. It is a circuit that realizes.

【0050】以上の回路により、プログラム中に分岐命
令を入れなくとも、プリフェッチ情報の部分を自動的に
スキップすることが可能となる。
The above circuit makes it possible to automatically skip the prefetch information portion without inserting a branch instruction in the program.

【0051】次に、命令ブロック2000に含まれるプ
リフェッチ情報2100の生成方法について説明する。
Next, a method of generating the prefetch information 2100 included in the instruction block 2000 will be described.

【0052】本発明においてプリフェッチ情報2100
は複数の方法およびタイミングで生成することができ
る。
In the present invention, the prefetch information 2100
Can be generated in multiple ways and timings.

【0053】例えば、プログラム開発時において、開発
者が、ソースコード中にプリフェッチを行なうこと示す
情報を埋め込むようにすることができる。そして、コン
パイラがオブジェクトファイルを作成するときにプリフ
ェッチ情報2000を作成し、リンク時にプリフェッチ
アドレス2200を決定するようにする。
For example, at the time of program development, the developer can embed information indicating that prefetching will be performed in the source code. Then, the compiler creates the prefetch information 2000 when creating the object file, and determines the prefetch address 2200 when linking.

【0054】また、コンパイラがコンパイル時に各命令
ブロックの実行順序を定めるときにプリフェッチ情報を
生成するようにしてもよい。
The prefetch information may be generated when the compiler determines the execution order of each instruction block at the time of compilation.

【0055】ただし、いずれの場合も、命令中に条件分
岐命令が含まれ、分岐結果によりプリフェッチに必要な
命令ブロックが異なるときには、プリフェッチ情報生成
時にどちらの命令ブロックをプリフェッチするかの指定
が一般に必要となる。このため、開発者がプリフェッチ
を行なうこと示す情報をソースコード中に埋め込むとき
には、あらかじめどちらの可能性が高いかを判断して、
その情報も埋め込むようにする。また、コンパイラがプ
リフェッチ情報を生成するときには、例えば、プログラ
ムの一般的な性質を用いて分岐先の予測をして、プリフ
ェッチ情報を作成するようにすることができる。
In either case, however, when a conditional branch instruction is included in the instruction and the instruction block required for prefetching differs depending on the branch result, it is generally necessary to specify which instruction block to prefetch when generating the prefetch information. Becomes Therefore, when the developer embeds information indicating that prefetching in the source code, it is determined whether the advance is high both possibilities,
Make sure to embed that information as well. Further, when the compiler generates the prefetch information, the prefetch information can be created by predicting the branch destination by using the general property of the program, for example.

【0056】さらに、本発明においては、上記のように
プリフェッチ情報2100をあらかじめ決定しておく方
法に加え、プログラム実行中に、実行中のプログラム自
身がプリフェッチ情報2100を書き換えるようにする
こともできる。
Further, in the present invention, in addition to the method of predetermining the prefetch information 2100 as described above, it is also possible that the program being executed rewrites the prefetch information 2100 during execution of the program.

【0057】まず、図5に示したプログラム例を用い
て、プリフェッチ情報2100の書き換えを行なわない
場合について説明する。
First, the case where the prefetch information 2100 is not rewritten will be described with reference to the program example shown in FIG.

【0058】図5に示したプログラムの1行目(以下
「line_1」のように示す)は、キーボードからの入力内
容によって、modeという変数に、0または1を代入する
命令文である。
The first line (shown as "line_1" below) of the program shown in FIG. 5 is an instruction statement for substituting 0 or 1 into a variable called mode depending on the contents input from the keyboard.

【0059】line_2は、line_3からline_8までの処理
を、変数flagが1である間、繰り返させる命令文であ
る。
Line_2 is an instruction statement for repeating the processing from line_3 to line_8 while the variable flag is 1.

【0060】line_3は、変数modeの値にかかわらず、関
数routine_common()を実行する。
Line_3 executes the function routine_common () regardless of the value of the variable mode.

【0061】line_4からline_8は、変数modeが1なら
ば、関数routine_mode1()を実行し、変数modeが0なら
ば、関数routine_mode0()を実行する。
The line_4 to line_8 execute the function routine_mode1 () if the variable mode is 1, and execute the function routine_mode0 () if the variable mode is 0.

【0062】すなわち、図5に示したプログラムは、キ
ーボード入力により変数modeに1が代入されれば、関数
routine_common()と関数routine_mode1とを交互に繰り
返し、0が代入されれば、関数routine_common()と関数
routine_mode0()とを交互に繰り返す処理を、変数flag
が1である間、実行することになる。
That is, in the program shown in FIG. 5, if 1 is assigned to the variable mode by keyboard input, the function
If routine_common () and function routine_mode1 are repeated alternately and 0 is substituted, the function routine_common () and function
The process that repeats routine_mode0 () alternately is changed to the variable flag.
While 1 is 1, it will be executed.

【0063】ここで、関数routine_common()の大きさ
が、命令キャッシュ12の容量よりも大きいとすると、
変数modeの値にかかわらず、関数routine_mode0()ある
いは関数routine_mode1()の読み出し時にキャッシュミ
スを起こすことになる。このため、実行する関数をプリ
フェッチしておくことは性能向上を実現するために重要
である。
If the size of the function routine_common () is larger than the capacity of the instruction cache 12,
Regardless of the value of the variable mode, a cache miss will occur when reading the function routine_mode0 () or the function routine_mode1 (). Therefore, it is important to prefetch the function to be executed in order to improve the performance.

【0064】しかし、プログラム作成時には、変数mode
の値が決定していないため、関数routine_mode1()およ
び関数routine_mode0()のどちらが実行されるかを知る
ことができない。
However, when creating the program, the variable mode
It is not possible to know which of the function routine_mode1 () or the function routine_mode0 () is executed because the value of is not determined.

【0065】仮に、関数routine_common()を含む命令ブ
ロック2000のプリフェッチ情報2100に、関数ro
utine_mode0()を含む命令ブロックをプリフェッチする
ように指定しておくと、変数modeが0の場合には、プリ
フェッチが有効に行われ、処理性能が向上する。しか
し、変数modeが1の場合には、プリフェッチが有効に行
われないばかりでなく、不要なプリフェッチ処理によ
り、転送バンド幅を消費してしまうため、プリフェッチ
をしない場合よりも処理性能が悪化してしまう。
If the prefetch information 2100 of the instruction block 2000 including the function routine_common () contains the function ro
If the instruction block including utine_mode0 () is designated to be prefetched, when the variable mode is 0, prefetching is effectively performed and the processing performance is improved. However, when the variable mode is 1, not only prefetching is not performed effectively, but also transfer bandwidth is consumed by unnecessary prefetching processing, so processing performance is worse than when prefetching is not performed. I will end up.

【0066】次に、図6に示したプログラム例を用い
て、プリフェッチ情報2100の書き換えを行なう場合
について説明する。
Next, the case where the prefetch information 2100 is rewritten will be described using the program example shown in FIG.

【0067】本図に示したプログラムの処理内容は、図
5に示したプログラムの処理内容と同じである。本プロ
グラムにおいて、line_10のupdate_prefetch_info()
は、プリフェッチ情報を書き換える命令である。
The processing contents of the program shown in this figure are the same as the processing contents of the program shown in FIG. In this program, update_prefetch_info () of line_10
Is an instruction to rewrite prefetch information.

【0068】このプログラムでは、プログラム作成時
に、関数routine_common()を含む命令ブロック2000
のプリフェッチ情報2100に、関数routine_mode0()
を含む命令ブロックをプリフェッチするように指定して
おく。こうすることにより、line_1で、変数modeに0が
代入された場合には、命令のプリフェッチが有効に行わ
れる。一方、変数modeに1が代入された場合には、最初
は誤ったプリフェッチが行われる。しかし、line_10に
よって、関数routine_common()を含む命令ブロック20
00のプリフェッチ情報2100を、関数rouine_mode1
()を含む命令ブロックをプリフェッチするように書き換
えることで、2回目以降は正しくプリフェッチが行われ
るようになる。
In this program, the instruction block 2000 including the function routine_common () when the program is created.
Prefetch information 2100 of the function routine_mode0 ()
Specify to prefetch the instruction block containing By doing so, when 0 is assigned to the variable mode in line_1, the instruction prefetch is effectively performed. On the other hand, when 1 is assigned to the variable mode, erroneous prefetching is initially performed. However, the instruction block 20 that includes the function routine_common () by line_10
00 prefetch information 2100 to the function routine_mode1
By rewriting the instruction block including () so that it is prefetched, prefetching will be correctly performed from the second time onward.

【0069】プリフェッチ情報2100の変更は、命令
実行ユニット14において、メモリ2への書き込み命令
を発行して、書き込み命令のパラメータで特定されるメ
モリ2中のプリフェッチ情報2100を書き換えること
で実現することができる。
The change of the prefetch information 2100 can be realized by issuing a write command to the memory 2 in the instruction execution unit 14 and rewriting the prefetch information 2100 in the memory 2 specified by the parameter of the write command. it can.

【0070】次に、本発明の他の実施例について説明す
る。前述の実施例では、プリフェッチは、キャッシュミ
スをしたときのキャッシュフィル動作において、命令制
御ユニット13が、プリフェッチ情報2100を参照し
て、プリフェッチの必要の有無を判断するようにしてい
た。本実施例では、プリフェッチ命令を命令列に含めて
おき、命令実行ユニット14がこの命令に基づいてプリ
フェッチを行なうようにする。ただし、プリフェッチの
対象となる命令ブロックの指定は、前述の実施例同様に
命令ブロックの所定の位置に設けられ、命令実行ユニッ
ト14には実行されないプリフェッチ情報に格納するよ
うにする。このプリフェッチ情報は、前述の実施例同様
に、命令ブロックのキャッシュフィル動作において、プ
リフェッチバッファ130に格納される。
Next, another embodiment of the present invention will be described. In the above-described embodiment, in the prefetch, the instruction control unit 13 refers to the prefetch information 2100 in the cache fill operation when a cache miss occurs and determines whether or not the prefetch is necessary. In this embodiment, a prefetch instruction is included in the instruction sequence, and the instruction execution unit 14 performs prefetch based on this instruction. However, the designation of the instruction block to be prefetched is provided at a predetermined position of the instruction block as in the above-described embodiment, and is stored in the prefetch information that is not executed by the instruction execution unit 14. This prefetch information is stored in the prefetch buffer 130 in the cache fill operation of the instruction block, as in the above-described embodiment.

【0071】図7を参照して、このときの命令制御ユニ
ット13の処理について説明する。図7は、命令実行ユ
ニット14からの命令通知信号線904aが、プリフェ
ッチ制御ユニット132に接続されている点で図2と相
違している。
The processing of the instruction control unit 13 at this time will be described with reference to FIG. 7 is different from FIG. 2 in that the instruction notification signal line 904a from the instruction execution unit 14 is connected to the prefetch control unit 132.

【0072】命令列に埋め込まれたプリフェッチ命令
が、プログラム実行中に読み込まれ、命令実行ユニット
14で実行されると、信号線904の中のプリフェッチ
命令通知信号線904aにより、プリフェッチ制御ユニ
ット132にプリフェッチ命令通知信号が送られる。
When the prefetch instruction embedded in the instruction sequence is read during the program execution and executed by the instruction execution unit 14, the prefetch instruction notification signal line 904a in the signal line 904 prefetches the prefetch control unit 132. A command notification signal is sent.

【0073】プリフェッチ制御ユニット132は、プリ
フェッチ命令通知信号を受け取ると、プリフェッチバッ
ファ130を参照し、プリフェッチ情報を取得する。そ
して、取得した情報を基に、命令キャッシュ制御ユニッ
ト133に対して、命令ブロックのプリフェッチ要求を
発行する。このとき、プリフェッチバッファ130中に
格納されている、参照したプリフェッチ情報を無効化す
る。これは、前述の実施例では、、プリフェッチバッフ
ァ130に格納されているプリフェッチ情報2100の
プリフェッチイネーブル2201をクリアすることに相
当する。ただし、メモリ2中の対応する命令ブロックの
プリフェッチ情報を更新する必要はない。
Upon receiving the prefetch instruction notification signal, the prefetch control unit 132 refers to the prefetch buffer 130 and acquires the prefetch information. Then, based on the acquired information, a prefetch request for an instruction block is issued to the instruction cache control unit 133. At this time, the referred prefetch information stored in the prefetch buffer 130 is invalidated. This is equivalent to clearing the prefetch enable 2201 of the prefetch information 2100 stored in the prefetch buffer 130 in the above-described embodiment. However, it is not necessary to update the prefetch information of the corresponding instruction block in the memory 2.

【0074】なお、プリフェッチ制御ユニット132
は、プリフェッチ命令通知信号を受け取った時に、対応
するプリフェッチ情報がプリフェッチバッファ130内
に存在しない場合、あるいは、無効化されている場合に
は、命令キャッシュ制御ユニット133へのプリフェッ
チ要求は発行しないようにする。
The prefetch control unit 132
Does not issue a prefetch request to the instruction cache control unit 133 when the corresponding prefetch information does not exist in the prefetch buffer 130 when the prefetch instruction notification signal is received, or when it is invalidated. To do.

【0075】なお、本発明において、一つの命令ブロッ
クが含むプリフェッチ情報の数は一つに限定されない。
これを図8、図9を用いて説明する。
In the present invention, the number of prefetch information included in one instruction block is not limited to one.
This will be described with reference to FIGS. 8 and 9.

【0076】図8は複数のプリフェッチ情報を用いた場
合のメモリ2中の命令列の格納形式の一例である。本図
の例では、一つの命令ブロック2000中に、2つのプ
リフェッチ情報2100が含まれている。もちろん、プ
リフェッチ情報2100の数は2つに限られない。
FIG. 8 shows an example of the storage format of the instruction sequence in the memory 2 when a plurality of prefetch information is used. In the example of this figure, one instruction block 2000 includes two pieces of prefetch information 2100. Of course, the number of prefetch information 2100 is not limited to two.

【0077】ただし、プリフェッチ情報の領域の大きさ
に対応して、プリフェッチ情報飛び越し回路1342に
変更が必要である。例えば、プリフェッチ情報2100
の大きさが8バイトの時には、命令長加算回路1341
の出力のビット7〜3がすべて0であった場合に、これ
に8を加算する回路を用いることができる。ここで、命
令長加算回路1341の出力は、ビット31が最上位ビ
ットであり、ビット0が最下位ビットのバイトアドレス
としている。
However, it is necessary to change the prefetch information skip circuit 1342 according to the size of the prefetch information area. For example, the prefetch information 2100
Is 8 bytes, the instruction length adding circuit 1341
If all bits 7 to 3 of the output of 0 are 0, a circuit for adding 8 to this can be used. Here, in the output of the instruction length addition circuit 1341, bit 31 is the most significant bit, and bit 0 is the least significant bit byte address.

【0078】複数あるプリフェッチ情報の選択は、プリ
フェッチ命令によって指定する。図9は、複数のプリフ
ェッチ情報に対応したプログラムの一例である。本図に
おいて、line_101からline_106までの命令は、単一の命
令ブロックに収まっているものとする。また、line_10
1、line_103、line_105、line_106は、サブルーチンコ
ール(routine_X())であり、line_102、line_104は、
プリフェッチ命令(prefetch N)である。
Selection of a plurality of pieces of prefetch information is designated by a prefetch instruction. FIG. 9 is an example of a program corresponding to a plurality of prefetch information. In this figure, it is assumed that the instructions from line_101 to line_106 are contained in a single instruction block. Also, line_10
1, line_103, line_105, line_106 are subroutine calls (routine_X ()), and line_102, line_104 are
This is a prefetch instruction (prefetch N).

【0079】図9に示したプログラムでは、line_102の
命令prefetch 0は、命令ブロック中の最初のプリフェッ
チ情報を使用することを指示し、line_104の命令prefet
ch 1は、2番目のプリフェッチ情報を使用することを指
示するものとする。ここで、命令ブロックの最初のプリ
フェッチ情報に、line_105のroutine_C()を含む命令ブ
ロックをプリフェッチするための情報を格納し、2番目
のプリフェッチ情報に、line_106のroutine_D()を含む
命令ブロックをプリフェッチするための情報を格納して
おくことで、効率よく命令ブロックのプリフェッチを行
うことができる。
In the program shown in FIG. 9, the instruction prefetch 0 of line_102 indicates to use the first prefetch information in the instruction block, and the instruction prefet of line_104 is used.
ch 1 indicates to use the second prefetch information. Here, information for prefetching an instruction block including routine_C () of line_105 is stored in the first prefetch information of the instruction block, and an instruction block including routine_D () of line_106 is prefetched in the second prefetch information. By storing the information for this, prefetch of the instruction block can be efficiently performed.

【0080】このようにプリフェッチ命令を用いてプリ
フェッチの指示を行なう場合でも、プリフェッチを行な
う命令ブロックを特定するプリフェッチ情報は、命令キ
ャッシュ12に格納されないため、プログラムの実行中
に容易にその内容を変更することが可能である。
Even when the prefetch instruction is used to instruct the prefetch as described above, the prefetch information for specifying the instruction block to be prefetched is not stored in the instruction cache 12 and therefore its contents can be easily changed during the execution of the program. It is possible to

【0081】また、アドレスの指定方法として絶対アド
レスではなく、現在の命令ブロックに対する相対アドレ
スを指定するようにすれば、プリフェッチアドレス22
00に必要なビット幅を少なくすることができる。これ
を図10に示す。この例では、各プリフェッチアドレス
を4ビットの相対アドレスで指定するものとしている。
このため、4バイトの領域に8個の命令ブロックを特定
するためのアドレスを格納することができる。
If the relative address for the current instruction block is designated instead of the absolute address as the address designation method, the prefetch address 22
00 can reduce the bit width required. This is shown in FIG. In this example, each prefetch address is designated by a 4-bit relative address.
Therefore, it is possible to store addresses for specifying eight instruction blocks in a 4-byte area.

【0082】本実施例で説明したプリフェッチ命令を用
いたプリフェッチ動作と、前述の実施例で説明したプリ
フェッチ制御ユニット132がキャッシュフィル時に行
なうプリフェッチとは併用することができる。
The prefetch operation using the prefetch instruction described in the present embodiment and the prefetch performed by the prefetch control unit 132 during the cache filling described in the above embodiments can be used together.

【0083】この場合は、例えば、図11に示すよう
に、プリフェッチ情報2100の中に、属性フィールド
2202を追加し、このフィールドに、プリフェッチ命
令によるプリフェッチか、プリフェッチ制御ユニット1
32がキャッシュフィル時に行なうプリフェッチかを指
定することによって両者を区別することができる。そし
て、属性フィールド2202で、プリフェッチ命令によ
るプリフェッチが指定されていた場合には、命令実行ユ
ニット14によりプリフェッチ命令が発行されるまで、
命令ブロックのプリフェッチは行われないようにする。
In this case, for example, as shown in FIG. 11, an attribute field 2202 is added to the prefetch information 2100 and prefetch by the prefetch instruction or the prefetch control unit 1 is added to this field.
The two can be distinguished by designating whether or not 32 is prefetch performed at the time of cache filling. If prefetch by the prefetch instruction is designated in the attribute field 2202, until the prefetch instruction is issued by the instruction execution unit 14,
Do not prefetch the instruction block.

【0084】図12に、本発明を適用したプロセッサを
用いた情報処理システムの構成例を示す。本図におい
て、プロセッサ1は本発明を適用したプロセッサ、メモ
リ2はプロセッサ1が実行する命令を格納してあるメモ
リであり、メモリバス3に接続されている。本システム
では、システムの使用者と情報をやり取りするため、デ
ィスプレイ、キーボード等の周辺機器6、7が搭載され
ている。周辺機器6、7は、周辺機器バス5により、周
辺機器制御ユニット4に接続されている。周辺機器制御
ユニット4は、メモリバス3を介してプロセッサ1に接
続されているため、メモリ2に格納されている命令をプ
ロセッサ1で実行することで、周辺機器6、7とデータ
のやり取りをすることが可能となっている。ただし、周
辺機器の個数をはじめ、情報処理システムの構成は本図
の例に限られない。
FIG. 12 shows an example of the configuration of an information processing system using a processor to which the present invention is applied. In the figure, a processor 1 is a processor to which the present invention is applied, and a memory 2 is a memory that stores instructions executed by the processor 1 and is connected to a memory bus 3. In this system, in order to exchange information with the user of the system, peripheral devices 6 and 7 such as a display and a keyboard are mounted. The peripheral devices 6 and 7 are connected to the peripheral device control unit 4 by a peripheral device bus 5. Since the peripheral device control unit 4 is connected to the processor 1 via the memory bus 3, the processor 1 executes the instructions stored in the memory 2 to exchange data with the peripheral devices 6 and 7. It is possible. However, the configuration of the information processing system including the number of peripheral devices is not limited to the example shown in this figure.

【0085】このシステムでは、本発明のプロセッサを
使用しているため、キャッシュミスによる性能の低下を
低減でき、本発明を使用しない場合に比べて、より高い
処理性能を実現することができる。
In this system, since the processor of the present invention is used, it is possible to reduce the deterioration of performance due to cache miss, and it is possible to realize higher processing performance as compared with the case where the present invention is not used.

【0086】[0086]

【発明の効果】上述のように、本発明によれば、プリフ
ェッチアドレスを動的に変更した場合にも、キャッシュ
と主メモリとのコヒーレンシーが保たれるキャッシュ制
御装置が提供される。
As described above, according to the present invention, there is provided a cache control device which maintains the coherency between the cache and the main memory even when the prefetch address is dynamically changed.

【0087】また、本発明によれば、実行サイクルを増
加させることなくプリフェッチを実行することを可能と
する構成のキャッシュ制御装置が提供される。
Further, according to the present invention, there is provided a cache control device having a structure capable of executing prefetch without increasing the execution cycle.

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

【図1】は、本発明を適用したプロセッサの構成例を説
明するためのブロック図である。
FIG. 1 is a block diagram for explaining a configuration example of a processor to which the present invention is applied.

【図2】は、実施例における命令制御ユニット13の構
成例を説明するためのブロック図である。
FIG. 2 is a block diagram for explaining a configuration example of an instruction control unit 13 in the embodiment.

【図3】は、実施例におけるメモリ2内のプログラムの
格納形式について説明するための図である。
FIG. 3 is a diagram for explaining a storage format of a program in the memory 2 in the embodiment.

【図4】は、プログラムカウンタ制御ユニット134の
構成例を説明するための図である。
FIG. 4 is a diagram for explaining a configuration example of a program counter control unit 134.

【図5】は、プリフェッチ情報2100の書き換えを行
なわない場合について説明するためのプログラムを表す
図である。
FIG. 5 is a diagram showing a program for explaining a case where prefetch information 2100 is not rewritten.

【図6】は、プリフェッチ情報2100の書き換えを行
なう場合について説明するためのプログラムを表す図で
ある。
FIG. 6 is a diagram showing a program for explaining a case of rewriting prefetch information 2100.

【図7】は、命令制御ユニット13の他の構成例を説明
するためのブロック図である。
FIG. 7 is a block diagram for explaining another configuration example of the instruction control unit 13.

【図8】は、複数のプリフェッチ情報を用いた場合のメ
モリ2中の命令列の格納形式の一例を説明するための図
である。
FIG. 8 is a diagram for explaining an example of a storage format of an instruction sequence in the memory 2 when a plurality of prefetch information is used.

【図9】は、複数のプリフェッチ情報に対応したプログ
ラムの一例を表す図である。
FIG. 9 is a diagram showing an example of a program corresponding to a plurality of prefetch information.

【図10】は、プリフェッチアドレス2200に必要な
ビット幅を少なくした場合のメモリ2中の命令列の格納
形式の一例を説明するための図である。
FIG. 10 is a diagram for explaining an example of a storage format of an instruction sequence in the memory 2 when the bit width required for the prefetch address 2200 is reduced.

【図11】は、プリフェッチ情報2100の中に、属性
フィールド2202を追加した場合のメモリ2中の命令
列の格納形式の一例を説明するための図である。
FIG. 11 is a diagram for explaining an example of a storage format of an instruction string in the memory 2 when an attribute field 2202 is added to the prefetch information 2100.

【図12】は、本発明のプロセッサを用いた情報処理シ
ステムの構成例を示すブロック図である。
FIG. 12 is a block diagram showing a configuration example of an information processing system using the processor of the present invention.

【図13】は、プロセッサ1のプリフェッチ処理につい
て説明するためのフロー図である。
FIG. 13 is a flowchart for explaining prefetch processing of the processor 1.

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

1:プロセッサ、2:外部メモリ、3、メモリバス、
4:周辺機器制御ユニット 5:周辺機器バス、6:周辺機器、7:周辺機器 12:命令キャッシュ、13:命令制御ユニット、1
4:命令実行ユニット 15:データ・キャッシュ、16:データ制御ユニット 17:メモリ制御ユニット、130:プリフェッチバッ
ファ 131:命令キャッシュヒット判定ユニット 132:命令プリフェッチ制御ユニット 133:命令キャッシュ制御ユニット 134:プログラムカウンタ制御ユニット 1340:プログラムカウンタ、1341:命令長加算
回路 1342:プリフェッチ情報飛び越し回路、1343:
アドレス切り替え回路 2000:命令ブロック、2100:プリフェッチ情報 2200:プリフェッチ・アドレス、2201:プリフ
ェッチイネーブル 2202:プリフェッチ属性
1: processor, 2: external memory, 3, memory bus,
4: peripheral device control unit 5: peripheral device bus, 6: peripheral device, 7: peripheral device 12: instruction cache, 13: instruction control unit, 1
4: instruction execution unit 15: data cache, 16: data control unit 17: memory control unit, 130: prefetch buffer 131: instruction cache hit determination unit 132: instruction prefetch control unit 133: instruction cache control unit 134: program counter control Unit 1340: Program counter, 1341: Instruction length addition circuit 1342: Prefetch information skip circuit, 1343:
Address switching circuit 2000: instruction block, 2100: prefetch information 2200: prefetch address, 2201: prefetch enable 2202: prefetch attribute

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.7 識別記号 FI テーマコート゛(参考) G06F 9/38 310 G06F 9/38 310A (72)発明者 西岡 清和 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 Fターム(参考) 5B005 JJ11 KK12 LL01 MM02 MM03 NN22 5B013 AA01 AA05 BB11 5B033 AA04 DB06 DB08 ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 7 Identification code FI theme code (reference) G06F 9/38 310 G06F 9/38 310A (72) Inventor Kiyokazu Nishioka 1099, Ozenji, Aso-ku, Kawasaki-shi, Kanagawa F-term in Hitachi Systems Development Laboratory (reference) 5B005 JJ11 KK12 LL01 MM02 MM03 NN22 5B013 AA01 AA05 BB11 5B033 AA04 DB06 DB08

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】記憶装置からデータを、連続したアドレス
に格納された複数個のデータの集合であるブロック単位
で読み込んで、キャッシュメモリに格納するキャッシュ
制御装置であって、 読み込んだブロック中のあらかじめ定めた領域に記録さ
れたプリフェッチ情報を、前記キャッシュメモリとは別
の記憶領域に格納する手段と、 前記格納したプリフェッチ情報に基づいて、他のブロッ
クの前記キャッシュメモリへの格納を行なうプリフェッ
チ手段とを備えることを特徴とするキャッシュ制御装
置。
1. A cache control device for reading data from a storage device in a block unit, which is a set of a plurality of data stored at consecutive addresses, and storing the data in a cache memory. A means for storing prefetch information recorded in a predetermined area in a storage area different from the cache memory; and a prefetch means for storing another block in the cache memory based on the stored prefetch information. A cache control device comprising:
【請求項2】請求項1に記載のキャッシュ制御装置であ
って、 前記プリフェッチ情報には、他のブロックを特定するた
めのアドレス情報が含まれることを特徴とするキャッシ
ュ制御装置。
2. The cache control device according to claim 1, wherein the prefetch information includes address information for specifying another block.
【請求項3】請求項2に記載のキャッシュ制御装置であ
って、 前記プリフェッチ情報には、前記アドレス情報で特定さ
れるブロックのキャッシュ格納を行なうか否かのイネー
ブル情報がさらに含まれることを特徴とするキャッシュ
制御装置。
3. The cache control device according to claim 2, wherein the prefetch information further includes enable information indicating whether to cache the block specified by the address information. Cache control device.
【請求項4】請求項1に記載のキャッシュ制御装置であ
って、 前記プリフェッチ情報は、前記キャッシュメモリには格
納されないことを特徴とするキャッシュ制御装置。
4. The cache control device according to claim 1, wherein the prefetch information is not stored in the cache memory.
【請求項5】請求項3に記載のキャッシュ制御装置であ
って、 前記プリフェッチ手段は、前記プリフェッチ情報に含ま
れるイネーブル情報に基づいて、前記アドレス情報で特
定されるブロックのキャッシュメモリへの格納を行なう
か否かを判断し、 行なうと判断した場合にのみ、前記アドレス情報で特定
されるブロックのキャッシュメモリへの格納を行なうこ
とを特徴とするキャッシュ制御装置。
5. The cache control device according to claim 3, wherein the prefetch means stores a block specified by the address information in a cache memory based on enable information included in the prefetch information. A cache control device characterized in that it is judged whether or not to carry out, and only when it is judged to carry out, the block specified by the address information is stored in the cache memory.
【請求項6】請求項1に記載のキャッシュ制御装置であ
って、 前記プリフェッチ手段は、プリフェッチ情報が前記記憶
領域に格納されると、このプリフェッチ情報を参照し
て、他のブロックの前記キャッシュメモリへの格納を行
なうことを特徴とするキャッシュ制御装置。
6. The cache control device according to claim 1, wherein when the prefetch information is stored in the storage area, the prefetch unit refers to the prefetch information to refer to the cache memory of another block. A cache control device characterized by storing in a cache.
【請求項7】請求項1に記載のキャッシュ制御装置であ
って、 前記プリフェッチ手段は、前記キャッシュメモリに格納
されたプリフェッチ命令が実行されると、前記記憶領域
に格納されれたプリフェッチ情報を参照して、他のブロ
ックの前記キャッシュメモリへの格納を行なうことを特
徴とするキャッシュ制御装置。
7. The cache control device according to claim 1, wherein the prefetch means refers to prefetch information stored in the storage area when a prefetch instruction stored in the cache memory is executed. Then, the cache control device is characterized in that another block is stored in the cache memory.
【請求項8】請求項1〜7のいずれか一項に記載のキャ
ッシュ制御装置を備えた情報処理装置。
8. An information processing device comprising the cache control device according to claim 1. Description:
【請求項9】プロセッサに読み込まれ実行される命令群
を含んで構成されるプログラムであって、 あらかじめ定めた大きさの命令ブロック中の、あらかじ
め定めた領域に、他の命令ブロックを特定するための情
報を記録したことを特徴とするプログラム。
9. A program including an instruction group read and executed by a processor, for specifying another instruction block in a predetermined area in an instruction block of a predetermined size. A program characterized by recording information of.
【請求項10】キャッシュメモリへの読み込みの単位と
なる命令ブロックのあらかじめ定めた領域に、他の命令
ブロックを特定するための情報を記録しておき、 命令ブロックがキャッシュメモリに読み込まれるとき
に、前記情報をキャッシュメモリとは別の記憶領域に記
録し、 この情報に基づいて他の命令ブロックをキャッシュメモ
リに読み込むことを特徴とするキャッシュ制御方法。
10. Information for specifying another instruction block is recorded in a predetermined area of an instruction block which is a unit of reading into the cache memory, and when the instruction block is read into the cache memory, A cache control method characterized in that the information is recorded in a storage area different from the cache memory and another instruction block is read into the cache memory based on this information.
JP2001210926A 2001-07-11 2001-07-11 Cache controller having pre-fetch mechanism of instruction cache Pending JP2003030046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001210926A JP2003030046A (en) 2001-07-11 2001-07-11 Cache controller having pre-fetch mechanism of instruction cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001210926A JP2003030046A (en) 2001-07-11 2001-07-11 Cache controller having pre-fetch mechanism of instruction cache

Publications (1)

Publication Number Publication Date
JP2003030046A true JP2003030046A (en) 2003-01-31

Family

ID=19046325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001210926A Pending JP2003030046A (en) 2001-07-11 2001-07-11 Cache controller having pre-fetch mechanism of instruction cache

Country Status (1)

Country Link
JP (1) JP2003030046A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007508640A (en) * 2003-10-14 2007-04-05 サン・マイクロシステムズ・インコーポレイテッド Method and apparatus for selectively deferring execution of instructions having indeterminate data dependencies when instructions are issued according to a program order
JP2007207246A (en) * 2006-02-03 2007-08-16 Internatl Business Mach Corp <Ibm> Self prefetching l2 cache mechanism for instruction line
US7543114B2 (en) * 2004-02-19 2009-06-02 Samsung Electronics Co., Ltd. System and controller with reduced bus utilization time
JP2009251998A (en) * 2008-04-08 2009-10-29 Renesas Technology Corp Data processor
JP2011076345A (en) * 2009-09-30 2011-04-14 Nec Computertechno Ltd Information processing apparatus, data caching method in information processing apparatus, and multiprocessor system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007508640A (en) * 2003-10-14 2007-04-05 サン・マイクロシステムズ・インコーポレイテッド Method and apparatus for selectively deferring execution of instructions having indeterminate data dependencies when instructions are issued according to a program order
JP4751831B2 (en) * 2003-10-14 2011-08-17 オラクル・アメリカ・インコーポレイテッド Method and apparatus for selectively deferring execution of instructions having indeterminate data dependencies when instructions are issued according to a program order
US7543114B2 (en) * 2004-02-19 2009-06-02 Samsung Electronics Co., Ltd. System and controller with reduced bus utilization time
JP2007207246A (en) * 2006-02-03 2007-08-16 Internatl Business Mach Corp <Ibm> Self prefetching l2 cache mechanism for instruction line
JP2009251998A (en) * 2008-04-08 2009-10-29 Renesas Technology Corp Data processor
JP2011076345A (en) * 2009-09-30 2011-04-14 Nec Computertechno Ltd Information processing apparatus, data caching method in information processing apparatus, and multiprocessor system

Similar Documents

Publication Publication Date Title
JP4374221B2 (en) Computer system and recording medium
JP3739491B2 (en) Harmonized software control of Harvard architecture cache memory using prefetch instructions
US6453365B1 (en) Direct memory access controller having decode circuit for compact instruction format
JP3816586B2 (en) Method and system for generating prefetch instructions
JP3888508B2 (en) Cache data management method
US6598126B2 (en) Processing device which prefetches instructions having indicator bits specifying cache levels for prefetching
US7873814B1 (en) Microcode based hardware translator to support a multitude of processors
US8561044B2 (en) Optimized code generation targeting a high locality software cache
US6782454B1 (en) System and method for pre-fetching for pointer linked data structures
JP4298800B2 (en) Prefetch management in cache memory
US6415338B1 (en) System for writing a data value at a starting address to a number of consecutive locations equal to a segment length identifier
US6718539B1 (en) Interrupt handling mechanism in translator from one instruction set to another
US7290119B2 (en) Memory accelerator with two instruction set fetch path to prefetch second set while executing first set of number of instructions in access delay to instruction cycle ratio
US20080184010A1 (en) Method and apparatus for controlling instruction cache prefetch
US5835972A (en) Method and apparatus for optimization of data writes
KR100505695B1 (en) Cache memory device having dynamically-allocated or deallocated buffers, digital data processing system comprising it and method thereof
US6990567B1 (en) Use of internal general purpose registers of a processor as a Java virtual machine top of stack and dynamic allocation of the registers according to stack status
JP3973129B2 (en) Cache memory device and central processing unit using the same
JP2003030046A (en) Cache controller having pre-fetch mechanism of instruction cache
JP3954992B2 (en) Memory interface circuit
US8612685B2 (en) Processor, information processing device and cache control method of processor
JP2001166989A (en) Memory system having prefetch mechanism and method for operating the system
JP2003036204A (en) Flash memory update method
US8990511B2 (en) Multiprocessor, cache synchronization control method and program therefor
JP2004240616A (en) Memory controller and memory access control method