JP2000148584A - Prefetching method and device - Google Patents

Prefetching method and device

Info

Publication number
JP2000148584A
JP2000148584A JP10318759A JP31875998A JP2000148584A JP 2000148584 A JP2000148584 A JP 2000148584A JP 10318759 A JP10318759 A JP 10318759A JP 31875998 A JP31875998 A JP 31875998A JP 2000148584 A JP2000148584 A JP 2000148584A
Authority
JP
Japan
Prior art keywords
prefetch
address
data
processor
buffer
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
JP10318759A
Other languages
Japanese (ja)
Inventor
Tetsuya Tanaka
哲也 田中
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP10318759A priority Critical patent/JP2000148584A/en
Publication of JP2000148584A publication Critical patent/JP2000148584A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To shorten the waiting time of a processor and to make it possible to execute a high speed program without requiring the generation of a prefetching instruction by a compiller and chang-ing data stored in a cache memory. SOLUTION: In the prefetching method, a state that a read request address from a processor 4 to a main storage 2 is a prefetching space is discriminated, and then data are prefetched and stored in a prefetch buffer 30 independently of the operation of the processor 4. When the processor 4 requests data stored in the buffer 30, data are supplied from the buffer 30 to the processor 40.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、プロセッサにお
けるプリフェッチ方法および装置に関し、特に記憶デバ
イスからのデータフェッチの待ち時間を低減するためデ
ータフェッチに先行してあらかじめデータフェッチをし
ておくプリフェッチ技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a prefetch method and apparatus in a processor, and more particularly, to a prefetch technique in which data fetch is performed in advance of data fetch in order to reduce the waiting time of data fetch from a storage device.

【0002】[0002]

【従来の技術】近年、マイクロプロセッサ応用製品の高
機能化および高速化に伴い、メディア処理に代表される
信号処理に使われる場合が増えてきた。信号処理ではメ
モリ上のデータを読み出し、演算後、メモリに書き込む
ことをデータの集合に対して行うストリームフィルタ処
理が数多く現れる。
2. Description of the Related Art In recent years, as the functions and speed of microprocessor-based products have become higher and higher, they have been increasingly used for signal processing represented by media processing. In signal processing, there are many stream filter processes for reading data in a memory, performing an operation, and then writing the data to the memory for a set of data.

【0003】ストリームフィルタ処理で扱うデータ集合
の個々のデータは、マイクロプロセッサ(以下、単に
「プロセッサ」という)で再利用することが少ないた
め、キャッシュがヒットすることは期待できない。これ
はストリームフィルタで取り扱うデータがプロセッサ外
部で生成され、プロセッサで処理した後はプロセッサ外
部で使用されることによる。
[0003] Since individual data of a data set handled in the stream filter processing is rarely reused by a microprocessor (hereinafter simply referred to as a "processor"), it is not expected that a cache hit will occur. This is because data to be handled by the stream filter is generated outside the processor, and is used outside the processor after being processed by the processor.

【0004】プロセッサはこのようなデータをロードす
るとき、メモリアクセスの待ち時間の分だけ処理が待た
されることになる。この待ち時間を低減するために用い
られる技術のひとつにプリフェッチがある。従来のプリ
フェッチ装置およびプリフェッチ方法としては、プリフ
ェッチ命令で実現するものと、キャッシュメモリにより
プリフェッチ機能を実現するものがある。
When loading such data, the processor has to wait for a memory access wait time. One technique used to reduce this waiting time is prefetch. As a conventional prefetch device and a prefetch method, there are a device that is realized by a prefetch instruction and a device that realizes a prefetch function by a cache memory.

【0005】プリフェッチ命令は例えば、特開平8−5
5025号に開示されているように、通常のロード命令
として機能した後、ロードしたデータを含むブロック
(例えば16バイト)をメモリから読み出し、プリフェ
ッチバッファに保持するものである。この時読み出した
ブロックのアドレスも同時に保持される。プリフェッチ
命令実行後、他のロード命令が実行されメモリにリード
要求を出したとき、要求されたアドレスがプリフェッチ
バッファに保持されたブロック内のデータを要求してい
る場合はプリフェッチバッファから要求されたデータを
プロセッサに供給する。メモリアクセスの待ち時間はプ
リフェッチ命令の時点から生じるが、プロセッサの動作
とは無関係に動作するのでプロセッサに待ち時間が生じ
ることはない。プリフェッチ命令のメモリアクセスが完
了した後にロード命令でプリフェッチしたデータ(例え
ば(A+4)のデータ)を読み出す場合はプロセッサの
メモリアクセス待ち時間を削減できる。
A prefetch instruction is disclosed in, for example,
As disclosed in Japanese Patent No. 5025, after functioning as a normal load instruction, a block (for example, 16 bytes) including loaded data is read from a memory and held in a prefetch buffer. At this time, the address of the read block is also held at the same time. After executing the prefetch instruction, when another load instruction is executed and a read request is issued to the memory, if the requested address requests data in a block held in the prefetch buffer, the data requested from the prefetch buffer To the processor. Although the waiting time for the memory access is generated from the time of the prefetch instruction, the waiting time does not occur in the processor because it operates independently of the operation of the processor. When reading data (for example, (A + 4) data) prefetched by a load instruction after the memory access of the prefetch instruction is completed, the memory access waiting time of the processor can be reduced.

【0006】図10に従来のプリフェッチ命令によるプ
リフェッチ装置の動作説明図を示す。“ldpf
(A),r0”命令はアドレス(A)のデータをメモリ
から読み出し(ロードし)レジスタr0に格納する命令
であり、アドレス(A)に対するロードを実行後、アド
レス(A+4)以降のデータを次々にメモリから読み出
しプリフェッチバッファに保持する。“ld(A+
4),r1”命令はアドレス(A+4)のデータをロー
ドしレジスタr1に保持する命令である。“ldpf
(A),r0”命令の実行後はアドレスAのデータをロ
ードするため待ち時間が生じているが、“ld(A+
4),r1”命令を実行するときはすでにプリフェッチ
バッファに所望のデータが保持されており、プリフェッ
チバッファからデータを供給するため、ロードの待ち時
間は生じることがない。
FIG. 10 is a diagram for explaining the operation of a conventional prefetch device using a prefetch instruction. “Ldpf
The (A), r0 "instruction is an instruction for reading (loading) the data at the address (A) from the memory and storing the data in the register r0. After executing the loading for the address (A), the data after the address (A + 4) is successively read. Read from the memory and hold it in the prefetch buffer.
The instruction "4), r1" is an instruction for loading the data at the address (A + 4) and holding the data in the register r1.
After the execution of the (A), r0 "instruction, a waiting time has occurred to load the data at the address A, but" ld (A +
4) When the "r1" instruction is executed, the desired data is already held in the prefetch buffer and the data is supplied from the prefetch buffer, so that there is no load waiting time.

【0007】キャッシュメモリによりプリフェッチ機能
を実現する場合は、キャッシュメモリの各エントリがプ
リフェッチバッファの役目を果たす。最初のロード命令
で、あるアドレスのデータをメモリから読み出す場合、
キャッシュメモリの管理単位であるキャッシュブロック
がキャッシュミスによって適切なエントリにフェッチさ
れる。これによりプリフェッチと同様の効果を得ること
ができる。図11に従来のキャッシュメモリによるプリ
フェッチ装置の動作説明図を示す。“ld(A),r
0”命令はアドレス(A)のデータをメモリから読み出
しレジスタr0に保持する命令である。このロード命令
がキャッシュミスを起こす場合、キャッシュメモリはア
ドレス(A)のデータを含むキャッシュブロックをメモ
リから読み出し、適切なエントリに保持する(リフィル
する)。このキャッシュブロックにはアドレス(A+
4)のデータも含まれているとすると、次のロード命
令”ld(A+4),r1”が実行される場合、アドレ
ス(A+4)のデータは既にキャッシュメモリの適切な
エントリに格納されているので、メモリからの読み出し
を行わずにキャッシュメモリからデータを転送すること
で、アドレス(A+4)に対するメモリ読み出しの待ち
時間は生じない。
When the prefetch function is realized by the cache memory, each entry of the cache memory functions as a prefetch buffer. When reading data at a certain address from memory in the first load instruction,
A cache block, which is a management unit of the cache memory, is fetched to an appropriate entry by a cache miss. Thereby, the same effect as that of the prefetch can be obtained. FIG. 11 is a diagram illustrating the operation of a conventional prefetch device using a cache memory. "Ld (A), r
The 0 "instruction is an instruction for reading data at address (A) from the memory and holding it in the register r0. When this load instruction causes a cache miss, the cache memory reads a cache block including the data at address (A) from the memory. , And hold (refill) in an appropriate entry.The address (A +
Assuming that the data of 4) is also included, when the next load instruction “ld (A + 4), r1” is executed, the data of address (A + 4) is already stored in an appropriate entry of the cache memory. By transferring data from the cache memory without reading from the memory, there is no waiting time for reading the memory for the address (A + 4).

【0008】[0008]

【発明が解決しようとする課題】しかしながら、上記従
来技術のプリフェッチ命令によるプリフェッチ装置では
コンパイラによって命令を生成することが困難であると
言う問題を有している。すなわち、プリフェッチ命令に
よる実現は、プリフェッチ命令と通常のロード命令とを
区別して使う必要があるが、一般的なC言語などの高級
言語はストリームフィルタで使用されるデータ(以下、
単に「ストリームデータ」と言う)であることを指定す
ることができないため、プリフェッチ命令と通常のロー
ド命令を区別して生成することが困難である。また、言
語処理系でプリフェッチ命令の有効な場合を自動的に判
別することは非常に広範囲にわたるプログラムの意味解
析が必要になるため同様に困難である。
However, there is a problem that it is difficult to generate an instruction by a compiler in the above-described conventional prefetch apparatus using a prefetch instruction. That is, the realization by the prefetch instruction requires the use of the prefetch instruction and the normal load instruction in distinction. However, a general high-level language such as the C language uses data (hereinafter, referred to as a stream filter).
(Hereinafter simply referred to as “stream data”), it is difficult to distinguish and generate a prefetch instruction and a normal load instruction. Also, it is similarly difficult for a language processing system to automatically determine the validity of a prefetch instruction because a very wide range of program semantic analysis is required.

【0009】一方、上記従来技術のキャッシュメモリに
よるプリフェッチ装置では、ストリームデータをキャッ
シュのエントリに格納するため、そのエントリにあった
他のデータがキャッシュメモリから追い出されてしま
う。ストリームデータはキャッシュメモリに残っていて
も再利用されることはないが、キャッシュメモリから追
い出されたデータは再利用する可能性のあるデータであ
る。もし、追い出されたデータを再利用する場合は、キ
ャッシュミスが生じ性能の低下を招く。すなわち、本来
キャッシュメモリに格納しておいた方が良いデータをス
トリームデータで置き換えることで性能低下を招く可能
性があるという問題を有している。
On the other hand, in the above-mentioned conventional cache memory prefetch device, since stream data is stored in a cache entry, other data in the entry is evicted from the cache memory. Although the stream data remains in the cache memory, it is not reused, but the data expelled from the cache memory is data that can be reused. If the evicted data is reused, a cache miss occurs and the performance is reduced. In other words, there is a problem that performance may be degraded by replacing data that is originally better stored in the cache memory with stream data.

【0010】この発明は、上記の問題を解決するもの
で、コンパイラでプリフェッチ命令を生成する必要がな
く、キャッシュメモリに保持されているデータが変化す
ることなく、プロセッサの待ち時間を低減でき、高速の
プログラムの実行が行なえるプリフェッチ方法および装
置を提供することを目的としている。
SUMMARY OF THE INVENTION The present invention solves the above-mentioned problem. It is not necessary to generate a prefetch instruction by a compiler, the data held in the cache memory does not change, the waiting time of the processor can be reduced, and the speed of the processor can be reduced. It is an object of the present invention to provide a prefetch method and a device capable of executing the program of (1).

【0011】[0011]

【課題を解決するための手段】請求項1記載のプリフェ
ッチ装置は、プロセッサの記憶デバイスへのリード要求
アドレスがプリフェッチ空間であることを判別する空間
判別手段と、プリフェッチアドレスを生成するアドレス
生成手段と、このアドレス生成手段で得たプリフェッチ
アドレスを用いて記憶デバイスから対応するデータを読
み出すデータ読み出し手段と、プロセッサの記憶デバイ
スへのリード要求アドレスが空間判別手段によりプリフ
ェッチ空間であることが判別された場合はプロセッサの
記憶デバイスへのリード要求とは無関係にデータ読み出
し手段によりデータを読み出して保持するプリフェッチ
バッファを有するプリフェッチ手段と、プロセッサの記
憶デバイスへのリード要求アドレスがプリフェッチバッ
ファに保持されているデータのアドレスと一致すること
を検出するアドレス一致検出手段と、このアドレス一致
検出手段により一致が検出された場合は、プリフェッチ
バッファに保持されているデータをプロセッサに転送す
るデータ転送手段とを備えたものである。
According to a first aspect of the present invention, there is provided a prefetch apparatus comprising: a space determination unit configured to determine that a read request address to a storage device of a processor is a prefetch space; and an address generation unit configured to generate a prefetch address. When the data reading means for reading the corresponding data from the storage device using the prefetch address obtained by the address generation means and the read request address to the storage device of the processor are determined to be the prefetch space by the space determination means A prefetch means having a prefetch buffer for reading and holding data by the data reading means irrespective of a read request to the storage device of the processor, and a read request address for the storage device of the processor held in the prefetch buffer. Address match detecting means for detecting a match with the address of the data to be read, and data transfer means for transferring the data held in the prefetch buffer to the processor when a match is detected by the address match detecting means. It is a thing.

【0012】請求項1記載のプリフェッチ装置によれ
ば、プロセッサがプリフェッチ空間に対しリード要求を
出すことにより、プリフェッチ装置はプロセッサの動作
とは無関係に主記憶からデータを読み出し、プリフェッ
チバッファに保持する。その後、プロセッサがプリフェ
ッチ空間に対しリード要求を出したとき、そのアドレス
がプリフェッチバッファに保持されているデータのアド
レスであれば、主記憶からの読み出しを行わず、代わり
にプリフェッチバッファに格納されているデータをプロ
セッサに転送する。すなわち、プロセッサのプリフェッ
チ空間へのリード要求のアドレスが、プリフェッチ装置
で想定しているプリフェッチアドレスと一致する場合
は、プロセッサのプリフェッチ空間へのリード要求の待
ち時間が生じないため、高速なプログラムの実行を行う
ことが出来る。
According to the first aspect of the present invention, when the processor issues a read request to the prefetch space, the prefetch apparatus reads data from the main memory regardless of the operation of the processor and holds the data in the prefetch buffer. Thereafter, when the processor issues a read request to the prefetch space, if the address is the address of the data held in the prefetch buffer, the data is not read from the main memory, but is stored in the prefetch buffer instead. Transfer data to the processor. That is, when the address of the read request to the prefetch space of the processor matches the prefetch address assumed by the prefetch device, the waiting time for the read request to the prefetch space of the processor does not occur, so that high-speed program execution is performed. Can be performed.

【0013】また、プリフェッチ空間へのリード要求を
出す命令は、キャッシュ空間や通常空間へのリード要求
を出す命令と同じ命令であるため、コンパイラでプリフ
ェッチ空間と他の空間を区別して命令生成する必要がな
いという効果がある。
Since the instruction for issuing a read request to the prefetch space is the same instruction as the instruction for issuing a read request to the cache space or the normal space, it is necessary for the compiler to generate an instruction while distinguishing the prefetch space from other spaces. There is an effect that there is no.

【0014】さらに、プリフェッチ空間へのリード要求
を出す命令を実行することではキャッシュメモリは動作
せず、キャッシュメモリに保持されているデータは変化
することはない。したがって、ストリームデータなどの
プリフェッチによるキャッシュメモリのヒット率の低下
を招くことはない。
Further, the cache memory does not operate by executing an instruction for issuing a read request to the prefetch space, and the data held in the cache memory does not change. Therefore, the hit rate of the cache memory does not decrease due to the prefetch of the stream data or the like.

【0015】請求項2記載のプリフェッチ装置は、請求
項1において、プリフェッチ手段におけるデータの読み
出しを繰り返す反復プリフェッチ手段と、この反復プリ
フェッチ手段を終了させるプリフェッチ終了手段とを備
えたものである。
According to a second aspect of the present invention, there is provided a prefetch apparatus according to the first aspect, further comprising: an iterative prefetch means for repeating data reading by the prefetch means; and a prefetch ending means for terminating the iterative prefetch means.

【0016】請求項2記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the second aspect, the same effect as that of the first aspect is obtained.

【0017】請求項3記載のプリフェッチ装置は、請求
項2において、反復プリフェッチ手段の行われた回数を
計数する回数計数手段と、制御レジスタに設定された値
と回数計数手段により計数されたプリフェッチ手段の回
数とが一致することを検出する回数一致手段と、この回
数一致手段により一致を検出した場合は反復プリフェッ
チ手段を終了する手段を備えたものである。
According to a third aspect of the present invention, there is provided the prefetch device according to the second aspect, wherein the number of times the repetitive prefetch means is performed is counted, and the value set in the control register and the prefetch means counted by the number count means. And a means for terminating the repetitive prefetch means when a match is detected by the number-of-times matching means.

【0018】請求項3記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the third aspect, the same effect as that of the first aspect is obtained.

【0019】請求項4記載のプリフェッチ装置は、請求
項2において、反復プリフェッチ手段によりプリフェッ
チバッファに保持したデータの大きさを計数するデータ
サイズ計数手段と、制御レジスタに設定されたデータサ
イズとデータサイズ計数手段により得られたプリフェッ
チバッファに保持されているデータの大きさとが一致す
ることを検出するデータサイズ一致検出手段と、このデ
ータサイズ一致検出手段により一致が検出された場合は
反復プリフェッチ手段を終了する手段を備えたものであ
る。
According to a fourth aspect of the present invention, there is provided the prefetch device according to the second aspect, wherein the data size counting means for counting the size of the data held in the prefetch buffer by the iterative prefetch means, and the data size and the data size set in the control register. Terminates the data size match detecting means for detecting that the size of the data held in the prefetch buffer obtained by the counting means matches, and terminates the iterative prefetch means if the data size match detecting means detects a match. It is provided with means for performing.

【0020】請求項4記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the fourth aspect, the same effect as that of the first aspect is obtained.

【0021】請求項5記載のプリフェッチ装置は、請求
項2において、反復プリフェッチ手段のアドレス生成手
段により生成したアドレスが制御レジスタに設定された
アドレスと一致することを検出する終了アドレス検出手
段と、この終了アドレス検出手段により一致が検出され
た場合は、反復プリフェッチ手段を終了する手段を備え
たものである。
According to a fifth aspect of the present invention, there is provided a prefetch apparatus according to the second aspect, wherein an end address detecting means for detecting that an address generated by the address generating means of the iterative prefetch means matches an address set in the control register; When a match is detected by the end address detecting means, means for terminating the repetitive prefetch means is provided.

【0022】請求項5記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the fifth aspect, the same effect as that of the first aspect is obtained.

【0023】請求項6記載のプリフェッチ装置は、請求
項1において、アドレス生成手段が、プロセッサの記憶
デバイスへのリード要求アドレスに制御レジスタに設定
された値を加算することでアドレスを生成する手段であ
る。
According to a sixth aspect of the present invention, in the first aspect, the address generating means generates an address by adding a value set in a control register to a read request address to the storage device of the processor. is there.

【0024】請求項6記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the sixth aspect, the same effect as that of the first aspect is obtained.

【0025】請求項7記載のプリフェッチ装置は、請求
項1において、アドレス生成手段が、プロセッサの記憶
デバイスへのリード要求アドレスに対し、制御レジスタ
に設定された情報により決定される演算を施すことでア
ドレスを生成する手段である。
According to a seventh aspect of the present invention, in the prefetch device according to the first aspect, the address generation means performs an operation determined by information set in a control register on a read request address to the storage device of the processor. This is a means for generating an address.

【0026】請求項7記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the seventh aspect, the same effect as that of the first aspect is obtained.

【0027】請求項8記載のプリフェッチ装置は、請求
項3から請求項7のいずれかの1項において、プロセッ
サにより制御レジスタを書き換える手段を備えたもので
ある。
An eighth aspect of the present invention provides the prefetch device according to any one of the third to seventh aspects, further comprising means for rewriting the control register by the processor.

【0028】請求項8記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the eighth aspect, the same effect as that of the first aspect is obtained.

【0029】請求項9記載のプリフェッチ装置は、請求
項1において、プリフェッチ手段におけるデータの読み
出しを繰り返す第1と第2の反復プリフェッチ手段と、
プロセッサの記憶デバイスへの第1のリード要求アドレ
スにより第1の反復プリフェッチ手段が開始され、プロ
セッサの記憶デバイスへの第2のリード要求アドレスと
第1の反復プリフェッチ手段によりプリフェッチバッフ
ァに保持されているデータのアドレスとが一致していな
いことがアドレス一致検出手段により検出された場合
は、第1の反復プリフェッチ手段を終了し、第2の反復
プリフェッチ手段を開始する手段を備えたものである。
According to a ninth aspect of the present invention, there is provided the prefetch device according to the first aspect, wherein the first and second iterative prefetch means for repeating data reading by the prefetch means;
The first iterative prefetch means is started by the first read request address to the storage device of the processor, and is held in the prefetch buffer by the second read request address to the storage device of the processor and the first iterative prefetch means. When the address coincidence detecting means detects that the address of the data does not match, the means for terminating the first iterative prefetch means and starting the second iterative prefetch means is provided.

【0030】請求項9記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the ninth aspect, the same effect as that of the first aspect is obtained.

【0031】請求項10記載のプリフェッチ装置は、請
求項1において、データ転送手段によりプリフェッチバ
ッファのデータをプロセッサに転送した場合は、プリフ
ェッチバッファに保持されているデータをプリフェッチ
バッファから無効化する無効化手段を備えたものであ
る。
According to a tenth aspect of the present invention, in the first aspect, when the data in the prefetch buffer is transferred to the processor by the data transfer means, the data held in the prefetch buffer is invalidated from the prefetch buffer. Means.

【0032】請求項10記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the tenth aspect, the same effect as that of the first aspect is obtained.

【0033】請求項11記載のプリフェッチ装置は、請
求項1において、アドレス一致検出手段によりプロセッ
サの記憶デバイスへのリード要求アドレスとプリフェッ
チバッファに保持したデータのアドレスとが一致しない
ことを検出した場合は、プリフェッチバッファに保持さ
れたデータを無効化する手段を備えたものである。
In the prefetch device according to the present invention, when the address match detection means detects that the address of the read request to the storage device of the processor does not match the address of the data held in the prefetch buffer, , Means for invalidating the data held in the prefetch buffer.

【0034】請求項11記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the eleventh aspect, the same effect as that of the first aspect is obtained.

【0035】請求項12記載のプリフェッチ方法は、プ
ロセッサの記憶デバイスへのリード要求アドレスがプリ
フェッチ空間であることを判別する空間判別ステップ
と、プリフェッチアドレスを生成するアドレス生成ステ
ップと、このアドレス生成ステップで得たプリフェッチ
アドレスを用いて記憶デバイスから対応するデータを読
み出すデータ読み出しステップと、プロセッサの記憶デ
バイスへのリード要求アドレスが空間判別ステップによ
りプリフェッチ空間であることが判別された場合はプロ
セッサの記憶デバイスへのリード要求とは無関係にデー
タ読み出しステップによりデータを読み出し、プリフェ
ッチバッファに保持するプリフェッチステップと、プロ
セッサの記憶デバイスへのリード要求アドレスがプリフ
ェッチバッファに保持されているデータのアドレスと一
致することを検出するアドレス一致検出ステップと、こ
のアドレス一致検出ステップにより一致が検出された場
合は、プリフェッチバッファに保持されているデータを
プロセッサに転送するデータ転送ステップとを含むもの
である。
According to a twelfth aspect of the present invention, there is provided a prefetch method, comprising: a space determining step of determining that a read request address to a storage device of a processor is a prefetch space; an address generating step of generating a prefetch address; A data reading step for reading out corresponding data from the storage device using the obtained prefetch address; and a read request address for the storage device of the processor to the storage device of the processor when it is determined in the space determination step that the address is a prefetch space. The data is read in the data read step regardless of the read request of the processor, and the data is read and stored in the prefetch buffer. The read request address to the storage device of the processor is stored in the prefetch buffer. An address match detecting step of detecting that the address matches the address of the data being written, and a data transfer step of transferring the data held in the prefetch buffer to the processor when a match is detected by the address match detecting step. Is included.

【0036】請求項12記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the twelfth aspect, the same effect as that of the first aspect can be obtained.

【0037】請求項13記載のプリフェッチ方法は、請
求項12において、プリフェッチステップにおけるデー
タの読み出しを繰り返す反復プリフェッチステップと、
この反復プリフェッチステップを終了させるプリフェッ
チ終了ステップとを含むものである。
According to a thirteenth aspect of the present invention, there is provided the prefetch method according to the twelfth aspect, wherein an iterative prefetch step of repeating data reading in the prefetch step;
And a prefetch termination step for terminating the repetitive prefetch step.

【0038】請求項13記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the thirteenth aspect, the same effect as that of the first aspect can be obtained.

【0039】請求項14記載のプリフェッチ方法は、請
求項13において、反復プリフェッチステップの行われ
た回数を計数する回数計数ステップと、制御レジスタに
設定された値と回数計数ステップにより計数されたプリ
フェッチステップの回数とが一致することを検出する回
数一致ステップと、回数一致ステップにより一致を検出
した場合は反復プリフェッチステップを終了するステッ
プを含むものである。
According to a fourteenth aspect of the present invention, there is provided the prefetch method according to the thirteenth aspect, wherein the number of times the repetitive prefetch step is performed is counted, and the prefetch step counted by the value set in the control register and the number of times is counted. And a step of terminating the iterative prefetch step when a match is detected in the number matching step.

【0040】請求項14記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the fourteenth aspect, the same effect as that of the first aspect is obtained.

【0041】請求項15記載のプリフェッチ方法は、請
求項13において、反復プリフェッチステップによりプ
リフェッチバッファに保持したデータの大きさを計数す
るデータサイズ計数ステップと、制御レジスタに設定さ
れたデータサイズとデータサイズ計数ステップにより得
られたプリフェッチバッファに保持されているデータの
大きさとが一致することを検出するデータサイズ一致検
出ステップと、このデータサイズ一致検出ステップによ
り一致が検出された場合は反復プリフェッチステップを
終了するステップを含むものである。
According to a fifteenth aspect of the present invention, in the thirteenth aspect, there is provided a data size counting step for counting the size of data held in the prefetch buffer by the iterative prefetch step, and a data size and a data size set in the control register. A data size match detecting step for detecting that the size of the data held in the prefetch buffer obtained by the counting step matches, and if a match is detected by the data size match detecting step, the iterative prefetch step is terminated. The step includes:

【0042】請求項15記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetching method of the fifteenth aspect, the same effect as that of the first aspect is obtained.

【0043】請求項16記載のプリフェッチ方法は、請
求項13において、反復プリフェッチステップのアドレ
ス生成ステップにより生成したアドレスが制御レジスタ
に設定されたアドレスと一致することを検出する終了ア
ドレス検出ステップと、この終了アドレス検出ステップ
により一致が検出された場合は、反復プリフェッチステ
ップを終了するステップを含むものである。
In the prefetch method according to a sixteenth aspect, in the thirteenth aspect, an end address detection step of detecting that an address generated by the address generation step of the iterative prefetch step matches an address set in the control register, When a match is detected by the end address detecting step, the step includes ending the repetitive prefetch step.

【0044】請求項16記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the sixteenth aspect, the same effect as that of the first aspect can be obtained.

【0045】請求項17記載のプリフェッチ方法は、請
求項12において、アドレス生成ステップが、プロセッ
サの記憶デバイスへのリード要求アドレスに制御レジス
タに設定された値を加算することでアドレスを生成する
ステップである。
According to a seventeenth aspect of the present invention, in the twelfth aspect, the address generating step includes the step of generating an address by adding a value set in a control register to a read request address to the storage device of the processor. is there.

【0046】請求項17記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the seventeenth aspect, the same effect as that of the first aspect can be obtained.

【0047】請求項18記載のプリフェッチ方法は、請
求項12において、アドレス生成ステップが、プロセッ
サの記憶デバイスへのリード要求アドレスに対し、制御
レジスタに設定された情報により決定される演算を施す
ことでアドレスを生成するステップである。
In the prefetch method according to the present invention, in the twelfth aspect, the address generating step performs an operation determined by information set in a control register on a read request address to a storage device of the processor. This is the step of generating an address.

【0048】請求項18記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the eighteenth aspect, the same effect as that of the first aspect can be obtained.

【0049】請求項19記載のプリフェッチ方法は、請
求項14から請求項18のいずれかの1項において、プ
ロセッサにより制御レジスタを書き換えるステップを含
むものである。
A prefetch method according to claim 19 includes the step of rewriting a control register by a processor according to any one of claims 14 to 18.

【0050】請求項19記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the nineteenth aspect, the same effect as that of the first aspect can be obtained.

【0051】請求項20記載のプリフェッチ方法は、請
求項12において、プリフェッチステップにおけるデー
タの読み出しを繰り返す第1と第2の反復プリフェッチ
ステップと、プロセッサの記憶デバイスへの第1のリー
ド要求アドレスにより第1の反復プリフェッチステップ
が開始され、プロセッサの記憶デバイスへの第2のリー
ド要求アドレスと第1の反復プリフェッチステップによ
りプリフェッチバッファに保持されているデータのアド
レスとが一致していないことがアドレス一致検出ステッ
プにより検出された場合は、第1の反復プリフェッチス
テップを終了し、第2の反復プリフェッチステップを開
始するステップを含むものである。
According to a twentieth aspect of the present invention, in the twelfth aspect, the first and second iterative prefetch steps of repeating the data reading in the prefetch step and the first read request address to the storage device of the processor. One iterative prefetch step is started, and an address match detection is made that the second read request address to the storage device of the processor does not match the address of the data held in the prefetch buffer by the first iterative prefetch step. If detected by the step, the method includes ending the first iterative prefetch step and starting the second iterative prefetch step.

【0052】請求項20記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the twentieth aspect, the same effect as that of the first aspect can be obtained.

【0053】請求項21記載のプリフェッチ方法は、請
求項12において、データ転送ステップによりプリフェ
ッチバッファのデータをプロセッサに転送した場合が、
プリフェッチバッファに保持されているデータをプリフ
ェッチバッファから無効化する無効化ステップを含むも
のである。
According to a twenty-first aspect of the present invention, in the twelfth aspect, when the data of the prefetch buffer is transferred to the processor by the data transfer step,
The method includes an invalidating step of invalidating the data held in the prefetch buffer from the prefetch buffer.

【0054】請求項21記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the twenty-first aspect, the same effect as that of the first aspect can be obtained.

【0055】請求項22記載のプリフェッチ方法は、請
求項12において、アドレス一致検出ステップによりプ
ロセッサの記憶デバイスへのリード要求アドレスとプリ
フェッチバッファに保持したデータのアドレスとが一致
しないことを検出した場合は、プリフェッチバッファに
保持されたデータを無効化するステップを含むものであ
る。
According to a twelfth aspect of the present invention, in the twelfth aspect, when the address match detection step detects that the read request address to the storage device of the processor and the address of the data held in the prefetch buffer do not match. , Invalidating the data held in the prefetch buffer.

【0056】請求項22記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetching method of the twenty-second aspect, the same effect as that of the first aspect is obtained.

【0057】[0057]

【発明の実施の形態】以下、本発明の第1の実施の形態
のプリフェッチ方法についてプリフェッチ装置を用い
て、図1から図6により説明する。図1は本発明の第1
の実施の形態におけるプリフェッチ装置を含むシステム
のハードウェア構成図を示すブロック図である。1はプ
リフェッチ装置、2は記憶デバイスとしての主記憶、3
は命令が格納された命令メモリ、4は命令メモリ3に格
納された命令にしたがって処理を行い必要に応じて主記
憶2に対しデータを読み出す要求を行う機能をはじめ通
常のプロセッサとしての機能を有するプロセッサ、5は
プロセッサ4が主記憶2から読み出したデータのコピー
を格納しておく機能をはじめ通常のキャッシュメモリと
しての機能を有するキャッシュメモリである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A prefetch method according to a first embodiment of the present invention will be described below with reference to FIGS. 1 to 6 using a prefetch device. FIG. 1 shows the first embodiment of the present invention.
FIG. 3 is a block diagram showing a hardware configuration diagram of a system including a prefetch device according to the embodiment. 1 is a prefetch device, 2 is a main memory as a storage device, 3
Is an instruction memory in which instructions are stored, and 4 has a function as a normal processor, including a function of performing processing in accordance with the instructions stored in the instruction memory 3 and making a request to read data from the main memory 2 as necessary. The processor 5 is a cache memory having a function of storing a copy of data read from the main memory 2 by the processor 4 and a function as a normal cache memory.

【0058】プリフェッチ装置1において、10はプロ
セッサ4の出力したアドレスを参照してアドレス空間を
判別するアドレス空間判別回路であり、請求項記載の空
間判別手段に対応する。
In the prefetch device 1, reference numeral 10 denotes an address space discriminating circuit for discriminating an address space by referring to an address output from the processor 4, and corresponds to a space discriminating means described in claims.

【0059】20はプロセッサ4の出力したアドレスを
元にプリフェッチアドレスを生成するプリフェッチアド
レス生成回路であり、請求項記載のアドレス生成手段に
対応する。図6に本発明の第1の実施の形態におけるプ
リフェッチアドレス生成回路20のブロック図を示して
いる。21は次のプリフェッチアドレスの生成に用いる
アドレスを保持するバッファであり、22はプロセッサ
4の出力したアドレスとプリフェッチアドレス生成回路
20の出力したアドレスとを選択しバッファ21に出力
するマルチプレクサであり、23はバッファ21に保持
されたアドレスとプロセッサ4のアドレスを加算するた
めの加算器である。
Reference numeral 20 denotes a prefetch address generating circuit for generating a prefetch address based on the address output from the processor 4, and corresponds to an address generating means described in claims. FIG. 6 is a block diagram of the prefetch address generation circuit 20 according to the first embodiment of the present invention. Reference numeral 21 denotes a buffer for holding an address used for generating the next prefetch address. Reference numeral 22 denotes a multiplexer for selecting an address output from the processor 4 and an address output from the prefetch address generation circuit 20 and outputting the selected address to the buffer 21. Is an adder for adding the address held in the buffer 21 and the address of the processor 4.

【0060】図1に戻って、30はプリフェッチにより
主記憶2から読み出されたデータを保持しておくプリフ
ェッチバッファであり、請求項記載のデータ読み出し手
段とプリフェッチバッファ30とでプリフェッチ手段に
対応する。
Returning to FIG. 1, reference numeral 30 denotes a prefetch buffer for holding data read from the main memory 2 by prefetch. The data read means and the prefetch buffer 30 correspond to the prefetch means. .

【0061】40はプリフェッチアドレス生成回路20
の出力したアドレスを保持しておくプリフェッチアドレ
スバッファであり、50はプロセッサ4の出力したアド
レスとプリフェッチアドレスバッファ40に格納された
アドレスとを比較し一致信号をプリフェッチ制御回路1
00に出力する比較回路であり、プリフェッチアドレス
バッファ40と比較回路50で請求項記載のアドレス一
致検出手段に対応する。比較回路50により一致が検出
された場合は、データ転送手段によりプリフェッチバッ
ファ30に保持されているデータをプロセッサ4に転送
し、データ転送手段によりプリフェッチバッファ30の
データをプロセッサ4に転送した場合は、無効化手段に
よりプリフェッチバッファ30に保持されているデータ
をプリフェッチバッファから無効化する。また、データ
転送手段は図1のマルチプレクサ102が対応し、無効
化手段はプリフェッチアドレスバッファ40とプリフェ
ッイチ制御回路100が対応する。すなわち、プリフェ
ッチ制御回路100の内部状態がプリフェッチ状態のと
きは無効であることをあらわす。
Reference numeral 40 denotes a prefetch address generation circuit 20
Is a prefetch address buffer for holding the address output from the prefetch control circuit 1 and compares the address output from the processor 4 with the address stored in the prefetch address buffer 40 and outputs a match signal.
The prefetch address buffer 40 and the comparison circuit 50 correspond to the address coincidence detecting means. When a match is detected by the comparison circuit 50, the data held in the prefetch buffer 30 is transferred to the processor 4 by the data transfer means, and when the data in the prefetch buffer 30 is transferred to the processor 4 by the data transfer means, Invalidating means invalidates the data held in the prefetch buffer 30 from the prefetch buffer. The data transfer means corresponds to the multiplexer 102 in FIG. 1, and the invalidating means corresponds to the prefetch address buffer 40 and the prefetch control circuit 100. That is, when the internal state of the prefetch control circuit 100 is in the prefetch state, it is invalid.

【0062】100はプリフェッチ装置1の全体を制御
するプリフェッチ制御回路であり、内部状態として図2
の状態遷移図に示す「非プリフェッチ状態」、「プリフ
ェッチ状態」、「プリフェッチ待ち状態」の3状態を有
する。「非プリフェッチ状態」はプリフェッチを行わな
い状態であり、「プリフェッチ状態」はプロセッサ4の
読み出し要求アドレスがプリフェッチ空間であると判断
された場合に「非プリフェッチ状態」から遷移し、「プ
リフェッチ状態」である間はプリフェッチを行う。「プ
リフェッチ待ち状態」はプリフェッチバッファ30にデ
ータが保持されておりこれ以上プリフェッチを行うこと
ができない状態である。プリフェッチバッファ30には
データが1つしか保持することができないため「プリフ
ェッチ状態」でデータを読み出すと「プリフェッチ待ち
状態」に遷移する。また、プリフェッチバッファ30の
データがプロセッサ4に転送されるとプリフェッチバッ
ファ30のデータは無効化されるので状態は「プリフェ
ッチ状態」に戻る。
Reference numeral 100 denotes a prefetch control circuit for controlling the whole of the prefetch device 1, which has an internal state shown in FIG.
Has three states of “non-prefetch state”, “prefetch state”, and “prefetch wait state” shown in FIG. The “non-prefetch state” is a state in which prefetching is not performed, and the “prefetch state” transits from the “non-prefetch state” when it is determined that the read request address of the processor 4 is in the prefetch space. Prefetch is performed for a while. The “prefetch waiting state” is a state in which data is held in the prefetch buffer 30 and prefetch cannot be performed any more. Since only one data can be held in the prefetch buffer 30, when data is read in the "prefetch state", the state transits to the "prefetch wait state". When the data in the prefetch buffer 30 is transferred to the processor 4, the data in the prefetch buffer 30 is invalidated, so that the state returns to the “prefetch state”.

【0063】図1に戻って、101はプロセッサ4の出
力するアドレスとプリフェッチアドレス生成回路20の
出力するアドレスとを選択し、主記憶2へ出力するマル
チプレクサであり、102は主記憶2の出力するデータ
とプリフェッチバッファ30の出力するデータとを選択
し、プロセッサ4へ出力するマルチプレクサである。
Returning to FIG. 1, reference numeral 101 denotes a multiplexer that selects an address output from the processor 4 and an address output from the prefetch address generation circuit 20 and outputs the selected address to the main memory 2. A multiplexer that selects data and data output from the prefetch buffer 30 and outputs the selected data to the processor 4.

【0064】図3は本発明のプリフェッチ装置1を備え
たシステムにおけるアドレス空間マップを示している。
本実施の形態のシステムにおけるアドレスは32ビット
の幅であるとしている。全アドレス空間は3つの空間、
「通常空間」、「プリフェッチ空間」、「キャッシュ空
間」に分割されており、通常空間はアドレス0x000
00000〜0x3FFFFFFFに割り当てられ、プ
リフェッチ空間はアドレス0x40000000〜0x
7FFFFFFFに割り当てられ、キャッシュ空間はア
ドレス0x80000000〜0xFFFFFFFFに
割り当てられている。すなわち、アドレスの上位2ビッ
トを参照するだけで属している空間を判別することがで
きる。なお、”0x”は16進数であることを示す接頭
辞である。
FIG. 3 shows an address space map in a system provided with the prefetch device 1 of the present invention.
The address in the system according to the present embodiment has a width of 32 bits. The total address space has three spaces,
It is divided into "normal space", "prefetch space", and "cache space", and the normal space has an address of 0x000.
0000 to 0x3FFFFFFF, and the prefetch space has addresses 0x40000000 to 0x
7FFFFFFF, and the cache space is allocated to addresses 0x80000000 to 0xFFFFFFFF. That is, it is possible to determine the space to which the address belongs only by referring to the upper two bits of the address. Note that “0x” is a prefix indicating a hexadecimal number.

【0065】「プリフェッチ空間」にはプロセッサ4に
より連続的にアクセスされ、プロセッサ4が一度しか使
用しないデータを配置する。これは例えば、ストリーム
データのように、プロセッサ4の外部で生成され主記憶
2に格納されるデータで、プロセッサ4が読み出すと主
記憶2上のデータは新しいデータに置き換わってしまう
データを想定している。第1の実施の形態ではプロセッ
サ4が「プリフェッチ空間」へリード要求を出すことに
よりプリフェッチ装置1が動作する。
In the "prefetch space", data which is continuously accessed by the processor 4 and is used only once by the processor 4 is arranged. This is, for example, data that is generated outside the processor 4 and stored in the main memory 2 such as stream data. When the processor 4 reads the data, the data in the main memory 2 is replaced with new data. I have. In the first embodiment, the prefetch device 1 operates when the processor 4 issues a read request to the “prefetch space”.

【0066】「キャッシュ空間」にはプロセッサが再利
用可能なデータを配置する。「キャッシュ空間」に配置
されたデータはプロセッサ4が一度読み出すと、キャッ
シュメモリ5にコピーされ、次回からキャッシュメモリ
5のデータがプロセッサ4に供給され、主記憶2のデー
タは読み出されない。また、プリフェッチ装置1は動作
しない。
In the “cache space”, data reusable by the processor is arranged. Once the data arranged in the “cache space” is read by the processor 4, it is copied to the cache memory 5, the data of the cache memory 5 is supplied to the processor 4 from the next time, and the data of the main memory 2 is not read. Further, the prefetch device 1 does not operate.

【0067】なお、プロセッサ4が「通常空間」へのア
クセスを行った場合は、プリフェッチ装置1およびキャ
ッシュメモリ5は動作せず直接主記憶2がアクセスされ
る。第1の実施の形態での動作説明には「通常空間」は
使用しないが、実際のプリフェッチ装置1を含むシステ
ムにおいては、「通常空間」のようなアドレス空間が必
要である。
When the processor 4 accesses the "normal space", the prefetch device 1 and the cache memory 5 do not operate, and the main memory 2 is accessed directly. Although "normal space" is not used in the description of the operation in the first embodiment, an address space such as "normal space" is required in a system including the actual prefetch device 1.

【0068】図4は本実施の形態で説明に用いるプログ
ラム例を示している。プログラム例中の命令i0〜i1
0は命令メモリ3に格納されており、プロセッサ4によ
って順次読み出され実行される。
FIG. 4 shows an example of a program used in the description of the present embodiment. Instructions i0 to i1 in the example program
“0” is stored in the instruction memory 3 and is sequentially read and executed by the processor 4.

【0069】以下、各命令について説明する。命令i
0、i1、i2はそれぞれ0x40000100、0x
80000100、256をレジスタr0、r1、r2
に格納する命令であり、それぞれ命令i3のロード用ア
ドレス、命令i4のロード用アドレス、ループカウンタ
として使用される。
Hereinafter, each instruction will be described. Instruction i
0, i1, and i2 are 0x40000100 and 0x, respectively.
80000100, 256 are stored in registers r0, r1, r2.
Are used as a load address of the instruction i3, a load address of the instruction i4, and a loop counter, respectively.

【0070】命令i3はレジスタr0の値をアドレスと
して主記憶2から4バイトのデータを読み出し、レジス
タr3に格納する命令であり、命令i4はレジスタr1
の値をアドレスとして主記憶2から4バイトのデータを
読み出し、レジスタr4に格納する命令である。
The instruction i3 is an instruction to read 4-byte data from the main memory 2 by using the value of the register r0 as an address and store it in the register r3. The instruction i4 is an instruction i4.
Is an instruction to read 4-byte data from the main memory 2 using the value of the address as an address and store it in the register r4.

【0071】命令i5はレジスタr3の値と、レジスタ
r4の値とを乗算し、その結果を積和レジスタMの値に
加算し、レジスタMに格納する積和命令である。レジス
タMは暗黙に指定されているものとする。
The instruction i5 is a product-sum instruction that multiplies the value of the register r3 by the value of the register r4, adds the result to the value of the product-sum register M, and stores the result in the register M. It is assumed that the register M is implicitly specified.

【0072】命令i6、i7はそれぞれレジスタr0、
r1に4を加算する命令である。レジスタr0、r1は
それぞれ命令i3、i4で4バイトデータのアドレスと
して使われており、次の4バイトデータのアドレスに更
新するため4を加算しているものである。本プログラム
例はループ構造をなしているので、命令i3、命令i4
は繰り返し実行されることになる。したがって、0x4
0000100および0x80000100の後続のデ
ータは4バイト単位で連続してアクセスされることにな
る。
Instructions i6 and i7 are respectively stored in registers r0,
This is an instruction to add 4 to r1. Registers r0 and r1 are used as addresses of 4-byte data in instructions i3 and i4, respectively, and add 4 to update to the address of the next 4-byte data. Since this program example has a loop structure, the instruction i3 and the instruction i4
Will be executed repeatedly. Therefore, 0x4
Subsequent data of 0000100 and 0x800000100 will be continuously accessed in units of 4 bytes.

【0073】命令i8はレジスタr2に−1を加算する
命令で、命令i9はレジスタr2と0とを比較する命令
であり、命令i10は命令i9の比較結果でレジスタr
2の方が大きい場合、ラベル“loop”に分岐し、そ
うでない場合分岐しない命令である。レジスタr2は本
プログラム例で構成されているループの回数を計数して
いるカウンタとして使用されており、命令i3〜i10
で256回のループを構成している。この場合、プリフ
ェッチ手段はデータの読み出しを繰り返す反復プリフェ
ッチ手段と、この反復プリフェッチ手段を終了させるプ
リフェッチ終了手段により構成されることとなる。
The instruction i8 is an instruction for adding -1 to the register r2, the instruction i9 is an instruction for comparing the register r2 with 0, and the instruction i10 is a comparison result of the instruction i9.
If 2 is larger, the instruction branches to the label “loop”; otherwise, the instruction does not branch. The register r2 is used as a counter that counts the number of times of the loop configured in the present program example.
Form a loop of 256 times. In this case, the prefetch means is constituted by an iterative prefetch means for repeating data reading and a prefetch ending means for terminating the iterative prefetch means.

【0074】図5は図4に示したプログラム例をプロセ
ッサ4が実行した場合の動作波形を示した図である。C
0〜C20は各サイクルを表しており、C0〜C10は
図4のプログラム例の命令i3〜i10で構成されるル
ープの1回目を示しており、C11〜C18は2回目の
ループを示している。
FIG. 5 is a diagram showing operation waveforms when the processor 4 executes the example of the program shown in FIG. C
0 to C20 represent each cycle, C0 to C10 represent the first loop of the instructions i3 to i10 of the program example in FIG. 4, and C11 to C18 represent the second loop. .

【0075】図5において、「プロセッサの実行命令」
の波形は各サイクルのプロセッサ4で実行されている命
令を表しており、「プロセッサのアドレス」はプロセッ
サ4が出力するアドレスを表している。「プロセッサか
らプリフェッチ装置」の「リード要求」はプロセッサ4
のプリフェッチ装置1に対するリード要求信号であり、
「アクノレッジ」はプリフェッチ装置1のプロセッサ4
に対するアクノレッジ信号を表している。それぞれの信
号はハイ状態のときアクティブ状態であるとしている。
In FIG. 5, "processor execution instruction"
Represents the instruction executed by the processor 4 in each cycle, and the “processor address” represents the address output by the processor 4. “Read request” of “Prefetch device from processor” is processor 4
Is a read request signal to the prefetch device 1 of
“Acknowledge” is the processor 4 of the prefetch device 1
Represents an acknowledgment signal with respect to. Each signal is assumed to be in an active state when in a high state.

【0076】同様に「プリフェッチ装置から主記憶」の
「リード要求」はプリフェッチ装置1の主記憶2に対す
るリード要求信号であり、「アクノレッジ」は主記憶2
のプリフェッチ装置1に対するアクノレッジ信号を表し
ている。同様にそれぞれの信号はハイ状態のときアクテ
ィブ状態であるとしている。
Similarly, "read request" of "prefetch device to main memory" is a read request signal for main memory 2 of prefetch device 1, and "acknowledge" is main memory 2
3 shows an acknowledge signal for the prefetch device 1. Similarly, it is assumed that each signal is in the active state when it is in the high state.

【0077】「主記憶」の波形は主記憶2の読み出し動
作を表しており、波形図中の値は読み出すときのアドレ
スを表している。なお、第1の実施の形態では主記憶2
の「読み出し」は4サイクルで完了するとしている。
The waveform of “main memory” indicates a read operation of the main memory 2, and the value in the waveform diagram indicates an address at the time of reading. In the first embodiment, the main memory 2
Is completed in four cycles.

【0078】「プリフェッチアドレスバッファ」の波形
はプリフェッチアドレスバッファ40に保持されている
アドレスを表しており、「プリフェッチバッファ」の波
形はプリフェッチバッファ30に保持されているデータ
を表している。プリフェッチバッファの波形図中の値は
アドレスであり、そのアドレスで読み出したデータが保
持されていることを示している。なお、黒く塗りつぶし
た部分は保持されているデータが無効であることを示し
ている。
The waveform of the “prefetch address buffer” indicates the address held in the prefetch address buffer 40, and the waveform of the “prefetch buffer” indicates the data held in the prefetch buffer 30. The value in the waveform diagram of the prefetch buffer is an address, which indicates that data read at that address is held. Note that a black portion indicates that the stored data is invalid.

【0079】「プリフェッチ制御回路の内部状態」の波
形は図2で示したプリフェッチ制御回路100の内部状
態を示している。
The waveform of “internal state of prefetch control circuit” indicates the internal state of prefetch control circuit 100 shown in FIG.

【0080】以下、図4のプログラム例における第1の
実施の形態のプリフェッチ装置を含むシステムの動作に
ついて説明する。
Hereinafter, the operation of the system including the prefetch device of the first embodiment in the example of the program of FIG. 4 will be described.

【0081】まず、プロセッサ4は命令i0〜i2を実
行し、レジスタr0、r1、r2にそれぞれ0x400
00100、0x80000100、256を格納す
る。この部分は図5には示されていない。
First, the processor 4 executes the instructions i0 to i2 and stores 0x400 in the registers r0, r1, r2 respectively.
00100, 0x800000100, 256 are stored. This part is not shown in FIG.

【0082】次に、プロセッサ4は命令i3を実行す
る。命令i3はレジスタr0に格納されている値0x4
0000100をアドレスとして主記憶2からデータを
読み出す命令である。図5のC0にプロセッサ4は命令
i3を実行している様子を示している。命令i3によ
り、プロセッサ4はリード要求信号をプリフェッチ装置
1に出力すると同時に、アドレス0x40000100
をマルチプレクサ101に出力する。プリフェッチ装置
1においては、プロセッサ4の出力したリード要求信号
はプリフェッチ制御回路100に入力される。このと
き、リード要求アドレスのアドレス空間はキャッシュ空
間と異なるのでキャッシュメモリ5は動作しない。
Next, the processor 4 executes the instruction i3. The instruction i3 has a value 0x4 stored in the register r0.
This is an instruction to read data from the main memory 2 using 0000100 as an address. The state where the processor 4 is executing the instruction i3 is shown at C0 in FIG. In response to the instruction i3, the processor 4 outputs a read request signal to the prefetch device 1 and at the same time, the address 0x40000100
Is output to the multiplexer 101. In the prefetch device 1, the read request signal output from the processor 4 is input to the prefetch control circuit 100. At this time, the cache memory 5 does not operate because the address space of the read request address is different from the cache space.

【0083】プリフェッチ制御回路100ではプロセッ
サ4から出力されたリード要求信号によりマルチプレク
サ101を制御することでプロセッサ4の出力したアド
レスを選択し主記憶2へ送ると同時に、主記憶2に対し
リード要求信号を出力する。
The prefetch control circuit 100 selects the address output from the processor 4 by controlling the multiplexer 101 based on the read request signal output from the processor 4 and sends it to the main memory 2. Is output.

【0084】一方、アドレス空間判別回路10はプロセ
ッサ4の出力するアドレスが0x40000100であ
ることによりプリフェッチ空間であると判断し、その旨
の信号をプリフェッチ制御回路100に出力する。プリ
フェッチ制御回路100はアドレス空間判別回路10の
出力する信号と、プロセッサ4のリード要求信号により
内部状態を「プリフェッチ状態」に遷移させるととも
に、プリフェッチアドレス生成回路20を制御し、プロ
セッサ4の出力するアドレスをバッファ21(図6)に
保持させる。
On the other hand, the address space discriminating circuit 10 judges that the address is 0x40000100 from the processor 4 as the prefetch space, and outputs a signal to that effect to the prefetch control circuit 100. The prefetch control circuit 100 changes the internal state to the “prefetch state” according to the signal output from the address space determination circuit 10 and the read request signal from the processor 4, controls the prefetch address generation circuit 20, and controls the address output from the processor 4. In the buffer 21 (FIG. 6).

【0085】C1〜C2は主記憶2の読み出しを待って
いるサイクルである。主記憶2の読み出しは4サイクル
であり、命令i3はデータの読み出しが完了するまで次
の命令に進むことができないので、命令i3が実行中の
状態となっている。
C1 and C2 are cycles waiting for reading of the main memory 2. The reading of the main memory 2 is performed in four cycles, and the instruction i3 cannot proceed to the next instruction until the data reading is completed, so that the instruction i3 is being executed.

【0086】C3では、主記憶2はアドレス0x400
00100のデータを読み出しマルチプレクサ102に
出力するとともに、アクノレッジ信号をプリフェッチ制
御回路100に出力する。プリフェッチ制御回路100
はマルチプレクサ102を制御し、主記憶2の出力した
データをプロセッサ4に出力し、アクノレッジ信号をプ
ロセッサ4に出力する。キャッシュメモリ5は動作して
いないので主記憶2の出力しているデータがキャッシュ
メモリ5に取り込まれることはない。
In C3, the main memory 2 has the address 0x400
The data of 00100 is output to the read multiplexer 102, and an acknowledge signal is output to the prefetch control circuit 100. Prefetch control circuit 100
Controls the multiplexer 102, outputs the data output from the main memory 2 to the processor 4, and outputs an acknowledge signal to the processor 4. Since the cache memory 5 is not operating, the data output from the main memory 2 is not taken into the cache memory 5.

【0087】C4ではプロセッサ4は命令i4を実行す
る。命令i4はld命令であるが、アドレスが0x80
000100、すなわちキャッシュ空間へのリード要求
であるためキャッシュメモリ5が動作する。ここではキ
ャッシュメモリ5はヒットするとしているので、プロセ
ッサ4はデータ待ちになることはなく、命令i4を完了
させることができ、直ちに命令i5の実行を開始でき
る。キャッシュメモリ5がヒットするとしているので、
プリフェッチ装置1および主記憶2へのアクセスは行わ
れず、動作しない。
At C4, the processor 4 executes the instruction i4. The instruction i4 is an ld instruction, but the address is 0x80.
000100, that is, a read request to the cache space, the cache memory 5 operates. Here, since the cache memory 5 hits, the processor 4 does not wait for data, can complete the instruction i4, and can immediately start executing the instruction i5. Since the cache memory 5 is said to hit,
The prefetch device 1 and the main memory 2 are not accessed and do not operate.

【0088】一方、プリフェッチ制御回路100の内部
状態は「プリフェッチ状態」になっているので、主記憶
2に対しプリフェッチ動作を開始する。プリフェッチ動
作はプロセッサ4の動作とは無関係に行われる。まず、
プリフェッチ制御回路100はプリフェッチアドレス生
成回路20に対し、最初のプリフェッチアドレスを生成
するように制御する。プリフェッチアドレス生成回路2
0は、バッファ21に保持したアドレス0x40000
100と値4を加算器23で加算した値0x40000
104をマルチプレクサ101に出力する。さらに、マ
ルチプレクサ101を制御し、プリフェッチアドレス生
成回路20の出力するアドレス0x40000104を
主記憶2に出力するようにし、同時にリード要求信号を
主記憶2に出力する。主記憶2ではアドレス0x400
00104のデータを4サイクルかけて読み出す。
On the other hand, since the internal state of the prefetch control circuit 100 is "prefetch state", the prefetch operation for the main memory 2 is started. The prefetch operation is performed independently of the operation of the processor 4. First,
The prefetch control circuit 100 controls the prefetch address generation circuit 20 to generate the first prefetch address. Prefetch address generation circuit 2
0 is the address 0x40000 held in the buffer 21
Value 0x40000 obtained by adding 100 and value 4 by the adder 23
104 is output to the multiplexer 101. Further, it controls the multiplexer 101 to output the address 0x40000104 output from the prefetch address generation circuit 20 to the main memory 2 and outputs a read request signal to the main memory 2 at the same time. Address 0x400 in main memory 2
The data of 00104 is read out over four cycles.

【0089】C5、C6ではプロセッサ4は命令i5、
命令i6を実行しているが、この間主記憶2へのアクセ
スは行わない。
In C5 and C6, the processor 4 executes the instruction i5,
While the instruction i6 is being executed, the main memory 2 is not accessed during this time.

【0090】C7では、主記憶2はプリフェッチ動作を
完了し、読み出したデータをプリフェッチバッファ30
およびマルチプレクサ102に出力し、アクノレッジ信
号をプリフェッチ制御回路100に出力する。プリフェ
ッチ制御回路100は主記憶2のアクノレッジ信号によ
り、プリフェッチバッファ30に主記憶2のデータを保
持させ、またプリフェッチアドレスバッファ40にプリ
フェッチアドレス生成回路20が出力するアドレスを保
持させる。さらに、プリフェッチ制御回路100は内部
状態を「プリフェッチ状態」から「プリフェッチ待ち状
態」に変化させる。また、プリフェッチアドレス生成回
路20では現在出力しているアドレス0x400001
04を内部に保持し直し、4を加算した0x40000
108を出力する。これらの動作はプロセッサ4の命令
実行に影響を与えることはない。
At C7, the main memory 2 completes the prefetch operation and stores the read data in the prefetch buffer 30.
And an acknowledgment signal to the prefetch control circuit 100. The prefetch control circuit 100 causes the prefetch buffer 30 to hold the data of the main memory 2 and the prefetch address buffer 40 to hold the address output from the prefetch address generation circuit 20 in response to the acknowledge signal of the main memory 2. Further, the prefetch control circuit 100 changes the internal state from the “prefetch state” to the “prefetch wait state”. The prefetch address generation circuit 20 outputs the currently output address 0x400001.
0x40000 where 04 was retained inside and 4 was added
108 is output. These operations do not affect the instruction execution of the processor 4.

【0091】C8〜C10ではプロセッサ4は命令i8
〜i10を実行しているが、この間主記憶2へのアクセ
スは行わない。
In C8 to C10, the processor 4 executes the instruction i8
To i10, but does not access the main memory 2 during this time.

【0092】命令i6〜i8によりプロセッサ4のレジ
スタr0、r1、r2の値はそれぞれ0x400001
04、0x80000100、255となる。命令i9
によりレジスタr2と値0が比較されるが、レジスタr
2の方が「大」なので命令i10により、ラベル「lo
op」への分岐が成立し、1回目のループが終了する。
次のC11からは命令i3が実行されることになる。
According to the instructions i6 to i8, the values of the registers r0, r1, and r2 of the processor 4 are respectively 0x400001.
04, 0x80000100, 255. Instruction i9
Compares the value of the register r2 with the value 0,
2 is "larger", the instruction "i10" causes the label "lo"
The branch to “op” is taken, and the first loop ends.
From the next C11, the instruction i3 is executed.

【0093】C11ではプロセッサ4は再び命令i3を
実行する。命令i3はld命令であるのでプロセッサ4
はレジスタr0の値である0x40000104をアド
レスとして出力し、リード要求信号をプリフェッチ制御
回路100に出力する。ここで、プリフェッチアドレス
バッファ40にはアドレス0x40000104が保持
されており、比較回路50はプロセッサ4の出力するア
ドレスと比較し一致することを検出し、一致信号をプリ
フェッチ制御回路100に出力する。プリフェッチ制御
回路100はプロセッサ4のリード要求信号と、比較回
路50の一致信号により、マルチプレクサ102を制御
し、プリフェッチバッファ30に保持されているアドレ
ス0x40000104のデータをプロセッサ4に出力
するとともに、アクノレッジ信号をプロセッサ4に出力
する。この場合の命令i3のld命令は1サイクル(0
サイクル待ち)で完了したことになる。このとき、リー
ド要求アドレスのアドレス空間はキャッシュ空間と異な
るのでキャッシュメモリ5は動作しない。
At C11, the processor 4 executes the instruction i3 again. Since the instruction i3 is an ld instruction, the processor 4
Outputs 0x40000104, which is the value of the register r0, as an address, and outputs a read request signal to the prefetch control circuit 100. Here, the address 0x40000104 is held in the prefetch address buffer 40, and the comparison circuit 50 compares the address with the address output from the processor 4 to detect a match, and outputs a match signal to the prefetch control circuit 100. The prefetch control circuit 100 controls the multiplexer 102 based on the read request signal of the processor 4 and the coincidence signal of the comparison circuit 50, outputs the data of the address 0x40000104 held in the prefetch buffer 30 to the processor 4, and outputs the acknowledgment signal. Output to the processor 4. In this case, the ld instruction of the instruction i3 has one cycle (0
Cycle wait). At this time, the cache memory 5 does not operate because the address space of the read request address is different from the cache space.

【0094】一方、プリフェッチバッファ30に保持さ
れていたデータはプロセッサ4への転送が完了したので
無効化され、プリフェッチ制御回路100は内部状態を
「プリフェッチ待ち状態」から「プリフェッチ状態」に
遷移する。
On the other hand, the data held in the prefetch buffer 30 is invalidated because the transfer to the processor 4 is completed, and the prefetch control circuit 100 changes the internal state from the “prefetch wait state” to the “prefetch state”.

【0095】C12ではプロセッサ4は命令i4を実行
する。命令i4はld命令であるが、アドレスが0x8
0000104、すなわちキャッシュ空間へのリード要
求であるためキャッシュメモリ5が動作する。ここでは
キャッシュメモリ5はヒットするとしているので、プロ
セッサ4はデータ待ちになることはなく、命令i4を完
了させることができ、直ちに命令i5の実行を開始でき
る。キャッシュメモリ5がヒットするとしているので、
プリフェッチ装置1および主記憶2へのアクセスは行わ
れず、動作しない。
At C12, the processor 4 executes the instruction i4. The instruction i4 is an ld instruction, but the address is 0x8
0000104, that is, a read request to the cache space, the cache memory 5 operates. Here, since the cache memory 5 hits, the processor 4 does not wait for data, can complete the instruction i4, and can immediately start executing the instruction i5. Since the cache memory 5 is said to hit,
The prefetch device 1 and the main memory 2 are not accessed and do not operate.

【0096】一方、プリフェッチ制御回路100の内部
状態は「プリフェッチ状態」になっているので、プロセ
ッサ4の命令動作とは無関係に主記憶2に対するプリフ
ェッチ動作を開始する。プリフェッチ制御回路100は
主記憶2に対しリード要求信号を出力すると同時に、マ
ルチプレクサ101を制御してプリフェッチアドレス生
成回路20の出力しているアドレス0x4000010
8を主記憶2に出力する。
On the other hand, since the internal state of the prefetch control circuit 100 is in the "prefetch state", the prefetch operation for the main memory 2 is started regardless of the instruction operation of the processor 4. The prefetch control circuit 100 outputs a read request signal to the main memory 2 and controls the multiplexer 101 to control the address 0x4000010 output from the prefetch address generation circuit 20 at the same time.
8 is output to the main memory 2.

【0097】C13以降は、1回目のループであるC5
以降と同様に動作する。特に、プリフェッチバッファ3
0に保持されるデータは、その後プロセッサ4が命令i
3を実行するときに、主記憶2の読み出しを行うことな
しにプロセッサ4に転送され、プロセッサ4は命令i3
の完了を待たされることがない。
After C13, the first loop, C5
It operates in the same manner as the following. In particular, prefetch buffer 3
The data held at 0 is then transmitted by the processor 4 to the instruction i.
3 is transferred to the processor 4 without reading the main memory 2, and the processor 4 executes the instruction i3
There is no need to wait for completion.

【0098】以上のように本発明の実施の形態のプリフ
ェッチ装置によれば、プロセッサ4の1回目の命令i3
の実行で、プリフェッチ空間に対しリード要求を出すこ
とにより、プリフェッチ装置1はプロセッサ4の動作と
は無関係に主記憶2から後続アドレスデータを読み出
し、プリフェッチバッファ30に保持する。その後、プ
ロセッサ4のリード要求で、そのアドレスのデータがプ
リフェッチバッファ30に保持されている場合は、主記
憶2のアクセスを行うことなしにプリフェッチバッファ
30からプロセッサ4に送る。そのため、プロセッサ4
は主記憶2の読み出しを待つことがなく、高速な読み出
しを行うことができる。
As described above, according to the prefetch device of the embodiment of the present invention, the first instruction i3
, The prefetch device 1 reads the subsequent address data from the main memory 2 and stores it in the prefetch buffer 30 irrespective of the operation of the processor 4. Thereafter, when the data of the address is held in the prefetch buffer 30 by a read request from the processor 4, the data is sent from the prefetch buffer 30 to the processor 4 without accessing the main memory 2. Therefore, processor 4
Can perform high-speed reading without waiting for reading from the main memory 2.

【0099】さらに、図4のプログラムのようにプリフ
ェッチ空間へのリード要求のアドレスが、プリフェッチ
装置1で想定しているプリフェッチアドレスと一致する
場合は、プロセッサ4のプリフェッチ空間へのリード要
求の待ち時間が生じないため、ストリームフィルタのよ
うなプログラムを高速に実行することができる。
Further, when the address of the read request to the prefetch space matches the prefetch address assumed by the prefetch device 1 as in the program of FIG. 4, the waiting time of the read request to the prefetch space of the processor 4 Therefore, a program such as a stream filter can be executed at high speed.

【0100】また、本発明の第1の実施の形態によれ
ば、命令i3、命令i4は同じld命令であり、コンパ
イラでプリフェッチ空間へのアクセスとキャッシュ空間
へのアクセスを区別することなく命令を生成することが
できる。
According to the first embodiment of the present invention, the instruction i3 and the instruction i4 are the same ld instructions, and the compiler can execute the instruction without distinguishing between access to the prefetch space and access to the cache space. Can be generated.

【0101】さらに、命令i3を実行することではキャ
ッシュメモリ5は動作せず、キャッシュメモリ5に保持
されているデータは変化しない。そのため、プリフェッ
チによるキャッシュメモリのヒット率低下を招くことは
ない。
Further, by executing the instruction i3, the cache memory 5 does not operate, and the data held in the cache memory 5 does not change. Therefore, the hit rate of the cache memory due to the prefetch does not decrease.

【0102】ここで、例えば命令i3がキャッシュ空間
へのアクセス命令であり、命令i3のアドレスと命令i
4のアドレスがキャッシュメモリ5上で同一のエントリ
を占める場合は、命令i3の実行により生じたキャッシ
ュミスにより、命令i4で読み出すデータはキャッシュ
メモリ5から追い出されてしまい命令i4実行時は必ず
ミスヒットとなる。また、次の機会で本実施の形態のプ
ログラム例が実行されるときは、命令i3のデータは外
部で生成され主記憶2上に格納されるため、キャッシュ
メモリ5に残っているデータを破棄しなければならなく
なる。このように、命令i3のデータをキャッシュメモ
リ5に保持させることは無駄であるばかりでなく、命令
i4のようなキャッシュメモリ5に保持させると有効な
データまで追い出してしまう恐れがある。本発明の実施
の形態によれば命令i3によりキャッシュメモリ5は動
作せず、キャッシュメモリ5と同等の動作をすることが
可能である。
Here, for example, the instruction i3 is an instruction to access the cache space, and the address of the instruction i3 and the instruction i
In the case where the address 4 occupies the same entry in the cache memory 5, the data read by the instruction i4 is evicted from the cache memory 5 due to the cache miss caused by the execution of the instruction i3. Becomes Further, when the program example of the present embodiment is executed at the next opportunity, since the data of the instruction i3 is generated externally and stored in the main memory 2, the data remaining in the cache memory 5 is discarded. I have to. Thus, holding the data of the instruction i3 in the cache memory 5 is not only wasteful, but holding the data in the cache memory 5 such as the instruction i4 may result in expelling even valid data. According to the embodiment of the present invention, the cache memory 5 does not operate in response to the instruction i3, and the same operation as the cache memory 5 can be performed.

【0103】なお、上記の動作説明において、例えばC
11でプロセッサ4のリード要求アドレスとプリフェッ
チアドレスバッファ40に保持されているアドレスとが
一致せず、かつそのアドレスがプリフェッチ空間内にあ
ることが比較回路50で検出された場合は、プリフェッ
チバッファ30のデータを破棄し、再度主記憶2からプ
ロセッサ4の要求するデータを読み出し、プリフェッチ
バッファ30に保持すると同時に、そのときのアドレス
をプリフェッチアドレスバッファ40に保持する。プロ
セッサ4の出力したアドレスはプリフェッチアドレス生
成回路20のバッファ21にも保持され、その後のプリ
フェッチに用いられる。このようにプリフェッチ装置1
の想定するアドレスと異なるプリフェッチ空間のアドレ
スをプロセッサ4が出力した場合でも誤動作することは
ない。
In the above description of the operation, for example, C
In step 11, if the read request address of the processor 4 does not match the address held in the prefetch address buffer 40 and the comparison circuit 50 detects that the address is in the prefetch space, the prefetch buffer 30 The data is discarded, the data requested by the processor 4 is read out again from the main memory 2 and stored in the prefetch buffer 30, and at the same time, the address at that time is stored in the prefetch address buffer 40. The address output from the processor 4 is also held in the buffer 21 of the prefetch address generation circuit 20, and is used for the subsequent prefetch. Thus, the prefetch device 1
If the processor 4 outputs an address in a prefetch space different from the address assumed by the processor 4, no malfunction occurs.

【0104】これは、プリフェッチバッファ30におけ
るデータの読み出しを繰り返す第1と第2の反復プリフ
ェッチ手段と、プロセッサ4の主記憶2への第1のリー
ド要求アドレスにより第1の反復プリフェッチ手段が開
始され、プロセッサ4の主記憶2への第2のリード要求
アドレスと第1の反復プリフェッチ手段によりプリフェ
ッチバッファに保持されているデータのアドレスとが一
致していないことが比較回路50により検出された場合
は、第1の反復プリフェッチ手段を終了し、第2の反復
プリフェッチ手段を開始する手段により構成されてい
る。
The first and second iterative prefetch means are started by the first and second iterative prefetch means for repeating reading of data in the prefetch buffer 30 and the first read request address to the main memory 2 of the processor 4. When the comparison circuit 50 detects that the second read request address to the main memory 2 of the processor 4 does not match the address of the data held in the prefetch buffer by the first repetitive prefetch means. , The first iterative prefetch means is terminated, and the second iterative prefetch means is started.

【0105】なお、本発明の実施の形態におけるプリフ
ェッチアドレス生成回路20は図6に示すような4を加
算する例を示しているが、4以外の他の値でも良く、ま
た加算以外の他の演算でも同様の効果を得ることができ
る。
Although the prefetch address generation circuit 20 according to the embodiment of the present invention shows an example of adding 4 as shown in FIG. 6, a value other than 4 may be used. The same effect can be obtained by calculation.

【0106】またアドレス一致検出手段(50)により
プロセッサ4の記憶デバイス(2)へのリード要求アド
レスとプリフェッチバッファ30に保持したデータのア
ドレスとが一致しないことを検出した場合は、プリフェ
ッチバッファ30に保持されたデータを無効化する手段
を設けるようにしてもよい。
When the address match detecting means (50) detects that the read request address of the storage device (2) of the processor 4 does not match the address of the data held in the prefetch buffer 30, the address of the prefetch buffer 30 is changed. Means for invalidating the held data may be provided.

【0107】また、プリフェッチアドレス生成回路の他
の実施の形態として、図7に示すようにプロセッサ4で
書換え可能な制御レジスタ25により演算器24の演算
方法とオペランドを指定できるようにしてもよい。図7
において、24はオペランドに対して複数の演算を施す
ことのできる演算器であり、25は演算器24に与える
演算コマンドおよびオペランドを保持し、プロセッサ4
により書き換え可能な制御レジスタである。図7のプリ
フェッチアドレス生成回路により、例えば、下位4ビッ
トのビット列を逆転する演算の場合と4を加算する場合
とを制御レジスタ25により切り替えるようにすると、
プロセッサ4で実行するプログラムの特性にあわせたプ
リフェッチのアドレス生成が容易になり本発明の効果は
より高くなる。
As another embodiment of the prefetch address generation circuit, as shown in FIG. 7, a control register 25 rewritable by the processor 4 may be used to specify the operation method of the operation unit 24 and the operand. FIG.
, 24 is an operation unit capable of performing a plurality of operations on operands, 25 is an operation command and an operand to be given to the operation unit 24, and the processor 4
Is a rewritable control register. When the prefetch address generation circuit of FIG. 7 switches between, for example, the operation of inverting the bit sequence of the lower 4 bits and the case of adding 4 using the control register 25,
It is easy to generate a prefetch address in accordance with the characteristics of a program executed by the processor 4, and the effect of the present invention is further enhanced.

【0108】また、図8に示すようにテーブルから取り
出したオフセットをアドレスに加算してプリフェッチア
ドレスを生成するようにしても良い。図8において、2
6はカウンタであり、27はカウンタ26の値をインデ
ックスとしてオフセットを読み出すことのできるテーブ
ルROMであり、28はテーブルROM27から読み出
したオフセットとレジスタ21に格納されたアドレスと
を加算することでアドレスを生成する加算器である。図
8のプリフェッチアドレス生成回路20により、例え
ば、テーブルROM27にランダムなオフセットを格納
しておくだけで、ランダムなアドレスを生成することも
できる。
Further, as shown in FIG. 8, a prefetch address may be generated by adding an offset taken out of a table to an address. In FIG. 8, 2
Reference numeral 6 denotes a counter, 27 denotes a table ROM from which the offset can be read using the value of the counter 26 as an index, and 28 denotes an address obtained by adding the offset read from the table ROM 27 and the address stored in the register 21. It is an adder to be generated. The prefetch address generation circuit 20 in FIG. 8 can generate a random address only by storing a random offset in the table ROM 27, for example.

【0109】さらに、図9にプリフェッチを終了させる
回路を備えた他の実施の形態のプリフェッチ装置のブロ
ック図を示す。200は終了アドレスを保持する制御レ
ジスタであり、201はプリフェッチアドレス生成回路
20の出力するアドレスと制御レジスタ200に保持さ
れているアドレスとを比較する比較回路であり、請求項
5の終了アドレス検出手段に対応する。この終了アドレ
ス検出手段により一致が検出された場合は、終了手段に
より反復プリフェッチ手段を終了する。6は制御レジス
タ200と比較回路201を備えたプリフェッチ装置で
あり、103はプリフェッチ装置6の全体を制御するプ
リフェッチ制御回路である。図9のプリフェッチ装置
6、プリフェッチ制御回路103はそれぞれ図1のプリ
フェッチ装置1、プリフェッチ制御回路100と同様に
動作するが、比較回路201によりプリフェッチアドレ
ス生成回路20の出力するアドレスと制御レジスタ20
0に保持されているアドレスとが一致することが検出さ
れた場合は、その旨の信号をプリフェッチ制御回路10
3に出力する。プリフェッチ制御回路103は内部状態
を「非プリフェッチ状態」に遷移させプリフェッチ動作
を終了する。図9の図1と同一符号で表した部分は図1
と共通しその説明を省略している。
FIG. 9 is a block diagram showing a prefetch apparatus according to another embodiment having a circuit for terminating prefetch. 6. A control register for holding an end address, and a comparison circuit for comparing an address output from the prefetch address generation circuit with an address held in the control register. Corresponding to When a match is detected by the end address detection means, the repetition prefetch means is ended by the end means. Reference numeral 6 denotes a prefetch device including a control register 200 and a comparison circuit 201. Reference numeral 103 denotes a prefetch control circuit that controls the entire prefetch device 6. The prefetch device 6 and the prefetch control circuit 103 shown in FIG. 9 operate in the same manner as the prefetch device 1 and the prefetch control circuit 100 shown in FIG. 1, respectively, but the comparison circuit 201 outputs the address output from the prefetch address generation circuit 20 and the control register 20.
If it is detected that the address held at 0 matches, a signal to that effect is sent to the prefetch control circuit 10.
Output to 3. The prefetch control circuit 103 changes the internal state to the “non-prefetch state” and ends the prefetch operation. 9 are denoted by the same reference numerals as those in FIG.
And its description is omitted.

【0110】図9のプリフェッチ装置6を含むシステム
は、プロセッサ4があらかじめ制御レジスタ200に終
了アドレスを設定しておき、プリフェッチ動作開始後、
プリフェッチ動作で用いるアドレスが制御レジスタ20
0に設定されたアドレスと等しい場合はプリフェッチ動
作を終了する。これによりプロセッサ4が使うことのな
い無駄なプリフェッチ動作を無くすことができるという
効果がある。
In the system including the prefetch device 6 shown in FIG. 9, the processor 4 sets an end address in the control register 200 in advance, and after the prefetch operation starts,
The address used in the prefetch operation is the control register 20
If the address is equal to the address set to 0, the prefetch operation ends. This has the effect of eliminating unnecessary prefetch operations that are not used by the processor 4.

【0111】なお、図9では終了アドレスを指定してプ
リフェッチアドレスと一致する場合に終了する回路を示
したが、プリフェッチの回数を計数し、制御レジスタで
指定した回数に達した場合に終了する手段でも同様の効
果を得ることができる。この場合、反復プリフェッチ手
段の行われた回数を計数する回数計数手段と、制御レジ
スタに設定された値と回数計数手段により計数されたプ
リフェッチ手段の回数とが一致することを検出する回数
一致手段と、この回数一致手段により一致を検出した場
合は反復プリフェッチ手段を終了する手段により構成さ
れる。また、プリフェッチしたトータルのデータサイズ
を計数し、制御レジスタで指定したデータサイズに達し
た場合に終了する手段でも同様の効果を得ることができ
る。この場合、反復プリフェッチ手段によりプリフェッ
チバッファに保持したデータの大きさを計数するデータ
サイズ計数手段と、制御レジスタに設定されたデータサ
イズとデータサイズ計数手段により得られたプリフェッ
チバッファに保持されているデータの大きさとが一致す
ることを検出するデータサイズ一致検出手段と、このデ
ータサイズ一致検出手段により一致が検出された場合は
反復プリフェッチ手段を終了する手段により構成され
る。
Although FIG. 9 shows a circuit which terminates when the end address is specified and matches the prefetch address, means for counting the number of prefetches and terminating when the number of times specified by the control register is reached is obtained. However, a similar effect can be obtained. In this case, the number-of-times counting means for counting the number of times the repetitive prefetch means has been performed, and the number-of-times matching means for detecting that the value set in the control register matches the number of times of the prefetch means counted by the number-of-times counting means. When the match is detected by the number matching means, the repetition prefetch means is terminated. The same effect can be obtained by means for counting the total data size of prefetched data and ending when the data size specified by the control register is reached. In this case, the data size counting means for counting the size of the data held in the prefetch buffer by the iterative prefetch means, the data size set in the control register and the data held in the prefetch buffer obtained by the data size counting means. And a means for ending the repetitive prefetch means when a match is detected by the data size match detecting means.

【0112】なお、図1および図9のプリフェッチバッ
ファ30は主記憶2から読み出したデータを1つだけ保
持する構成を例示しているが、複数のデータを保持でき
る構成の方がよりプリフェッチ動作の効果が高くなる。
例えば、4つ分のデータを保持できる構成の場合は、何
らかの要因で主記憶2がアクセスできない場合でもプロ
セッサ4へのデータ供給にある程度応えることができ
る。
The prefetch buffer 30 shown in FIGS. 1 and 9 exemplifies a configuration in which only one data read from the main memory 2 is held. However, a configuration capable of holding a plurality of data is more effective in the prefetch operation. The effect is higher.
For example, in the case of a configuration that can hold four data, even if the main memory 2 cannot be accessed for some reason, it is possible to respond to data supply to the processor 4 to some extent.

【0113】なお、主記憶2は記憶デバイスであればよ
く、例えば他のデバイスとして、ハードディスクのよう
な記録メディアなどでも同様の効果を得ることができる
ことは言うまでもない。
It is needless to say that the main memory 2 may be a storage device, and the same effect can be obtained with another device such as a recording medium such as a hard disk.

【0114】[0114]

【発明の効果】請求項1記載のプリフェッチ装置によれ
ば、プロセッサがプリフェッチ空間に対しリード要求を
出すことにより、プリフェッチ装置はプロセッサの動作
とは無関係に主記憶からデータを読み出し、プリフェッ
チバッファに保持する。その後、プロセッサがプリフェ
ッチ空間に対しリード要求を出したとき、そのアドレス
がプリフェッチバッファに保持されているデータのアド
レスであれば、主記憶からの読み出しを行わず、代わり
にプリフェッチバッファに格納されているデータをプロ
セッサに転送する。すなわち、プロセッサのプリフェッ
チ空間へのリード要求のアドレスが、プリフェッチ装置
で想定しているプリフェッチアドレスと一致する場合
は、プロセッサのプリフェッチ空間へのリード要求の待
ち時間が生じないため、高速なプログラムの実行を行う
ことが出来る。
According to the prefetch device of the first aspect, the processor issues a read request to the prefetch space, so that the prefetch device reads data from the main memory regardless of the operation of the processor and holds the data in the prefetch buffer. I do. Thereafter, when the processor issues a read request to the prefetch space, if the address is the address of the data held in the prefetch buffer, the data is not read from the main memory, but is stored in the prefetch buffer instead. Transfer data to the processor. That is, when the address of the read request to the prefetch space of the processor matches the prefetch address assumed by the prefetch device, there is no waiting time for the read request to the prefetch space of the processor. Can be performed.

【0115】また、プリフェッチ空間へのリード要求を
出す命令は、キャッシュ空間や通常空間へのリード要求
を出す命令と同じ命令であるため、コンパイラでプリフ
ェッチ空間と他の空間を区別して命令生成する必要がな
いという効果がある。
The instruction for issuing a read request to the prefetch space is the same as the instruction for issuing a read request to the cache space or the normal space. Therefore, it is necessary for the compiler to generate instructions by distinguishing the prefetch space from other spaces. There is an effect that there is no.

【0116】さらに、プリフェッチ空間へのリード要求
を出す命令を実行することではキャッシュメモリは動作
せず、キャッシュメモリに保持されているデータは変化
することはない。したがって、ストリームデータなどの
プリフェッチによるキャッシュメモリのヒット率の低下
を招くことはない。
Furthermore, the cache memory does not operate by executing an instruction for issuing a read request to the prefetch space, and the data held in the cache memory does not change. Therefore, the hit rate of the cache memory does not decrease due to the prefetch of the stream data or the like.

【0117】請求項2記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the second aspect, the same effects as those of the first aspect can be obtained.

【0118】請求項3記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the third aspect, the same effect as that of the first aspect is obtained.

【0119】請求項4記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the fourth aspect, the same effect as that of the first aspect is obtained.

【0120】請求項5記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the fifth aspect, the same effect as that of the first aspect is obtained.

【0121】請求項6記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the sixth aspect, the same effects as those of the first aspect can be obtained.

【0122】請求項7記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch apparatus of the seventh aspect, the same effect as that of the first aspect can be obtained.

【0123】請求項8記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the eighth aspect, the same effects as those of the first aspect are obtained.

【0124】請求項9記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the ninth aspect, the same effect as that of the first aspect can be obtained.

【0125】請求項10記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the tenth aspect, the same effect as that of the first aspect is obtained.

【0126】請求項11記載のプリフェッチ装置によれ
ば、請求項1と同様な効果がある。
According to the prefetch device of the eleventh aspect, the same effect as that of the first aspect can be obtained.

【0127】請求項12記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the twelfth aspect, the same effect as that of the first aspect is obtained.

【0128】請求項13記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the thirteenth aspect, the same effect as that of the first aspect can be obtained.

【0129】請求項14記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the fourteenth aspect, the same effect as that of the first aspect can be obtained.

【0130】請求項15記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetching method of the fifteenth aspect, the same effect as that of the first aspect is obtained.

【0131】請求項16記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the sixteenth aspect, the same effect as that of the first aspect can be obtained.

【0132】請求項17記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the seventeenth aspect, the same effect as that of the first aspect can be obtained.

【0133】請求項18記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the eighteenth aspect, the same effect as that of the first aspect can be obtained.

【0134】請求項19記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the nineteenth aspect, the same effect as that of the first aspect can be obtained.

【0135】請求項20記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetching method of the twentieth aspect, the same effect as that of the first aspect can be obtained.

【0136】請求項21記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetch method of the twenty-first aspect, the same effect as that of the first aspect can be obtained.

【0137】請求項22記載のプリフェッチ方法によれ
ば、請求項1と同様な効果がある。
According to the prefetching method of the twenty-second aspect, the same effect as that of the first aspect is obtained.

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

【図1】本発明の第1の実施の形態におけるプリフェッ
チ装置を含むシステムのハードウェア構成図である。
FIG. 1 is a hardware configuration diagram of a system including a prefetch device according to a first embodiment of the present invention.

【図2】第1の実施の形態におけるプリフェッチ制御回
路100の内部状態遷移を示す説明図である。
FIG. 2 is an explanatory diagram showing an internal state transition of a prefetch control circuit 100 according to the first embodiment.

【図3】第1の実施の形態におけるプリフェッチ装置を
含むシステムの動作説明用のアドレス空間マップ図であ
る。
FIG. 3 is an address space map for explaining the operation of the system including the prefetch device according to the first embodiment;

【図4】第1の実施の形態におけるプリフェッチ装置を
含むシステムの動作説明用のプログラム例の説明図であ
る。
FIG. 4 is an explanatory diagram of an example of a program for explaining an operation of a system including a prefetch device according to the first embodiment;

【図5】第1の実施の形態におけるプリフェッチ装置を
含むシステムの動作説明用の動作波形図である。
FIG. 5 is an operation waveform diagram for explaining the operation of the system including the prefetch device according to the first embodiment.

【図6】第1の実施の形態におけるプリフェッチアドレ
ス生成回路20の詳細ブロック図である。
FIG. 6 is a detailed block diagram of a prefetch address generation circuit 20 according to the first embodiment.

【図7】本発明の他の実施の形態におけるプリフェッチ
アドレス生成回路20のブロック図である。
FIG. 7 is a block diagram of a prefetch address generation circuit 20 according to another embodiment of the present invention.

【図8】本発明のさらに他の実施の形態におけるプリフ
ェッチアドレス生成回路20のブロック図である。
FIG. 8 is a block diagram of a prefetch address generation circuit 20 according to still another embodiment of the present invention.

【図9】本発明のさらに他の実施の形態におけるプリフ
ェッチ装置を含むシステムのハードウェア構成図であ
る。
FIG. 9 is a hardware configuration diagram of a system including a prefetch device according to still another embodiment of the present invention.

【図10】従来のプリフェッチ命令によるプリフェッチ
装置の動作説明用のプログラム動作説明図である。
FIG. 10 is a program operation explanatory diagram for explaining the operation of a conventional prefetch device using a prefetch instruction.

【図11】従来のキャッシュメモリによるプリフェッチ
装置の動作説明用のプログラム動作説明図である。
FIG. 11 is a program operation explanatory diagram for explaining the operation of a prefetch device using a conventional cache memory.

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

1 プリフェッチ装置 2 主記憶 3 命令メモリ 4 プロセッサ 5 キャッシュメモリ 10 アドレス空間判別回路 20 プリフェッチアドレス生成回路 21 バッファ 22 マルチプレクサ 23 加算器 24 演算器 25 制御レジスタ 30 プリフェッチバッファ 40 プリフェッチアドレスバッファ 50 比較回路 100 プリフェッチ制御回路 101 マルチプレクサ 102 マルチプレクサ 200 制御レジスタ 201 比較回路 DESCRIPTION OF SYMBOLS 1 Prefetch apparatus 2 Main memory 3 Instruction memory 4 Processor 5 Cache memory 10 Address space discrimination circuit 20 Prefetch address generation circuit 21 Buffer 22 Multiplexer 23 Adder 24 Arithmetic unit 25 Control register 30 Prefetch buffer 40 Prefetch address buffer 50 Comparison circuit 100 Prefetch control Circuit 101 Multiplexer 102 Multiplexer 200 Control register 201 Comparison circuit

Claims (22)

【特許請求の範囲】[Claims] 【請求項1】 プロセッサの記憶デバイスへのリード要
求アドレスがプリフェッチ空間であることを判別する空
間判別手段と、プリフェッチアドレスを生成するアドレ
ス生成手段と、このアドレス生成手段で得た前記プリフ
ェッチアドレスを用いて前記記憶デバイスから対応する
データを読み出すデータ読み出し手段と、前記プロセッ
サの前記記憶デバイスへのリード要求アドレスが前記空
間判別手段により前記プリフェッチ空間であることが判
別された場合は前記プロセッサの前記記憶デバイスへの
リード要求とは無関係に前記データ読み出し手段により
データを読み出して保持するプリフェッチバッファを有
するプリフェッチ手段と、前記プロセッサの前記記憶デ
バイスへのリード要求アドレスが前記プリフェッチバッ
ファに保持されているデータのアドレスと一致すること
を検出するアドレス一致検出手段と、このアドレス一致
検出手段により一致が検出された場合は、前記プリフェ
ッチバッファに保持されているデータを前記プロセッサ
に転送するデータ転送手段とを備えたプリフェッチ装
置。
1. A space determining means for determining that a read request address to a storage device of a processor is a prefetch space, an address generating means for generating a prefetch address, and using the prefetch address obtained by the address generating means. Data reading means for reading out corresponding data from the storage device, and if the read request address to the storage device of the processor is determined to be the prefetch space by the space determination means, the storage device of the processor. A prefetch means having a prefetch buffer for reading and holding data by the data reading means irrespective of a read request to the memory; and a read request address to the storage device of the processor is held in the prefetch buffer. Address match detecting means for detecting a match with an address of data to be transferred, and data transfer means for transferring data held in the prefetch buffer to the processor when a match is detected by the address match detecting means. A prefetch device comprising:
【請求項2】 プリフェッチ手段におけるデータの読み
出しを繰り返す反復プリフェッチ手段と、この反復プリ
フェッチ手段を終了させるプリフェッチ終了手段とを備
えた請求項1記載のプリフェッチ装置。
2. The prefetch apparatus according to claim 1, further comprising: iterative prefetch means for repeating data reading by said prefetch means; and prefetch ending means for terminating said iterative prefetch means.
【請求項3】 反復プリフェッチ手段の行われた回数を
計数する回数計数手段と、制御レジスタに設定された値
と前記回数計数手段により計数されたプリフェッチ手段
の回数とが一致することを検出する回数一致手段と、こ
の回数一致手段により一致を検出した場合は前記反復プ
リフェッチ手段を終了する手段を備えた請求項2記載の
プリフェッチ装置。
3. A number-of-times counting means for counting the number of times the repetitive prefetch means has been performed, and a number of times for detecting that the value set in the control register matches the number of times of the prefetch means counted by the number-of-times counting means. 3. The prefetch apparatus according to claim 2, further comprising a coincidence unit, and a unit for terminating the repetitive prefetch unit when a coincidence is detected by the number-of-times coincidence unit.
【請求項4】 反復プリフェッチ手段によりプリフェッ
チバッファに保持したデータの大きさを計数するデータ
サイズ計数手段と、制御レジスタに設定されたデータサ
イズと前記データサイズ計数手段により得られた前記プ
リフェッチバッファに保持されているデータの大きさと
が一致することを検出するデータサイズ一致検出手段
と、このデータサイズ一致検出手段により一致が検出さ
れた場合は前記反復プリフェッチ手段を終了する手段を
備えた請求項2記載のプリフェッチ装置。
4. A data size counting means for counting the size of data held in a prefetch buffer by an iterative prefetch means, and a data size set in a control register and held in the prefetch buffer obtained by the data size counting means. 3. A data size match detecting means for detecting that the size of the data matches the data size, and means for terminating the iterative prefetch means when a match is detected by the data size match detecting means. Prefetch device.
【請求項5】 反復プリフェッチ手段のアドレス生成手
段により生成したアドレスが制御レジスタに設定された
アドレスと一致することを検出する終了アドレス検出手
段と、この終了アドレス検出手段により一致が検出され
た場合は、前記反復プリフェッチ手段を終了する手段を
備えた請求項2記載のプリフェッチ装置。
5. An ending address detecting means for detecting that an address generated by an address generating means of an iterative prefetch means matches an address set in a control register; and, when a match is detected by the ending address detecting means, 3. The prefetch apparatus according to claim 2, further comprising means for terminating said iterative prefetch means.
【請求項6】 アドレス生成手段が、プロセッサの記憶
デバイスへのリード要求アドレスに制御レジスタに設定
された値を加算することでアドレスを生成する手段であ
る請求項1記載のプリフェッチ装置。
6. The prefetch apparatus according to claim 1, wherein the address generating means is means for generating an address by adding a value set in a control register to a read request address of the storage device of the processor.
【請求項7】 アドレス生成手段が、プロセッサの記憶
デバイスへのリード要求アドレスに対し、制御レジスタ
に設定された情報により決定される演算を施すことでア
ドレスを生成する手段である請求項1記載のプリフェッ
チ装置。
7. The address generation means according to claim 1, wherein the address generation means generates an address by performing an operation determined by information set in a control register on a read request address to the storage device of the processor. Prefetch device.
【請求項8】 プロセッサにより制御レジスタを書き換
える手段を備えた請求項3から請求項7のいずれかの1
項に記載のプリフェッチ装置。
8. The method according to claim 3, further comprising means for rewriting the control register by a processor.
A prefetch device according to the item.
【請求項9】 プリフェッチ手段におけるデータの読み
出しを繰り返す第1と第2の反復プリフェッチ手段と、
プロセッサの記憶デバイスへの第1のリード要求アドレ
スにより第1の反復プリフェッチ手段が開始され、前記
プロセッサの前記記憶デバイスへの第2のリード要求ア
ドレスと第1の反復プリフェッチ手段によりプリフェッ
チバッファに保持されているデータのアドレスとが一致
していないことがアドレス一致検出手段により検出され
た場合は、第1の反復プリフェッチ手段を終了し、第2
の反復プリフェッチ手段を開始する手段を備えた請求項
1記載のプリフェッチ装置。
9. A first and second iterative prefetch means for repeating reading of data in the prefetch means;
The first iterative prefetch means is started by the first read request address to the storage device of the processor, and is held in the prefetch buffer by the second read request address to the storage device of the processor and the first iterative prefetch means. If the address match detecting means detects that the address of the data does not match, the first iterative prefetch means is terminated and the second iterative prefetch means is terminated.
2. A prefetch apparatus according to claim 1, further comprising means for starting said iterative prefetch means.
【請求項10】 データ転送手段によりプリフェッチバ
ッファのデータをプロセッサに転送した場合は、プリフ
ェッチバッファに保持されているデータをプリフェッチ
バッファから無効化する無効化手段を備えた請求項1記
載のプリフェッチ装置。
10. The prefetch apparatus according to claim 1, further comprising invalidating means for invalidating the data held in the prefetch buffer from the prefetch buffer when data in the prefetch buffer is transferred to the processor by the data transfer means.
【請求項11】 アドレス一致検出手段によりプロセッ
サの記憶デバイスへのリード要求アドレスとプリフェッ
チバッファに保持したデータのアドレスとが一致しない
ことを検出した場合は、プリフェッチバッファに保持さ
れたデータを無効化する手段を備えた請求項1記載のプ
リフェッチ装置。
11. When the address match detecting means detects that the read request address to the storage device of the processor does not match the address of the data held in the prefetch buffer, the data held in the prefetch buffer is invalidated. 2. The prefetch apparatus according to claim 1, further comprising: means.
【請求項12】 プロセッサの記憶デバイスへのリード
要求アドレスがプリフェッチ空間であることを判別する
空間判別ステップと、プリフェッチアドレスを生成する
アドレス生成ステップと、このアドレス生成ステップで
得た前記プリフェッチアドレスを用いて前記記憶デバイ
スから対応するデータを読み出すデータ読み出しステッ
プと、前記プロセッサの前記記憶デバイスへのリード要
求アドレスが前記空間判別ステップにより前記プリフェ
ッチ空間であることが判別された場合は前記プロセッサ
の前記記憶デバイスへのリード要求とは無関係に前記デ
ータ読み出しステップによりデータを読み出し、プリフ
ェッチバッファに保持するプリフェッチステップと、前
記プロセッサの前記記憶デバイスへのリード要求アドレ
スが前記プリフェッチバッファに保持されているデータ
のアドレスと一致することを検出するアドレス一致検出
ステップと、このアドレス一致検出ステップにより一致
が検出された場合は、前記プリフェッチバッファに保持
されているデータを前記プロセッサに転送するデータ転
送ステップとを含むプリフェッチ方法。
12. A space discriminating step for discriminating that a read request address to a storage device of a processor is a prefetch space, an address generating step for generating a prefetch address, and using the prefetch address obtained in the address generating step. A data reading step for reading out corresponding data from the storage device, and if the read request address to the storage device of the processor is determined to be the prefetch space by the space determination step, the storage device of the processor A prefetch step in which data is read by the data read step and held in a prefetch buffer irrespective of a read request to the storage device; An address match detecting step of detecting that the address matches the address of the data held in the buffer, and when a match is detected by the address match detecting step, transferring the data held in the prefetch buffer to the processor. And a data transfer step.
【請求項13】 プリフェッチステップにおけるデータ
の読み出しを繰り返す反復プリフェッチステップと、こ
の反復プリフェッチステップを終了させるプリフェッチ
終了ステップとを含む請求項12記載のプリフェッチ方
法。
13. The prefetch method according to claim 12, further comprising: an iterative prefetch step of repeating data reading in the prefetch step; and a prefetch ending step of terminating the iterative prefetch step.
【請求項14】 反復プリフェッチステップの行われた
回数を計数する回数計数ステップと、制御レジスタに設
定された値と前記回数計数ステップにより計数された前
記プリフェッチステップの回数とが一致することを検出
する回数一致ステップと、前記回数一致ステップにより
一致を検出した場合は前記反復プリフェッチステップを
終了するステップを含む請求項13記載のプリフェッチ
方法。
14. A number counting step for counting the number of times the repetitive prefetch step has been performed, and detecting that a value set in a control register matches the number of the prefetch steps counted by the number counting step. 14. The prefetch method according to claim 13, further comprising a number matching step, and a step of terminating the iterative prefetch step when a match is detected by the number matching step.
【請求項15】 反復プリフェッチステップによりプリ
フェッチバッファに保持したデータの大きさを計数する
データサイズ計数ステップと、制御レジスタに設定され
たデータサイズと前記データサイズ計数ステップにより
得られた前記プリフェッチバッファに保持されているデ
ータの大きさとが一致することを検出するデータサイズ
一致検出ステップと、このデータサイズ一致検出ステッ
プにより一致が検出された場合は前記反復プリフェッチ
ステップを終了するステップを含む請求項13記載のプ
リフェッチ方法。
15. A data size counting step for counting the size of data held in a prefetch buffer by an iterative prefetch step, and a data size set in a control register and holding in the prefetch buffer obtained by the data size counting step. 14. A data size match detecting step for detecting that the size of the data matches the data size, and a step of terminating the iterative prefetch step when a match is detected by the data size match detecting step. Prefetch method.
【請求項16】 反復プリフェッチステップのアドレス
生成ステップにより生成したアドレスが制御レジスタに
設定されたアドレスと一致することを検出する終了アド
レス検出ステップと、この終了アドレス検出ステップに
より一致が検出された場合は、前記反復プリフェッチス
テップを終了するステップを含む請求項13記載のプリ
フェッチ方法。
16. An end address detecting step for detecting that an address generated in an address generating step of an iterative prefetch step matches an address set in a control register; and, if a match is detected in the end address detecting step, 14. The prefetch method according to claim 13, further comprising the step of terminating the iterative prefetch step.
【請求項17】 アドレス生成ステップが、プロセッサ
の記憶デバイスへのリード要求アドレスに制御レジスタ
に設定された値を加算することでアドレスを生成するス
テップである請求項12記載のプリフェッチ方法。
17. The prefetch method according to claim 12, wherein the address generating step is a step of generating an address by adding a value set in a control register to a read request address of a processor to a storage device.
【請求項18】 アドレス生成ステップが、プロセッサ
の記憶デバイスへのリード要求アドレスに対し、制御レ
ジスタに設定された情報により決定される演算を施すこ
とでアドレスを生成するステップである請求項1記載の
プリフェッチ方法。
18. The address generating step according to claim 1, wherein the address generating step generates an address by performing an operation determined by information set in a control register on a read request address to a storage device of the processor. Prefetch method.
【請求項19】 プロセッサにより制御レジスタを書き
換えるステップを含む請求項14から請求項18のいず
れかの1項に記載のプリフェッチ方法。
19. The prefetch method according to claim 14, further comprising the step of rewriting a control register by a processor.
【請求項20】 プリフェッチステップにおけるデータ
の読み出しを繰り返す第1と第2の反復プリフェッチス
テップと、プロセッサの記憶デバイスへの第1のリード
要求アドレスにより前記第1の反復プリフェッチステッ
プが開始され、前記プロセッサの前記記憶デバイスへの
第2のリード要求アドレスと前記第1の反復プリフェッ
チステップによりプリフェッチバッファに保持されてい
るデータのアドレスとが一致していないことがアドレス
一致検出ステップにより検出された場合は、前記第1の
反復プリフェッチステップを終了し、前記第2の反復プ
リフェッチステップを開始するステップを含む請求項1
2記載のプリフェッチ方法。
20. The first iterative prefetch step is started by a first and a second iterative prefetch step of repeating data reading in a prefetch step, and a first read request address to a storage device of the processor. When the address match detecting step detects that the second read request address to the storage device does not match the address of the data held in the prefetch buffer in the first repetitive prefetch step, 2. The method of claim 1, further comprising terminating the first iterative prefetch step and starting the second iterative prefetch step.
2. The prefetch method according to 2.
【請求項21】 データ転送ステップによりプリフェッ
チバッファのデータをプロセッサに転送した場合は、プ
リフェッチバッファに保持されている前記データを前記
プリフェッチバッファから無効化する無効化ステップを
含む請求項12記載のプリフェッチ方法。
21. The prefetch method according to claim 12, further comprising the step of invalidating the data stored in the prefetch buffer from the prefetch buffer when the data in the prefetch buffer is transmitted to the processor in the data transfer step. .
【請求項22】 前記アドレス一致検出ステップにより
プロセッサの記憶デバイスへのリード要求アドレスとプ
リフェッチバッファに保持したデータのアドレスとが一
致しないことを検出した場合は、プリフェッチバッファ
に保持されたデータを無効化するステップを含む請求項
12記載のプリフェッチ方法。
22. When the address match detecting step detects that the read request address to the storage device of the processor does not match the address of the data held in the prefetch buffer, invalidates the data held in the prefetch buffer. 13. The prefetch method according to claim 12, further comprising the step of:
JP10318759A 1998-11-10 1998-11-10 Prefetching method and device Pending JP2000148584A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10318759A JP2000148584A (en) 1998-11-10 1998-11-10 Prefetching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10318759A JP2000148584A (en) 1998-11-10 1998-11-10 Prefetching method and device

Publications (1)

Publication Number Publication Date
JP2000148584A true JP2000148584A (en) 2000-05-30

Family

ID=18102631

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10318759A Pending JP2000148584A (en) 1998-11-10 1998-11-10 Prefetching method and device

Country Status (1)

Country Link
JP (1) JP2000148584A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7356649B2 (en) 2002-09-30 2008-04-08 Renesas Technology Corp. Semiconductor data processor
US7970998B2 (en) 2005-04-08 2011-06-28 Panasonic Corporation Parallel caches operating in exclusive address ranges
JP2011227880A (en) * 2010-04-22 2011-11-10 Arm Ltd Preload instruction control
JP2012533811A (en) * 2009-07-20 2012-12-27 フリースケール セミコンダクター インコーポレイテッド Signal processing system and integrated circuit with prefetch module, and method therefor
US8549226B2 (en) 2004-05-14 2013-10-01 Hewlett-Packard Development Company, L.P. Providing an alternative caching scheme at the storage area network level

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7356649B2 (en) 2002-09-30 2008-04-08 Renesas Technology Corp. Semiconductor data processor
US8549226B2 (en) 2004-05-14 2013-10-01 Hewlett-Packard Development Company, L.P. Providing an alternative caching scheme at the storage area network level
US7970998B2 (en) 2005-04-08 2011-06-28 Panasonic Corporation Parallel caches operating in exclusive address ranges
JP2012533811A (en) * 2009-07-20 2012-12-27 フリースケール セミコンダクター インコーポレイテッド Signal processing system and integrated circuit with prefetch module, and method therefor
JP2011227880A (en) * 2010-04-22 2011-11-10 Arm Ltd Preload instruction control
US9632776B2 (en) 2010-04-22 2017-04-25 Arm Limited Preload instruction control

Similar Documents

Publication Publication Date Title
JP3830651B2 (en) Microprocessor circuit, system, and method embodying a load target buffer for prediction of one or both of loop and stride
US7089370B2 (en) Apparatus and method for pre-fetching page data using segment table data
US5353426A (en) Cache miss buffer adapted to satisfy read requests to portions of a cache fill in progress without waiting for the cache fill to complete
US6401192B1 (en) Apparatus for software initiated prefetch and method therefor
US5170476A (en) Data processor having a deferred cache load
US6321326B1 (en) Prefetch instruction specifying destination functional unit and read/write access mode
JP3204323B2 (en) Microprocessor with built-in cache memory
JPH10232827A (en) Method and device for writing back prefetch cache
JP2000242558A (en) Cache system and its operating method
JPH02208728A (en) Virtual instruction cash refill algorithm
US6684319B1 (en) System for efficient operation of a very long instruction word digital signal processor
JP3407808B2 (en) Computer system
US10437603B2 (en) Super-thread processor
CN103514107B (en) High-performance data caching system and method
JP2000148584A (en) Prefetching method and device
US5421026A (en) Data processor for processing instruction after conditional branch instruction at high speed
JP4111645B2 (en) Memory bus access control method after cache miss
JP2927160B2 (en) Register device
JPH06348592A (en) Write buffer control system
JPH06149669A (en) System and device for transferring cache data
JP3729832B2 (en) Cache memory device
JPH02259945A (en) Storing processing system
JPH03255531A (en) Instruction fetching device
JPH07152650A (en) Cache control unit
CN115686624A (en) Processor circuit and data processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041005

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070412

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070424

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070821