JPH0895852A - Buffer circuit - Google Patents

Buffer circuit

Info

Publication number
JPH0895852A
JPH0895852A JP23468394A JP23468394A JPH0895852A JP H0895852 A JPH0895852 A JP H0895852A JP 23468394 A JP23468394 A JP 23468394A JP 23468394 A JP23468394 A JP 23468394A JP H0895852 A JPH0895852 A JP H0895852A
Authority
JP
Japan
Prior art keywords
read
data
buffer
port
ahead
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
JP23468394A
Other languages
Japanese (ja)
Inventor
Yoshifumi Ishikawa
善文 石川
Masayuki Eto
正幸 江藤
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP23468394A priority Critical patent/JPH0895852A/en
Publication of JPH0895852A publication Critical patent/JPH0895852A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)

Abstract

PURPOSE: To improve the processing speed of the whole system of a buffer circuit by enabling the system to have fast read access to low-speed memory without using an expensive, high-speed memory device. CONSTITUTION: Before a 'preprocessing' mode is started, a command consisting of the address of required data is written in a preread-only port 2d attached to a preread control circuit 2a in a memory controller 2 in 'writing of a preread command' mode. A preread control circuit 2a inputs data to a dedicated buffer 2c from the low-speed memory 4 corresponding to the address written in the command. A CPU 1 starts 'preprocessing' right after the 'writing of the preread command' to the preread-only port 2d ends. Once a 'data read' mode is started, the CPU 1 sends a read instruction to the preread-only port 2d. The preread control circuit 2a once receiving it passes the data from the preread-only buffer 2c to the CPU 1.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、リードアクセスの処理
時間の短縮を図るようにしたバッファ回路に関し、例え
ば、低速I/O(入出力)デバイスやメモリを用いた回
路に適用されるものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a buffer circuit designed to shorten the read access processing time, and is applied to a circuit using a low speed I / O (input / output) device or a memory. is there.

【0002】[0002]

【従来の技術】低速なI/Oデバイスやメモリへのアク
セスにおいて、バッファを用いた高速化が可能なライト
サイクルよりも、高速化の手段のないリードサイクルの
方が時間がかかる。つまり、ライトサイクルではライト
データを高速動作可能なデバイスでバッファリングし、
それ以降の動作をバスの管理回路に委任することによっ
て、低速なデバイスを直接アクセスすることなく、CP
U等のバスマスタはサイクルを終了することができるか
らである。しかし、リードサイクルでは低速なデバイス
の動作が完了するまでアクセスが終了しないため、アク
セスタイムは低速なデバイスの動作速度に依存し、一連
の動作を短縮することができなかった。
2. Description of the Related Art In accessing a low-speed I / O device or memory, a read cycle without speed increasing means takes longer than a write cycle using a buffer to enable high speed. In other words, in the write cycle, write data is buffered by a device that can operate at high speed,
By delegating subsequent operations to the bus management circuit, CP can be used without directly accessing slow devices.
This is because the bus master such as U can finish the cycle. However, in the read cycle, since the access is not completed until the operation of the slow device is completed, the access time depends on the operating speed of the slow device, and the series of operations cannot be shortened.

【0003】図15は、従来のバッファ回路のブロック
図で、図中、11はCPU(中央処理装置)、12はメ
モリコントローラ、13は高速メモリ(メインメモ
リ)、14は低速メモリである。CPU11の処理は、
「前処理」、「データリード」、「後処理」、「データ
ライト」の4つのモードから成っている。「前処理」モ
ード終了後に、CPU11はデータリード命令を実行
し、「データリード」モードが開始される。データリー
ド命令を受け取ったメモリコントローラ12は、アドレ
スに該当する低速メモリ14を制御してデータを読み出
す。CPU11はこのデータを、データバスを介して低
速メモリ14から直接受け取る。このため、CPU11
は低速メモリ14からのデータ読み出しが終了するまで
「データリード」モードを終了できない。また、データ
バスもこの間アクティブ状態にあり、他の動作にデータ
バスを使用することはできない。
FIG. 15 is a block diagram of a conventional buffer circuit. In the figure, 11 is a CPU (central processing unit), 12 is a memory controller, 13 is a high speed memory (main memory), and 14 is a low speed memory. The processing of the CPU 11 is
It consists of four modes: "pre-processing", "data read", "post-processing", and "data write". After the end of the "preprocessing" mode, the CPU 11 executes the data read command, and the "data read" mode is started. Upon receiving the data read command, the memory controller 12 controls the low speed memory 14 corresponding to the address and reads the data. The CPU 11 receives this data directly from the low speed memory 14 via the data bus. Therefore, the CPU 11
Cannot finish the "data read" mode until the data read from the low speed memory 14 is finished. Further, the data bus is also in the active state during this period, and the data bus cannot be used for other operations.

【0004】図16は、図15に示したバッファ回路の
動作を説明するためのフローチャートである。以下、各
ステップ(S)に従って順に説明する。まず、CPU1
1において前処理を行い(S81)、次に、リード命令
の実行を行う(S82)。次に、メモリコントローラ1
2においてメモリアドレスとコントロール信号の作成を
行い(S83)、低速メモリ14からのデータ読み出し
を行う(S84)。次に、CPU11においてデータの
読み込みを行い(S85)、後処理を行って(S8
6)、ライト命令の実行とデータの書き出しを行う(S
87)。次に、メモリコントローラ12においてメモリ
アドレスとコントロール信号の作成を行い(S88)、
高速メモリ13へのデータの書き込みを行う(S8
9)。次に、CPU11において終了判定を行い(S9
0)、終了でないと判定されれば、前記ステップS81
に戻り、終了と判定されれば処理を終了する。
FIG. 16 is a flow chart for explaining the operation of the buffer circuit shown in FIG. Hereinafter, each step (S) will be described in order. First, CPU1
In step 1, preprocessing is performed (S81), and then a read instruction is executed (S82). Next, the memory controller 1
In 2, the memory address and the control signal are created (S83), and the data is read from the low speed memory 14 (S84). Next, the CPU 11 reads data (S85) and performs post-processing (S8).
6), execute write command and write data (S
87). Next, the memory controller 12 creates a memory address and a control signal (S88),
Data is written to the high-speed memory 13 (S8
9). Next, the CPU 11 determines the end (S9
0), if it is determined that the processing is not completed, then the step S81
Returning to, if it is determined that the process is completed, the process is completed.

【0005】従来技術を記載した公知文献としては、例
えば、特開平2−122345号公報がある。この公報
のものは、リード要求のあったカウント数分のセクタを
リードした後も、もし他の入出力要求がなければ引き続
いてその先のセクタを次々と読み込み、リードデータバ
ッファが満杯になるように動作させるようにしたもので
ある。また、リードデータバッファ内に入っているデー
タが記憶装置のどの部分にあたるデータであるかを常に
記憶し、情報処理装置からのリード要求のあったデータ
がリードデータバッファ内にあるかどうかを即座に判断
できるようにしたものである。
As a known document describing the prior art, there is, for example, JP-A-2-122345. In this publication, even after reading the count number of sectors for which a read request has been made, if there are no other input / output requests, the subsequent sectors will be read one after another so that the read data buffer becomes full. It is designed to work. Further, it always stores which part of the storage device the data in the read data buffer is, and immediately confirms whether the data requested by the information processing device is in the read data buffer. This is so that it can be judged.

【0006】[0006]

【発明が解決しようとする課題】I/Oデバイスやメイ
ンメモリは、CPU等のバスマスタの動作速度に比べて
遅い。メインメモリには高速なデバイスを用いることも
可能であるが、基板スペースやコストの問題から、実際
に使用することは難しい。このために、ライトサイクル
ではライトバッファが用いられ、処理速度の改善に寄与
している。しかし、リードサイクルの短縮には有効な手
段がなく、処理速度向上のネックになっている。
The I / O device and the main memory are slower than the operating speed of a bus master such as a CPU. It is possible to use a high-speed device for the main memory, but it is difficult to actually use it due to the problems of board space and cost. Therefore, the write buffer is used in the write cycle, which contributes to the improvement of the processing speed. However, there is no effective means for shortening the read cycle, which is a bottleneck in improving the processing speed.

【0007】また、データは連続領域にまたがって利用
されることが多い。このような場合に、DRAMにはバ
ーストモードやページモードでの転送が用意されている
が、これらの転送方法はデータをブロックで扱うため、
1回1回の個別の連続領域の読み出しには対応していな
い。更に、これらの転送方法は高速ではあるが、その転
送中には他の処理ができないため、利用の確定していな
いデータまでも一括して転送するのは不合理である。
In addition, data is often used over continuous areas. In such a case, the DRAM is provided with a transfer in a burst mode or a page mode, but since these transfer methods handle data in blocks,
It does not support the reading of individual continuous areas once. Further, although these transfer methods are fast, it is unreasonable to collectively transfer even data whose use has not been determined, because other processing cannot be performed during the transfer.

【0008】本発明は、このような実情に鑑みてなされ
たもので、高価な高速メモリデバイスを使用することな
く、低速メモリの高速リードアクセスを可能とし、ま
た、I/Oデバイス等の低速デバイスのリードアクセス
の高速化にはより、効果的で、システム全体の処理速度
が大きく向上するようにしたバッファ回路を提供するこ
とを目的としている。
The present invention has been made in view of the above circumstances, and enables high-speed read access to a low-speed memory without using an expensive high-speed memory device, and also enables low-speed devices such as I / O devices. It is an object of the present invention to provide a buffer circuit that is more effective in increasing the read access speed and is capable of greatly improving the processing speed of the entire system.

【0009】[0009]

【課題を解決するための手段】本発明は、上記課題を解
決するために、(1)低速なI/Oデバイスやメモリを
アクセスするシステムにおいて、データの先読みを行う
ための先読み制御回路と、データのアドレスを含む先読
みコマンドの書き込みとデータの読み出しを行う先読み
専用ポートと、先読みデータを格納するための先読み専
用バッファとを備え、バスマスタへのデータ転送時に、
低速デバイスではなく、前記先読み専用ポートをリード
することによって、先読み専用バッファから必要とする
データを読み出す機能を有し、先読み専用ポートへの先
読み命令の書き込みと、先読み専用ポートからのデータ
の読み出しを適切なタイミングで実行することによっ
て、リードアクセスのアクセスタイムの短縮を可能にす
ること、更には、(2)前記先読み制御回路にデータの
連続読み出し機能を追加することによって、先読み専用
バッファに格納されているデータの読み出し後に、該デ
ータに連続する領域に格納されたデータを、連続して先
読み専用バッファに上書きする機能を有し、リードアク
セスに於ける処理時間の更なる短縮を可能にすること、
更には、(3)前記(2)において、前記連続先読みの
回数別に複数の先読み専用ポートを設けることによっ
て、先読み専用バッファに格納されているデータの読み
出し後に、該データに連続する領域に格納されたデータ
を、使用された先読み専用ポート毎に決められた回数に
達するまで、先読み専用バッファに上書きする機能を有
し、リードアクセスにおける処理時間の更なる短縮を可
能にすること、(4)前記(2)において、前記先読み
専用ポートに先読みの転送条件を定義するビットを追加
することによって、先読み専用バッファに格納されてい
るデータの読み出し後に、該データに連続する領域に格
納されたデータを、転送条件を定義したビットに即して
先読み専用バッファに上書きする機能を有し、リードア
クセスにおける処理時間の更なる短縮を可能にするこ
と、(5)前記(2)〜(4)のいずれかにおいて、前
記先読み専用バッフアを多段構成とし、連続領域に格納
されたデータを高速に連続して専用バッファに取り込む
機能を有し、リードアクセスにおける処理時間の更なる
短縮を可能とすることを特徴としたものである。
To solve the above problems, the present invention provides (1) a prefetch control circuit for prefetching data in a system for accessing a low-speed I / O device or memory, A read-only port for writing a read-ahead command including the address of the data and reading the data, and a read-only buffer for storing the read-ahead data are provided, and at the time of data transfer to the bus master,
It has a function to read the required data from the read-only buffer by reading the read-only port instead of the low-speed device, and writes the read-ahead instruction to the read-only port and reads the data from the read-only port. By executing at an appropriate timing, it is possible to shorten the access time of read access, and further, (2) by adding a continuous read function of data to the read-ahead control circuit, the data is stored in the read-only buffer. After reading the stored data, it has the function of continuously overwriting the data stored in the area continuous with the data in the read-only buffer, enabling further reduction of the processing time in read access. ,
Further, (3) in (2), by providing a plurality of read-only ports according to the number of times of continuous read-ahead, the data stored in the read-only buffer is read and then stored in an area continuous with the data. The read-only buffer has a function of overwriting the read-only data until it reaches the number of times determined for each read-only port used, thereby making it possible to further reduce the processing time in read access. In (2), by adding a bit defining a prefetch transfer condition to the prefetch-only port, after reading the data stored in the prefetch-only buffer, the data stored in the area continuous with the data is read as follows. It has the function to overwrite the read-only buffer according to the bit that defines the transfer condition, and the processing in read access (5) In any one of (2) to (4) above, the pre-read-only buffer has a multi-stage configuration, and data stored in a continuous area is dedicated at high speed continuously. It is characterized in that it has a function of taking it into a buffer and can further reduce the processing time in read access.

【0010】[0010]

【作用】前記構成を有する本発明のバッファ回路におい
て、 (1)先読み制御回路は、必要とするデータのアドレス
を含むコマンドが専用ポートに書き込まれると、直ちに
専用バッファにデータを取り込む。この後、バスマスタ
は他の処理を実行し、データが必要になった時点で先読
み専用ポートに対してリード命令を実行する。先読み制
御回路はこのリード命令を受け取ると、先読みデータ専
用バッファからデータをバスマスタに渡す。このため、
低速なデバイスからのリードに際し、ウェートが挿入さ
れて処理を中断することがなくなり、処理速度の向上が
可能となる。
In the buffer circuit of the present invention having the above structure, (1) The prefetch control circuit immediately fetches data in the dedicated buffer when a command including the address of the required data is written in the dedicated port. After this, the bus master executes other processing, and executes a read instruction to the read-only port when data is needed. When the read-ahead control circuit receives this read command, it transfers the data from the read-ahead data dedicated buffer to the bus master. For this reason,
When reading from a low-speed device, the weight is not inserted and the processing is not interrupted, and the processing speed can be improved.

【0011】(2)また、先読み制御回路にデータの連
続読み出し機能を追加することによって、専用バッファ
に格納されているデータの読み出し終了を確認した後
に、このデータに連続する領域に格納されたデータを、
自動的に専用バッファに上書きすることが可能となる。
これにより、利用頻度の高い連続領域にまたがったデー
タのリードサイクルに於ける処理速度が向上する。 (3)さらに、先読み専用ポートを複数個設け、それぞ
れのポート毎に連続読み出しの回数を設定しておくこと
によって、先読み専用バッファに格納されているデータ
の読み出し終了を確認した後に、このデータに連続する
領域に格納されたデータを、使用されたポート毎に設定
された回数に達するまで、自動的に先読み専用バッファ
に上書きすることが可能となる。これにより、処理速度
の更なる向上が見込まれる。
(2) Further, by adding a continuous read function of data to the prefetch control circuit, after confirming the completion of reading of the data stored in the dedicated buffer, the data stored in the area continuous with this data is confirmed. To
It is possible to automatically overwrite the dedicated buffer.
As a result, the processing speed in the data read cycle across the frequently used continuous area is improved. (3) Furthermore, by providing a plurality of pre-read-only ports and setting the number of consecutive readings for each port, after confirming the read end of the data stored in the pre-read-only buffer, this It is possible to automatically overwrite the data stored in the continuous area in the read-only buffer until the number of times set for each port used is reached. This is expected to further improve the processing speed.

【0012】(4)一方、複数の先読み専用ポートを設
ける代わりに、先読み専用ポートに先読み転送条件を定
義したビットを追加することによって、先読み専用バッ
ファに格納されているデータの読み出し終了を確認した
後に、このデータに連続する領域に格納されたデータ
を、規定した通りの、最適な方法で先読み専用バッファ
に上書きすることが可能となる。前記(3)の回路に比
べ、データバスとアドレスバスのバス幅によっては、先
読み専用ポートへの書き込みに2回のライトサイクルを
必要とする場合もあるが、その分多くの制御が可能であ
り、先読み制御の有効活用ができる。 (5)更に、専用バッファを多段にし、データの一括転
送を可能にすることによって、バスの転送効率を高め、
処理速度の向上が図れる。
(4) On the other hand, instead of providing a plurality of read-ahead ports, by adding a bit defining a read-ahead transfer condition to the read-ahead port, it is confirmed that the data stored in the read-ahead buffer has been read. Later, it becomes possible to overwrite the data stored in the area continuous with this data in the read-only buffer in an optimum manner as specified. Depending on the bus widths of the data bus and the address bus, writing to the read-only port may require two write cycles as compared with the circuit of (3), but more control is possible accordingly. It is possible to effectively use the prefetch control. (5) Further, by increasing the number of dedicated buffers and enabling batch transfer of data, the transfer efficiency of the bus is improved,
The processing speed can be improved.

【0013】[0013]

【実施例】実施例について、図面を参照して以下に説明
する。図1及び図2は、本発明によるバッファ回路の一
実施例を説明するための構成図で、図2は、図1におけ
る先読み制御回路の詳細図である。図中、1はCPU
(中央処理装置)、2はメモリコントローラ、2aは先
読み制御回路、2bはトランシーバ、2cは先読み専用
バッファ、2dは先読み専用ポート、2cはレジスタ、
3は高速メモリ(メインメモリ)、4は低速メモリであ
る。
Embodiments will be described below with reference to the drawings. 1 and 2 are configuration diagrams for explaining one embodiment of the buffer circuit according to the present invention, and FIG. 2 is a detailed diagram of the prefetch control circuit in FIG. In the figure, 1 is a CPU
(Central processing unit) 2, memory controller, 2a read-ahead control circuit, 2b transceiver, 2c read-only buffer, 2d read-only port, 2c register,
3 is a high speed memory (main memory), and 4 is a low speed memory.

【0014】データを先読みするための制御回路2a
と、先読みされたデータを保存するための先読み専用バ
ッファ2cと、先読み制御回路2aとの命令やデータの
入出力に用いられる先読み専用ポート2dを設ける。ま
た、CPU1の処理は、「前処理」「データリード」
「後処理」「データライト」の4つのモードから成るも
のである。以下に、低速メモリ4からデータをCPU1
に取り込み、処理を施した後に高速メモリ3にデータを
書き込む場合を示す。
Control circuit 2a for prefetching data
A read-only buffer 2c for storing the read-ahead data and a read-only port 2d used for inputting and outputting commands and data with the read-ahead control circuit 2a are provided. Further, the processing of the CPU 1 is “preprocessing” and “data read”.
It is composed of four modes of "post-processing" and "data write". Below, data from the low-speed memory 4 is sent to the CPU 1
The case where data is written in the high-speed memory 3 after being taken in and processed.

【0015】「前処理」モードを開始する以前に、必要
とするデータのアドレスからなるコマンドを「先読みコ
マンドの書き込み」モードで、メモリコントローラ2の
内部の先読み制御回路2aに付随する先読み専用ポート
2dに書き込む。なお、図3(a),(b)は、先読み
専用ポートの構造(実施例1)を示す図で、図3(a)
はポート、ライト時、図3(b)はポート・リード時を
各々示している。「先読みコマンドの書き込み」が先読
み専用ポート2dに書き込まれると、先読み制御回路2
aはコマンド内に書かれたアドレスに該当する低速メモ
リ4から、先読み専用バッファ2cにデータを取り込
む。この動作は、メモリコントローラ2と低速メモリ4
間の専用データバスのみを使用するので、低速メモリ4
から先読み専用バッファ2cへのデータ転送が実行中で
あっても、この専用バスを使用しない他の動作には影響
がない。
Before starting the "pre-processing" mode, a command consisting of the address of the necessary data is set in the "read-ahead command writing" mode in the read-ahead control circuit 2a inside the memory controller 2 and the read-only port 2d is attached. Write in. 3A and 3B are diagrams showing the structure of the read-only port (Example 1), and FIG.
Shows a port and write, and FIG. 3B shows a port read. When the "write-ahead command write" is written to the read-only port 2d, the read-ahead control circuit 2
a fetches data from the low-speed memory 4 corresponding to the address written in the command into the read-only buffer 2c. This operation is performed by the memory controller 2 and the low speed memory 4.
Since only the dedicated data bus between
Even if data transfer from the read-only buffer 2c to the read-ahead buffer 2c is being executed, there is no effect on other operations that do not use this dedicated bus.

【0016】したがって、CPU1は、先読み専用ポー
ト2dへの「先読みコマンドの書き込み」が終了すると
直ぐに「前処理」を開始する。「データリード」モード
が開始されると、CPU1は先読み専用ポート2dに対
して、リード命令を実行する。これを受けて先読み制御
回路2aは、先読みデータ専用バッファ2cからデータ
をCPU1に渡す。このためCPU1は低速メモリ4を
アクセスすることなく、直ちにデータを受け取り「デー
タリード」モードを終了することができる。
Therefore, the CPU 1 starts the "preprocessing" immediately after the "writing of the readahead command" to the readahead dedicated port 2d is completed. When the "data read" mode is started, the CPU 1 executes a read command to the read-only port 2d. In response to this, the prefetch control circuit 2a passes the data from the prefetch data dedicated buffer 2c to the CPU 1. Therefore, the CPU 1 can immediately receive the data and end the "data read" mode without accessing the low speed memory 4.

【0017】ここで、以下の〜のように仮定する。 CPUの1サイクルは、動作周波数33.3MHzで2ク
ロック(60nsec)である。 低速メモリのアクセスには400nsecかかる。 先読み制御回路と先読み専用バッファにはノンウェー
トでアクセスできる。 高速メモリへの書き込みは、CPUの1サイクル(6
0nsec)で実行できる。 このように仮定すると、図16に示すフローチャートに
従って動作する従来のバッファ回路を用いた処理では、
1回のループにかかる時間は、以下の式(1)のように
なる。 X + 400 + Y + 60= 460 + X + Y …(1) 前処理 リード 後処理 ライト
Here, it is assumed that One cycle of the CPU is 2 clocks (60 nsec) at an operating frequency of 33.3 MHz. It takes 400 nsec to access the low speed memory. The read-ahead control circuit and the read-only buffer can be accessed non-waiting. Writing to high-speed memory takes 1 cycle (6
It can be executed in 0 nsec). Assuming this, in the processing using the conventional buffer circuit that operates according to the flowchart shown in FIG.
The time required for one loop is as shown in the following expression (1). X + 400 + Y + 60 = 460 + X + Y (1) Pre-processing Read / Post-processing Write

【0018】図4及び図5は、本発明によるバッファ回
路(実施例1)の動作を説明するためのフローチャート
である。以下、各ステップ(S)に従って順に説明す
る。まず、CPU1において先読み命令の書き込み(ポ
ート・ライト)を行ってから(S1)、前処理を行い
(S2)、先読み専用ポート2dへのリード命令の実行
を行う(S3)。メモリコントローラ2においては前記
ステップS1の処理ののち、メモリアドレスとコントロ
ール信号の作成を行い(S4)、低速メモリ4からのデ
ータの読み出しを行う(S5)。次に、メモリコントロ
ーラ2において先読み専用バッファ2cへの読み込みを
行う(S6)。次に、メモリコントローラ2において、
前記ステップS3とS6の処理ののち、低速メモリ4か
ら先読み専用バッファ2cへの読み込みが終了したかど
うかを判断する(S7)。
4 and 5 are flow charts for explaining the operation of the buffer circuit (embodiment 1) according to the present invention. Hereinafter, each step (S) will be described in order. First, the CPU 1 writes a prefetch instruction (port write) (S1), performs preprocessing (S2), and executes a read instruction to the prefetch dedicated port 2d (S3). In the memory controller 2, after the processing of step S1, the memory address and the control signal are created (S4), and the data is read from the low speed memory 4 (S5). Next, the memory controller 2 reads into the read-only buffer 2c (S6). Next, in the memory controller 2,
After the processing of steps S3 and S6, it is determined whether the reading from the low-speed memory 4 to the read-ahead buffer 2c is completed (S7).

【0019】次に、ステップS7において、先読み専用
バッファ2cへの読み込みが終了していれば、CPU1
においてデータの読み込みを行い(S8)、後処理を行
って(S9)、ライト命令の実行とデータの書き出しを
行う(S10)。次に、メモリコントローラ2において
メモリアドレスとコントロール信号の作成を行い(S1
1)、高速メモリ3へのデータの書き込みを行う(S1
2)。次に、CPU1において終了判定を行い(S1
3)、終了していなければ、前記ステップS1に戻り、
終了していれば処理を終了する。このように、図4及び
図5で示す実施例1に基づいたバッファ回路を用いた処
理では、以下の式(2)のようになる。
Next, in step S7, if the reading into the read-only buffer 2c is completed, the CPU 1
At step S8, data is read (S8), post-processing is performed (S9), and a write command is executed and data is written (S10). Next, the memory controller 2 creates a memory address and a control signal (S1
1), write data to the high speed memory 3 (S1)
2). Next, the CPU 1 determines the end (S1
3) If not completed, return to step S1 above,
If completed, the process ends. As described above, in the processing using the buffer circuit based on the first embodiment shown in FIGS. 4 and 5, the following Expression (2) is obtained.

【0020】 60 + X +α+60+ Y + 60 コマンド書き込み 前処理 リード 後処理 ライト =180+X+Y+α (但し、α=400−Xnsec) …(2) ここで、αは「前処理」モードの終了から先読み専用バ
ッファ2cへのデータ転送終了までのウェイトタイム
で、低速メモリ4から先読み専用バッファ2cへのデー
タ転送に要する時間から、「前処理」モードに要する時
間を引いた時間である。
60 + X + α + 60 + Y + 60 Command writing pre-processing Read post-processing write = 180 + X + Y + α (where α = 400−Xnsec) (2) Here, α is the pre-read-only buffer 2c from the end of the “pre-processing” mode. Is the wait time until the end of the data transfer to the pre-processing mode, which is the time required to transfer the data from the low-speed memory 4 to the read-only buffer 2c.

【0021】前処理時間Xが十分に長い場合、低速メモ
リ4から先読み専用バッファ2cへのデータ転送時間
は、前処理時間Xに吸収され、CPU1から見た場合に
は(α=)0nsecとなる。したがって、1回のループに
かかる時間は、以下の式(3)のようになる。 60 + X + 60 + Y + 60=180+X+Y コマンド書き込み 前処理 リード 後処理 ライト (但し、X≧400nsec) …(3) このように、最適動作が可能な場合には、低速メモリ4
のアクセスに要する時間に関係なく、「先読みコマンド
の書き込み」のための1CPUサイクル(60nsec)
と、先読み専用バッファ2cからの読み出しのための1
CPUサイクル(60nsec)の合計2CPUサイクル
(120nsec)で低速メモリ4からのデータリードが可
能となる。
When the preprocessing time X is sufficiently long, the data transfer time from the low-speed memory 4 to the read-only buffer 2c is absorbed by the preprocessing time X, and when viewed from the CPU 1, it becomes (α =) 0 nsec. . Therefore, the time required for one loop is as in the following Expression (3). 60 + X + 60 + Y + 60 = 180 + X + Y Command writing Pre-processing Read Post-processing Write (however, X ≧ 400 nsec) (3) In this way, when the optimum operation is possible, the low speed memory 4
CPU cycle (60nsec) for "write-ahead command write" regardless of the time required to access
And 1 for reading from the read-only buffer 2c
Data can be read from the low-speed memory 4 in a total of 2 CPU cycles (120 nsec) of the CPU cycle (60 nsec).

【0022】図6及び図7は、本発明によるバッファ回
路(実施例2)の動作を説明するためのフローチャート
である。以下、各ステップ(S)に従って順に説明す
る。まず、CPU1において先読み命令の書き込み(ポ
ート・ライト)を行ってから(S21)、前処理を行い
(S22)、先読み専用ポート2dへのリード命令の実
行を行う(S23)。メモリコントローラ2においては
前記ステップS21の処理のあと、メモリアドレスとコ
ントロール信号の作成を行い(S24)、低速メモリ4
からのデータの読み出しを行って(S25)、次に、メ
モリコントローラ2において先読み専用バッファへの読
み込みを行う(S26)。次に、メモリコントローラ2
において、前記ステップS23とS26の処理ののち、
低速メモリ4から先読み専用バッファ2cへの読み込み
が終了したかどうかを判断する(S27)。
6 and 7 are flow charts for explaining the operation of the buffer circuit (second embodiment) according to the present invention. Hereinafter, each step (S) will be described in order. First, the CPU 1 writes a read-ahead instruction (port write) (S21), then performs preprocessing (S22), and executes a read instruction to the read-only port 2d (S23). In the memory controller 2, after the processing of step S21, a memory address and a control signal are created (S24), and the low speed memory 4
The data is read from the memory (S25), and then the memory controller 2 reads the data into the pre-read-only buffer (S26). Next, the memory controller 2
At the step S23 and S26,
It is determined whether or not the reading from the low-speed memory 4 to the prefetch-only buffer 2c is completed (S27).

【0023】次に、ステップS27において、低速メモ
リからバッファへの読み込みが終了していれば、CPU
1においてデータの読み込みを行い(S28)、後処理
を行って(S29)、ライト命令の実行とデータの書き
出しを行う(S30)。次に、メモリコントローラ2に
おいてメモリアドレスとコントロール信号の作成を行っ
て(S31)、高速メモリ3へのデータの書き込みを行
って(S32)、CPU1において終了判定を行い(S
33)、終了していなければ、前記ステップS22に戻
り、終了していれば、処理を終了する。
Next, in step S27, if the reading from the low speed memory to the buffer is completed, the CPU
In step 1, data is read (S28), post-processing is performed (S29), and a write command is executed and data is written (S30). Next, the memory controller 2 creates a memory address and a control signal (S31), writes the data to the high-speed memory 3 (S32), and determines the end in the CPU 1 (S31).
33) If not completed, the process returns to step S22, and if completed, the process is completed.

【0024】この場合、先読み専用バッファ2cに格納
されているデータの読み出し終了が確認された後、この
データに連続する領域に格納されたデータを、先読み専
用バッファ2cに上書きする。メモリコントローラ2と
低速メモリ4とのデータバスは、他のデータバスと独立
している。したがって、低速メモリ4から先読み専用バ
ッファ2cへの2度目のリードサイクルは、CPU1側
のデータバスの動作に関係無く、1回目の先読みされた
データがCPU1に転送され、先読み専用バッファ2c
が空き状態になると直ぐに開始される。またこの際、先
読みは自動的に再開されるので、2回目以降のループで
は、「先読みコマンドの書き込み」モードは不用とな
る。したがって、処理速度は、以下の式(4),(5)
のようになる。
In this case, after it is confirmed that the data stored in the read-only buffer 2c has been read out, the data stored in the area continuous with this data is overwritten in the read-only buffer 2c. The data bus between the memory controller 2 and the low-speed memory 4 is independent of other data buses. Therefore, in the second read cycle from the low-speed memory 4 to the read-ahead buffer 2c, the first read-ahead data is transferred to the CPU 1 regardless of the operation of the data bus on the CPU 1 side, and the read-ahead buffer 2c is read.
It will start as soon as is empty. Further, at this time, the prefetch is automatically restarted, so that the "prefetch command write" mode is unnecessary in the second and subsequent loops. Therefore, the processing speed is calculated by the following equations (4) and (5).
become that way.

【0025】 1回目のループ 60 + X + α+60 + Y + 60 コマンド書き込み 前処理 リード 後処理 ライト =180+X+Y+α …(4) (但し、α=400−Xnsec) 2回目以降のループ X + β+60 + Y + 60 = 120+X+Y+β 前処理 リード 後処理 ライト (但し、β=400−X−Y−60nsec) …(5) ここで、βは「前処理」モードの終了から先読み専用バ
ッファ2cへのデータ転送終了までのウェイトタイム
で、前回の「データリード」モードの終了から今回の
「データリード」モードの開始までに要する時間と、低
速メモリ4からのデータ転送に要する時間の差である。
First loop 60 + X + α + 60 + Y + 60 Command writing pre-processing Read post-processing write = 180 + X + Y + α (4) (where α = 400-Xnsec) Second and subsequent loops X + β + 60 + Y + 60 = 120 + X + Y + β Pre-processing Read Post-processing Write (however, β = 400−X−Y−60 nsec) (5) where β is from the end of the “pre-processing” mode to the end of data transfer to the read-only buffer 2c. The wait time is the difference between the time required from the end of the previous "data read" mode to the start of the current "data read" mode and the time required to transfer data from the low-speed memory 4.

【0026】前処理時間Xが十分に長い場合、1回目の
低速メモリ4から先読み専用バッファ2cへのデータ転
送に要する時間は、前処理時間Xに吸収され、CPU1
から見た場合には(α=)0nsecとなる。また、先読み
専用バッファ2cからCPU1へのリードサイクル終了
後、次のリードサイクルが開始されるまでの時間(X+
Y+60)が十分に長ければ、これもCPU1から見た
場合には(β=)0nsecとなる。したがって、1ループ
にかかる時間は、以下の式(6),(7)のようにな
る。
When the preprocessing time X is sufficiently long, the time required for the first data transfer from the low-speed memory 4 to the read-ahead buffer 2c is absorbed by the preprocessing time X, and the CPU 1
When viewed from above, it becomes (α =) 0 nsec. In addition, the time from the end of the read cycle from the prefetch-only buffer 2c to the CPU 1 until the start of the next read cycle (X +
If (Y + 60) is sufficiently long, this is also (β =) 0 nsec when viewed from the CPU 1. Therefore, the time required for one loop is expressed by the following equations (6) and (7).

【0027】 1回目のループ 60 + X + 60 + Y + 60=180+X+Y コマンド書き込み 前処理 リード 後処理 ライト (但し、X≧400nsec) …(6) 2回目以降のループ X + 60 + Y + 60=120+X+Y 前処理 リード 後処理 ライト (但し、X+Y+60≧400nsec) …(7) 式(3)と式(7)の比較から、図6及び図7のフロー
チャートに従って動作するバッファ回路が図4及び図5
のバッファより高速であり、最適状態になる条件も緩や
かであることが判る。
First loop 60 + X + 60 + Y + 60 = 180 + X + Y Command writing pre-processing Read post-processing Write (however, X ≧ 400 nsec) (6) Second and subsequent loops X + 60 + Y + 60 = 120 + X + Y pre-processing read post-processing write (however, X + Y + 60 ≧ 400 nsec) (7) From the comparison of the equations (3) and (7), the buffer circuit operating according to the flowcharts of FIGS. 6 and 7 is shown in FIGS. 4 and 5.
It can be seen that it is faster than the buffer and the conditions for reaching the optimum state are lenient.

【0028】図8及び図9は、本発明にはバッファ回路
(実施例3,4)の動作を説明するためのフローチャー
トで、先読み転送回数別に複数の先読み専用ポートを設
け、ポート毎に設定された回数の先読みを行う場合(実
施例3)のフローチャートについて、以下、各ステップ
に従って順に説明する。
FIG. 8 and FIG. 9 are flowcharts for explaining the operation of the buffer circuit (third and fourth embodiments) according to the present invention. A plurality of dedicated read-ahead ports are provided according to the number of read-ahead transfers, which are set for each port. Hereinafter, the flowchart for performing the prefetching for the number of times (third embodiment) will be sequentially described according to each step.

【0029】まず、CPU1において、先読み命令の書
き込み(ポート・ライト)を行ってから(S41)、前
処理を行って(S42)、先読み専用ポート2dへのリ
ード命令の実行を行う(S43)。次に、メモリコント
ローラ2においては前記ステップ41の処理のあと、初
期設定(先読み指定回数Nの設定、先読み実施回数N=
0)を行い(S44)、メモリアドレスとコントロール
信号の作成を行って(S45)、低速メモリ4からのデ
ータの読み出しを行う(S46)。次に、メモリコント
ローラ2において先読み専用バッファへの読み込みを行
う(S47)。次に、メモリコントロール2においてス
テップS43と47の処理ののち、低速メモリ4から先
読み専用バッファ2cへの読み込みが終了したかどうか
を判断する(S48)。
First, the CPU 1 writes a prefetch instruction (port write) (S41), performs preprocessing (S42), and executes a read instruction to the prefetch dedicated port 2d (S43). Next, in the memory controller 2, after the processing of step 41, initial setting (setting of the number of times of prefetching designation N, setting of the number of times of prefetching N =
0) is performed (S44), a memory address and a control signal are created (S45), and data is read from the low speed memory 4 (S46). Next, the memory controller 2 reads data into the read-only buffer (S47). Next, in the memory control 2, after the processes of steps S43 and 47, it is determined whether or not the reading from the low-speed memory 4 to the read-only buffer 2c is completed (S48).

【0030】前記ステップS48において、低速メモリ
からバッファへの読み込みが終了していれば、CPU1
においてデータの読み込みを行い(S49)、次に、メ
モリコントローラ2においてM=M+1とし(S5
0)、M≧Nかどうかを判断し(S51)、M≧Nでな
ければ、前記ステップS45へ戻り、M≧Nであれば、
先読みの終了となる。次に、CPU1においてステップ
49の処理のあとに、後処理を行い(S52)、ライト
命令の実行とデータの書き出しを行う(S53)。次
に、メモリコントローラ2においてメモリアドレスとコ
ントロール信号の作成を行って(S54)、高速メモリ
3へのデータの書き込みを行う(S55)。次に、CP
U1において終了判定を行い(S56)、終了していな
ければ、前記ステップS42に戻り、終了していれば、
処理を終了する。
In step S48, if the reading from the low speed memory to the buffer is completed, the CPU 1
Data is read in (S49), and then M = M + 1 is set in the memory controller 2 (S5).
0), it is determined whether M ≧ N (S51). If M ≧ N, the process returns to step S45. If M ≧ N,
The prefetching ends. Next, in the CPU 1, after the processing of step 49, post-processing is performed (S52), and a write command is executed and data is written (S53). Next, the memory controller 2 creates a memory address and a control signal (S54), and writes data to the high speed memory 3 (S55). Next, CP
The end determination is made in U1 (S56), and if not completed, the process returns to step S42, and if completed,
The process ends.

【0031】図10は、連続先読みの回数別に複数の先
読み専用ポートを設けた場合のポートとレジスタの関係
(データ、アドレスバス幅が32ビットの場合の例)を
示す図で、どの先読み専用ポートを利用しても、書き込
みされるレジスタ及び読み出されるバッファは同じであ
る。
FIG. 10 is a diagram showing the relationship between the port and the register when a plurality of read-only ports are provided according to the number of continuous read-aheads (example when the data and address bus widths are 32 bits). Even if is used, the written register and the read buffer are the same.

【0032】ポートライト時:「先読みコマンドの書き
込み」時には、先読み転送を行う回数に応じて、先読み
専用ポートを使い分ける。図10の例では、それぞれの
転送回数に対応した8種類のポートを設ける。各ポート
は、それぞれのアドレスに割り振られている。各ポート
へ書き込まれた先読みコマンドは、ただ一つのレジスタ
に記憶される。また同時に、どのポートがアクセスされ
たかも記憶され、それによって、先読み制御回路は先読
み転送回数を決定する。
At port write: At the time of "write-in of read-ahead command", the read-only port is used properly according to the number of times of the read-ahead transfer. In the example of FIG. 10, eight types of ports corresponding to the respective transfer numbers are provided. Each port is assigned to each address. The read-ahead command written to each port is stored in only one register. At the same time, which port is accessed is also stored so that the prefetch control circuit determines the prefetch transfer count.

【0033】ポートリード時:先読みされたデータを読
み出す際には、どのポートをリードアクセスしても、た
だ一つの先読み専用バッファから読み出される。このよ
うにポートを複数設け、先読み転送の要求回数に合わせ
て、先読み専用ポートを選択することによって、不必要
な先読みを行うことが少なくなり、他の命令によって発
生する低速デバイスのアクセスへの影響を軽減するとと
もに、不必要なアクセスによって発生する電力の浪費を
抑えることができる。なお、処理速度の計算式は、前記
式(4)〜(7)と同じである。
At port read: When reading prefetched data, no matter which port is read-accessed, it is read from only one prefetch-only buffer. By providing multiple ports in this way and selecting a read-only port according to the number of read-ahead transfer requests, unnecessary read-ahead is less likely to occur, and the impact on low-speed device access caused by other instructions It is possible to reduce power consumption and waste of power generated by unnecessary access. The processing speed calculation formula is the same as the formulas (4) to (7).

【0034】一方、上記実施例3のバッファ回路では、
目的別に先読み専用ポートを複数個設ける必要があった
が、代わりに先読み専用ポートに先読み転送条件を定義
したビットを追加することによって、前のデータに連続
する領域に格納されたデータを、定義した通りの最適な
方法で先読み専用バッファに上書きすることが可能とな
る。この場合のフローチャート(実施例4)は、基本的
に図8及び図9(実施例3)と同じになる。今、転送条
件を定義するビットの例として、先読み回数定義ビット
と、データ幅の定義ビット、アドレスのインクリメント
/デクリメントの定義ビットを追加した場合を考える。
図11(a),(b)にこの場合の先読み専用ポートの
構造を示す。
On the other hand, in the buffer circuit of the third embodiment,
It was necessary to provide multiple read-only ports for each purpose, but instead, by adding a bit that defines the read-ahead transfer condition to the read-only port, the data stored in the area contiguous to the previous data was defined. It is possible to overwrite the read-only buffer in the optimum way. The flowchart (Example 4) in this case is basically the same as that in FIGS. 8 and 9 (Example 3). Now, as an example of bits that define the transfer condition, consider the case where a prefetch count definition bit, a data width definition bit, and an address increment / decrement definition bit are added.
FIGS. 11A and 11B show the structure of the read-only port in this case.

【0035】低速メモリ4から先読み専用バッファ2c
へのデータ転送は、先読み回数定義ビットで定義された
回数に達するまで、データ幅の定義ビットで定義された
データ幅で、アドレスのインクリメント/デクリメント
の定義ビットの定義に従って、データが連続するように
アドレスを順次インクリメント/デクリメントして、先
読み専用バッファ2cに上書きされる。データバスとア
ドレスバスのバス幅をそれぞれ32ビットとすれば、前
記実施例3の回路に比べ、先読み専用ポート2dへの先
読みコマンドの書き込みに要する時間が増えるが、その
分多くの制御が可能であり、先読み制御の有効活用がで
きる。
Read-only buffer 2c from low-speed memory 4
The data transfer to the device is performed so that the data continues with the data width defined by the definition bit of the data width and according to the definition of the definition bit of the increment / decrement of the address until the number of times defined by the prefetch count definition bit is reached. The address is sequentially incremented / decremented and overwritten in the read-only buffer 2c. If the bus widths of the data bus and the address bus are each 32 bits, the time required to write the pre-read command to the pre-read-only port 2d will be longer than that of the circuit of the third embodiment, but much control can be performed accordingly. Yes, the prefetch control can be effectively used.

【0036】なお、処理に要する時間は、以下のように
計算できる。前述のように、メモリコントローラ2と低
速メモリ4との間のデータバスは、他のデータバスと独
立している。したがって、低速メモリ4から先読み専用
バッファ2cへの2度目のリードサイクルは、CPU1
側のデータバスの動作に関係無く、1回目の先読みされ
たデータがCPU1に転送され、先読み専用バッファ2
cが空き状態になると直ぐに開始される。またこの際、
先読みは自動的に再開されるので、2回目以降のループ
では、「先読みコマンドの書き込み」モードは不用とな
る。ここで、1回目の先読みループでは、先読み専用ポ
ート2dへの「先読みコマンドの書き込み」で、2度の
ライトサイクルが必要になる。しかし、2回目以降のル
ープでは、「先読みコマンドの書き込み」モードは不用
となり、このロスタイムによる影響は少ない。したがっ
て、処理速度は、以下の式(8),(9)のようにな
る。
The time required for processing can be calculated as follows. As described above, the data bus between the memory controller 2 and the low speed memory 4 is independent of other data buses. Therefore, the second read cycle from the low-speed memory 4 to the read-only buffer 2c is
The prefetched data for the first time is transferred to the CPU 1 regardless of the operation of the data bus on the side
It starts as soon as c becomes empty. Also at this time,
Since the prefetch is automatically restarted, the "prefetch command write" mode is unnecessary in the second and subsequent loops. Here, in the first read-ahead loop, two write cycles are required for "writing a read-ahead command" to the read-only port 2d. However, in the second and subsequent loops, the "write-ahead command write" mode is unnecessary, and this loss time has little effect. Therefore, the processing speed is expressed by the following equations (8) and (9).

【0037】 1回目のループ 60×2 + X +α+60+ Y + 60 コマンド書き込み 前処理 リード 後処理 ライト =240+X+Y+α (但し、α=400−Xnsec) …(8) 2回目以降のループ X +β+60+ Y + 60=120+X+Y+β 前処理 リード 後処理 ライト (但し、β=400−X−Y−60nsec) …(9) ここで、βは「前処理」モードの終了から先読み専用バ
ッファ2cへのデータ転送終了までのウェイトタイム
で、前回の「データリード」モードの終了から今回の
「データリード」モードの開始までに要する時間と、低
速メモリ4からのデータ転送に要する時間の差である。
First loop 60 × 2 + X + α + 60 + Y + 60 Command writing pre-processing Read post-processing write = 240 + X + Y + α (however, α = 400−Xnsec) (8) Second and subsequent loops X + β + 60 + Y + 60 = 120 + X + Y + β pre-processing read post-processing write (however, β = 400−X−Y−60 nsec) (9) where β is the wait time from the end of the “pre-processing” mode to the end of data transfer to the read-only buffer 2c. Then, it is the difference between the time required from the end of the previous "data read" mode to the start of the current "data read" mode and the time required to transfer the data from the low-speed memory 4.

【0038】前処理時間Xが十分に長い場合、1回目の
低速メモリ4から先読み専用バッファ2cへのデータ転
送に要する時間は、前処理時間Xに吸収され、CPU1
から見た場合には(α=)0nsecとなる。また、先読み
専用バッファ2cからCPU1へのリードサイクル終了
後、次のリードサイクルが開始されるまでの時間(X+
Y+60)が十分に長ければ、これもCPU1から見た
場合には(β=)0nsecとなる。したがって、1ループ
にかかる時間は、以下の式(10),(11)のように
なる。
When the preprocessing time X is sufficiently long, the time required for the first data transfer from the low-speed memory 4 to the prefetch-only buffer 2c is absorbed by the preprocessing time X, and the CPU 1
When viewed from above, it becomes (α =) 0 nsec. In addition, the time from the end of the read cycle from the prefetch-only buffer 2c to the CPU 1 until the start of the next read cycle (X +
If (Y + 60) is sufficiently long, this is also (β =) 0 nsec when viewed from the CPU 1. Therefore, the time required for one loop is expressed by the following equations (10) and (11).

【0039】 1回目のループ 120 + X + 60 + Y + 60 = 180+X+Y コマンド書き込み 前処理 リード 後処理 ライト (但し、X≧400nsec) …(10) 2回目以降のループ X + 60 + Y + 60 = 120+X+Y 前処理 リード 後処理 ライト (但し、X+Y+60≧400nsec) …(11)First loop 120 + X + 60 + Y + 60 = 180 + X + Y Command writing Pre-processing Read Post-processing Write (however, X ≧ 400 nsec) (10) Second and subsequent loops X + 60 + Y + 60 = 120 + X + Y Pre-processing Read Post-processing Write (however, X + Y + 60 ≧ 400nsec) (11)

【0040】式(11)と式(7)の比較から、このバ
ッファ回路(実施例4)を用いた場合の処理時間が、2
回目以降のループでは、前記実施例3のバッファ回路と
同じであることが判る。したがって、前述した通り、
「先読みコマンドの書き込み」モードに要する時間が増
えたことによる影響は、2回目以降のループでは現われ
ない。しかし、このバッファ回路(実施例4)を用いて
必要とする転送に最適な条件設定を行うことは、前記実
施例3のバッファ回路よりも更に、不必要な先読みを行
うことがなくなり、他の命令によって発生する低速デバ
イスのアクセスへの影響を軽減するとともに、不必要な
アクセスによって発生する電力の浪費を抑えることを可
能にする。また、このバッファ回路(実施例4)では、
より複雑な転送が可能となり、前記実施例3のバッファ
回路よりも先読み転送の応用範囲が広がる。
From the comparison between equations (11) and (7), the processing time when this buffer circuit (Example 4) is used is 2
It can be seen that the loops after the first time are the same as the buffer circuit of the third embodiment. Therefore, as mentioned above,
The effect of the increase in the time required for the “write-ahead command writing” mode does not appear in the second and subsequent loops. However, setting the optimum conditions for the required transfer using this buffer circuit (Embodiment 4) eliminates unnecessary pre-reading as compared with the buffer circuit of Embodiment 3 described above. It is possible to reduce the influence on the access of the low-speed device generated by the instruction and to suppress the waste of the power generated by the unnecessary access. In addition, in this buffer circuit (Example 4),
More complex transfer becomes possible, and the application range of the prefetch transfer is expanded as compared with the buffer circuit of the third embodiment.

【0041】この実施例では、データバス、アドレスバ
ス共に32ビットの場合を示したが、データバスが、ア
ドレスバスよりも広い場合には、1CPUサイクルで
「先読みコマンドの書き込み」モードを終了することも
可能となる。この場合には、前記実施例3のバッファ回
路を用いた場合との対比が容易になり、このバッファ回
路(実施例4)の有用性がより明確になる。
In this embodiment, the case where both the data bus and the address bus are 32 bits is shown. However, when the data bus is wider than the address bus, the "write-ahead command write" mode should be ended in one CPU cycle. Will also be possible. In this case, comparison with the case where the buffer circuit of the third embodiment is used becomes easy, and the usefulness of this buffer circuit (fourth embodiment) becomes clearer.

【0042】図12〜図14は、本発明によるバッファ
回路(実施例5)の動作を説明するためのフローチャー
トで、先読み専用バッファを多段構成とした場合のフロ
ーチャートである。前記実施例2〜4において、先読み
専用バッファを多段構成とすれば、連続領域に格納され
たデータの読み出しに際して更に高速化が図れる。以
下、各ステップ(S)に従って順に説明する。
12 to 14 are flow charts for explaining the operation of the buffer circuit (embodiment 5) according to the present invention, and are flow charts in the case where the read-ahead buffer has a multistage structure. In the second to fourth embodiments, if the read-only buffer has a multi-stage structure, the speed of reading data stored in the continuous area can be further increased. Hereinafter, each step (S) will be described in order.

【0043】まず、CPU1において、先読み命令の書
き込み(ポート・ライト)を行ってから(S61)、前
処理を行って(S62)、先読み専用ポート2dへのリ
ード命令の実行を行う(S63)。次に、メモリコント
ローラ21においては、前記ステップS61の処理の
後、初期設定(先読み指定回数N)の設定、先読み実施
回路(M=0)を行い(S64)、使用する先読み専用
バッファ2cの選択を行う(S65)、次に、空きバッ
ファか否かの確認を行い(S66)、空きバッファであ
れば、メモリアドレスとコントロール信号の作成を行っ
て(S67)、低速メモリ4からのデータの読み出しを
行う(S68)。次に、メモリコントローラ2におい
て、先読み専用バッファへの読み込みを行い(S6
9)、M=M+1とし(S70)、M≧Nかどうかを判
断する(S71)、M≧Nでなければ、前記ステップS
65へ戻り、M≧Nであれば、先読みの終了となる。
First, the CPU 1 writes a prefetch instruction (port write) (S61), performs preprocessing (S62), and executes a read instruction to the prefetch dedicated port 2d (S63). Next, in the memory controller 21, after the processing of step S61, the initial setting (prefetching designated number N) is set, the prefetching execution circuit (M = 0) is performed (S64), and the prefetching dedicated buffer 2c to be used is selected. (S65), then it is confirmed whether or not it is an empty buffer (S66), and if it is an empty buffer, a memory address and a control signal are created (S67), and the data is read from the low speed memory 4. Is performed (S68). Next, the memory controller 2 reads into the read-only buffer (S6
9), M = M + 1 is set (S70), and it is determined whether M ≧ N (S71).
Returning to step 65, if M ≧ N, the prefetching ends.

【0044】前記ステップS63の処理のあとに、メモ
リコントローラ2において、使用する先読み専用バッフ
ァ2cの選択を行い(S72)、有効データの有無を調
べる(S73)。有効データがあれば、次に、CPU1
においてデータの読み込みを行ってから(S74)、後
処理を行って(S75)、ライト命令の実行とデータの
書き出しを行う(S76)。次に、メモリコントローラ
2において、メモリアドレスとコントロール信号の作成
を行って(S77)、高速メモリ3へのデータの書き込
みを行い(S78)、次に、CPU1において終了判定
を行う(S79)。終了でなければ、前記ステップS6
2へ戻り、終了であれば、処理を終了する。
After the processing of step S63, the memory controller 2 selects the prefetch-only buffer 2c to be used (S72) and checks whether there is valid data (S73). If there is valid data, then CPU1
After reading data (S74), post-processing is performed (S75), and a write command is executed and data is written (S76). Next, the memory controller 2 creates memory addresses and control signals (S77), writes data to the high-speed memory 3 (S78), and then the CPU 1 determines the end (S79). If not completed, the above step S6
Returning to step 2, if it is completed, the process is completed.

【0045】前述したように、メモリコントローラ2と
低速メモリ4のデータバスは、他のデータバスと独立し
ている。そこで、先読み専用バッファ2cを多段とし、
低速メモリ4から先読み専用バッファ2cのデータ転送
と、該先読み専用バッファ2cからCPU1へのデータ
転送が同時に行えるようにバッファ回路を構成すれば、
低速メモリ4から先読み専用バッファ2cへの2度目の
リードサイクルは、CPU1側のデータバスの動作に関
係無く、1回目の低速メモリ4から先読み専用バッファ
2cへのリードサイクルが終了すると直ぐに開始され
る。これにより、CPU1のリードサイクルに要する時
間は更に短縮できる。
As described above, the data buses of the memory controller 2 and the low speed memory 4 are independent of other data buses. Therefore, the read-only buffer 2c has multiple stages,
If a buffer circuit is configured so that data transfer from the low-speed memory 4 to the read-only buffer 2c and data transfer from the read-only buffer 2c to the CPU 1 can be performed simultaneously,
The second read cycle from the low-speed memory 4 to the read-only buffer 2c is started immediately after the first read cycle from the low-speed memory 4 to the read-only buffer 2c ends, regardless of the operation of the data bus on the CPU 1 side. . As a result, the time required for the read cycle of the CPU 1 can be further shortened.

【0046】図12〜図14のフローチャートにおい
て、先読み制御回路2aは「先読みコマンドの書き込
み」を受けると、該先読み制御回路2aを初期化し、最
初の先読み専用バッファ2cへ、低速メモリ4からデー
タを読み込む。この読み込みが終了すると、先読み回数
を確認して、指定回数に達していなければ、次のバッフ
ァへの読み込みを始める。バッファへの読み込みに際し
ては、CPU1へ転送の済んでいないデータが存在しな
い、空き状態のバッファであることを確認する。もし、
空き状態でない場合には、空き状態になるまで読み込み
を待つ。先読み継続の条件は、指定回数Nに対する実施
回数Mの確認の他は、バッファが空き状態か否かの確認
だけである。
In the flow charts of FIGS. 12 to 14, when the prefetch control circuit 2a receives the "write of prefetch command", the prefetch control circuit 2a is initialized and data is read from the low speed memory 4 to the first prefetch dedicated buffer 2c. Read. When this reading is completed, the number of prefetches is confirmed, and if the number of times of reading is not reached, the reading to the next buffer is started. When reading data into the buffer, it is confirmed that there is no data that has not been transferred to the CPU 1 and that the buffer is empty. if,
If it is not empty, it waits for reading until it becomes empty. The condition to continue prefetching is to confirm whether the buffer is empty or not, in addition to the confirmation of the number of executions M with respect to the specified number of times N.

【0047】したがって、次に書き込みを行うバッファ
が空き状態である限り、先読みは停滞すること無く、連
続して指定回数まで実施される。つまり、次に書き込み
を行うバッファが空き状態である限り、低速メモリ4か
ら先読み専用バッファ2cへのデータ転送は、該先読み
専用バッファ2cからCPU1へのデータ転送に独立し
て動作する。先読み専用バッファ2cからCPU1への
データ転送においては、先読み制御回路2aは使用する
バッファを選択した後、そのバッファ内に有効なデータ
が存在するか否かを確認し、存在が確認されたならCP
U1へデータを転送する。ただし、このCPU1へのデ
ータ転送中も、低速メモリ4からバッファへのデータ転
送は続いているので、より効率の良いデータ転送が行え
る。ここで先読み制御回路2aは、データの転送の制御
だけでなく、使用するバッファの選択と、バッファ内の
有効データの有無の管理も行う必要がある。以上の結
果、処理速度は、以下の式(12),(13)の様にな
る。
Therefore, as long as the buffer in which data is to be written next is empty, the read-ahead is continuously performed up to the specified number of times without delay. That is, as long as the buffer for writing next is empty, the data transfer from the low-speed memory 4 to the read-only buffer 2c operates independently of the data transfer from the read-only buffer 2c to the CPU 1. In the data transfer from the read-ahead only buffer 2c to the CPU 1, the read-ahead control circuit 2a selects a buffer to be used and then confirms whether or not valid data exists in the buffer.
Transfer data to U1. However, even during the data transfer to the CPU 1, the data transfer from the low-speed memory 4 to the buffer continues, so that more efficient data transfer can be performed. Here, the prefetch control circuit 2a needs to control not only the transfer of data but also the selection of the buffer to be used and the management of the presence or absence of valid data in the buffer. As a result, the processing speed becomes as shown in the following equations (12) and (13).

【0048】 1回目のループ 60×2 + X + α+60 + Y + 60 コマンド書き込み 前処理 リード 後処理 ライト = 240+X+Y+α (但し、α=400−Xnsec) …(12) 2回目以降のループ X + γ+60 + Y + 60 = 120+X+Y+γ 前処理 リード 後処理 ライト (但し、γ=400−X−Y−120nsec) …(13) ここで、γは「前処理」モードの終了から先読み専用バ
ッファ2cへのデータ転送終了までのウェイトタイム
で、前回分の低速メモリ4から先読み専用バッファ2c
へのデータ転送の終了から、今回の「データリード」モ
ードの開始までに要する時間と、低速メモリからのデー
タ転送に要する時間の差である。
First loop 60 × 2 + X + α + 60 + Y + 60 Command writing pre-processing Read post-processing write = 240 + X + Y + α (where α = 400−Xnsec) (12) Second and subsequent loops X ++ γ + 60 + Y + 60 = 120 + X + Y + γ Pre-processing Read Post-processing Write (however, γ = 400−X−Y−120 nsec) (13) Here, γ is the end of data transfer to the read-only buffer 2c from the end of the “pre-processing” mode. Wait time up to the previous low-speed memory 4 to read-only buffer 2c
It is the difference between the time required from the end of the data transfer to the device to the start of the current "data read" mode and the time required to transfer the data from the low speed memory.

【0049】前処理時間Xが十分に長い場合、1回目の
低速メモリ4から先読み専用バッファ2cへのデータ転
送に要する時間は、前処理時間Xに吸収され、CPU1
から見た場合には(α=)0nsecとなる。また、低速メ
モリ4から先読み専用バッファ2cへのリードサイクル
終了後、次のリードサイクルが開始されるまでの時間
(X+Y+120)が十分に長ければ、これもCPU1
から見た場合には(γ=)0nsecとなる。したがって、
1ループにかかる時間は、以下の式(14),(15)
のようになる。
When the preprocessing time X is sufficiently long, the time required for the first data transfer from the low-speed memory 4 to the read-ahead buffer 2c is absorbed by the preprocessing time X, and the CPU 1
When viewed from above, it becomes (α =) 0 nsec. If the time (X + Y + 120) from the end of the read cycle from the low-speed memory 4 to the read-only buffer 2c until the start of the next read cycle is sufficiently long, this also applies to the CPU 1
When viewed from above, it becomes (γ =) 0 nsec. Therefore,
The time required for one loop is calculated by the following equations (14) and (15).
become that way.

【0050】 1回目のループ 120 + X + 60 + Y + 60= 240+X+Y コマンド書き込み 前処理 リード 後処理 ライト (但し、X≧400nsec) …(14) 2回目以降のループ X + 60 + Y + 60 = 120+X+Y 前処理 リード 後処理 ライト (但し、X+Y+120≧400nsec) …(15) 式(11)と式(15)に付随の条件式の比較から、図
12〜図14のフローチャートに従って動作するバッフ
ァ回路(実施例5)は、図8及び図9のフローチャート
に従って動作するバッファ回路(実施例4)より、さら
に最適状態になる条件(β≦0またはγ≦0)が緩やか
であり、先読み動作の有効性が現れ易いことがわかる。
First loop 120 + X + 60 + Y + 60 = 240 + X + Y Command writing pre-process Read post-process write (however, X ≧ 400 nsec) (14) Second and subsequent loops X + 60 + Y + 60 = 120 + X + Y pre-processing read post-processing write (however, X + Y + 120 ≧ 400 nsec) (15) From the comparison of the conditional expressions attached to the equations (11) and (15), the buffer circuit that operates according to the flowcharts of FIGS. In the example 5), the condition (β ≦ 0 or γ ≦ 0) for achieving the optimum state is more lenient than that of the buffer circuit (embodiment 4) that operates according to the flowcharts of FIGS. 8 and 9, and the effectiveness of the prefetch operation is low. You can see that it is easy to appear.

【0051】[0051]

【発明の効果】以上の説明から明らかなように、本発明
によると、高価な高速メモリデバイスを使用することな
く、低速メモリの高速リードアクセスが可能になる。ま
た、本本発明はI/Oデバイス等の低速デバイスのリー
ドアクセスの高速化にはより効果的で、システム全体の
処理速度が大きく向上する。さらに、請求項4に記載し
た方法を用いることによって、先読みのデータ幅,転送
回数,転送アドレスのインクリメント/デクリメントの
選択,現在の転送データと次の転送データとの間隔等を
自由に設定することが可能となり、また、これらの組み
合わせによって画像処理等で多用される特殊転送にも対
応した高速リードアクセスが可能となり、画面切替が速
くなる。
As is apparent from the above description, according to the present invention, high speed read access to a low speed memory is possible without using an expensive high speed memory device. Further, the present invention is more effective for speeding up read access of low speed devices such as I / O devices, and greatly improves the processing speed of the entire system. Further, by using the method described in claim 4, it is possible to freely set the pre-read data width, the number of transfers, the selection of increment / decrement of the transfer address, and the interval between the current transfer data and the next transfer data. In addition, by combining these, high-speed read access corresponding to special transfer frequently used in image processing and the like becomes possible, and screen switching becomes faster.

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

【図1】本発明によるバッファ回路の一実施例を説明す
るためのブロック図である。
FIG. 1 is a block diagram for explaining an embodiment of a buffer circuit according to the present invention.

【図2】本発明における先読み専用回路部のブロック図
である。
FIG. 2 is a block diagram of a read-ahead circuit unit according to the present invention.

【図3】本発明における先読み専用ポートの構造を示す
図である。
FIG. 3 is a diagram showing a structure of a read-only port according to the present invention.

【図4】実施例1に基づくバッファ回路のフローチャー
ト(その1)である。
FIG. 4 is a flowchart (No. 1) of the buffer circuit according to the first embodiment.

【図5】実施例1に基づくバッファ回路のフローチャー
ト(その2)である。
FIG. 5 is a flowchart (No. 2) of the buffer circuit according to the first embodiment.

【図6】実施例2に基づくバッファ回路のフローチャー
ト(その1)である。
FIG. 6 is a flowchart (No. 1) of the buffer circuit according to the second embodiment.

【図7】実施例2に基づくバッファ回路のフローチャー
ト(その2)である。
FIG. 7 is a flowchart (part 2) of the buffer circuit according to the second embodiment.

【図8】実施例3,4に基づくバッファ回路のフローチ
ャート(その1)である。
FIG. 8 is a flowchart (part 1) of the buffer circuit according to the third and fourth embodiments.

【図9】実施例3,4に基づくバッファ回路のフローチ
ャート(その2)である。
FIG. 9 is a flowchart (part 2) of the buffer circuit according to the third and fourth embodiments.

【図10】本発明における複数の先読み専用ポートを設
けた場合のポートとレジスタの関係を示す図である。
FIG. 10 is a diagram showing a relation between ports and registers when a plurality of read-only ports are provided in the present invention.

【図11】本発明における先読み専用ポートの構造を示
す図である。
FIG. 11 is a diagram showing a structure of a read-only port according to the present invention.

【図12】実施例5に基づくバッファ回路のフローチャ
ート(その1)である。
FIG. 12 is a flowchart (No. 1) of the buffer circuit according to the fifth embodiment.

【図13】実施例5に基づくバッファ回路のフローチャ
ート(その2)である。
FIG. 13 is a flowchart (part 2) of the buffer circuit according to the fifth embodiment.

【図14】実施例5に基づくバッファ回路のフローチャ
ート(その3)である。
FIG. 14 is a flowchart (part 3) of the buffer circuit according to the fifth embodiment.

【図15】従来のバッファ回路のブロック図である。FIG. 15 is a block diagram of a conventional buffer circuit.

【図16】従来のバッファ回路の動作を説明するための
フローチャートである。
FIG. 16 is a flowchart for explaining the operation of the conventional buffer circuit.

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

1…CPU(中央処理装置)、2…メモリコントロー
ラ、2a…先読み制御回路、2b…トランシーバ、2c
…バッファ、2d…ポート、2c…レジスタ、3…高速
メモリ(メインメモリ)、4…低速メモリ。
1 ... CPU (central processing unit), 2 ... Memory controller, 2a ... Prefetch control circuit, 2b ... Transceiver, 2c
... buffer, 2d ... port, 2c ... register, 3 ... high speed memory (main memory), 4 ... low speed memory.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 低速なI/Oデバイスやメモリをアクセ
スするシステムにおいて、データの先読みを行うための
先読み制御回路と、データのアドレスを含む先読みコマ
ンドの書き込みとデータの読み出しを行う先読み専用ポ
ートと、先読みデータを格納するための先読み専用バッ
ファとを備え、バスマスタへのデータ転送時に、低速デ
バイスではなく、前記先読み専用ポートをリードするこ
とによって、先読み専用バッファから必要とするデータ
を読み出す機能を有し、先読み専用ポートへの先読み命
令の書き込みと、先読み専用ポートからのデータの読み
出しを適切なタイミングで実行することによって、リー
ドアクセスのアクセスタイムの短縮を可能にすることを
特徴とするバッファ回路。
1. A pre-read control circuit for pre-reading data in a system for accessing a low-speed I / O device or memory, and a pre-read-only port for writing a pre-read command including a data address and reading the data. It has a read-only buffer for storing read-ahead data, and has the function of reading the necessary data from the read-only buffer by reading the read-only port instead of the low-speed device during data transfer to the bus master. A buffer circuit, which is capable of shortening the access time of read access by writing a read-ahead instruction to the read-only port and reading data from the read-only port at appropriate timings.
【請求項2】 前記先読み制御回路にデータの連続読み
出し機能を追加することによって、先読み専用バッファ
に格納されているデータの読み出し後に、該データに連
続する領域に格納されたデータを、連続して先読み専用
バッファに上書きする機能を有し、リードアクセスに於
ける処理時間の更なる短縮を可能にすることを特徴とす
る請求項1記載のバッファ回路。
2. A data continuous read function is added to the read-ahead control circuit to read data stored in a read-only buffer, and then continuously store data stored in an area continuous with the data. 2. The buffer circuit according to claim 1, wherein the buffer circuit has a function of overwriting the read-ahead-only buffer, and enables further shortening of processing time in read access.
【請求項3】 前記連続先読みの回数別に複数の先読み
専用ポートを設けることによって、先読み専用バッファ
に格納されているデータの読み出し後に、該データに連
続する領域に格納されたデータを、使用された先読み専
用ポート毎に決められた回数に達するまで、先読み専用
バッファに上書きする機能を有し、リードアクセスにお
ける処理時間の更なる短縮を可能にすることを特徴とす
る請求項2記載のバッファ回路。
3. By providing a plurality of read-only ports for each number of times of continuous read-ahead, after reading the data stored in the read-only buffer, the data stored in the area continuous with the data is used. 3. The buffer circuit according to claim 2, wherein the buffer circuit has a function of overwriting the read-only buffer until the number of times determined for each read-only port is reached to further reduce the processing time in read access.
【請求項4】 前記先読み専用ポートに先読みの転送条
件を定義するビットを追加することによって、先読み専
用バッファに格納されているデータの読み出し後に、該
データに連続する領域に格納されたデータを、転送条件
を定義したビットに即して先読み専用バッファに上書き
する機能を有し、リードアクセスにおける処理時間の更
なる短縮を可能にすることを特徴とする請求項2記載の
バッファ回路。
4. By adding a bit defining a transfer condition of prefetch to the prefetch only port, after reading the data stored in the prefetch only buffer, data stored in an area continuous with the data is read, 3. The buffer circuit according to claim 2, wherein the buffer circuit has a function of overwriting the read-only buffer in accordance with a bit defining a transfer condition, thereby further reducing the processing time in read access.
【請求項5】 前記先読み専用バッフアを多段構成と
し、連続領域に格納されたデータを高速に連続して専用
バッファに取り込む機能を有し、リードアクセスにおけ
る処理時間の更なる短縮を可能とすることを特徴とする
請求項2,3又は4記載のバッファ回路。
5. The read-only buffer has a multi-stage structure, and has a function of continuously capturing data stored in a continuous area into a dedicated buffer at high speed, thereby further reducing the processing time in read access. 5. The buffer circuit according to claim 2, 3 or 4.
JP23468394A 1994-09-29 1994-09-29 Buffer circuit Pending JPH0895852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23468394A JPH0895852A (en) 1994-09-29 1994-09-29 Buffer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23468394A JPH0895852A (en) 1994-09-29 1994-09-29 Buffer circuit

Publications (1)

Publication Number Publication Date
JPH0895852A true JPH0895852A (en) 1996-04-12

Family

ID=16974812

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23468394A Pending JPH0895852A (en) 1994-09-29 1994-09-29 Buffer circuit

Country Status (1)

Country Link
JP (1) JPH0895852A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6199150B1 (en) 1997-07-15 2001-03-06 Matsushita Electric Industrial Co., Ltd. Data memory apparatus forming memory map having areas with different access speeds
US7552311B2 (en) 2003-04-14 2009-06-23 Renesas Technology Corp. Memory device with preread data management
JP2010191983A (en) * 2010-04-12 2010-09-02 Renesas Electronics Corp Storage device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6199150B1 (en) 1997-07-15 2001-03-06 Matsushita Electric Industrial Co., Ltd. Data memory apparatus forming memory map having areas with different access speeds
US7552311B2 (en) 2003-04-14 2009-06-23 Renesas Technology Corp. Memory device with preread data management
JP2010191983A (en) * 2010-04-12 2010-09-02 Renesas Electronics Corp Storage device

Similar Documents

Publication Publication Date Title
EP1161729B1 (en) High-speed processor system, method of using the same, and recording medium
JPH05205477A (en) Randomly accessible memory having time overlap memory-access
JP2006079523A (en) Cache memory system and its control method
JPH0895852A (en) Buffer circuit
US5586282A (en) Memory system employing pipeline process for accessing memory banks
JP2755039B2 (en) Register access control method
JP2000227895A (en) Device and method for transferring image data
JP2554761B2 (en) Data transfer path control method
JP2005141682A (en) High-speed memory access control device
JP2003036238A (en) I/o access control method and program for information processing system
JP3039391B2 (en) Memory system
KR940001590B1 (en) Method and device for shortening memory access time in reading and writing
JP2976909B2 (en) Cache data flush control method
EP0398191A2 (en) Quadruple word, multiplexed, paged mode and cache memory
JPH0789341B2 (en) Data processing device
JP2006331008A (en) Memory interface
JPH09319657A (en) Processor provided with buffer for reading instruction
JPH11249961A (en) Data transfer device and data transfer control method therefor
JP2861053B2 (en) Image processing device
JPH07210454A (en) High-speed processor
JP2768373B2 (en) Information processing device
JPS61264455A (en) Coinciding and controlling system for main storage
JP2845746B2 (en) Micro program controller
JPH06161868A (en) Memory controller
JP2000235516A (en) Memory system with operation function, method for controlling memory to be used for the system and recording medium recording control program