JPH03212735A - Instruction processing system for microprocessor - Google Patents

Instruction processing system for microprocessor

Info

Publication number
JPH03212735A
JPH03212735A JP938890A JP938890A JPH03212735A JP H03212735 A JPH03212735 A JP H03212735A JP 938890 A JP938890 A JP 938890A JP 938890 A JP938890 A JP 938890A JP H03212735 A JPH03212735 A JP H03212735A
Authority
JP
Japan
Prior art keywords
instruction
stage
microprocessor
operand
fetch
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
JP938890A
Other languages
Japanese (ja)
Inventor
Akira Otsuka
亮 大塚
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP938890A priority Critical patent/JPH03212735A/en
Publication of JPH03212735A publication Critical patent/JPH03212735A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明はマイクロプロセッサの命令処理方式に係わり
、特にその処理能力の向上に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an instruction processing method of a microprocessor, and particularly to improving its processing performance.

[従来の技術] 第4図は、例えは電子情報通信学会技術報告ICU38
−106に記載された従来のマイクロプロセッサのパイ
プライン処理機構を示すブロック図である。図において
、7は従来の命令フェッチステージ(以下IFステージ
と略記)であり、2は命令デコードステージ(以下Dス
テージと略記)、8はデコードされた命令コード中で指
定されたオペランドの実効アドレスの計算を行う従来の
オペランドアドレス計算ステージ(以下Aステージと略
記)、4はメモリよりオペランドをフェッチするオペラ
ンドフェッチステージ(以下Fステージと略記)、5は
オペランドに対して命令コード中で指定された演算を実
行する命令実行ステージ(以下Eステージと略記)であ
る。
[Prior art] Figure 4 shows, for example, the Institute of Electronics, Information and Communication Engineers technical report ICU38.
106 is a block diagram showing a pipeline processing mechanism of a conventional microprocessor described in US Pat. In the figure, 7 is the conventional instruction fetch stage (hereinafter abbreviated as IF stage), 2 is the instruction decode stage (hereinafter abbreviated as D stage), and 8 is the effective address of the operand specified in the decoded instruction code. 4 is the conventional operand address calculation stage (hereinafter abbreviated as A stage) that performs calculations, 4 is an operand fetch stage (hereinafter abbreviated as F stage) that fetches operands from memory, and 5 is an operation specified in the instruction code for the operand. This is an instruction execution stage (hereinafter abbreviated as E stage) for executing.

次に動作について説明する。Next, the operation will be explained.

IFステージ7はメモリから命令をフェッチしてDステ
ージ2に出力する。Dステージ2はIFステージ7から
入力された命令コードをデコードして、そのデコード結
果をAステージ8に出力する。Aステージ8は命令コー
ド中で指定されたオペランドの実効アドレスの計算を行
い、必要ならばアドレス間接参照を行い、計算したオペ
ランドアドレスをFステージ4に出力する。Fステージ
4はAステージ8から入力されたオペランドアドレスを
用いてメモリよりオペランドをフェッチする。フェッチ
したオペランドはEステージ5に出力される。Eステー
ジ5はFステージ4から入力されたオペランドに対して
命令コード中で指定された演算を実行する。さらに必要
であれば、その演算結果を図には明記していない外部メ
モリにストアする。
IF stage 7 fetches instructions from memory and outputs them to D stage 2. The D stage 2 decodes the instruction code input from the IF stage 7 and outputs the decoding result to the A stage 8. The A stage 8 calculates the effective address of the operand specified in the instruction code, performs address indirection if necessary, and outputs the calculated operand address to the F stage 4. F stage 4 uses the operand address input from A stage 8 to fetch an operand from memory. The fetched operand is output to E stage 5. The E stage 5 executes the operation specified in the instruction code on the operand input from the F stage 4. Furthermore, if necessary, the calculation results are stored in an external memory not clearly shown in the figure.

続いて、第5図を用いて命令かパイプライン上で処理さ
れる様子を説明する。IFステージ7では、命令フェッ
チアドレスを出力して最小2クロックで命令フェッチを
行う。命令フェッチ後直ちにデコードされ、以降のパイ
プライン処理を通じて命令に指定された演算を行う。D
ステージ2では命令の最小単位毎に2クロツクで命令デ
コードを終了し、Aステージ8に命令情報を送る。Aス
テージ8でも最小2クロックの処理でFステージ4に命
令情報を送り、Fステージ4でも最小2クロックの処理
でEステージ5に命令を伝える。
Next, the manner in which instructions are processed on the pipeline will be explained using FIG. At the IF stage 7, an instruction fetch address is output and an instruction fetch is performed in a minimum of two clocks. Immediately after the instruction is fetched, it is decoded and the operation specified by the instruction is performed through subsequent pipeline processing. D
In stage 2, instruction decoding is completed in two clocks for each minimum instruction unit, and instruction information is sent to A stage 8. The A stage 8 also sends instruction information to the F stage 4 in a process of at least two clocks, and the F stage 4 also sends instructions to the E stage 5 in a process of a minimum of two clocks.

最後にEステージ5で最小2クロック、複雑な命令の場
合さらに多くの時間をかけて演算を実行する。このよう
に1命令の実行は最小でも10クロツクの時間が必要で
ある。
Finally, in the E stage 5, the operation is executed by taking a minimum of two clocks, or even more time in the case of a complicated instruction. In this way, execution of one instruction requires at least 10 clocks.

通常、IFステージ7には命令キャッシュがあり、キャ
ッシュに登録されているアドレスに対して命令フェッチ
をした場合、外部メモリへの2クロツクアクセスに代え
て1クロツクで命令のフェッチを終了する。命令キャッ
シュの効果により命令フェッチが1クロツクで終わるた
め、見かけ上の処理能力は向上する。
Normally, the IF stage 7 has an instruction cache, and when an instruction is fetched to an address registered in the cache, the instruction fetch is completed in one clock instead of two clocks accessing the external memory. Due to the effect of the instruction cache, instruction fetching can be completed in one clock, so the apparent processing power is improved.

[発明が解決しようとする課題] 従来のマイクロプロセッサは上記のように構成され、動
作するため、命令キャッシュに登録されている命令を処
理するために最低でも命令フェッチに1クロツク、命令
デコードに2クロツク必要とする。しかし、さらに高速
化の要求がある。
[Problems to be Solved by the Invention] Conventional microprocessors are configured and operate as described above, and therefore require at least one clock for instruction fetch and two clocks for instruction decoding in order to process instructions registered in the instruction cache. Requires a clock. However, there is a demand for even higher speeds.

この発明は上記のような課題を解決するためになされた
もので、マイクロプロセッサの処理能力を向上させるこ
とを目的とする。
This invention was made to solve the above-mentioned problems, and its purpose is to improve the processing ability of a microprocessor.

[課題を解決するための手段] この発明に係るマイクロプロセッサの命令処理方式は、
命令のデコード結果とその命令のフェッチ先アドレスを
対応付けて記憶する記憶手段を設け、命令フェッチ時に
フェッチ先アドレスを用いて上記記憶手段を参照し、ア
ドレスが一致した場合は当該記憶手段に記憶されたデコ
ード結果を用いて以降の処理を実行するようにしたもの
である。
[Means for Solving the Problems] The instruction processing method of the microprocessor according to the present invention is as follows:
A storage means is provided for storing a decoding result of an instruction and a fetch destination address of the instruction in association with each other, and when an instruction is fetched, the fetch destination address is used to refer to the storage means, and when the addresses match, the memory is stored in the storage means. The subsequent processing is executed using the decoded results obtained.

[作用コ この発明においては、命令フェッチ先アドレスがデコー
ド結果をキャッシングしている記憶手段に登録されてい
れば、最低でも命令フェッチ、デコード処理で3クロツ
ク必要とするところを1クロツクで終Yすることができ
、処理の高速化が図れる。
[Operation: In this invention, if the instruction fetch destination address is registered in the storage means that caches the decoding results, the instruction fetching and decoding processing, which would otherwise require three clocks, can be completed in one clock. This allows for faster processing.

[実施例] 以下、この発明の一実施例を図について説明する。[Example] An embodiment of the present invention will be described below with reference to the drawings.

第1図はこの発明の一実施例におけるマイクロプロセッ
サのパイプライン処理機構を示すブロック図である。図
において、1は命令をフェッチすると同時に後述するデ
コードキャッシュメモリをアクセス(参照)するIFス
テージであり、2は命令をデコードするDステージ、3
は通常はDステージ2の出力を、デコードキャッシュが
ヒツトした時はデコードキャッシュメモリの出力を使用
して、デコードされた命令コード中で指定されたオペラ
ンドの実効アドレスの計算を行うAステージ、4はメモ
リよりオペランドをフェッチするFステージ、5はオペ
ランドに対して命令コード中で指定された演算を実行す
るEステージである。
FIG. 1 is a block diagram showing a pipeline processing mechanism of a microprocessor in an embodiment of the present invention. In the figure, 1 is an IF stage that fetches an instruction and simultaneously accesses (references) a decode cache memory (described later), 2 is a D stage that decodes an instruction, and 3
4 is the A stage that calculates the effective address of the operand specified in the decoded instruction code, usually using the output of D stage 2, and when the decode cache hits, the output of the decode cache memory. F stage 5 fetches an operand from memory, and E stage 5 executes an operation specified in the instruction code on the operand.

さらに6は命令のデコード結果とその命令が格納されて
いる先頭アドレス(フェッチ先アドレス)を対応付けて
記憶するデコードキャッシュメモリ(記憶手段)である
Furthermore, 6 is a decode cache memory (storage means) that stores the decoding result of an instruction and the start address (fetch destination address) where the instruction is stored in association with each other.

次に動作について説明する。Next, the operation will be explained.

IFステージ1はメモリから命令をフェッチしてDステ
ージ2に出力する。Dステージ2は■Fステージ1から
人力された命令コードをデコートして、そのデコード結
果をAステージ3に出力する。これと同時に、デコード
キャッシュメモリ6にデコードした命令の格納されてい
る先頭アドレスとデコード結果が登録される。Aステー
ジ3は命令コード中で指定されたオペランドの実効アド
レスの計算を行い、必要ならばアドレス間接参照を行い
、計算したオペランドアドレスをFステージ4に出力す
る。Fステージ4はAステージ3から入力されたオペラ
ンドアドレスを用いてメモリよりオペランドをフェッチ
する。フェッチしたオペランドはEステージ5に出力さ
れる。Eステージ5はFステージ4から入力されたオペ
ランドに対して命令コード中で指定された演算を実行す
る。さらに必要であれば、その演算結果をメモリにスト
アする。デコードキャッシュメモリ6にはデコード結果
とその命令の先頭アドレス値が登録される。
IF stage 1 fetches instructions from memory and outputs them to D stage 2. The D stage 2 decodes the instruction code input manually from the F stage 1 and outputs the decoding result to the A stage 3. At the same time, the start address where the decoded instruction is stored and the decode result are registered in the decode cache memory 6. The A stage 3 calculates the effective address of the operand specified in the instruction code, performs address indirection if necessary, and outputs the calculated operand address to the F stage 4. F stage 4 uses the operand address input from A stage 3 to fetch an operand from memory. The fetched operand is output to E stage 5. The E stage 5 executes the operation specified in the instruction code on the operand input from the F stage 4. Furthermore, if necessary, the calculation result is stored in memory. The decode result and the start address value of the instruction are registered in the decode cache memory 6.

続いて、第2図、第3図を用いて命令がパイプライン処
理で処理される様子を説明する。IFステージ1では命
令フェッチ先アI’レスを出力して通常は最小2クロッ
クで命令フェッチを行う。
Next, the manner in which instructions are processed by pipeline processing will be explained using FIGS. 2 and 3. In IF stage 1, an instruction fetch destination address is output, and the instruction fetch is normally performed in a minimum of two clocks.

このときデコードキャッシュメモリ6も同時に参照され
、デコードキャッシュメモリ6に登録されている命令が
フェッチ対象であったならば命令フェッチ及び直後の命
令デコードの代わりに、第2図に示すように1クロツク
でデコード結果がデコードキャッシュメモリ6よりAス
テージ3に送られ、パイプライン処理を通じて命令に指
定された演算を行う。デコードキャッシュメモリ6に登
録された内容と命令フェッチを行ったアドレスが異なる
場合は、第3図に示すようにIFステージ1での命令フ
ェッチ後、Dステージ2で命令の最小単位毎に2クロツ
クで命令デコードを終了し、Aステージ3に命令情報を
送る。Aステージ3でも最小2クロックの処理でFステ
ージ4に命令情報を送り、Fステージ4でも最小2クロ
ックの処理でEステージ5に命令を伝える。最後にEス
テージ5で最小2クロック、複雑な命令の場合さらに多
くの時間をかけて演算を実行する。デコートキャッシュ
がミスした場合、第3図に示すように1命令の実行は最
小でも10クロツクの時間が必要であるが、デコードキ
ャッシュがヒツトした場合、第2図に示すように1命令
の実行に必要なりロック数は最小で7クロツクとなる。
At this time, the decode cache memory 6 is also referenced at the same time, and if the instruction registered in the decode cache memory 6 is to be fetched, instead of fetching the instruction and decoding the immediately following instruction, the instruction is fetched in one clock as shown in FIG. The decode result is sent from the decode cache memory 6 to the A stage 3, and the operation specified by the instruction is performed through pipeline processing. If the contents registered in the decode cache memory 6 and the address at which the instruction was fetched are different, as shown in FIG. Instruction decoding is completed and instruction information is sent to A stage 3. The A stage 3 also sends instruction information to the F stage 4 in a minimum of two clocks, and the F stage 4 also sends instructions to the E stage 5 in a minimum of two clocks. Finally, in the E stage 5, the operation is executed by taking a minimum of two clocks, or even more time in the case of a complicated instruction. If the decode cache misses, it will take at least 10 clocks to execute one instruction as shown in Figure 3, but if the decode cache hits, the execution of one instruction will take a minimum of 10 clocks as shown in Figure 2. The minimum number of locks required is 7 clocks.

これは、命令のフェッチ、デコードをデコードキャッシ
ュ参照という形で1クロツクで処理してしまい、Aステ
ージ3.Fステージ4.Eステージ5それぞれの処理に
2クロツクずつ必要なためである。
This results in instruction fetch and decoding being processed in one clock by referring to the decode cache, and A stage 3. F stage 4. This is because two clocks are required for each E stage 5 process.

デコードキャッシュメモリ6はその性質上あまり大きな
容量は期待できない。そのようなとき限られたデコード
キャッシュメモリ6の効果が最大限発揮されるように、
ジャンプやブランチ命令などパイプラインの規則的な動
きを乱すような動作が起こったときに有効となるように
ジャンプやブランチ命令実行直後の命令フェッチだけを
登録するようにする。ジャンプやブランチ命令実行直後
の命令フェッチは必ず命令の先頭アドレスをフェッチす
るため、命令の先頭アドレスが登録されでいるデコード
キャッシュの性質とも良くマツチする。
Due to its nature, the decode cache memory 6 cannot be expected to have a very large capacity. In such a case, in order to maximize the effectiveness of the limited decode cache memory 6,
Only the instruction fetch immediately after execution of a jump or branch instruction is registered so that it becomes effective when an operation that disturbs the regular movement of the pipeline, such as a jump or branch instruction, occurs. Since an instruction fetch immediately after execution of a jump or branch instruction always fetches the start address of the instruction, it matches well with the nature of the decode cache in which the start address of the instruction is registered.

なお、上記実施例では、パイプライン処理機構を有する
マイクロプロセッサに本願を適用したものについて示し
たが、パイプライン処理機構を有さないマイクロプロセ
ッサに適用してもその効果が期待できる。
In the above embodiment, the present invention is applied to a microprocessor having a pipeline processing mechanism, but the effects can be expected even when applied to a microprocessor without a pipeline processing mechanism.

[発明の効果] 以上説明したように、この発明によれば、命令デコード
結果をキャッシングするようにしたことにより、マイク
ロプロセッサの処理の高速化を実現することができる。
[Effects of the Invention] As described above, according to the present invention, by caching the instruction decoding results, it is possible to realize faster processing of the microprocessor.

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

第1図は本発明の一実施例のマイクロプロセッサの内部
パイプラインを示すブロック図、第2図は本発明のマイ
クロプロセッサにおいてデコードキャッシュがヒツトし
た場合の命令処理の概念図、第3図は本発明のマイクロ
プロセッサにおいてデコードキャッシュがミスした場合
の命令処理の概念図、第4図は従来のマイクロプロセッ
サの内部パイプラインを示すブロック図、第5図は従来
のマイクロプロセッサにおける命令処理の概念図である
。 1は命令フェッチ(T F)ステージ、2は命令デコー
ド(D)ステージ、3はオペランドアドレス計算(A)
ステージ、4はオペランドフェッチ(F)ステージ、5
は命令実行(E)ステージ、6はデコードキャッシュメ
モリ(記憶手段)。 なお、図中、同一符号は同一、又は相当部分を示す。
FIG. 1 is a block diagram showing the internal pipeline of a microprocessor according to an embodiment of the present invention, FIG. 2 is a conceptual diagram of instruction processing when the decode cache is hit in the microprocessor according to the present invention, and FIG. FIG. 4 is a block diagram showing the internal pipeline of a conventional microprocessor; FIG. 5 is a conceptual diagram of instruction processing in a conventional microprocessor. be. 1 is the instruction fetch (TF) stage, 2 is the instruction decode (D) stage, and 3 is the operand address calculation (A).
Stage 4 is operand fetch (F) stage 5
6 is an instruction execution (E) stage, and 6 is a decode cache memory (storage means). In addition, in the figures, the same reference numerals indicate the same or equivalent parts.

Claims (1)

【特許請求の範囲】 メモリよりフェッチした命令をデコードし、このデコー
ド結果に基づき命令に指定された処理を実行するマイク
ロプロセッサにおいて、 命令のデコード結果とその命令のフェッチ先アドレスを
対応付けて記憶する記憶手段を設け、命令フェッチ時に
フェッチ先アドレスを用いて上記記憶手段を参照し、ア
ドレスが一致した場合は当該記憶手段に記憶されたデコ
ード結果を用いて以降の処理を実行することを特徴とす
るマイクロプロセッサの命令処理方式。
[Scope of Claims] In a microprocessor that decodes an instruction fetched from a memory and executes processing specified by the instruction based on the decoding result, the decoding result of the instruction and the fetch destination address of the instruction are stored in association with each other. A storage means is provided, and when an instruction is fetched, the fetch destination address is used to refer to the storage means, and when the addresses match, the decoding result stored in the storage means is used to execute subsequent processing. Microprocessor instruction processing method.
JP938890A 1990-01-17 1990-01-17 Instruction processing system for microprocessor Pending JPH03212735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP938890A JPH03212735A (en) 1990-01-17 1990-01-17 Instruction processing system for microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP938890A JPH03212735A (en) 1990-01-17 1990-01-17 Instruction processing system for microprocessor

Publications (1)

Publication Number Publication Date
JPH03212735A true JPH03212735A (en) 1991-09-18

Family

ID=11719063

Family Applications (1)

Application Number Title Priority Date Filing Date
JP938890A Pending JPH03212735A (en) 1990-01-17 1990-01-17 Instruction processing system for microprocessor

Country Status (1)

Country Link
JP (1) JPH03212735A (en)

Similar Documents

Publication Publication Date Title
US5377336A (en) Improved method to prefetch load instruction data
JP3186798B2 (en) Partially decoded instruction cache
US6289445B2 (en) Circuit and method for initiating exception routines using implicit exception checking
JP2504830Y2 (en) Data processing device
GB2321323A (en) Computer programme branch prediction
JP2560889B2 (en) Microprocessor
JP2006520964A (en) Method and apparatus for branch prediction based on branch target
JP2006520964A5 (en)
JP3486690B2 (en) Pipeline processor
US6189093B1 (en) System for initiating exception routine in response to memory access exception by storing exception information and exception bit within architectured register
US20150205613A1 (en) Efficient central processing unit (cpu) return address and instruction cache
EP3905034A1 (en) A code prefetch instruction
US20040172518A1 (en) Information processing unit and information processing method
JPH02287626A (en) Pipeline system branch instruction controller
JPH03129432A (en) Branch control circuit
JP3345787B2 (en) Data processing device
JP2000020311A (en) Information processing device
US5421026A (en) Data processor for processing instruction after conditional branch instruction at high speed
JPH03212735A (en) Instruction processing system for microprocessor
KR100300875B1 (en) How to deal with cache misses
JPH09311787A (en) Data processing device
JP2503223B2 (en) Prior control method
JP2835179B2 (en) Parallel processing computer
KR19990057839A (en) How to deal with cache misses
JPH0462637A (en) Microprocessor