JPS63141130A - Instruction prefetching device - Google Patents

Instruction prefetching device

Info

Publication number
JPS63141130A
JPS63141130A JP28783086A JP28783086A JPS63141130A JP S63141130 A JPS63141130 A JP S63141130A JP 28783086 A JP28783086 A JP 28783086A JP 28783086 A JP28783086 A JP 28783086A JP S63141130 A JPS63141130 A JP S63141130A
Authority
JP
Japan
Prior art keywords
instruction
address
cpu
read
analysis
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
JP28783086A
Other languages
Japanese (ja)
Inventor
Kimihiko Mitsubori
三堀 公彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP28783086A priority Critical patent/JPS63141130A/en
Publication of JPS63141130A publication Critical patent/JPS63141130A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To accelerate a CPU processing operation and to prevent the unauthorized access of a program from being performed by using a specific pattern, by enabling the pattern of an instruction to be prefetched to be set freely in an instruction analysis memory part. CONSTITUTION:An address signal outputted for the read of the next execution instruction from a CPU is latched by an address analysis memory part 2 in an instruction prefetching device 15, then is analyzed, and it is checked whether the said instruction already exists in a prefetch instruction buffer 5. When the instruction exists by prefetching, the instruction in the buffer 5 is immediately sent to the CPU1. Meanwhile, when no instruction exists, the instruction read out from an instruction memory device to the CPU1 by the address signal is latched by the instruction analysis memory part 3 in the instruction prefetching device 15, and it is checked whether the instruction is a specific instruction having a specific pattern or not.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、中央処理装置(CP U)が次に実行すべき
命令を、命令記憶装置から先取りしてきて貯えておき、
必要になったとき該CPUに供給するようにした命令先
取り装置に関するものであり、CPUを取り入れたコン
ピュータ応用製品全般に適用可能な命令先取り装置に関
するものである。
[Detailed Description of the Invention] [Industrial Application Field] The present invention provides a method for fetching and storing an instruction to be executed next by a central processing unit (CPU) from an instruction storage device.
The present invention relates to an instruction prefetching device that supplies instructions to a CPU when necessary, and relates to an instruction prefetching device that can be applied to general computer application products incorporating a CPU.

〔従来の技術〕[Conventional technology]

従来の命令先取り装置は、特開昭60−181930号
公報において提案されているような、マイクロプログラ
ム方式によるもの(条件分岐型命令の実行で、条件不成
立時の次の命令の読み出しアクセスと、条件成立時の分
岐命令の読み出しアクセスとを並行して行うことにより
命令実行時間を速くし、高速な制御を可能とするもの)
とか、特開昭60−181931号公報において提案さ
れているような、特殊な条件のもとで先取りする方式(
条件分岐命令を実行するに際し、この条件の成立、不成
立を過去の情報から予測することにより、条件分岐命令
の次にくる命令を先取りし、主記憶装置へのアクセス時
間の無駄を低減させる方式)などが知られており、前者
は、マイクロプログラム制御によるものであるから、既
存のCPUに対して適用できるという性質のものではな
く、また後者は、特殊なCPUに対してのみ適用可能な
ものである。
Conventional instruction prefetching devices are based on a microprogram method, such as the one proposed in Japanese Patent Application Laid-open No. 181930/1983 (in the execution of a conditional branch type instruction, read access of the next instruction when the condition is not met, and This speeds up the instruction execution time by performing read access of the branch instruction in parallel when the branch instruction is established, enabling high-speed control)
For example, a method of pre-empting under special conditions as proposed in Japanese Patent Application Laid-Open No. 60-181931 (
When executing a conditional branch instruction, by predicting whether the condition is satisfied or not based on past information, the instruction that follows the conditional branch instruction is preempted, reducing wasted time accessing the main memory) The former is based on microprogram control and cannot be applied to existing CPUs, and the latter is only applicable to special CPUs. be.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した如き従来の命令先取り装置では、先取りすべき
命令のアドレスが固定的であった。
In the conventional instruction prefetching device as described above, the address of the instruction to be prefetched is fixed.

例えば、条件分岐型命令を実行した後の先取りでは、条
件不成立時の次の命令か、条件成立時の次の命令か、の
どちらかしか先取りできないという点で固定的であった
。条件成立時、不成立時、双方を考えての先取り機構が
入っている場合は、条件分岐型命令の実行に関してはか
なり効率があがる。
For example, prefetching after executing a conditional branch type instruction is fixed in that it can only prefetch either the next instruction when the condition is not met or the next instruction when the condition is met. If a prefetch mechanism is included that considers both when the condition is met and when the condition is not met, the efficiency of executing conditional branch type instructions will be considerably improved.

しかしながら、条件分岐命令以外の場合、例えばDIV
命令(割算命令)のようなCPU内部の実行時間が大き
い命令を実行しているとき、複数個の命令にわたり先取
りしたいといった場合については先取りできないという
ものであった。
However, in cases other than conditional branch instructions, for example DIV
When an instruction (such as a division instruction) that takes a long time to execute inside the CPU is being executed, it is not possible to prefetch multiple instructions.

本発明は、先取りすべき命令のアドレスを固定的でなく
、自由に設定可能にすること、また命令の先取りを既存
のCPUに対して適用可能にすること、を解決すべき課
題としている。
The problem to be solved by the present invention is to make the address of an instruction to be prefetched not fixed but freely settable, and to make instruction prefetching applicable to existing CPUs.

〔問題点を解決するための手段〕[Means for solving problems]

本発明による命令先取り装置は、中央処理装置(CP 
U)が次に実行すべき命令を、命令記憶装置から先取り
してきて貯えておき、必要になったとき該cpuに供給
するようにした命令先取り装置として構成され、CPU
と、該cpuが命令記憶装置にアクセスするためのバス
と、の間に介在することにより、該CPUに命令先取り
機能を付与する。
The instruction prefetching device according to the present invention comprises a central processing unit (CP).
U) is configured as an instruction prefetching device that prefetches the next instruction to be executed from the instruction storage device, stores it, and supplies it to the CPU when it is needed.
and a bus for the CPU to access an instruction storage device, thereby providing the CPU with an instruction prefetching function.

そして、この本発明による命令先取り装置は、CPUが
命令記憶装置から命令を読み出すために出力するアドレ
ス信号を別に取り込んで記憶し解析するためのアドレス
解析記憶部と、CPUが前記アドレス信号により命令記
憶装置から読み出してきた命令を別に取り込んで記憶し
解析するための命令解析記憶部と、該命令解析記憶部に
おける解析の結果、その読み出してきた命令が或る特定
の命令であることが判明したとき、該命令解析記憶部か
らその読み出してきた命令を送出されて入力されると共
に、前記アドレス解析記憶部からもその読み出してきた
命令に対応するアドレス信号を入力されて、その両者か
ら先取りすべき命令のアドレスを演算により求めるアド
レス演算部と、演算により求めた該アドレスに従って先
取りしてきた命令を貯えておく先取り命令バッファと、
CPUが次に実行すべき命令の読み出しのためのアドレ
ス信号を出力したとき、前記アドレス解析記憶部におい
てこれを取り込み、解析の結果、当該命令が前記バッフ
ァにすでに先取りされて格納されていることが判明した
とき、該バッファからこれを読み出してCPUに供給す
る回路と、を具備する。
The instruction prefetching device according to the present invention includes an address analysis storage section for separately capturing, storing, and analyzing an address signal outputted by the CPU in order to read an instruction from the instruction storage device, and an address analysis storage section for separately capturing, storing, and analyzing an address signal that the CPU outputs in order to read an instruction from the instruction storage device; An instruction analysis storage section for separately fetching, storing and analyzing instructions read out from the device, and when it is determined that the instruction read out is a certain specific instruction as a result of analysis in the instruction analysis storage section. , the instruction that has been read out from the instruction analysis storage section is sent and inputted, and the address signal corresponding to the instruction that has been read out is also inputted from the address analysis storage section, and an instruction that should be preempted from both of them. an address calculation unit that calculates the address of the address by calculation; a prefetch instruction buffer that stores an instruction that has been prefetched according to the address calculated by the calculation;
When the CPU outputs an address signal for reading the next instruction to be executed, the address analysis storage unit takes in the address signal, and as a result of analysis, it is determined that the instruction has already been prefetched and stored in the buffer. and a circuit for reading the information from the buffer and supplying it to the CPU when the information is determined.

〔作用〕[Effect]

CPUから次の実行命令読み出し用に出力されるアドレ
ス信号は、命令先取り装置の中でアドレス解析記憶部に
ラッチされ、解析されて、当該実行命令が既に先取り命
令バッファ内に先取りされて存在するか否かチェックさ
れる。存在する場合には、即座に該バッファ内の命令が
CPUに対して送出される。
The address signal output from the CPU for reading the next execution instruction is latched into the address analysis storage section in the instruction prefetching device and analyzed to determine whether the execution instruction has already been prefetched and exists in the prefetching instruction buffer. It is checked whether or not. If the instruction exists, the instruction in the buffer is immediately sent to the CPU.

存在しない場合は、そのアドレス信号によって命令記憶
装置からCPtJに読み出された命令は、命令先取り装
置の中で命令解析記憶部にラッチされ、解析されてそれ
が特定のパターンを持つ特定の命令か、否かチェックさ
れる。特定の命令であるときは、該命令をアドレス演算
部に送り、また前記アドレス解析記憶部にラッチされて
いた該命令に対応するアドレス信号もそのアドレス演算
部に送られる。
If not, the instruction read from the instruction store to the CPtJ by that address signal is latched into the instruction parsing store in the instruction prefetcher and parsed to determine if it is a specific instruction with a specific pattern. , is checked. If it is a specific instruction, the instruction is sent to the address calculation section, and the address signal corresponding to the instruction latched in the address analysis storage section is also sent to the address calculation section.

アドレス演算部では、その両者から先取りすべき命令の
アドレスを演算により求め、CPUが読み取り/書き込
み(READ/WRITE)を行っていない期間に、前
記アドレスに従って命令の先取りを行い先取り命令バッ
ファに格納する。
The address calculation unit calculates the address of the instruction to be prefetched from both of them, prefetches the instruction according to the address and stores it in the prefetch instruction buffer during a period when the CPU is not performing reading/writing (READ/WRITE). .

以上の動作の繰り返しにより命令先取り動作が実行され
る。
The instruction prefetching operation is executed by repeating the above operations.

〔実施例〕〔Example〕

次に図を参照して本発明の詳細な説明する。 The present invention will now be described in detail with reference to the drawings.

図は本発明の一実施例を示すブロック図である。The figure is a block diagram showing one embodiment of the present invention.

同図において、1はCPU (条件分岐成立時の次の命
令を先取りする機能を有する中央処理装置とする)、2
はアドレス解析記憶部、3は命令解析記憶部、4はアド
レス演算部、5は先取り命令バッファ、6はR/W (
読み出し/書き込み)方向制御部、11.11Aはそれ
ぞれデータバス、12.12/Aはそれぞれアドレスバ
ス、13.13AはそれぞれR/W111?ill線、
15は本発明による命令先取り装置、である。
In the figure, 1 is a CPU (a central processing unit that has the function of preempting the next instruction when a conditional branch is established), 2
is an address analysis storage unit, 3 is an instruction analysis storage unit, 4 is an address calculation unit, 5 is a prefetch instruction buffer, and 6 is an R/W (
read/write) direction control unit, 11.11A are data buses, 12.12/A are address buses, and 13.13A are R/W111? ill line,
15 is an instruction prefetching device according to the present invention.

CPUIは、既に述べたように、条件分岐成立時の次の
命令を先取りする機能を有する中央処理装置である。C
PUIが、データバス11.アドレスバス12につなが
る図示せざる命令記憶装置から、条件分岐型命令を読み
取ったとき、該命令は、命令先取り装置15内の命令解
析記憶部3により解析され、特定の命令であることが認
識される。すると、該命令はアドレス演算部4に渡され
る。また、該条件分岐型命令を読み出すためにCPUI
がアドレスバス12に先に送出したアドレスがアドレス
解析記憶部2に記憶されているので、このアドレスもア
ドレス演算部4に渡される。アドレス演算部4では、そ
のアドレスと命令から条件分岐不成立時の命令のアドレ
スを演算し、CPU1の命令先取り期間が終了するのを
待って、そのアドレスをアドレスバス12上に送出する
ことにより、該アドレスにある命令をデータバス11を
介して先取り命令バッファ5に読み込む。またアドレス
演算部に渡されたアドレスは再びアドレス解析記憶部2
に戻しておく。
As already mentioned, the CPUI is a central processing unit that has the function of preempting the next instruction when a conditional branch is established. C
The PUI is connected to the data bus 11. When a conditional branch type instruction is read from an instruction storage device (not shown) connected to the address bus 12, the instruction is analyzed by the instruction analysis storage section 3 in the instruction prefetching device 15 and recognized as a specific instruction. Ru. Then, the instruction is passed to the address calculation section 4. In addition, in order to read the conditional branch type instruction, the CPU
Since the address previously sent to the address bus 12 is stored in the address analysis storage section 2, this address is also passed to the address calculation section 4. The address calculation unit 4 calculates the address of the instruction when the conditional branch is not taken from the address and the instruction, waits for the end of the instruction prefetch period of the CPU 1, and sends the address onto the address bus 12. The instruction at the address is read into the prefetch instruction buffer 5 via the data bus 11. Also, the address passed to the address calculation unit is returned to the address analysis storage unit 2.
Return it to

条件分岐型命令が不成立に終わったとき、cpUlは次
の命令のアドレスをアドレスバス12Aから出力する。
When the conditional branch type instruction fails, cpUl outputs the address of the next instruction from address bus 12A.

そのアドレスは、アドレス解析記憶部2において解析さ
れ、つまり先のアドレスと比較され、先取り命令バッフ
ァ5に既に読み込まれていることが認識される。認識後
、その命令はバッファ5から取り出され、命令解析記憶
部3、データバスIIAを介してCPUIへ出力される
The address is analyzed in the address analysis storage section 2, that is, it is compared with the previous address, and it is recognized that it has already been read into the prefetch instruction buffer 5. After recognition, the instruction is taken out from the buffer 5 and output to the CPUI via the instruction analysis storage section 3 and data bus IIA.

その際、読み取り完了(READ完了)の信号はR/W
方向制御部6より出力される。
At that time, the read completion (READ completion) signal is R/W
It is output from the direction control section 6.

以上、述べたように、本実施例によれば、条件分岐不成
立時も先取りすることが可能となり、命令記憶装置への
アクセスとcpu内部処理との並列処理時間が拡大され
一層のCPU処理動作の高速化が図れる。
As described above, according to this embodiment, it is possible to preempt even when a conditional branch is not taken, and the parallel processing time for accessing the instruction storage device and the CPU internal processing is expanded, thereby further improving the CPU processing operation. Speed-up can be achieved.

以上の説明は、条件分岐型の命令を例に挙げて説明した
ものであるが、命令はこれに限るものではなく、例えば
先に述べたDIV命令(割算命令)であってもよい。命
令解析記憶部3においてDI■命令が認識されると、そ
のCPUIにおける実行には時間がかかるので、アドレ
ス演算部4では、命令解析記憶部3からそのDrV命令
を、またアドレス解析記憶部2からそのアドレス信号を
与えられて、DIV命令に続く命令の複数個にわたるそ
のアドレスを演算により求めて命令記憶装置に送り、複
数個の命令の先取りを行って先取り命令バッファ5に格
納しておくことができる。
Although the above description has been made using a conditional branch type instruction as an example, the instruction is not limited to this, and may be, for example, the above-mentioned DIV instruction (division instruction). When the DI instruction is recognized in the instruction analysis storage unit 3, it takes time to execute it on the CPUI, so the address calculation unit 4 reads the DrV instruction from the instruction analysis storage unit 3 and from the address analysis storage unit 2. Given the address signal, the addresses of multiple instructions following the DIV instruction can be calculated and sent to the instruction storage device, and the multiple instructions can be prefetched and stored in the prefetch instruction buffer 5. can.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、先取りすべき命令のパターンを命令解
析記憶部において自由に設定することにより、CPU処
理動作の高速化が図れるだけでなく、特殊なパターンが
命令解析記憶部に入力されたとき、特別なコードをCP
Uへ入力してやるようにすることにより、プログラムの
重要な部分を他から読み取られないように隠すこともで
きる。
According to the present invention, by freely setting the pattern of instructions to be prefetched in the instruction analysis storage section, not only can CPU processing operation be made faster, but also when a special pattern is input to the instruction analysis storage section. , CP special code
By inputting data to U, important parts of the program can be hidden from being read by others.

また命令解析部を使わずに、アドレス解析部と命令送出
部の機能だけを使って命令の保護機能も実現できる。
In addition, the instruction protection function can be realized using only the functions of the address analysis section and the instruction sending section without using the instruction analysis section.

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

図は本発明の一実施例を示すブロック図である。 符号の説明 1・・・条件分岐成立時の次の命令を先取りする機能を
有する中央処理装置、2・・・CPUからのREADア
ドレスの解析記憶部、3・・・CPUに読み込まれる命
令の解析記憶部、4・・・先取りする命令のアドレスの
演算部、5・・・先取り命令バッファ、6・・・R/W
方向制御部
The figure is a block diagram showing one embodiment of the present invention. Explanation of symbols 1...Central processing unit having a function of pre-fetching the next instruction when a conditional branch is established, 2...Analysis storage unit for READ addresses from the CPU, 3...Analysis of instructions read into the CPU Storage unit, 4... A calculation unit for the address of the instruction to be prefetched, 5... Prefetching instruction buffer, 6... R/W
direction control section

Claims (1)

【特許請求の範囲】 1、中央処理装置(CPU)が次に実行すべき命令を、
命令記憶装置から先取りしてきて貯えておき、必要にな
ったとき該CPUに供給するようにした命令先取り装置
において、 CPUが命令記憶装置から命令を読み出すために出力す
るアドレス信号を別に取り込んで記憶し解析するための
アドレス解析記憶部と、CPUが前記アドレス信号によ
り命令記憶装置から読み出してきた命令を別に取り込ん
で記憶し解析するための命令解析記憶部と、該命令解析
記憶部における解析の結果、その読み出してきた命令が
或る特定の命令であることが判明したとき、該命令解析
記憶部からその読み出してきた命令を送出されて入力さ
れると共に、前記アドレス解析記憶部からもその読み出
してきた命令に対応するアドレス信号を入力されて、そ
の両者から先取りすべき命令のアドレスを演算により求
めるアドレス演算部と、演算により求めた該アドレスに
従って先取りしてきた命令を貯えておく先取り命令バッ
ファと、CPUが次に実行すべき命令の読み出しのため
のアドレス信号を出力したとき、前記アドレス解析記憶
部においてこれを取り込み、解析の結果、当該命令が前
記バッファにすでに先取りされて格納されていることが
判明したとき、該バッファからこれを読み出してCPU
に供給する回路と、を具備したことを特徴とする命令先
取り装置。
[Claims] 1. The instruction to be executed next by the central processing unit (CPU) is
In an instruction prefetching device that prefetches an instruction from an instruction storage device, stores it, and supplies it to the CPU when necessary, the address signal output by the CPU to read an instruction from the instruction storage device is separately captured and stored. an address analysis storage section for analysis, an instruction analysis storage section for separately capturing, storing and analyzing the instructions read out from the instruction storage device by the CPU in accordance with the address signal, and the results of the analysis in the instruction analysis storage section; When the read instruction is found to be a certain specific instruction, the read instruction is sent from the instruction analysis storage section and input, and at the same time, the read instruction is also read from the address analysis storage section. an address calculation section which receives an address signal corresponding to an instruction and calculates the address of the instruction to be prefetched from both of them; a prefetch instruction buffer that stores the instruction prefetched according to the address obtained by the calculation; and a CPU. outputs an address signal for reading the next instruction to be executed, the address analysis storage section captures this, and as a result of analysis, it is found that the instruction has already been prefetched and stored in the buffer. When this happens, read this from the buffer and send it to the CPU
An instruction prefetching device comprising: a circuit for supplying an instruction to an instruction prefetching device;
JP28783086A 1986-12-04 1986-12-04 Instruction prefetching device Pending JPS63141130A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28783086A JPS63141130A (en) 1986-12-04 1986-12-04 Instruction prefetching device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28783086A JPS63141130A (en) 1986-12-04 1986-12-04 Instruction prefetching device

Publications (1)

Publication Number Publication Date
JPS63141130A true JPS63141130A (en) 1988-06-13

Family

ID=17722314

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28783086A Pending JPS63141130A (en) 1986-12-04 1986-12-04 Instruction prefetching device

Country Status (1)

Country Link
JP (1) JPS63141130A (en)

Similar Documents

Publication Publication Date Title
US20030204673A1 (en) Data prefetching apparatus in a data processing system and method therefor
US5617553A (en) Computer system which switches bus protocols and controls the writing of a dirty page bit of an address translation buffer
US4967338A (en) Loosely coupled pipeline processor
US4747045A (en) Information processing apparatus having an instruction prefetch circuit
JPH05342084A (en) Device and method for storing data
WO2023237084A1 (en) Data prefetching method, compiling method and related apparatus
JPS63141130A (en) Instruction prefetching device
JPH08161230A (en) Look-ahead method in on-demand paging
JPH06324861A (en) System and method for controlling cpu
JPH07114509A (en) Memory access device
JPH04268928A (en) Emulation device and semiconductor device
US5524221A (en) Next instruction pointer calculation system for a microcomputer
JP2545594B2 (en) Operand data prefetching method
JP2883335B2 (en) Information processing device
KR960018958A (en) Main Memory Access Device Using Data Buffer When Performing Atomic Instruction in Multiprocessor System
JPH10187531A (en) Prefetch system for cache memory
WO2002057909A2 (en) Value speculation on an assist processor to facilitate prefetching for a primary processor
JPS5925264B2 (en) Vector instruction processing method
JPH0248733A (en) Information processor
JP2701799B2 (en) Microcomputer
JPS6191725A (en) Address matching control system
JPS61294550A (en) Data reading and writing control system for electronic computer
JPS61145643A (en) Variable word length instruction processing system
JPS5875256A (en) Monitoring system for execution instruction processing state
JPH1040106A (en) Function type language processor