JP2000105698A - Microcomputer - Google Patents
MicrocomputerInfo
- Publication number
- JP2000105698A JP2000105698A JP10276072A JP27607298A JP2000105698A JP 2000105698 A JP2000105698 A JP 2000105698A JP 10276072 A JP10276072 A JP 10276072A JP 27607298 A JP27607298 A JP 27607298A JP 2000105698 A JP2000105698 A JP 2000105698A
- Authority
- JP
- Japan
- Prior art keywords
- hazard
- stage
- register
- instruction
- processing
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 claims abstract description 183
- 238000001514 detection method Methods 0.000 claims description 17
- 238000000034 method Methods 0.000 claims description 15
- 230000004044 response Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 6
- 230000001902 propagating effect Effects 0.000 claims 1
- 238000004904 shortening Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 16
- 230000007704 transition Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 3
- 101000640813 Homo sapiens Sodium-coupled neutral amino acid transporter 2 Proteins 0.000 description 2
- 102100033774 Sodium-coupled neutral amino acid transporter 2 Human genes 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 230000003111 delayed effect Effects 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000002195 synergetic effect Effects 0.000 description 1
Landscapes
- Advance Control (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明はパイプライン処理を
行なうマイクロコンピュータに係わり、特に内部回路を
処理手順に沿って分割し、各々の回路規模を整えパイプ
ラインレジスタで接続することにより、各レジスタに供
給するクロック周波数を高め演算処理を高速化するパイ
プライン制御のマイクロコンピュータに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer for performing pipeline processing, and more particularly to a microcomputer which divides an internal circuit in accordance with a processing procedure, adjusts the circuit scale of each circuit, and connects the registers by using pipeline registers. The present invention relates to a pipeline-controlled microcomputer that increases a clock frequency to be supplied and speeds up arithmetic processing.
【0002】[0002]
【従来の技術】この種の従来のパイプライン処理を行な
うマイクロコンピュータは、一般的に命令の高速演算処
理が可能ではあるが、近年、演算のためにデコードされ
た命令が情報やレジスタ等のハードウェア資源の競合等
により、直ちに演算が実行できない場合等に発生するハ
ザード条件の検出を行い、さらに後続する命令の演算処
理動作の停止およびハザード要因を発生させた命令の演
算動作のキャンセルを行う手段が必要である。2. Description of the Related Art Although a conventional microcomputer for performing this kind of conventional pipeline processing is generally capable of high-speed operation processing of instructions, recently, instructions decoded for the operation are hard-coded such as information and registers. Means for detecting a hazard condition that occurs when an operation cannot be executed immediately due to a competition of wear resources, for example, and for stopping an operation processing operation of a subsequent instruction and canceling an operation of an instruction that caused a hazard factor. is necessary.
【0003】このハザード条件の判定からパイプライン
演算処理の停止およびキャンセル動作を、1ステージ内
で全て完了させることは処理動作が煩雑となるのでデバ
イス上のクリティカルパスとなる。そのため、命令デコ
ードを行うステージ内で動作する論理制御の規模を低減
することが要請されている。Completing the stop and cancel operations of the pipeline arithmetic processing within one stage from the determination of the hazard condition becomes a critical path on the device because the processing operation becomes complicated. Therefore, it is required to reduce the scale of the logic control that operates within the instruction decoding stage.
【0004】この要請に応えるために提案された技術と
しては、例えばその一例が、特開平7−021022号
公報に記載されている。同公報記載の演算処理装置で
は、命令デコードおよびハザード処理実行用のステージ
を2段のパイプラインに分割し、1段目のパイプライン
で命令デコードおよびハザード検出を行い、2段目のパ
イプラインで他のステージに対するハザード処理の制御
動作を行うことが提案されている。[0004] As a technique proposed to meet this demand, for example, one example is described in Japanese Patent Application Laid-Open No. 7-021022. In the arithmetic processing device described in the publication, a stage for instruction decoding and hazard processing execution is divided into a two-stage pipeline, instruction decoding and hazard detection are performed in a first stage pipeline, and a second stage pipeline is used. It has been proposed to perform a control operation of hazard processing for another stage.
【0005】この先行技術に用いられた手法の構成を示
した図8を参照すると、この従来のパイプライン演算処
理装置は、命令フェッチステージ(IF)、レジスタフ
ェッチステージ(RF)、命令実行ステージ(EX)、
データフェッチステージ(DF)、ライトバックステー
ジ(WB)の各ステージを備える5ステージのパイプラ
イン構成である。Referring to FIG. 8 showing the configuration of the technique used in the prior art, this conventional pipeline arithmetic processing device comprises an instruction fetch stage (IF), a register fetch stage (RF), and an instruction execution stage (RF). EX),
This is a five-stage pipeline configuration including a data fetch stage (DF) and a write-back stage (WB).
【0006】命令フェッチステージ(IF)では、IF
Pレジスタ100と、命令メモリ110と、IFPレジ
スタ100の出力を+1する加算器120と、加算器1
20およびIFPレジスタ100の出力信号を入力しプ
ログラムカウンタおよびハザード時の保持ループを構成
する選択器130とを備える。In the instruction fetch stage (IF), the IF
A P register 100, an instruction memory 110, an adder 120 for increasing the output of the IFP register 100 by 1, and an adder 1
20 and a selector 130 which receives an output signal of the IFP register 100 and forms a program counter and a holding loop at the time of hazard.
【0007】レジスタフェッチステージ(RF)は、R
FPレジスタ200と、その出力を入力する処理回路2
10および命令デコーダ220と、命令メモリ110お
よびRFPレジスタ200の出力信号を入力しハザード
時の保持ループを構成する選択器230とを備える。[0007] The register fetch stage (RF)
FP register 200 and processing circuit 2 for inputting its output
10 and an instruction decoder 220, and a selector 230 which receives output signals of the instruction memory 110 and the RFP register 200 and forms a holding loop at the time of hazard.
【0008】命令実行ステージ(EX)は、EXPレジ
スタ300と、EXCレジスタ320と、EXPレジス
タ300の出力をEXCレジスタ320出力に基づき演
算する演算器310とを備える。[0008] The instruction execution stage (EX) includes an EXP register 300, an EXC register 320, and a calculator 310 for calculating the output of the EXP register 300 based on the output of the EXC register 320.
【0009】データフェッチステージ(DF)は、DF
Pレジスタ400と、DFCレジスタ420と、DFC
レジスタ420の出力をDFCレジスタ420出力に基
づき格納するするデータメモリ400とを備える。The data fetch stage (DF) has a DF
P register 400, DFC register 420, DFC
A data memory 400 for storing the output of the register 420 based on the output of the DFC register 420.
【0010】ライトバックステージ(WB)は、WBP
レジスタ500と、WBCレジスタ520と、WBPレ
ジスタ500の出力をWBCレジスタ520出力に基づ
きファイルするレジスタファイル510とを備える。The write back stage (WB) is a WBP
The register 500 includes a register 500, a WBC register 520, and a register file 510 for filing the output of the WBP register 500 based on the output of the WBC register 520.
【0011】上述した構成からなる従来のパイプライン
ステージが時間毎に実行する命令群の遷移図を示した図
9を参照すると、パイプライン動作中の時間t2におい
て、レジスタフェッチステージ(RF)で命令1が処理
回路210で処理されるとともに命令デコーダ200で
もデコードされる。Referring to FIG. 9, which shows a transition diagram of a group of instructions executed by the conventional pipeline stage having the above-described configuration at each time, at time t2 during the pipeline operation, the instruction is executed at the register fetch stage (RF). 1 is processed by the processing circuit 210 and also decoded by the instruction decoder 200.
【0012】デコードされた結果および処理回路210
の命令1は命令実行ステージ(EX)へ進み、時間t3
において命令1はEXPレジスタ300に読み込まれ、
同時に命令デコーダ200のデコード結果もEXCレジ
スタ320に保持される。Decoded result and processing circuit 210
Of the instruction 1 proceeds to the instruction execution stage (EX), and at time t3
In the instruction 1, the instruction 1 is read into the EXP register 300,
At the same time, the decoding result of the instruction decoder 200 is also held in the EXC register 320.
【0013】このEXCレジスタ320の情報により、
EXPレジスタ300の命令1は演算器310で演算処
理によってフラグ操作やメモリ資源の確保等の実行を行
う。According to the information in the EXC register 320,
The instruction 1 of the EXP register 300 is executed by the arithmetic unit 310 to execute a flag operation, memory resource reservation, and the like by arithmetic processing.
【0014】その直後の、同じ時間t3のレジスタフェ
ッチステージ(RF)において後続する命令2によって
分岐命令等が発行された場合、命令2のデコード結果に
よって選択器130は命令3を選択し選択器230は命
令2を選択することにより命令3をIFPレジスタ10
0に確保し、かつレジスタフェッチステージ(RF)内
の命令2もRFPレジスタ200に確保する。Immediately after that, when a branch instruction or the like is issued by the subsequent instruction 2 in the register fetch stage (RF) at the same time t3, the selector 130 selects the instruction 3 according to the decoding result of the instruction 2 and selects the instruction 3 Selects instruction 2 to store instruction 3 in IFP register 10
0, and the instruction 2 in the register fetch stage (RF) is also reserved in the RFP register 200.
【0015】次の時間t4において命令1はデータフェ
ッチステージ(DF)へ進み、命令2はRFPレジスタ
200および選択器230のループにより保持された状
態でEXPレジスタ300およびEXCレジスタ320
に読み込まれるとともに、演算実行され、命令3はIF
Pレジスタ100および選択器130によるループ保持
された状態でパイプラインが停止している。At the next time t4, the instruction 1 proceeds to the data fetch stage (DF), and the instruction 2 is held by the loop of the RFP register 200 and the selector 230 in the EXP register 300 and the EXC register 320.
Is read, and the operation is executed.
The pipeline is stopped with the loop held by the P register 100 and the selector 130.
【0016】次の時刻5において、命令1がライトバッ
クステージ(WB)に進み、命令2は命令実行ステージ
(EX)で演算処理されてデータフェッチステージ(D
F)へ、命令3はレジスタフェッチステージ(RF)へ
それぞれ進み、命令フェッチステージ(IF)には命令
4がフェッチされる。At the next time 5, the instruction 1 proceeds to the write-back stage (WB), the instruction 2 is processed in the instruction execution stage (EX), and the data is fetched (D).
To F), the instruction 3 proceeds to the register fetch stage (RF), and the instruction 4 is fetched to the instruction fetch stage (IF).
【0017】すなわち、この従来のパイプライン構成で
行われている、時間t3のサイクル内での命令フェッチ
ステージ(IF)への保持制御やレジスタフェッチステ
ージ(RF)のREPレジスタの保持制御までの回路動
作を伴なうので、回路動作時間が遅延する。That is, the circuit up to the control of holding the instruction fetch stage (IF) and the holding of the REP register of the register fetch stage (RF) within the cycle of time t3, which are performed in the conventional pipeline configuration. Since the operation is involved, the circuit operation time is delayed.
【0018】この動作を、各命令が時間毎に実行するパ
イプラインステージ群の遷移図を示した図10を参照す
ると、時間t3から時間t4へのサイクルが移る際、レ
ジスタフェッチステージ(RF)の命令2はハザード発
生により、通常状態であれば命令実行ステージ(EX)
に格納すべき情報をレジスタフェッチステージ(RF)
に確保し、後続の命令3はハザードによる実行保留が解
除される時間t5まで命令デコーダ220のデコード結
果信号S220に応答して選択器100で選択される保
持ループを経て命令フェッチステージ(IF)で保持さ
れることで、時間t6での命令3の演算処理は継続が可
能となる。Referring to FIG. 10 showing a transition diagram of a group of pipeline stages in which each instruction executes this operation every time, when the cycle from time t3 to time t4 shifts, the register fetch stage (RF) Instruction 2 is an instruction execution stage (EX) if it is in a normal state due to the occurrence of a hazard.
Information to be stored in the register fetch stage (RF)
And the subsequent instruction 3 passes through the holding loop selected by the selector 100 in response to the decode result signal S220 of the instruction decoder 220 until the time t5 when the execution suspension due to the hazard is released, at the instruction fetch stage (IF). By being held, the arithmetic processing of the instruction 3 at the time t6 can be continued.
【0019】また、時間t4において命令実行ステージ
(EX)のEXPレジスタ300に格納された命令2は
キャンセルされた後、時間t5においてレジスタフェッ
チステージ(RF)のREPレジスタ200に格納され
た命令2の情報を命令実行ステージ(EX)のEXPレ
ジスタ300およびEXCレジスタ320の入力として
選択され演算が実行される。At time t4, the instruction 2 stored in the EXP register 300 of the instruction execution stage (EX) is canceled, and then at time t5, the instruction 2 stored in the REP register 200 of the register fetch stage (RF) is canceled. The information is selected as an input to the EXP register 300 and the EXC register 320 of the instruction execution stage (EX), and the operation is executed.
【0020】命令実行ステージ(EX)以降の演算処理
の手順は各命令とも1サイクル毎に実行が行われてい
く。In the procedure of the arithmetic processing after the instruction execution stage (EX), each instruction is executed every cycle.
【0021】この結果、ハザード要因を発生した命令2
に着目すると、図9において、ハザード処理を要するレ
ジスタフェッチステージ(RF)の命令2は、次の1ク
ロック周期目で命令実行ステージ(EX)での演算処理
を行うため、1クロック周期内で、ハザード判定から命
令の演算処理全てを行っている。As a result, the instruction 2 causing the hazard
In FIG. 9, the instruction 2 of the register fetch stage (RF) requiring the hazard processing performs the arithmetic processing in the instruction execution stage (EX) in the next first clock cycle. All of the instructions are processed from the hazard determination.
【0022】[0022]
【発明が解決しようとする課題】上述したパイプライン
構成を備える従来のマイクロコンピュータは、レジスタ
フェッチステージ(RF)における命令デコードの結果
として、ハザード要因が検出された場合、レジスタフェ
ッチステージ(RF)でのハザード発行の要因となった
命令の保持制御を行なうとともに、ハザード発生の同一
サイクル期間中は命令フェッチステージ(IF)の情報
を保持し、後続する命令のパイプライン演算処理装置へ
の入力を保留する制御動作をハザード発生の同一サイク
ル期間中に完了する必要がある。In a conventional microcomputer having the above-described pipeline configuration, when a hazard factor is detected as a result of instruction decoding in the register fetch stage (RF), the microcomputer is operated in the register fetch stage (RF). Of the instruction that caused the hazard is issued, the information of the instruction fetch stage (IF) is retained during the same cycle of the occurrence of the hazard, and the input of the subsequent instruction to the pipeline arithmetic processing unit is suspended. Must be completed during the same cycle of the hazard occurrence.
【0023】また、命令実行ステージ(EX)に格納さ
れる命令の実行キャンセルの制御も、ハザード発生の同
一サイクル期間中に制御動作を完了する必要がある。Also, in the control of the execution cancellation of the instruction stored in the instruction execution stage (EX), it is necessary to complete the control operation during the same cycle period when the hazard occurs.
【0024】この場合、ハザード発生が無い場合と比較
すると、1クロック周期内に動作する回路規模が大き
く、他のステージを含めて全ての動作の中で、このハザ
ード処理に要する遅延時間が長く、その遅延時間がマイ
クロコンピュータ全体の演算性能を制約するという問題
がある。In this case, as compared with the case where no hazard occurs, the circuit scale operating within one clock cycle is large, and the delay time required for this hazard processing is long in all the operations including the other stages. There is a problem that the delay time limits the operation performance of the entire microcomputer.
【0025】また、このハザード処理の際に動作するレ
ジスタフェッチステージ(RF)の回路を2段のパイプ
ラインにする方法を用いると、1クロック周期内に動作
する回路の遅延は低減すると考えられる。It is considered that the use of a method in which the register fetch stage (RF) circuit that operates during the hazard processing is a two-stage pipeline reduces the delay of the circuit that operates within one clock cycle.
【0026】しかし、命令実行ステージ(EX)に対す
る命令発行が1クロック遅くなるため、命令実行ステー
ジ(EX)から命令フェッチステージ(IF)の動作を
制御する分岐命令の処理に影響を及ぼし、一定時間内に
処理可能な命令数を示すスループットの性能を低下させ
るという問題が発生する。However, the instruction issuance to the instruction execution stage (EX) is delayed by one clock, which affects the processing of the branch instruction controlling the operation of the instruction fetch stage (IF) from the instruction execution stage (EX), and is performed for a certain period of time. A problem arises in that the performance of the throughput indicating the number of instructions that can be processed within the device is reduced.
【0027】さらには、パイプラインステージ数の増大
は、各々のステージを構成するパイプラインレジスタ数
の増加、つまり、レジスタのフェッチ時にハザード判定
を行う制御回路、および2段のパイプラインステージそ
れぞれにパイプラインレジスタを有する必要があるの
で、装置全体の回路規模が大きくなり、その結果、消費
電力が大きくなるという問題も発生する。Furthermore, an increase in the number of pipeline stages is caused by an increase in the number of pipeline registers constituting each stage, that is, a control circuit for performing hazard determination at the time of register fetch, and a pipe to each of the two pipeline stages. Since it is necessary to have a line register, the circuit scale of the entire device increases, and as a result, there is a problem that power consumption increases.
【0028】本発明の目的は、上述した従来の欠点に鑑
みなされたものであり、連続した演算処理に影響を及ぼ
さず、ハザード発生時に必要な遅延時間を短縮し、クロ
ック周期の増大要因を改善することで、よりパイプライ
ン処理の高速化を実現するマイクロコンピュータを提供
することにある。An object of the present invention has been made in view of the above-mentioned drawbacks of the related art, and does not affect continuous arithmetic processing, shortens a delay time necessary when a hazard occurs, and improves an increase factor of a clock cycle. Accordingly, it is an object of the present invention to provide a microcomputer that realizes faster pipeline processing.
【0029】[0029]
【課題を解決するための手段】本発明のマイクロコンピ
ュータの特徴は、命令フェッチステージ(IF)、レジ
スタフェッチステージ(RF)、命令実行ステージ(E
X)、データフェッチステージ(DF)、ライトバック
ステージ(WB)の順で命令の演算処理を行うパイプラ
インステージの入力側あるいは出力側あるいはパイプラ
インステージ間に少なくとも一つのパイプラインステー
ジの入出力情報を一時保管する保持手段を備えるパイプ
ラインの基本構成に基づき、各々の前記パイプラインス
テージ毎に所望の命令処理を他のステージと並列に実行
するパイプライン制御のマイクロコンピュータにおい
て、デコードされた命令の演算が実行できない時に発生
するハザードの要因を検出した際に、前記パイプライン
の一部として動作するハザード処理ステージ(HE)
を、前記レジスタフェッチステージ(RF)と前記命令
実行ステージ(EX)との間に設けることにある。The microcomputer of the present invention is characterized by an instruction fetch stage (IF), a register fetch stage (RF), and an instruction execution stage (E).
X), data fetch stage (DF), write-back stage (WB), input / output information of at least one pipeline stage on the input side or output side of the pipeline stage for performing instruction arithmetic processing, or between pipeline stages Based on a basic configuration of a pipeline having a holding unit for temporarily storing, a pipeline-controlled microcomputer that executes desired instruction processing for each of the pipeline stages in parallel with the other stages. A hazard processing stage (HE) that operates as a part of the pipeline when detecting a factor of a hazard that occurs when an operation cannot be executed.
Is provided between the register fetch stage (RF) and the instruction execution stage (EX).
【0030】また、前記命令フェッチステージ(IF)
においてメモリ装置から命令をフェッチする命令フェッ
チ手段と、前記レジスタフェッチステージ(RF)にお
いて前記フェッチされた命令をデコードする命令デコー
ド手段および前記命令が要求するデータに提供されるレ
ジスタのフェッチ手段と、前記命令実行ステージ(E
X)において前記デコードされた命令を実行する命令実
行手段と、前記データフェッチテージ(DF)において
前記命令実行ステージ(EX)で演算されたアドレスに
対し前記メモリ装置にデータのリードまたはライトを行
うデータフェッチ手段と、前記ライトバックステージ
(WB)において前記データフェッチステージ(DF)
で前記メモリ装置から得られるオペランドデータまたは
前記命令実行ステージ(EX)において処理されたオペ
ランドデータをレジスタに書き込むライトバック手段
と、前記ハザード処理ステージ(HE)において前記レ
ジスタフェッチステージ(RF)の前記レジスタフェッ
チ手段が出力する情報を、次のステージに出力するかあ
るいは前の状態を保持するかを選択するハザード処理手
段と、を併せて備えることもできる。The instruction fetch stage (IF)
Instruction fetch means for fetching an instruction from a memory device, instruction decode means for decoding the fetched instruction in the register fetch stage (RF), and fetch means for a register provided for data requested by the instruction; Instruction execution stage (E
X) an instruction executing means for executing the decoded instruction, and data for reading or writing data from / to the memory device at an address calculated in the instruction execution stage (EX) in the data fetch stage (DF). Fetch means, and said data fetch stage (DF) in said write back stage (WB)
Write-back means for writing operand data obtained from the memory device or operand data processed in the instruction execution stage (EX) to a register, and the register of the register fetch stage (RF) in the hazard processing stage (HE) Hazard processing means for selecting whether to output the information output by the fetch means to the next stage or to retain the previous state can also be provided.
【0031】さらに、前記レジスタフェッチステージ
(RF)においてデコードされた命令と、前記命令実行
ステージ(EX)で先行して演算処理されている命令と
の組み合わせ、あるいは装置の資源確保等による動作条
件の判定を行い、前記レジスタフェッチステージ(R
F)でデコードされた命令の正常処理を動作保証できな
いと判断した場合に、ハザードとしてパイプライン演算
処理の制御をクロック1サイクルあるいはそれ以上の期
間の動作状態の保持要求を発生するハザード検出器を前
記レジスタフェッチステージ内部に有してもよい。Further, a combination of an instruction decoded in the register fetch stage (RF) and an instruction previously processed in the instruction execution stage (EX), or an operating condition such as a device resource reservation. A determination is made and the register fetch stage (R
If it is determined that the normal processing of the instruction decoded in F) cannot be guaranteed, the hazard detector that generates a request to maintain the operation state for one clock cycle or more is controlled as a hazard by controlling the pipeline arithmetic processing. It may be provided inside the register fetch stage.
【0032】さらにまた、前記ハザード処理ステージ
(HE)は、前記レジスタフェッチステージ(RF)の
情報を保持するとともにこの保持情報または前記情報の
いずれかを選択的に転送する選択転送手段を有してもよ
い。Further, the hazard processing stage (HE) has selection transfer means for holding the information of the register fetch stage (RF) and selectively transferring either the held information or the information. Is also good.
【0033】また、前記選択転送手段は、前記ハザード
が発生しないとき、前記ハザード検出器で生成されたハ
ザード信号の非活性状態に応答して、前記レジスタフェ
ッチステージ(RF)の命令デコーダが出力する信号で
あって前記命令フェッチステージ(IF)および前記レ
ジスタフェッチステージ(RF)におけるパイプライン
動作保持要求用の第1の制御信号およびその信号を記憶
する第1のハザードレジスタの出力のうち第1の制御信
号を選択して転送する第1の選択器と、前記命令デコー
ダが出力する信号であって前記命令実行ステージ(E
X)におけるパイプライン動作保持要求用の第2の制御
信号およびその信号を記憶する第2のハザードレジスタ
の出力のうち前記第2の制御信号を選択して転送する第
2の選択器と、前記レジスタフェッチステージ(RF)
のデータ処理回路が出力する信号であって前記命令実行
ステージ(EX)のパイプラインレジスタへ渡すデータ
信号およびその信号を記憶する第3のハザードレジスタ
の出力のうち前記データ信号を選択して転送する第3の
選択器とをそれぞれ前記ハザード処理ステージ(HE)
内部に有してもよい。When the hazard does not occur, the selective transfer means outputs an instruction decoder of the register fetch stage (RF) in response to an inactive state of a hazard signal generated by the hazard detector. A first control signal for a pipeline operation holding request in the instruction fetch stage (IF) and the register fetch stage (RF) and an output of a first hazard register storing the signal; A first selector for selecting and transmitting a control signal; and a signal output by the instruction decoder, the signal being output from the instruction execution stage (E).
X) a second selector for selecting and transferring the second control signal from the second control signal for the pipeline operation holding request in X) and the output of the second hazard register storing the signal; Register fetch stage (RF)
And selecting and transferring the data signal among the signals output from the data processing circuit of the third embodiment, the data signal being passed to the pipeline register of the instruction execution stage (EX) and the output of the third hazard register storing the signal. A third selector for each of the hazard processing stages (HE)
You may have inside.
【0034】さらに、前記選択転送手段は、前記ハザー
ドが発生するとき、前記ハザード検出器で生成されたハ
ザード信号の非活性状態に応答して、前記レジスタフェ
ッチステージ(RF)の命令デコーダが出力する信号で
あって前記命令フェッチステージ(IF)およびレジス
タフェッチステージ(RF)のパイプライン動作制御信
号として、前記ハザードが解除されるまでハザード発生
時点の情報を保持するステージ制御用の第1のハザード
処理レジスタの出力信号を選択して伝播する第1の選択
器と、前記命令デコーダが出力する信号であって前記命
令実行ステージ(EX)のパイプライン動作制御信号と
して、前記ハザードが解除されるまでハザード発生時点
の情報を保持するステージ制御用の第2のハザード処理
レジスタの出力信号を選択して伝播する第2の選択器
と、前記レジスタフェッチステージ(RF)のデータ処
理回路が出力する信号であって前記命令実行ステージ
(EX)のパイプラインレジスタに渡すデータ信号とし
て、前記ハザードが解除されるまでハザード発生時点の
情報を保持するデータ保持用の第3のハザード処理レジ
スタの出力信号を選択して伝播する第3の選択器とを備
えることができる。Further, the selective transfer means outputs, when the hazard occurs, an instruction decoder of the register fetch stage (RF) in response to an inactive state of the hazard signal generated by the hazard detector. A first hazard process for a stage control, which is a signal and holds information on a time point when a hazard occurs until the hazard is eliminated as a pipeline operation control signal for the instruction fetch stage (IF) and the register fetch stage (RF). A first selector that selects and propagates an output signal of a register; and a signal output by the instruction decoder, which is a pipeline operation control signal of the instruction execution stage (EX), until the hazard is released. The output signal of the second hazard processing register for controlling the stage that holds the information at the time of occurrence And a second selector for selecting and transmitting the hazard signal as a data signal output from a data processing circuit of the register fetch stage (RF) and passed to a pipeline register of the instruction execution stage (EX). And a third selector that selects and propagates an output signal of a third hazard processing register for retaining data that retains information at the time of occurrence of the hazard until is released.
【0035】さらにまた、前記ハザード信号の活性状態
により、前記ハザード処理ステージ(HE)内の前記第
1のハザード処理レジスタ、前記第2のハザード処理レ
ジスタおよび前記第3のハザード処理レジスタにそれぞ
れ保持された情報をハザード検出後に選択することによ
りパイプラインステージ段数を可変してもよい。Further, the first hazard processing register, the second hazard processing register, and the third hazard processing register in the hazard processing stage (HE) respectively hold the signals depending on the activation state of the hazard signal. The number of pipeline stages may be varied by selecting the information after the hazard detection.
【0036】また、前記レジスタフェッチステージ(R
F)に格納されている命令は、次のクロックサイクルに
ハザード処理ステージ(HE)および前記命令実行ステ
ージ(EX)に重複して格納され、前記ハザードが検出
されていない時はハザード処理ステージ(HE)の前記
第1,前記第2および前記第3の選択器はいずれもレジ
スタフェッチステージ(RF)側の情報を選択し、ハザ
ード処理ステージ(HE)に格納された情報を無効とす
ることもできる。The register fetch stage (R
The instruction stored in F) is redundantly stored in the hazard processing stage (HE) and the instruction execution stage (EX) in the next clock cycle. When the hazard is not detected, the hazard processing stage (HE) is executed. ), The first, second and third selectors can all select information on the register fetch stage (RF) side and invalidate the information stored in the hazard processing stage (HE). .
【0037】さらに、前記ハザード検出器は、前記ハザ
ード検出ステージ(HE)をハザード状態が解除される
までの任意のクロックサイクル数だけ保持状態にするこ
ともできる。Further, the hazard detector can keep the hazard detection stage (HE) for an arbitrary number of clock cycles until the hazard state is released.
【0038】さらにまた、前記ハザード検出器を、前記
レジスタフェッチステージ(RF)に設けることもでき
る。Further, the hazard detector can be provided in the register fetch stage (RF).
【0039】また、前記命令実行ステージ(EX)のパ
イプラインレジスタに格納する情報をレジスタフェッチ
ステージ(RF)における演算処理結果によって選択す
る場合、前記ハザード発生後に前記命令実行ステージ
(EX)が前記ハザード処理ステージ(HE)の命令を
転送する手段として、前記ハザード処理ステージ(H
E)内に前記レジスタフェッチステージ(RF)のレジ
スタファイルからなる処理回路の出力する2系統の情報
の一方を選択する第1の選択器と、前記処理回路による
制御信号と、前記制御信号を格納するレジスタと、前記
制御信号および前記レジスタの出力をハザード信号によ
り選択して前記第1の選択器の制御信号を出力する第2
の選択器をさらに備え、前記第1の選択器の出力を前記
ハザード処理ステージ(HE)の前記第3の選択器の入
力とすることもできる。In the case where information to be stored in the pipeline register of the instruction execution stage (EX) is selected according to the result of the arithmetic processing in the register fetch stage (RF), after the occurrence of the hazard, the instruction execution stage (EX) executes the hazard execution. As means for transferring instructions of the processing stage (HE), the hazard processing stage (H)
E) a first selector for selecting one of two types of information output from a processing circuit including a register file of the register fetch stage (RF), a control signal from the processing circuit, and storing the control signal. And a second selector for selecting the control signal and the output of the register by a hazard signal and outputting a control signal of the first selector.
And the output of the first selector may be used as the input of the third selector of the hazard processing stage (HE).
【0040】さらに、前記ハザードの発生要因となる命
令がデコードされた時点でハザード発生を予測し、前記
ハザード処理ステージ(HE)の動作設定を行う予測手
段として、前記レジスタフェッチステージ(RF)の前
記ハザード検出器において前記ハザードの発生要因とな
る命令がデコードされた場合に、次の命令デコードによ
り前記ハザードの発生の有無によらずハザード予測を行
い、次のクロックサイクルで前記ハザード処理ステージ
(HE)の前記第1、前記第2および前記第3のレジス
タに前記情報の保持要求を行う予測制御信号を前記ハザ
ード検出器がさらに有することもできる。Further, when the instruction which causes the hazard is decoded, the occurrence of the hazard is predicted, and the operation of the hazard processing stage (HE) is set as the prediction means. When an instruction that causes the hazard is decoded by the hazard detector, a hazard prediction is performed by the next instruction decode regardless of the presence or absence of the hazard, and the hazard processing stage (HE) is performed in the next clock cycle. The hazard detector may further include a prediction control signal for requesting the first, second, and third registers to hold the information.
【0041】さらにまた、前記ハザードの発生が無かっ
た場合、次の前記ハザードの発生要因となる命令がデコ
ードされてハザード予測が発生するまで前記ハザード処
理ステージ(HE)の動作を停止させてパイプライン動
作が必要なときのみ選択的に前記ハザード処理を動作さ
せることもできる。Further, when the hazard does not occur, the operation of the hazard processing stage (HE) is stopped by stopping the operation of the hazard processing stage (HE) until the next instruction causing the hazard is decoded and a hazard prediction occurs. The hazard processing can be selectively operated only when an operation is necessary.
【0042】[0042]
【発明の実施の形態】まず本発明の概要を説明すると、
本発明によるマイクロコンピュータは、複数のパイプラ
インステージを有して情報の処理を行なうマイクロコン
ピュータにおいて各々のパイプラインステージ毎に命令
処理を並列に実行し、パイプラインに格納されたレジス
タフェッチステージと命令実行ステージ間の部分に、ハ
ザード処理ステージを設けたものである。DESCRIPTION OF THE PREFERRED EMBODIMENTS First, the outline of the present invention will be described.
A microcomputer according to the present invention executes instruction processing in parallel for each pipeline stage in a microcomputer having a plurality of pipeline stages and processing information, and executes a register fetch stage and an instruction stored in a pipeline. A hazard processing stage is provided between the execution stages.
【0043】後述する図1に示した本発明によるマイク
ロコンピュータの構成からも明らかなように、レジスタ
フェッチステージ(RF)の情報を命令実行ステージ
(EX)に転送するという従来の構成に対し、本発明は
レジスタフェッチステージ(RF)の情報を保持するこ
とが出来、かつ、情報の転送および保持の選択を行う選
択器をハザード処理ステージ(HE)内に設けている。As will be apparent from the configuration of the microcomputer according to the present invention shown in FIG. 1 to be described later, the present invention is different from the conventional configuration in which the information of the register fetch stage (RF) is transferred to the instruction execution stage (EX). According to the present invention, a selector capable of holding information of the register fetch stage (RF) and selecting the transfer and holding of information is provided in the hazard processing stage (HE).
【0044】このハザード検出ステージ(HE)は、ハ
ザードが発生しない場合にはレジスタフェッチステージ
(RF)に格納された命令や情報等を、次のサイクルで
命令実行ステージ(EX)へと転送する一方、マルチサ
イクル命令の場合は次の命令をパイプラインに取り込ま
ないように、命令フェッチステージ(IF)を含め命令
の保持処理を実行する。The hazard detection stage (HE) transfers instructions and information stored in the register fetch stage (RF) to the instruction execution stage (EX) in the next cycle when the hazard does not occur. In the case of a multi-cycle instruction, instruction holding processing including an instruction fetch stage (IF) is executed so that the next instruction is not taken into the pipeline.
【0045】ハザードが発生する場合には、ハザード要
因判定とレジスタフェッチステージ(RF)でのハザー
ド動作、および命令実行ステージ(EX)に情報が転送
されるのに対しそれを無効にするキャンセル動作で1サ
イクルを完了する。When a hazard occurs, the hazard is determined by a hazard operation at the register fetch stage (RF) and a cancel operation for invalidating the information transferred to the instruction execution stage (EX). Complete one cycle.
【0046】次のサイクルで、命令フェッチステージ
(IF)におけるハザード動作、分岐命令などの条件判
定を実行する。In the next cycle, conditions such as a hazard operation and a branch instruction in the instruction fetch stage (IF) are determined.
【0047】マルチサイクル命令実行時およびハザード
発生時には、命令実行ステージ(EX)の入力に位置す
るハザード検出ステージ(HE)に命令および情報を保
持するハザード処理レジスタによって、実行ステージに
保持すべき情報をハザード処理レジスタから供給するこ
とにより、マルチサイクル命令が実行可能になる。At the time of execution of a multi-cycle instruction and occurrence of a hazard, information to be held in the execution stage is stored in a hazard detection register (HE) located at the input of the instruction execution stage (EX). By supplying from the hazard processing register, a multi-cycle instruction can be executed.
【0048】従って、1サイクル期間内に、レジスタフ
ェッチステージ(IF)において判定されたハザードの
発生から命令フェッチステージ(IF)および命令実行
ステージ(EX)における情報保持の制御を、クロック
が2サイクルの期間に亘り処理することが可能になる。
これは、一定のクロック周期で動作させる場合、ネック
になる回路の処理時間がそのクロック周期以上かかると
誤動作の原因になり、その回路を含めて正常な動作をさ
せる上で有利である。したがって、1サイクルの期間で
処理する構成に対してクロック周期を長く必要とする要
因を改善することが可能となり、マイクロコンピュータ
のパイプライン処理を高速化できるという発明である。Therefore, within one cycle period, the control of information holding in the instruction fetch stage (IF) and the instruction execution stage (EX) is controlled by the occurrence of the hazard determined in the register fetch stage (IF). Processing can be performed over a period.
This is advantageous in that, when operating at a constant clock cycle, if the processing time of a circuit that becomes a bottle takes longer than the clock cycle, it causes malfunction and normal operation including that circuit is performed. Therefore, it is possible to improve a factor that requires a longer clock cycle in a configuration in which processing is performed in one cycle period, and it is an invention that the pipeline processing of the microcomputer can be speeded up.
【0049】次に、本発明の実施の形態を図面を参照し
ながらさらに詳細に説明する。図1は本発明のマイクロ
コンピュータにおける第1の実施形態を示すパイプライ
ン主要部の構成図である。図1を参照すると、本発明の
マイクロコンピュータは、命令フェッチステージ(I
F)、レジスタフェッチステージ(RF)、ハザード処
理ステージ(HE)、命令実行ステージ(EX)、デー
タフェッチステージ(DF)、およびライトバックステ
ージ(WB)を備える6ステージのパイプライン構成を
有する。Next, embodiments of the present invention will be described in more detail with reference to the drawings. FIG. 1 is a configuration diagram of a main part of a pipeline showing a microcomputer according to a first embodiment of the present invention. Referring to FIG. 1, the microcomputer of the present invention includes an instruction fetch stage (I
F), a pipeline fetch stage (RF), a hazard processing stage (HE), an instruction execution stage (EX), a data fetch stage (DF), and a write back stage (WB).
【0050】命令フェッチステージ(IF)では命令フ
ェッチ処理を行ない、命令デコードや分岐処理はレジス
タフェッチステージ(RF)で行なうものとする。In the instruction fetch stage (IF), instruction fetch processing is performed, and instruction decoding and branch processing are performed in the register fetch stage (RF).
【0051】図1において、命令フェッチステージ(I
F)では、パイプラインレジスタ101(以下、IFP
レジスタ101と称す)と、命令メモリ111と、この
命令メモリ111のアドレスを1サイクル毎に1ずつ加
算し、IFPレジスタ101とのループを可能にするこ
とによりプログラムカウンタを構成する加算器121
と、IFPレジスタ101および加算器121の出力信
号を入力する選択器131とを備える。In FIG. 1, an instruction fetch stage (I
F), the pipeline register 101 (hereinafter, IFP)
Register 101), an instruction memory 111, and an adder 121 which adds one address to the instruction memory 111 every cycle to enable a loop with the IFP register 101 to form a program counter.
And a selector 131 for inputting an output signal of the IFP register 101 and the adder 121.
【0052】レジスタフェッチステージ(RF)は、選
択器231と、パイプラインレジスタ201(以下、R
FPレジスタ201と称す)と、処理回路(レジスタフ
ァイル)211と、命令デコーダ221と、デコードさ
れた信号とパイプラインで実行中の演算の条件からハザ
ード発生を判定するハザード検出器241ととを備え
る。このハザード検出器はあるクロックサイクルでハザ
ードを検出し、次のクロックサイクルでハザード信号を
出力するものとする。The register fetch stage (RF) includes a selector 231 and a pipeline register 201 (hereinafter referred to as R).
An FP register 201), a processing circuit (register file) 211, an instruction decoder 221, and a hazard detector 241 that determines the occurrence of a hazard from the decoded signal and the condition of the operation being executed in the pipeline. . It is assumed that this hazard detector detects a hazard in a certain clock cycle and outputs a hazard signal in the next clock cycle.
【0053】さらに、レジスタフェッチステージ(R
F)の次段に本発明で新たに設けたハザード処理ステー
ジ(HE)を有している。Further, a register fetch stage (R
A hazard processing stage (HE) newly provided in the present invention is provided next to F).
【0054】このハザード処理ステージ(HE)は、パ
イプラインレジスタ601(以下、HOPレジスタ60
1と称す)、パイプラインレジスタ621(以下、HE
Cレジスタ621と称す)、パイプラインレジスタ63
1(以下、HRCレジスタ631と称す)と、選択器6
11、641、651とを備え、選択信号の切り換えに
より、HOPレジスタ601、HECレジスタ621、
HRCレジスタ631の格納情報の選択ができる。The hazard processing stage (HE) includes a pipeline register 601 (hereinafter referred to as a HOP register 60).
1), a pipeline register 621 (hereinafter referred to as HE).
C register 621), pipeline register 63
1 (hereinafter referred to as an HRC register 631) and a selector 6
11, 641, 651, and the HOP register 601, the HEC register 621,
The information stored in the HRC register 631 can be selected.
【0055】命令実行ステージ(EX)は、パイプライ
ンレジスタ301(以下、EXPレジスタ301と称
す),パイプラインレジスタ321(以下、EXCレジ
スタ321と称す)と、演算器311とを備え、EXC
レジスタタ321からの制御により、EXPレジスタ3
01の情報を用いて演算器311が命令の演算処理を行
なう。The instruction execution stage (EX) includes a pipeline register 301 (hereinafter referred to as an EXP register 301), a pipeline register 321 (hereinafter referred to as an EXC register 321), and a computing unit 311.
The EXP register 3 is controlled by the register 321.
Using the information of 01, the arithmetic unit 311 performs the arithmetic processing of the instruction.
【0056】データフェッチステージ(DF)は、パイ
プラインレジスタ401(以下、DFPレジスタ401
と称す),パイプラインレジスタ421(以下、DFC
レジスタ421と称す)と、データメモリ411とを備
え、DFCレジスタ421からの制御により、DFPレ
ジスタ401の情報をデータメモリ411に記憶する。The data fetch stage (DF) includes a pipeline register 401 (hereinafter, referred to as a DFP register 401).
), Pipeline register 421 (hereinafter referred to as DFC).
A register 421) and a data memory 411, and the information of the DFP register 401 is stored in the data memory 411 under the control of the DFC register 421.
【0057】ライトバックステージ(WB)は、パイプ
ラインレジスタ501(以下、WBPレジスタ501と
称す),パイプラインレジスタ521(以下、WBCレ
ジスタ521と称す)と、レジスタファイル511とを
備え、WBCレジスタ521からの制御により、WBP
レジスタ501の情報をレジスタファイル511に記憶
する。The write back stage (WB) includes a pipeline register 501 (hereinafter, referred to as a WBP register 501), a pipeline register 521 (hereinafter, referred to as a WBC register 521), and a register file 511, and a WBC register 521. Control from WBP
The information of the register 501 is stored in the register file 511.
【0058】上述した構成からなるマイクロコンピュー
タのパイプライン制御における動作を説明する。The operation of the microcomputer having the above configuration in the pipeline control will be described.
【0059】再び図1を参照しながら、まず、ハザード
発生が検出されない場合について説明する。なお、以下
の説明では、信号線に付された符号(例えば命令デコー
ダ221の出力線に付されたS221)を信号名とす
る。従来のパイプラインおける演算処理と同様に、命令
フェッチステージ(IF)でIFPレジスタ101にフ
ェッチされた命令は命令メモリ111に格納された後、
次のサイクルで選択器231を介してレジスタフェッチ
ステージ(RF)のRFPレジスタ201に格納され
る。Referring to FIG. 1 again, the case where no hazard is detected will be described. In the following description, a code assigned to a signal line (for example, S221 assigned to an output line of the instruction decoder 221) is used as a signal name. Similarly to the arithmetic processing in the conventional pipeline, the instruction fetched into the IFP register 101 in the instruction fetch stage (IF) is stored in the instruction memory 111,
In the next cycle, the data is stored in the RFP register 201 of the register fetch stage (RF) via the selector 231.
【0060】レジスタフェッチステージ(RF)の命令
デコーダ221により、RFPレジスタ201に格納さ
れた命令S201がデコードされ、そのデコード結果S
221を基にハザード検出器241によりハザードの有
り、無しを判定する。The instruction S201 stored in the RFP register 201 is decoded by the instruction decoder 221 in the register fetch stage (RF), and the decoding result S
The presence / absence of a hazard is determined by the hazard detector 241 based on the H.221.
【0061】判定の結果、ハザードの発生が検出され
ず、マルチサイクルによる命令保持の要求等も発生しな
かった場合、その検出結果のハザード検出信号S241
が非活性化され、この信号S241に応答してハザード
処理ステージ(HE)の選択器611、641、651
は、レジスタフェッチステージ(RF)から転送される
情報S211、S221、S221をそれぞれ選択す
る。As a result of the determination, when the occurrence of a hazard is not detected and no request for holding an instruction in a multi-cycle is generated, the hazard detection signal S241 of the detection result is obtained.
Is deactivated, and the selectors 611, 641, 651 of the hazard processing stage (HE) are responded to this signal S241.
Selects information S211, S221, and S221 transferred from the register fetch stage (RF), respectively.
【0062】この選択により、レジスタフェッチステー
ジ(RF)のパイプラインは、次のサイクルで情報S2
11、S221をハザード処理ステージ(HE)のHO
Pレジスタ601、HECレジスタ621、HRCレジ
スタ631に格納すると同時に、選択器611、641
で選択された情報S211,S221を命令実行ステー
ジ(EX)のEXPレジスタ301、EXCレジスタ3
21にも格納する。According to this selection, the pipeline of the register fetch stage (RF) sets the information S2 in the next cycle.
11, S221 is HO of hazard processing stage (HE)
At the same time as storing in the P register 601, the HEC register 621, and the HRC register 631, the selectors 611 and 641
The information S211 and S221 selected in step 3 are stored in the EXP register 301 and the EXC register 3 of the instruction execution stage (EX).
21 is also stored.
【0063】従って、レジスタフェッチステージ(R
F)に格納されている命令は、次のサイクルにハザード
処理ステージ(HE)、および命令実行ステージ(E
X)に二重化して格納されることになる。Therefore, the register fetch stage (R
The instruction stored in the instruction processing stage (E) is stored in the hazard processing stage (HE) and the instruction execution stage (E) in the next cycle.
X) is stored in duplicate.
【0064】しかし、ハザードが判定されていない条件
では、ハザード処理ステージ(HE)の選択器611、
641、651はいずれもレジスタフェッチステージ
(RF)側の情報S211、S221、S221を入力
として選択するので、ハザード処理ステージ(HE)の
HOPレジスタ601、HECレジスタ621、HRC
レジスタ631に格納された情報は無効となる。However, under the condition that the hazard is not determined, the selector 611 of the hazard processing stage (HE),
641 and 651 select the information S211, S221, and S221 on the register fetch stage (RF) side as inputs, so that the HOP register 601, HEC register 621, and HRC of the hazard processing stage (HE) are selected.
The information stored in the register 631 becomes invalid.
【0065】命令実行ステージ(EX)に格納された情
報は、命令に沿って制御され、演算処理された情報は、
必要に応じて次のサイクル以降、データフェッチステー
ジ(DF)、ライトバックステージ(WB)へと処理が
伝達されることになる。The information stored in the instruction execution stage (EX) is controlled according to the instruction, and the information subjected to the arithmetic processing is
The processing is transmitted to the data fetch stage (DF) and the write back stage (WB) after the next cycle as necessary.
【0066】その結果、ハザード発生が検出されない場
合は、従来の回路と同様のサイクルでパイプライン中の
演算処理が実行される。As a result, when the occurrence of a hazard is not detected, the arithmetic processing in the pipeline is executed in the same cycle as in the conventional circuit.
【0067】次に、ハザード発生が検出された場合の動
作について説明する。ハザード発生が検出された場合の
パイプライン動作であって、各パイプラインステージが
時間毎に実行する命令群の遷移図を示した図2を参照す
ると、パイプライン動作中の時間t2において、レジス
タフェッチステージ(RF)で命令1がデコードされ
る。デコードされた命令1が、選択器611,641で
選択されて命令実行ステージ(EX)へ進み、時間t3
に命令実行ステージ(EX)の演算処理によってフラグ
操作やメモリ資源の確保等の実行が行なわれる。Next, the operation when the occurrence of a hazard is detected will be described. Referring to FIG. 2 showing a transition diagram of a group of instructions executed by each pipeline stage at each time when the occurrence of a hazard is detected, the register fetch is performed at time t2 during the pipeline operation. Instruction 1 is decoded at the stage (RF). The decoded instruction 1 is selected by the selectors 611 and 641 and proceeds to the instruction execution stage (EX) at time t3
At the same time, execution of a flag operation, securing of memory resources, and the like are performed by the arithmetic processing of the instruction execution stage (EX).
【0068】その直後に、同じ時間t3のレジスタフェ
ッチステージ(RF)において後続する命令2によって
分岐命令等が発行された場合、次の時間t4でハザード
検出信号S241が出力され、この信号により命令2を
HOPレジスタ601,HECレジスタ621,HRC
レジスタ631に確保し、同時に命令2はEXPレジス
タ301,EXCレジスタ321へ確保される。Immediately after that, when a branch instruction or the like is issued by the subsequent instruction 2 in the register fetch stage (RF) at the same time t3, a hazard detection signal S241 is output at the next time t4, and the instruction 2 To HOP register 601, HEC register 621, HRC
The instruction 2 is secured in the register 631, and at the same time, the instruction 2 is secured in the EXP register 301 and the EXC register 321.
【0069】一方、ハザード検出信号S241に応答し
て選択器131およびIFPレジスタ101の保持ルー
プと選択器231およびRFPレジスタ201の保持ル
ープとでそれぞれ命令4および命令3がそれぞれIFP
レジスタ101およびRFPレジスタ201に保持さ
れ、IFPレジスタ101には命令4が、RFPレジス
タ201には命令3が保持されてパイプラインが停止す
る。On the other hand, in response to the hazard detection signal S241, the instruction 4 and the instruction 3 are executed by the selector 131 and the holding loop of the IFP register 101 and the holding loop of the selector 231 and the RFP register 201, respectively.
The instruction 4 is held in the register 101 and the RFP register 201, the instruction 4 is held in the IFP register 101, and the instruction 3 is held in the RFP register 201, and the pipeline stops.
【0070】時間t5において、HOPレジスタ601
およびHECレジスタ621に前の時間で確保された命
令2が選択器611,641を介してEXPレジスタお
よびEXCレジスタ321の命令2をキャンセルして書
き換えるとともに、RFPレジスタ201に保持された
命令3をHOPレジスタ601に、命令3のデコード結
果をHECレジスタ621,HRCレジスタ631にそ
れぞれ確保する。At time t5, HOP register 601
And the instruction 2 secured in the HEC register 621 at the previous time cancels and rewrites the instruction 2 in the EXP register and the EXC register 321 via the selectors 611 and 641, and also replaces the instruction 3 held in the RFP register 201 with the HOP. The decoding result of the instruction 3 is secured in the register 601 and the HEC register 621 and the HRC register 631, respectively.
【0071】時間t4に命令デコーダ221でデコード
された命令3には分岐命令等が含まれていないので時間
t5でパイプライン停止のハザード検出信号S241が
非アクティブとなるので、時間t6においてIFPレジ
スタ101には命令5が、RFPレジスタ201には命
令4がそれぞれ確保される。同時に、時間t5でRFP
レジスタ201に保持されていた命令3は時間t6でH
OPレジスタ601およびEXPレジスタ301に確保
されるとともに、命令デコーダ221の命令3出力もH
ECレジスタ621およびEXCレジスタ321にそれ
ぞれ確保され、EXCレジスタ321からの制御により
EXPレジスタ301の情報を用いて演算器311が演
算を実行する。Since the instruction 3 decoded by the instruction decoder 221 at time t4 does not include a branch instruction or the like, the pipeline stop hazard detection signal S241 becomes inactive at time t5, so the IFP register 101 at time t6. And the instruction 4 are secured in the RFP register 201, respectively. At the same time, RFP at time t5
The instruction 3 held in the register 201 becomes H at time t6.
The OP register 601 and the EXP register 301 are secured, and the instruction 3 output of the instruction decoder 221 is also H
The arithmetic unit 311 is secured in the EC register 621 and the EXC register 321, and the arithmetic unit 311 executes an arithmetic operation using the information in the EXP register 301 under the control of the EXC register 321.
【0072】上述したように、レジスタフェッチステー
ジ(RF)でのハザード動作および時間t4で命令実行
ステージ(EX)に格納される命令2の情報に対しての
キャンセル処理を同一サイクル内に実行して1サイクル
期間内の動作を終了する。As described above, the hazard operation in the register fetch stage (RF) and the cancellation process for the information of the instruction 2 stored in the instruction execution stage (EX) at the time t4 are executed in the same cycle. The operation within one cycle period ends.
【0073】すなわち、従来のパイプライン構成で行わ
れていた時間t3のサイクル内での命令フェッチステー
ジ(IF)への保持制御やレジスタフェッチステージ
(RF)のREPレジスタの保持制御までの回路動作を
伴なわない分、回路動作時間が短縮することになる。That is, the circuit operation up to the instruction fetch stage (IF) holding control and the register fetch stage (RF) REP register holding control in the cycle of the time t3 performed in the conventional pipeline configuration is performed. The circuit operation time is shortened by the absence.
【0074】この動作を、各命令が時間毎に実行するパ
イプラインステージ群の遷移図を示して図3を参照する
と、時間t3から時間t4へのサイクルが移る際、レジ
スタフェッチステージ(RF)の命令2はハザード検出
により、通常命令実行ステージ(EX)に格納すべき情
報をハザード処理ステージ(HE)に退避し、後続の命
令3は命令フェッチステージ(IF)からレジスタフェ
ッチステージ(RF)に格納される。FIG. 3 shows a transition diagram of a group of pipeline stages in which each instruction executes this operation at every time. Referring to FIG. 3, when the cycle from time t3 to time t4 shifts, the register fetch stage (RF) The instruction 2 saves information to be stored in the normal instruction execution stage (EX) to the hazard processing stage (HE) by detecting a hazard, and stores the subsequent instruction 3 from the instruction fetch stage (IF) to the register fetch stage (RF). Is done.
【0075】ハザードによる実行保留が解除される時間
t5まで、ハザード検出により活性化されたS241に
応答して選択される命令3の制御信号S631が選択さ
れ、この選択結果の信号S651によりRFPレジスタ
201の命令3が選択器231で選択される保持ループ
を経て、レジスタフェッチステージ(RF)に保持され
ることで、命令3の演算処理は継続が可能となる。Until time t5 when the execution suspension due to the hazard is released, the control signal S631 of the instruction 3 selected in response to S241 activated by the hazard detection is selected, and the RFP register 201 is selected by the signal S651 of the selection result. Is stored in the register fetch stage (RF) through the holding loop selected by the selector 231, so that the arithmetic processing of the instruction 3 can be continued.
【0076】また、時間t4において、命令実行ステー
ジ(EX)のレジスタ301に格納された命令2はキャ
ンセルされた後、時間t5においてハザード処理ステー
ジ(HE)のHOPレジスタ601に格納された命令2
の情報を命令実行ステージ(EX)の入力として選択さ
れる。At time t4, the instruction 2 stored in the register 301 of the instruction execution stage (EX) is canceled, and thereafter, the instruction 2 stored in the HOP register 601 of the hazard processing stage (HE) at time t5.
Is selected as an input to the instruction execution stage (EX).
【0077】命令実行ステージ(EX)以降の演算処理
の手順は従来のパイプライン構成と同様に、各命令とも
1サイクル毎に実行が行われていく。As for the procedure of the arithmetic processing after the instruction execution stage (EX), each instruction is executed every cycle as in the conventional pipeline configuration.
【0078】この結果、ハザード要因を発生した命令2
に着目すると、演算処理の増大に備えてパイプラインの
ステージ数を一つ増やすという可変長パイプライン構成
を実現することにより、1サイクル期間中のステージ内
における演算処理を分割するという機能を実現できる。As a result, the instruction 2 that caused the hazard
Focusing on, by implementing a variable-length pipeline configuration in which the number of stages in the pipeline is increased by one in preparation for an increase in arithmetic processing, a function of dividing arithmetic processing within a stage during one cycle period can be realized. .
【0079】つまり、図2において、ハザード処理を要
するレジスタフェッチステージ(RF)の命令2は、次
の1クロック周期目でハザード処理ステージ(HE)に
格納され、続く2クロック周期目で命令実行ステージ
(EX)での演算処理を行うため、従来の1クロック周
期内でハザード判定から命令の演算処理全てを行う手法
に比べ、処理内容が同等でも動作周期を2倍とすること
で、処理量をそれぞれのクロック周期内に配分すること
が出来る。That is, in FIG. 2, the instruction 2 of the register fetch stage (RF) requiring the hazard processing is stored in the hazard processing stage (HE) in the next first clock cycle, and the instruction execution stage in the next second clock cycle. In order to perform the arithmetic processing in (EX), the processing amount is doubled even if the processing contents are the same, as compared with the conventional method of performing all of the instruction arithmetic processing from the hazard determination within one clock cycle. It can be distributed within each clock cycle.
【0080】以上説明したように、本願発明によれば、
通常条件では従来と同様に命令フェッチステージ(I
F)、レジスタフェッチステージ(RF)、命令実行ス
テージ(EX)、データフェッチステージ(DF)、ラ
イトバックステージ(WB)の順で命令の演算処理を行
うという基本構成に基づき、ハザード要因が判定された
場合にパイプラインの一部として機能するハザード処理
ステージ(HE)を有することによる可変長パイプライ
ン構成とした。As described above, according to the present invention,
Under normal conditions, the instruction fetch stage (I
F), a hazard factor is determined based on a basic configuration in which instruction arithmetic processing is performed in the order of a register fetch stage (RF), an instruction execution stage (EX), a data fetch stage (DF), and a write-back stage (WB). In this case, a variable length pipeline configuration is provided by having a hazard processing stage (HE) functioning as a part of the pipeline.
【0081】その結果、従来、1サイクル期間内の遅延
時間増大の要因となる動作を、2サイクルに分割して演
算処理することにより、1サイクル期間内における遅延
増大要因を改善することが可能となり、演算処理の高速
化による性能向上を実現した、パイプライン制御のマイ
クロプロセッサが提供される。As a result, it is possible to improve the delay increase factor in one cycle period by dividing the operation causing the delay time increase in one cycle period into the operation process in two cycles. And a pipeline-controlled microprocessor realizing improved performance by accelerating arithmetic processing.
【0082】なお、本発明が上記各実施例に限定され
ず、本発明の技術思想の範囲内において、各実施例は適
宜変更され得ることは明らかである。It should be noted that the present invention is not limited to the above-described embodiments, and that each embodiment can be appropriately modified within the scope of the technical idea of the present invention.
【0083】従って、ハザード発生が無い場合と比較す
ると、1クロック周期内に動作する回路規模を2段のパ
イプラインに分割し、他のステージを含めて全ての動作
の中で、このハザード処理に要する遅延時間が長く、そ
の遅延時間がマイクロコンピュータ全体の演算性能を制
約するという問題を排除することができる。Therefore, as compared with the case where no hazard occurs, the circuit scale operating within one clock cycle is divided into two stages of pipelines, and the hazard processing is performed in all operations including other stages. It is possible to eliminate the problem that the required delay time is long and the delay time limits the operation performance of the entire microcomputer.
【0084】さらには、本実施形態では、このハザード
処理の際にのみ動作するハザード処理ステージ(HE)
を用いることによって、ハザード発生時以外の1クロッ
ク周期内に動作する回路の遅延に影響を与えず、レジス
タフェッチステージ(RF)を単純に2段のパイプライ
ン化した場合の命令実行ステージ(EX)への命令発行
を1クロック遅くする性能低下も避けることが可能とな
る。Further, in this embodiment, a hazard processing stage (HE) that operates only during this hazard processing is provided.
The instruction execution stage (EX) when the register fetch stage (RF) is simply pipelined into two stages without affecting the delay of a circuit operating within one clock cycle other than when a hazard occurs. It is also possible to avoid the performance degradation that delays the issue of the instruction to one clock.
【0085】その結果、命令実行ステージ(EX)から
命令フェッチステージ(IF)の動作を制御する分岐命
令の処理にも影響を及ぼさない。そのため、一定時間内
に処理可能な命令数を示す尺度としてのスループットの
性能を低下させるという問題は発生しない。As a result, it does not affect the processing of the branch instruction controlling the operation from the instruction execution stage (EX) to the instruction fetch stage (IF). Therefore, there is no problem that the performance of throughput as a measure indicating the number of instructions that can be processed within a certain time is reduced.
【0086】さらには、ハザード処理の場合以外にパイ
プライン演算処理の動作を行うパイプラインステージ数
は増大しないため、ハザード検出の予測機能を付加する
ことにより、消費電力の増大を回避することが可能にな
る。Further, since the number of pipeline stages for performing the pipeline operation processing does not increase except in the case of hazard processing, an increase in power consumption can be avoided by adding a prediction function of hazard detection. become.
【0087】本発明の他の実施の形態として、その基本
的構成は前述した通りであるが、ハザード処理ステージ
(HE)のHOPレジスタ、HECレジスタ、HRCレ
ジスタに格納する情報のハザード条件での入力選択制御
についてさらに工夫している。As another embodiment of the present invention, the basic configuration is as described above, but input of information stored in the HOP register, HEC register, and HRC register of the hazard processing stage (HE) under a hazard condition is performed. The selection control is further devised.
【0088】その構成を第2の実施の形態としてその構
成図を示した図4を参照すると、図1に示したパイプラ
イン構成との相違点は、ハザード処理ステージ(HE)
内に、処理回路212による制御信号S212を格納す
るHCPレジスタ662と、制御信号S212およびH
CPレジスタ662の出力をハザード検出器242のハ
ザード検出信号S242に応答して選択し、この選択し
た信号を選択信号S682として出力する選択器682
と、レジスタフェッチステージ(RF)の処理回路21
2の出力RFDATA1およびRFDATA2からなる
2系統の情報のうち一方を、選択信号S682に応答し
て選択する選択器672とをさらに付加して備え、選択
器672の出力がハザード処理ステージ(HE)のHO
Pレジスタ602の入力となる構成を備えたことであ
る。Referring to FIG. 4 showing the configuration of the second embodiment, the difference from the pipeline configuration shown in FIG. 1 is that a hazard processing stage (HE) is used.
, An HCP register 662 for storing a control signal S212 by the processing circuit 212, and control signals S212 and H
A selector 682 that selects the output of the CP register 662 in response to the hazard detection signal S242 of the hazard detector 242, and outputs the selected signal as a selection signal S682.
And the processing circuit 21 of the register fetch stage (RF)
And a selector 672 for selecting one of the two sets of information consisting of the two outputs RFDATA1 and RFDATA2 in response to the selection signal S682. The output of the selector 672 is the output of the hazard processing stage (HE). HO
That is, a configuration for inputting to the P register 602 is provided.
【0089】前述したように、レジスタフェッチステー
ジ(RF)での演算処理結果が命令実行ステージ(E
X)のEXPレジスタ302に格納されるのであるが、
命令の内容によっては、命令実行ステージ(EX)のE
XPレジスタ302に格納する情報を、レジスタフェッ
チステージ(RF)での演算処理結果によって選択して
格納する必要があり、その選択機能が要求されることが
ある。As described above, the result of the arithmetic processing in the register fetch stage (RF) is the instruction execution stage (E
X) is stored in the EXP register 302.
Depending on the content of the instruction, E in the instruction execution stage (EX)
The information to be stored in the XP register 302 must be selected and stored according to the result of the arithmetic processing in the register fetch stage (RF), and the selection function may be required.
【0090】その場合、ハザード発生後に、命令実行ス
テージ(EX)がハザード処理ステージ(HE)の命令
を転送する必要があり、選択器672はハザード発生前
のレジスタフェッチステージ(RF)の処理回路212
の出力S212を格納したハザード処理ステージ(H
E)のHCPレジスタ662の条件に基づいて、HOP
レジスタ602の入力を処理回路212の出力RFDA
TA1およびRFDATA2の中から選択することが可
能となる。In this case, after the occurrence of the hazard, the instruction execution stage (EX) needs to transfer the instruction of the hazard processing stage (HE), and the selector 672 selects the processing circuit 212 of the register fetch stage (RF) before the occurrence of the hazard.
Processing stage (H
E) Based on the condition of the HCP register 662, the HOP
The input of the register 602 is used as the output RFDA of the processing circuit 212.
It is possible to select from TA1 and RFDATA2.
【0091】この時の動作説明用タイミングチャートを
示した図5および図4を併せて参照すると、時間T2で
ハザード要因が検出されハザード検出信号S242がハ
イレベルを出力し、処理回路212の2系統出力はRF
DATA1(X0,X1,X2,‥‥‥)およびRFD
ATA2(Y0,Y1,Y2,‥‥‥)を出力し、出力
信号S212は時間t0,t1まではRFDATA1の
状態値を選択するための信号を出力し、時間T2では状
態値が変化してRFDATA1の状態値を選択するため
の信号を出力している。Referring to FIGS. 5 and 4 showing timing charts for explaining the operation at this time, the hazard factor is detected at time T2, the hazard detection signal S242 outputs a high level, and the two circuits of the processing circuit 212 Output is RF
DATA1 (X0, X1, X2, ‥‥‥) and RFD
ATA2 (Y0, Y1, Y2,...), An output signal S212 outputs a signal for selecting the state value of RFDATA1 until time t0, t1, and at time T2, the state value changes to RFDATA1. The signal for selecting the state value of is output.
【0092】ハザード発生の時間t2において、選択器
682はHCPレジスタ662の出力を選択しており、
このレジスタには直前の時間t1における処理回路21
2出力である選択信号S212の状態値が保持されてい
る。図4ではS212t2で変化してRFDATA1か
らRFDATA2選択へ変化しているにもかかわらずS
662がt3まで前のRFDATA1の状態を保持して
いることを示す。At time t2 when the hazard occurs, the selector 682 selects the output of the HCP register 662.
This register stores the processing circuit 21 at the immediately preceding time t1.
The state value of the selection signal S212, which is two outputs, is held. In FIG. 4, despite the change at S212t2 and the change from RFDATA1 to RFDATA2 selection,
662 indicates that the state of the previous RFDATA1 is held until t3.
【0093】したがって、時間t2の終了まで選択器6
72の出力であるHEDATA1はRFDATA1の状
態値であるX0,X1,X2,‥‥‥を出力し、時間t
2以降はRFDATA2の状態値であるY3,Y4,Y
5,‥‥‥を出力することを示す。Therefore, until the end of the time t2, the selector 6
HEDATA1 which is the output of 72 outputs the status values X0, X1, X2,.
2 and subsequent values are Y3, Y4, and Y, which are the status values of RFDATA2.
5, ‥‥‥ is output.
【0094】HOPレジスタ602の出力であるHED
ATA2は、次のクロックで前の状態値を出力するの
で、RFDATA1の状態値が1クロックシフトし時間
t1からX0,X1,X2,‥‥‥を出力し、時間t4
以降はRFDATA2の状態値であるY3,Y4,Y
5,‥‥‥を出力することを示す。HED which is the output of the HOP register 602
Since ATA2 outputs the previous state value at the next clock, the state value of RFDATA1 shifts by one clock and outputs X0, X1, X2,.
Thereafter, Y3, Y4, Y, which are the status values of RFDATA2,
5, ‥‥‥ is output.
【0095】命令実行ステージ(EX)のEXPレジス
タ302の入力となるEXDATA入力は時間t0,t
1までは基本的な選択ルートによりX0,X1が選択さ
れ、時間t2においてハザード要因が検出されたのでH
OPレジスタ602に保持されたX1を選択し、時間t
3以降は、またハザードが解除されたので基本的な選択
ルートに戻り、信号S662に基づきHEDATA2の
Y3,Y4Y5,‥‥‥を選択して入力する。The EXDATA input, which is the input to the EXP register 302 of the instruction execution stage (EX), is at the times t0, t
Up to 1, X0 and X1 are selected by a basic selection route, and at time t2, a hazard factor is detected.
X1 held in the OP register 602 is selected, and time t
From 3 onward, the hazard is released again, and the process returns to the basic selection route, and Y3, Y4Y5,... Of HEDATA2 are selected and input based on the signal S662.
【0096】したがって、選択信号S212が時間t2
において状態値変化をした場合でも、HCPレジスタ6
62に保持されている、時間t1の条件で選択すべき状
態値をハザード処理ステージ(HE)のHOPレジス
タ、HECレジスタ、HRCレジスタに格納することが
可能となる。Therefore, the selection signal S212 changes at time t2.
HCP register 6
It is possible to store the state value to be selected under the condition of the time t1 held in the HOP register, the HEC register, and the HRC register of the hazard processing stage (HE).
【0097】この結果、レジスタフェッチステージ(R
F)から選択器を経由して命令実行ステージ(EX)の
パイプラインレジスタに情報を転送する構成のパイプラ
イン制御装置においても、ハザード条件時のハザード処
理ステージ(HE)での保持情報は、正しいレジスタフ
ェッチステージ(RF)の処理回路出力信号を選択する
ことができる。As a result, the register fetch stage (R
Even in a pipeline control device configured to transfer information from F) to the pipeline register of the instruction execution stage (EX) via the selector, the information held in the hazard processing stage (HE) under the hazard condition is correct. The processing circuit output signal of the register fetch stage (RF) can be selected.
【0098】つまり、RFステージの制御信号RFDA
TA1またはRFDATA2を選択しEXステージに出
力する場合、ハザード発生時には、その選択信号の状態
もHEステージに保持していなければ、HEステージの
パイプラインレジスタHOPレジスタ602の内容が間
違ってしまうからである。That is, the RF stage control signal RFDA
This is because, when TA1 or RFDATA2 is selected and output to the EX stage, if the state of the selection signal is not held in the HE stage when a hazard occurs, the contents of the pipeline register HOP register 602 in the HE stage will be incorrect. .
【0099】この手法は、レジスタフェッチステージ
(RF)から命令実行ステージ(EX)に転送される情
報が複数系統あり、その中から情報自身の状態によって
転送される情報の系統が選択される場合、その中の選択
情報全てを保持するためのパイプラインレジスタをハザ
ード処理ステージ(HE)に備え、情報選択の状態の判
定を再実行する場合に比べて、ハザード処理時の判定動
作の遅延を少なくすることができる。ここでいう状態判
定の再実行とは、ハザード発生時に、一度EXステージ
で演算された命令をキャンセルする一方、次のクロック
周期以降で再度命令を実行する必要があり、状態値によ
る情報選択の判定等の動作内容はそのときの命令になる
ということである。In this method, when there are a plurality of systems to be transferred from the register fetch stage (RF) to the instruction execution stage (EX), and the system of the information to be transferred is selected from among them according to the state of the information itself, A pipeline register for holding all the selection information therein is provided in the hazard processing stage (HE), and the delay of the determination operation at the time of the hazard processing is reduced as compared with the case where the determination of the information selection state is performed again. be able to. Here, the re-execution of the state determination means that when a hazard occurs, the instruction once calculated in the EX stage must be canceled, and the instruction needs to be executed again after the next clock cycle. The operation content such as is the instruction at that time.
【0100】さらに、上述したハザード処理時の判定動
作の遅延が少なくてすむというメリットに加え、選択信
号と選択された信号をそれぞれ保持しておくことで、レ
ジスタフェッチステージ(RF)からの出力信号全てを
保持しなくても済み、保持すべき情報量が少くすること
ができる構成となっている。したがって、レジスタフェ
ッチステージ(RF)の情報全てをハザード処理ステー
ジ(HE)に保持する場合に比べて、マイクロコンピュ
ータの小型化および低消費電力化に有利である。Further, in addition to the advantage that the delay of the judgment operation at the time of the hazard processing described above can be reduced, the output signal from the register fetch stage (RF) can be held by holding the selection signal and the selected signal, respectively. It is not necessary to hold all of them, and the amount of information to be held can be reduced. Therefore, it is advantageous for miniaturization and low power consumption of the microcomputer as compared with the case where all the information of the register fetch stage (RF) is held in the hazard processing stage (HE).
【0101】上述の実施形態では、マイクロコンピュー
タのハザード処理時の判定動作の遅延が少なくてすむと
いう作用・効果を、レジスタフェッチステージ(RF)
から命令実行ステージ(EX)に転送される情報が複数
系統あり、その中から情報自身の状態によって転送され
る情報の系統が選択される場合、その中の選択情報を保
持するためのパイプラインレジスタをハザード処理ステ
ージ(HE)の選択器回路に備えることにより得てい
る。In the above-described embodiment, the operation and effect that the delay of the judgment operation at the time of the hazard processing of the microcomputer can be reduced is reduced by the register fetch stage (RF).
If there is a plurality of systems to be transferred to an instruction execution stage (EX) from among them, and a system of information to be transferred is selected from the plurality of systems according to the state of the information itself, a pipeline register for holding the selected information among the systems Is provided in the selector circuit of the hazard processing stage (HE).
【0102】一方、ハザードの発生が特定の命令の連続
した処理において起こることから、ハザード発生要因と
なる命令がデコードされた時点でハザード発生を予測
し、ハザード処理ステージの動作設定を行うという(技
術思想)を用いても得られる。On the other hand, since the occurrence of a hazard occurs in the continuous processing of a specific instruction, the occurrence of the hazard is predicted when the instruction which causes the hazard is decoded, and the operation of the hazard processing stage is set (technique). Thought) can also be obtained.
【0103】そのための構成を、第3の実施形態として
示す。本発明のマイクロコンピュータの第3の実施形態
の構成図を示した図6を参照すると、前述した第1の実
施形態との相違点は、ハザード検出器243から時刻t
3,t4期間ハザード予測信号S243Bを新たに生成
させ、この信号に応答して、HOPレジスタ603に処
理回路213の出力を保持させ、HECレジスタ623
に命令デコーダ223のデコード結果を保持させ、さら
にHPCレジスタ633にも命令デコーダ223のデコ
ード結果を保持させるようにしたことである。つまり、
上述した3つのレジスタをハザード予測信号S243B
により保持動作させている。A configuration for this is shown as a third embodiment. Referring to FIG. 6, which shows a configuration diagram of a microcomputer according to a third embodiment of the present invention, the difference from the first embodiment described above is that the hazard detector 243 detects the time t
Hazard prediction signal S243B is newly generated during periods 3 and t4, and in response to this signal, HOP register 603 holds the output of processing circuit 213 and HEC register 623
, The decoding result of the instruction decoder 223 is held, and the decoding result of the instruction decoder 223 is also held in the HPC register 633. That is,
The above-mentioned three registers are used for hazard prediction signal S243B.
The holding operation is performed.
【0104】本実施形態の動作説明のための、パイプラ
インステージが時間毎に実行する命令群の遷移図を示し
た図7を参照すると、時間t1に命令1、時間t2に命
令2、時間t3に命令3、時間t4に命令4、時間t5
に命令5がそれぞれ命令フェッチステージ(IF)に順
次フェッチされているものとする。Referring to FIG. 7, which shows a transition diagram of a group of instructions executed by the pipeline stage every time for explaining the operation of the present embodiment, instruction 1 at time t1, instruction 2 at time t2, and time t3 Command 3 at time t4, command 4 at time t4
It is assumed that the instructions 5 are sequentially fetched in the instruction fetch stage (IF).
【0105】また、ハザード処理ステージ(HE)のH
OPレジスタ603、HECレジスタ623、HRCレ
ジスタ633は通常はクロックがマスクされて停止状態
に設定され、ハザード予測信号が出力されるとマスクが
解除され次のクロックでレジスタに命令の格納が行われ
るものとする。The H level of the hazard processing stage (HE)
The OP register 603, the HEC register 623, and the HRC register 633 are normally set to a stopped state by masking the clock, and when the hazard prediction signal is output, the mask is released and the instruction is stored in the register at the next clock. And
【0106】時間t2において命令1が命令デコーダ2
23においてデコードされるとともに、そのデコード結
果からハザード予測信号S243が発生したとすると、
次の時間t3においてこのハザード予測信号S243が
出力され、次の時刻t4でこのハザード予測信号S24
3に応答して、HOPレジスタ603、HECレジスタ
623、HRCレジスタ633の情報読み込みが行われ
る。At time t2, instruction 1 is set to instruction decoder 2
23, and a hazard prediction signal S243 is generated from the decoding result.
At the next time t3, the hazard prediction signal S243 is output, and at the next time t4, the hazard prediction signal S24
In response to No. 3, information reading of the HOP register 603, the HEC register 623, and the HRC register 633 is performed.
【0107】さらに、時間t4に検出されるハザード検
出信号S243に応答して、命令2の情報がハザード処
理ステージ(HE)のHOPレジスタ603、HECレ
ジスタ623、HRCレジスタ633から選択器60
3,623,633で選択されて命令フェッチステージ
(IF)、レジスタフェッチステージ(RF)の選択器
133および233にそれぞれ出力され、かつ命令実行
ステージ(EX)のEXPレジスタ603およびEXC
レジスタ303にも出力される。Further, in response to the hazard detection signal S243 detected at time t4, the information of the instruction 2 is output from the HOP register 603, HEC register 623, HRC register 633 of the hazard processing stage (HE) to the selector 60.
3, 623, 633 and output to the instruction fetch stage (IF) and register fetch stage (RF) selectors 133 and 233, respectively, and the EXP register 603 and EXC of the instruction execution stage (EX).
It is also output to the register 303.
【0108】時間t5においては、EXPレジスタに読
み込まれた命令2が、演算処理によってフラグ操作やメ
モリ資源の確保等の実行を行なった直後に、同じ時間t
3においてレジスタフェッチステージ(RF)で後続す
る命令3によって分岐命令等が発行された場合、レジス
タフェッチステージ(RF)でのハザード動作および時
間t4で命令実行ステージ(EX)に格納される命令2
の情報に対してのキャンセル処理を同一サイクル内に実
行して1サイクル期間内の動作を終了する。At the time t5, immediately after the instruction 2 read into the EXP register performs the operations such as the flag operation and the reservation of the memory resource by the arithmetic processing, the same time t5
3, when a branch instruction or the like is issued by the subsequent instruction 3 in the register fetch stage (RF), the hazard operation in the register fetch stage (RF) and the instruction 2 stored in the instruction execution stage (EX) at time t4
Is executed within the same cycle, and the operation within one cycle period ends.
【0109】上述したように、このマイクロコンピュー
タでは、レジスタフェッチステージ(RF)のハザード
検出器243においてハザード発生要因となる命令がデ
コードされた場合に、次の命令デコード結果においてハ
ザード発生の有無によらずハザード予測を行い、次のサ
イクルでハザード処理ステージ(HE)のHOPレジス
タ603、HECレジスタ623、HRCレジスタ63
3に情報の保持要求を行う機能を有する。As described above, in this microcomputer, when an instruction that causes a hazard is decoded by the hazard detector 243 of the register fetch stage (RF), whether or not a hazard has occurred in the next instruction decode result is determined. In the next cycle, the HOP register 603, the HEC register 623, and the HRC register 63 of the hazard processing stage (HE) are predicted.
3 has a function of making a request to hold information.
【0110】従って、次のサイクルで実際にハザードが
検出された場合の処理は上述した各実施形態と同様であ
るが、ハザードの発生が無かった場合は、次のハザード
発生要因となる命令がデコードされて、ハザード予測が
発生されるまでハザード処理ステージ(HE)の動作は
停止することにより、ハザード処理時の判定動作の遅延
が少なくてすむという作用・効果が得られ、本発明の目
的が達成される。Therefore, the processing when a hazard is actually detected in the next cycle is the same as that in each of the above-described embodiments. However, when no hazard is generated, the instruction that causes the next hazard is decoded. Then, by stopping the operation of the hazard processing stage (HE) until the hazard prediction is generated, the operation and effect of reducing the delay of the judgment operation at the time of the hazard processing can be obtained, and the object of the present invention is achieved. Is done.
【0111】しかも、本実施例では、パイプライン動作
を必要時にのみハザード処理ステージを動作させるた
め、ハザード処理ステージ(HE)を常に動作させる場
合に比べて、よりマイクロコンピュータの低消費電力化
に有利という相乗的な効果を奏する。Further, in this embodiment, the hazard processing stage is operated only when the pipeline operation is required, so that it is more advantageous to reduce the power consumption of the microcomputer than in the case where the hazard processing stage (HE) is always operated. It has a synergistic effect.
【0112】[0112]
【発明の効果】以上説明したように、本願発明によれ
ば、通常条件では従来と同様に命令フェッチステージ
(IF)、レジスタフェッチステージ(RF)、命令実
行ステージ(EX)、データフェッチステージ(D
F)、ライトバックステージ(WB)の順で命令の演算
処理うという基本構成に基づき、レジスタフェッチステ
ージ(RF)の次のステージに、ハザード要因が判定さ
れた場合にパイプラインの一部として機能するハザード
処理ステージ(HE)を有することによる可変長パイプ
ライン構成とすることで、従来、1サイクル期間内の遅
延時間増大の要因となる動作を2サイクルに分割して演
算処理することにより、1サイクル期間内の遅延を増大
させる要因を改善することが可能となり、演算処理の高
速化による性能向上を実現した、パイプライン制御のマ
イクロプロセッサが提供される。As described above, according to the present invention, under normal conditions, the instruction fetch stage (IF), the register fetch stage (RF), the instruction execution stage (EX), and the data fetch stage (D) are performed as in the conventional case.
F), based on a basic configuration in which instructions are processed in the order of the write-back stage (WB), functioning as a part of the pipeline in the next stage of the register fetch stage (RF) when a hazard factor is determined Conventionally, by employing a variable-length pipeline configuration having a hazard processing stage (HE), an operation that causes an increase in delay time within one cycle period is divided into two cycles to perform arithmetic processing. A pipeline-controlled microprocessor is provided, which can improve a factor that increases a delay in a cycle period and realizes performance improvement by speeding up arithmetic processing.
【0113】従って、ハザード発生が無い場合と比較し
て、1クロック周期内に動作する回路規模を2段のパイ
プラインに分割し、他のステージを含めて全ての動作の
中で、このハザード処理に要する遅延時間が長く、その
遅延時間がマイクロコンピュータ全体の演算性能を制約
するという問題を排除することができる。Therefore, as compared with the case where no hazard occurs, the circuit scale operating within one clock cycle is divided into two stages of pipelines, and this hazard processing is performed in all the operations including other stages. The problem that the delay time required for the microcomputer is long and the delay time limits the operation performance of the entire microcomputer can be eliminated.
【0114】また、このハザード処理の際にのみ動作す
るハザード処理ステージ(HE)を用いることによっ
て、ハザード発生時以外の1クロック周期内に動作する
回路の遅延に影響を与えず、レジスタフェッチステージ
(RF)を単純に2段のパイプライン化した場合の命令
実行ステージ(EX)への命令発行を1クロック遅くす
る性能低下も避けることが可能となり、命令実行ステー
ジ(EX)から命令フェッチステージ(IF)の動作を
制御する分岐命令の処理にも影響を及ぼさないため、一
定時間内に処理可能な命令数を示すスループットの性能
を低下させるという問題は発生しない。By using the hazard processing stage (HE) that operates only during the hazard processing, the delay of the circuit that operates within one clock cycle other than when the hazard occurs is not affected, and the register fetch stage (HE) is not affected. (RF) is simply pipelined into two stages, so that it is possible to avoid a decrease in performance that delays instruction issuance to the instruction execution stage (EX) by one clock, and from the instruction execution stage (EX) to the instruction fetch stage (IF). Since this does not affect the processing of the branch instruction for controlling the operation of (1), the problem of lowering the throughput performance indicating the number of instructions that can be processed within a fixed time does not occur.
【0115】さらに、ハザード処理の場合以外にパイプ
ライン演算処理に動作を行うパイプラインステージ数は
増大しないため、ハザード検出の予測機能を付加するこ
とにより、消費電力の増大を回避することが出来るとい
う効果もある。Further, since the number of pipeline stages that operate in the pipeline operation processing does not increase except in the case of hazard processing, an increase in power consumption can be avoided by adding a prediction function for hazard detection. There is also an effect.
【図1】本発明のマイクロコンピュータのパイプライン
の第1の実施の形態を示す構成図である。FIG. 1 is a configuration diagram showing a first embodiment of a pipeline of a microcomputer of the present invention.
【図2】第1の実施形態の各パイプラインステージが時
間毎に実行する命令群の遷移図である。FIG. 2 is a transition diagram of an instruction group executed by each pipeline stage of the first embodiment at each time.
【図3】第1の実施形態の各命令が時間毎に実行するパ
イプラインステージ群の遷移図である。FIG. 3 is a transition diagram of a group of pipeline stages that each instruction of the first embodiment executes every time.
【図4】第2の実施の形態を示す構成図である。FIG. 4 is a configuration diagram showing a second embodiment.
【図5】第2の実施の形態の動作を説明するためのタイ
ミングチャートである。FIG. 5 is a timing chart for explaining the operation of the second embodiment.
【図6】第3の実施の形態を示す構成図である。FIG. 6 is a configuration diagram illustrating a third embodiment.
【図7】第3の実施形態のパイプラインステージが時間
毎に実行する命令群の遷移図である。FIG. 7 is a transition diagram of a group of instructions executed by the pipeline stage of the third embodiment every time.
【図8】従来のマイクロコンピュータのパイプラインを
示す構成図である。FIG. 8 is a configuration diagram showing a pipeline of a conventional microcomputer.
【図9】従来のパイプラインステージが時間毎に実行す
る命令群の遷移図である。FIG. 9 is a transition diagram of a group of instructions executed by the conventional pipeline stage every time.
【図10】従来のパイプラインステージが時間毎に実行
する命令群の遷移図である。FIG. 10 is a transition diagram of a group of instructions executed by the conventional pipeline stage every time.
101 IFPレジスタ 111 命令メモリ 121 加算器 131,231,611,641,651 選択器 201 RFPレジスタ 211 処理回路 221 命令デコーダ 241 ハザード検出器 301 EXPレジスタ 311 演算器 321 EXCレジスタ 401 DFPレジスタ 411 データメモリ 421 DFCレジスタ 501 WBPレジスタ 511 レジスタファイル 521 WBCレジスタ 601 HOPレジスタ 621 HECレジスタ 631 HRCレジスタ DF データフェッチステージ EX 命令実行ステージ HE ハザード処理ステージ IF 命令フェッチステージ RF レジスタフェッチステージ WB ライトバックステージ 101 IFP register 111 Instruction memory 121 Adder 131, 231, 611, 641, 651 Selector 201 RFP register 211 Processing circuit 221 Instruction decoder 241 Hazard detector 301 EXP register 311 Operation unit 321 EXC register 401 DFP register 411 Data memory 421 DFC Register 501 WBP register 511 Register file 521 WBC register 601 HOP register 621 HEC register 631 HRC register DF Data fetch stage EX Instruction execution stage HE hazard processing stage IF Instruction fetch stage RF register fetch stage WB Write back stage
Claims (13)
タフェッチステージ(RF)、命令実行ステージ(E
X)、データフェッチステージ(DF)、ライトバック
ステージ(WB)の順で命令の演算処理を行うパイプラ
インステージの入力側あるいは出力側あるいはパイプラ
インステージ間に少なくとも一つのパイプラインステー
ジの入出力情報を一時保管する保持手段を備えるパイプ
ラインの基本構成に基づき、各々の前記パイプラインス
テージ毎に所望の命令処理を他のステージと並列に実行
するパイプライン制御のマイクロコンピュータにおい
て、デコードされた命令の演算が実行できない時に発生
するハザードの要因を検出した際に、前記パイプライン
の一部として動作するハザード処理ステージ(HE)
を、前記レジスタフェッチステージ(RF)と前記命令
実行ステージ(EX)との間に設けることを特徴とする
マイクロコンピュータ。1. An instruction fetch stage (IF), a register fetch stage (RF), and an instruction execution stage (E).
X), data fetch stage (DF), write-back stage (WB), input / output information of at least one pipeline stage on the input side or output side of the pipeline stage for performing instruction arithmetic processing, or between pipeline stages Based on a basic configuration of a pipeline having a holding unit for temporarily storing, a pipeline-controlled microcomputer that executes desired instruction processing for each of the pipeline stages in parallel with the other stages. A hazard processing stage (HE) that operates as a part of the pipeline when detecting a factor of a hazard that occurs when an operation cannot be executed.
Is provided between the register fetch stage (RF) and the instruction execution stage (EX).
いてメモリ装置から命令をフェッチする命令フェッチ手
段と、前記レジスタフェッチステージ(RF)において
前記フェッチされた命令をデコードする命令デコード手
段および前記命令が要求するデータに提供されるレジス
タのフェッチ手段と、前記命令実行ステージ(EX)に
おいて前記デコードされた命令を実行する命令実行手段
と、前記データフェッチテージ(DF)において前記命
令実行ステージ(EX)で演算されたアドレスに対し前
記メモリ装置にデータのリードまたはライトを行うデー
タフェッチ手段と、前記ライトバックステージ(WB)
において前記データフェッチステージ(DF)で前記メ
モリ装置から得られるオペランドデータまたは前記命令
実行ステージ(EX)において処理されたオペランドデ
ータをレジスタに書き込むライトバック手段と、前記ハ
ザード処理ステージ(HE)において前記レジスタフェ
ッチステージ(RF)の前記レジスタフェッチ手段が出
力する情報を、次のステージに出力するかあるいは前の
状態を保持するかを選択するハザード処理手段と、を併
せて備える請求項1記載のマイクロコンピュータ。2. An instruction fetch unit for fetching an instruction from a memory device in the instruction fetch stage (IF), an instruction decoding unit for decoding the fetched instruction in the register fetch stage (RF), and a request from the instruction. Fetch means for a register provided for data; instruction execution means for executing the decoded instruction in the instruction execution stage (EX); and operation performed in the instruction execution stage (EX) in the data fetch ratio (DF). A data fetch means for reading or writing data to or from the memory device at a given address; and a write-back stage (WB).
A write-back means for writing operand data obtained from the memory device in the data fetch stage (DF) or operand data processed in the instruction execution stage (EX) to a register, and the register in the hazard processing stage (HE). 2. A microcomputer according to claim 1, further comprising: hazard processing means for selecting whether to output the information output by said register fetch means of a fetch stage (RF) to a next stage or to retain a previous state. .
においてデコードされた命令と、前記命令実行ステージ
(EX)で先行して演算処理されている命令との組み合
わせ、あるいは装置の資源確保等による動作条件の判定
を行い、前記レジスタフェッチステージ(RF)でデコ
ードされた命令の正常処理を動作保証できないと判断し
た場合に、ハザードとしてパイプライン演算処理の制御
をクロック1サイクルあるいはそれ以上の期間の動作状
態の保持要求を発生するハザード検出器を前記レジスタ
フェッチステージ内部に有する請求項2記載のマイクロ
コンピュータ。3. The register fetch stage (RF)
In the register fetch stage (RF), the combination of the instruction decoded in step (1) and the instruction that has been previously processed in the instruction execution stage (EX) or the operating condition by securing the resources of the device is determined. If it is determined that the normal processing of the decoded instruction cannot be guaranteed, the hazard detector that issues a request to hold the operation state for one clock cycle or more is controlled by the register fetch. 3. The microcomputer according to claim 2, wherein the microcomputer is provided inside the stage.
前記レジスタフェッチステージ(RF)の情報を保持す
るとともにこの保持情報または前記情報のいずれかを選
択的に転送する選択転送手段を有する請求項2記載のマ
イクロコンピュータ。4. The hazard processing stage (HE)
3. The microcomputer according to claim 2, further comprising a selection transfer unit that holds information of the register fetch stage (RF) and selectively transfers either the held information or the information.
生しないとき、前記ハザード検出器で生成されたハザー
ド信号の非活性状態に応答して、前記レジスタフェッチ
ステージ(RF)の命令デコーダが出力する信号であっ
て前記命令フェッチステージ(IF)および前記レジス
タフェッチステージ(RF)におけるパイプライン動作
保持要求用の第1の制御信号およびその信号を記憶する
第1のハザードレジスタの出力のうち第1の制御信号を
選択して転送する第1の選択器と、前記命令デコーダが
出力する信号であって前記命令実行ステージ(EX)に
おけるパイプライン動作保持要求用の第2の制御信号お
よびその信号を記憶する第2のハザードレジスタの出力
のうち前記第2の制御信号を選択して転送する第2の選
択器と、前記レジスタフェッチステージ(RF)のデー
タ処理回路が出力する信号であって前記命令実行ステー
ジ(EX)のパイプラインレジスタへ渡すデータ信号お
よびその信号を記憶する第3のハザードレジスタの出力
のうち前記データ信号を選択して転送する第3の選択器
とをそれぞれ前記ハザード処理ステージ(HE)内部に
有する請求項4記載のマイクロコンピュータ。5. An instruction decoder of the register fetch stage (RF) outputs the selective transfer means in response to an inactive state of a hazard signal generated by the hazard detector when the hazard does not occur. A first control signal for a pipeline operation holding request in the instruction fetch stage (IF) and the register fetch stage (RF) and an output of a first hazard register storing the signal; A first selector for selecting and transferring a control signal; a second control signal for a pipeline operation holding request in the instruction execution stage (EX), which is a signal output by the instruction decoder; and a signal for storing the second control signal. A second selector for selecting and transferring the second control signal from the output of the second hazard register to be activated, A data signal which is output from a data processing circuit of a data fetch stage (RF) and which is passed to a pipeline register of the instruction execution stage (EX) and an output of a third hazard register which stores the signal; 5. The microcomputer according to claim 4, further comprising: a third selector for selecting and transferring the data in the hazard processing stage (HE).
生するとき、前記ハザード検出器で生成されたハザード
信号の非活性状態に応答して、前記レジスタフェッチス
テージ(RF)の命令デコーダが出力する信号であって
前記命令フェッチステージ(IF)およびレジスタフェ
ッチステージ(RF)のパイプライン動作制御信号とし
て、前記ハザードが解除されるまでハザード発生時点の
情報を保持するステージ制御用の第1のハザード処理レ
ジスタの出力信号を選択して伝播する第1の選択器と、
前記命令デコーダが出力する信号であって前記命令実行
ステージ(EX)のパイプライン動作制御信号として、
前記ハザードが解除されるまでハザード発生時点の情報
を保持するステージ制御用の第2のハザード処理レジス
タの出力信号を選択して伝播する第2の選択器と、前記
レジスタフェッチステージ(RF)のデータ処理回路が
出力する信号であって前記命令実行ステージ(EX)の
パイプラインレジスタに渡すデータ信号として、前記ハ
ザードが解除されるまでハザード発生時点の情報を保持
するデータ保持用の第3のハザード処理レジスタの出力
信号を選択して伝播する第3の選択器とを備える請求項
4記載のマイクロコンピュータ。6. The selective transfer means outputs an instruction decoder of the register fetch stage (RF) in response to an inactive state of a hazard signal generated by the hazard detector when the hazard occurs. A first hazard process for a stage control, which is a signal and holds information on a time point when a hazard occurs until the hazard is eliminated as a pipeline operation control signal for the instruction fetch stage (IF) and the register fetch stage (RF). A first selector for selecting and transmitting the output signal of the register;
A signal output from the instruction decoder, which is a pipeline operation control signal of the instruction execution stage (EX),
A second selector for selecting and propagating an output signal of a second hazard processing register for stage control which holds information on the time of occurrence of the hazard until the hazard is released, and data of the register fetch stage (RF) A third hazard process for retaining data, which is a signal output from the processing circuit and is a data signal to be passed to a pipeline register of the instruction execution stage (EX), and retains information on a point when the hazard occurs until the hazard is released. 5. The microcomputer according to claim 4, further comprising a third selector for selecting and transmitting an output signal of the register.
記ハザード処理ステージ(HE)内の前記第1のハザー
ド処理レジスタ、前記第2のハザード処理レジスタおよ
び前記第3のハザード処理レジスタにそれぞれ保持され
た情報をハザード検出後に選択することによりパイプラ
インステージ段数を可変する請求項6記載のマイクロコ
ンピュータ。7. The first hazard processing register, the second hazard processing register, and the third hazard processing register in the hazard processing stage (HE) according to an active state of the hazard signal, respectively. 7. The microcomputer according to claim 6, wherein the number of pipeline stages is varied by selecting information after detecting the hazard.
に格納されている命令は、次のクロックサイクルにハザ
ード処理ステージ(HE)および前記命令実行ステージ
(EX)に重複して格納され、前記ハザードが検出され
ていない時はハザード処理ステージ(HE)の前記第
1,前記第2および前記第3の選択器はいずれもレジス
タフェッチステージ(RF)側の情報を選択し、ハザー
ド処理ステージ(HE)に格納された情報を無効とする
請求項6記載のマイクロコンピュータ。8. The register fetch stage (RF)
Is stored in the hazard processing stage (HE) and the instruction execution stage (EX) in the next clock cycle, and when the hazard is not detected, the instruction is stored in the hazard processing stage (HE). 7. The method according to claim 6, wherein each of the first, second, and third selectors selects information on a register fetch stage (RF) side, and invalidates information stored in a hazard processing stage (HE). Microcomputer.
出ステージ(HE)をハザード状態が解除されるまでの
任意のクロックサイクル数だけ保持状態にする請求項3
記載のマイクロコンピュータ。9. The hazard detector holds the hazard detection stage (HE) for an arbitrary number of clock cycles until the hazard state is released.
The microcomputer as described.
フェッチステージ(RF)に設ける請求項3記載のマイ
クロコンピュータ。10. The microcomputer according to claim 3, wherein the hazard detector is provided in the register fetch stage (RF).
プラインレジスタに格納する情報をレジスタフェッチス
テージ(RF)における演算処理結果によって選択する
場合、前記ハザード発生後に前記命令実行ステージ(E
X)が前記ハザード処理ステージ(HE)の命令を転送
する手段として、前記ハザード処理ステージ(HE)内
に前記レジスタフェッチステージ(RF)のレジスタフ
ァイルからなる処理回路の出力する2系統の情報の一方
を選択する第1の選択器と、前記処理回路による制御信
号と、前記制御信号を格納するレジスタと、前記制御信
号および前記レジスタの出力をハザード信号により選択
して前記第1の選択器の制御信号を出力する第2の選択
器をさらに備え、前記第1の選択器の出力を前記ハザー
ド処理ステージ(HE)の前記第3の選択器の入力とす
る請求項5記載のマイクロコンピュータ。11. When information to be stored in a pipeline register of the instruction execution stage (EX) is selected based on a result of an arithmetic processing in a register fetch stage (RF), the instruction execution stage (E) is executed after the occurrence of the hazard.
X) is a means for transferring an instruction of the hazard processing stage (HE) as one of two systems of information output from a processing circuit including a register file of the register fetch stage (RF) in the hazard processing stage (HE). , A control signal by the processing circuit, a register for storing the control signal, and a control of the first selector by selecting the control signal and the output of the register by a hazard signal. 6. The microcomputer according to claim 5, further comprising a second selector that outputs a signal, wherein an output of the first selector is an input of the third selector of the hazard processing stage (HE).
デコードされた時点でハザード発生を予測し、前記ハザ
ード処理ステージ(HE)の動作設定を行う予測手段と
して、前記レジスタフェッチステージ(RF)の前記ハ
ザード検出器において前記ハザードの発生要因となる命
令がデコードされた場合に、次の命令デコードにより前
記ハザードの発生の有無によらずハザード予測を行い、
次のクロックサイクルで前記ハザード処理ステージ(H
E)の前記第1、前記第2および前記第3のレジスタに
前記情報の保持要求を行う予測制御信号を前記ハザード
検出器がさらに有する請求項5記載のマイクロコンピュ
ータ。12. A predicting means for predicting the occurrence of a hazard when an instruction causing the occurrence of the hazard is decoded, and setting the operation of the hazard processing stage (HE) as the prediction means. When an instruction that causes the hazard is decoded in the hazard detector, the next instruction decode performs a hazard prediction regardless of whether or not the hazard has occurred,
In the next clock cycle, the hazard processing stage (H
The microcomputer according to claim 5, wherein the hazard detector further includes a prediction control signal for requesting the first, second, and third registers of (E) to hold the information.
次の前記ハザードの発生要因となる命令がデコードされ
てハザード予測が発生するまで前記ハザード処理ステー
ジ(HE)の動作を停止させてパイプライン動作が必要
なときのみ選択的に前記ハザード処理を動作させる請求
項12記載のマイクロコンピュータ。13. When there is no occurrence of the hazard,
The operation of the hazard processing stage (HE) is stopped until the next instruction that causes the hazard is decoded and a hazard prediction occurs, and the hazard processing is selectively operated only when pipeline operation is necessary. The microcomputer according to claim 12.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP27607298A JP3204390B2 (en) | 1998-09-29 | 1998-09-29 | Microcomputer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP27607298A JP3204390B2 (en) | 1998-09-29 | 1998-09-29 | Microcomputer |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000105698A true JP2000105698A (en) | 2000-04-11 |
| JP3204390B2 JP3204390B2 (en) | 2001-09-04 |
Family
ID=17564419
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP27607298A Expired - Fee Related JP3204390B2 (en) | 1998-09-29 | 1998-09-29 | Microcomputer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3204390B2 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7028165B2 (en) | 2000-12-06 | 2006-04-11 | Intel Corporation | Processor stalling |
| JP2010522940A (en) * | 2007-03-28 | 2010-07-08 | クゥアルコム・インコーポレイテッド | System and method for executing instructions prior to an execution stage in a processor |
| CN113986354A (en) * | 2021-10-28 | 2022-01-28 | 南京理工大学 | RISC-V instruction set based six-stage pipeline CPU |
-
1998
- 1998-09-29 JP JP27607298A patent/JP3204390B2/en not_active Expired - Fee Related
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7028165B2 (en) | 2000-12-06 | 2006-04-11 | Intel Corporation | Processor stalling |
| JP2010522940A (en) * | 2007-03-28 | 2010-07-08 | クゥアルコム・インコーポレイテッド | System and method for executing instructions prior to an execution stage in a processor |
| CN113986354A (en) * | 2021-10-28 | 2022-01-28 | 南京理工大学 | RISC-V instruction set based six-stage pipeline CPU |
| CN113986354B (en) * | 2021-10-28 | 2025-03-11 | 南京理工大学 | Six-stage pipeline CPU based on RISC-V instruction set |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3204390B2 (en) | 2001-09-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7401207B2 (en) | Apparatus and method for adjusting instruction thread priority in a multi-thread processor | |
| JP4829541B2 (en) | Digital data processing apparatus with multi-level register file | |
| JP3209205B2 (en) | Inherit device of register contents in processor | |
| US4928226A (en) | Data processor for parallelly executing conflicting instructions | |
| JP2911278B2 (en) | Processor | |
| US6301655B1 (en) | Exception processing in asynchronous processor | |
| WO2004021173A2 (en) | Apparatus and method for scheduling instruction execution in functional units with issue lock mechanism | |
| US6981131B2 (en) | Early condition code evaluation at pipeline stages generating pass signals for controlling coprocessor pipeline executing same conditional instruction | |
| JP2535252B2 (en) | Parallel processor | |
| US7603543B2 (en) | Method, apparatus and program product for enhancing performance of an in-order processor with long stalls | |
| US6115730A (en) | Reloadable floating point unit | |
| KR100974401B1 (en) | Method and apparatus for swapping the contents of an address register | |
| JP3204390B2 (en) | Microcomputer | |
| US20070260857A1 (en) | Electronic Circuit | |
| JP3640855B2 (en) | Processor | |
| JP3199035B2 (en) | Processor and execution control method thereof | |
| JP7487535B2 (en) | Processing Unit | |
| JP3475861B2 (en) | Data processing device | |
| JP3568737B2 (en) | Microprocessor with conditional execution instruction | |
| JPH08272608A (en) | Pipeline processing equipment | |
| JP2503223B2 (en) | Prior control method | |
| JP2636192B2 (en) | Information processing device | |
| JP3743155B2 (en) | Pipeline controlled computer | |
| JP3850156B2 (en) | Instruction processing device | |
| JPH08115215A (en) | Processing system and operating method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20010529 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080629 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090629 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100629 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100629 Year of fee payment: 9 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100629 Year of fee payment: 9 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100629 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110629 Year of fee payment: 10 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120629 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120629 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130629 Year of fee payment: 12 |
|
| LAPS | Cancellation because of no payment of annual fees |