JP3461887B2 - Variable length pipeline controller - Google Patents

Variable length pipeline controller

Info

Publication number
JP3461887B2
JP3461887B2 JP00025594A JP25594A JP3461887B2 JP 3461887 B2 JP3461887 B2 JP 3461887B2 JP 00025594 A JP00025594 A JP 00025594A JP 25594 A JP25594 A JP 25594A JP 3461887 B2 JP3461887 B2 JP 3461887B2
Authority
JP
Japan
Prior art keywords
stage
instruction
memory
memory access
data
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.)
Expired - Fee Related
Application number
JP00025594A
Other languages
Japanese (ja)
Other versions
JPH07200291A (en
Inventor
厚 桜井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP00025594A priority Critical patent/JP3461887B2/en
Priority to US08/367,494 priority patent/US5706459A/en
Publication of JPH07200291A publication Critical patent/JPH07200291A/en
Priority to US08/927,065 priority patent/US5949996A/en
Application granted granted Critical
Publication of JP3461887B2 publication Critical patent/JP3461887B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータシステム
における中央処理装置に係り、更に詳しくは、パイプラ
イン制御装置を備えたマイクロプロセッサに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a central processing unit in a computer system, and more particularly to a microprocessor equipped with a pipeline controller.

【0002】[0002]

【従来の技術及び発明が解決しようとする課題】近年、
RISC(限定命令セットコンピュータ)方式に基づい
て動作するプロセッサ等において、パイプラインアーキ
テクチャを有するものが多い。このようなパイプライン
プロセッサは、命令フェッチモジュール、命令デコード
モジュール、命令実行モジュール、メモリアクセスモジ
ュール、及びライトバックモジュールのそれぞれが、パ
イプラインを構成している。そして、1つの命令サイク
ルにおいて、それぞれのモジュールが、別々の命令に対
する処理を、並列に実行することができる。
2. Description of the Related Art In recent years,
Many processors and the like that operate based on the RISC (Limited Instruction Set Computer) system have a pipeline architecture. In such a pipeline processor, each of an instruction fetch module, an instruction decode module, an instruction execution module, a memory access module, and a write back module constitutes a pipeline. Then, in one instruction cycle, each module can execute processing for different instructions in parallel.

【0003】図13に、このようなパイプラインプロセ
ッサにおけるパイプライン制御装置の一部の構成例を示
す。この構成は、パイプライン制御装置のうちの、プロ
グラムカウンタのパイプライン(PCパイプ)に関する
ものである。
FIG. 13 shows an example of the configuration of part of a pipeline control device in such a pipeline processor. This configuration relates to the program counter pipeline (PC pipe) of the pipeline control device.

【0004】アダー1301(以下、PC_adder
1301と呼ぶ)により所定の初期値から順次インクリ
メントされるプログラムカウンタ値は、アンドゲート1
307〜1310を介して入力するクロックCLKに同
期し、命令フェッチステージプログラムカウンタ値保持
部1302(以下、PC_IF1302と呼ぶ)、命令
デコードステージプログラムカウンタ値保持部1303
(以下、PC_ID1303と呼ぶ)、命令実行ステー
ジプログラムカウンタ値保持部1304(以下、PC_
EX1304と呼ぶ)、メモリアクセスステージプログ
ラムカウンタ値保持部1305(以下、PC_MA13
05と呼ぶ)、及びライトバックステージプログラムカ
ウンタ値保持部1306(以下、PC_WB1306と
呼ぶ)に、順次流れてゆく。なお、PC_IF1302
から出力されるプログラムカウンタ値がPC_adde
r1301に入力されることによって、プログラムカウ
ンタ値が順次インクリメントされる。
Adder 1301 (hereinafter PC_adder
Called 1301), the program counter value that is sequentially incremented from a predetermined initial value is AND gate 1
In synchronization with a clock CLK input via 307 to 1310, an instruction fetch stage program counter value holding unit 1302 (hereinafter, referred to as PC_IF1302), an instruction decode stage program counter value holding unit 1303.
(Hereinafter, referred to as PC_ID 1303), instruction execution stage program counter value holding unit 1304 (hereinafter, PC_ID 1303)
EX1304), memory access stage program counter value holding unit 1305 (hereinafter PC_MA13)
05)) and the write-back stage program counter value holding unit 1306 (hereinafter referred to as PC_WB 1306). Note that PC_IF1302
The program counter value output from PC_add
The program counter value is sequentially incremented by being input to r1301.

【0005】この結果、特には図示しない命令フェッチ
モジュール、命令デコードモジュール、命令実行モジュ
ール、メモリアクセスモジュール、及びライトバックモ
ジュールのそれぞれは、上述のプログラムカウンタ値保
持部1302〜1306のそれぞれに保持されたプログ
ラムカウンタ値に対応する命令に関する処理を実行す
る。
As a result, the instruction fetch module, the instruction decode module, the instruction execution module, the memory access module, and the write back module, which are not shown, are held in the program counter value holding units 1302-1306. The processing related to the instruction corresponding to the program counter value is executed.

【0006】ここで、命令フェッチモジュールは、メモ
リから命令をフェッチする。命令デコードモジュール
は、フェッチされた命令をデコードする。命令実行モジ
ュールは、デコードされた命令を実行する。メモリアク
セスモジュールは、オペランドデータを、メモリから読
み出し又はメモリに書き込む。ライトバックモジュール
は、上述のメモリアクセスによりメモリから得られるオ
ペランドデータ又は実行モジュールで処理されたオペラ
ンドデータをプロセッサチップ内部のレジスタに書き込
む。
Here, the instruction fetch module fetches an instruction from the memory. The instruction decode module decodes the fetched instruction. The instruction execution module executes the decoded instruction. The memory access module reads the operand data from the memory or writes the operand data in the memory. The write-back module writes the operand data obtained from the memory by the above-mentioned memory access or the operand data processed by the execution module into the register inside the processor chip.

【0007】なお、オアゲート1311〜1313と、
ウエイト信号if_wait、id_wait、ex_
wait、及びma_waitについては、後述する。
上述したようなプログラムカウンタのパイプラインは、
各モジュールにおいて例外処理が発生した場合などにお
いて、それぞれのモジュールにおけるプログラムカウン
タ値を保持するために必要とされる。
The OR gates 1311 to 1313,
Wait signals if_wait, id_wait, ex_
The wait and ma_wait will be described later.
The program counter pipeline as described above
It is necessary to hold the program counter value in each module when exception processing occurs in each module.

【0008】パイプライン制御装置には、図13に示さ
れるプログラムカウンタのパイプラインのほかに、命令
のオペランドを各モジュールに伝えるためのオペランド
のパイプラインなども設けられている。
In addition to the program counter pipeline shown in FIG. 13, the pipeline control device is provided with an operand pipeline for transmitting an instruction operand to each module.

【0009】図14は、パイプライン処理の説明図であ
る。命令サイクル毎に、命令A〜Dに対応する各実行ス
テージが、特には図示しない命令フェッチモジュール、
命令デコードモジュール、命令実行モジュール、メモリ
アクセスモジュール、及びライトバックモジュールにお
いて並列に実行される様子が示されている。
FIG. 14 is an explanatory diagram of pipeline processing. For each instruction cycle, each execution stage corresponding to the instructions A to D includes an instruction fetch module (not shown),
The parallel execution in the instruction decode module, instruction execution module, memory access module, and write back module is shown.

【0010】命令サイクル1においては、命令Aに対す
る命令フェッチステージ(以下、IFステージと呼ぶ)
が、特には図示しない命令フェッチモジュールにおいて
実行される。
In instruction cycle 1, an instruction fetch stage for instruction A (hereinafter referred to as an IF stage)
Is executed in an instruction fetch module (not shown).

【0011】命令サイクル2においては、命令Aに対す
る命令デコードステージ(以下、IDステージと呼ぶ)
が、特には図示しない命令デコードモジュールにおいて
実行されると共に、命令Aに続く命令Bに対するIFス
テージが、命令フェッチモジュールにおいて実行され
る。
In instruction cycle 2, an instruction decode stage for instruction A (hereinafter referred to as an ID stage)
Is executed in an instruction decode module (not shown), and the IF stage for the instruction B following the instruction A is executed in the instruction fetch module.

【0012】命令サイクル3においては、命令Aに対す
る命令実行ステージ(以下、EXステージと呼ぶ)が、
特には図示しない命令実行モジュールにおいて実行され
ると共に、命令Bに対するIDステージが命令デコード
モジュールにおいて実行され、命令Bに続く命令Cに対
するIFステージが、命令フェッチモジュールにおいて
実行される。
In the instruction cycle 3, the instruction execution stage for the instruction A (hereinafter referred to as the EX stage) is
In particular, the instruction execution module (not shown) executes the ID stage for the instruction B in the instruction decode module, and the IF stage for the instruction C following the instruction B is executed in the instruction fetch module.

【0013】命令サイクル4においては、命令Aに対す
るメモリアクセスステージ(以下、MAステージと呼
ぶ)が、特には図示しないメモリアクセスモジュールに
おいて実行されると共に、命令Bに対するEXステージ
が、命令実行モジュールにおいて実行され、命令Cに対
するIDステージが命令デコードモジュールにおいて実
行され、命令Cに続く命令Dに対するIFステージが、
命令フェッチモジュールにおいて実行される。
In the instruction cycle 4, the memory access stage for the instruction A (hereinafter referred to as the MA stage) is executed in the memory access module (not shown), and the EX stage for the instruction B is executed in the instruction execution module. And the ID stage for instruction C is executed in the instruction decode module, and the IF stage for instruction D following instruction C is
It is executed in the instruction fetch module.

【0014】命令サイクル5においては、命令Aに対す
るライトバックステージ(以下、WBステージと呼ぶ)
が、特には図示しないライトバックモジュールにおいて
実行されると共に、命令Bに対するMAステージが、メ
モリアクセスモジュールにおいて実行され、命令Cに対
するEXステージが、命令実行モジュールにおいて実行
され、命令Dに対するIDステージが命令デコードモジ
ュールにおいて実行され、更に、特には図示しないが、
命令Dに続く命令Eに対するIFステージが、命令フェ
ッチモジュールにおいて実行される。
In the instruction cycle 5, the write back stage for the instruction A (hereinafter referred to as the WB stage).
Is executed in a write back module (not shown), the MA stage for the instruction B is executed in the memory access module, the EX stage for the instruction C is executed in the instruction execution module, and the ID stage for the instruction D is executed. It is executed in the decoding module and, though not specifically shown,
The IF stage for the instruction E following the instruction D is executed in the instruction fetch module.

【0015】上述したパイプライン処理において、IF
ステージ及びMAステージが実行される場合に、メモリ
に対してデータのリード動作又はライト動作が行われ
る。このメモリには、プロセッサチップに内蔵されるも
のと、プロセッサチップの外部に接続されるものとがあ
る。以後、前者を内部メモリ、後者を外部メモリと呼ぶ
ことにする。
In the pipeline processing described above, the IF
When the stage and the MA stage are executed, a data read operation or a data write operation is performed on the memory. Some memories are built into the processor chip and some are connected to the outside of the processor chip. Hereinafter, the former will be called an internal memory and the latter will be called an external memory.

【0016】外部メモリに対しては、一般的に、パイプ
ラインピッチ(=1命令サイクル)の時間間隔でアクセ
スをすることは困難であるため、メモリウエイトが発生
する。
Since it is generally difficult to access the external memory at a time interval of a pipeline pitch (= 1 instruction cycle), a memory wait occurs.

【0017】図15は、メモリウエイトが発生した場合
のパイプライン処理の説明図である。IFステージでメ
モリウエイトが発生した場合の動作とMAステージでメ
モリウエイトが発生した場合の動作はほぼ同様であるた
め、図15では、説明の簡単のために、MAステージに
おいてのみメモリウエイトが発生した場合について示さ
れている。図15で、IFw、IDw、EXw、及びM
Awは、IFステージ、IDステージ、EXステージ、
及びMAステージのそれぞれの実行時に、メモリウエイ
トが発生していることを示している。
FIG. 15 is an explanatory diagram of pipeline processing when a memory wait occurs. Since the operation when the memory wait occurs in the IF stage and the operation when the memory wait occurs in the MA stage are almost the same, in FIG. 15, the memory wait occurs only in the MA stage for simplification of description. The case is shown. In FIG. 15, IFw, IDw, EXw, and M
Aw is IF stage, ID stage, EX stage,
It shows that a memory wait is occurring at the time of executing each of the MA stage and the MA stage.

【0018】命令Aに対するMAステージにおいてメモ
リウエイトが発生した場合、本来は命令サイクル4にお
いて終了するMAステージが、メモリウエイトが発生し
たことにより命令サイクル5においても繰り返される。
また、命令サイクル5において命令Aに対するMAステ
ージの実行が終了していないため、後続する命令ストリ
ームである命令B、C、Dのそれぞれについて、命令サ
イクル4で実行されたEXステージ、IDステージ、及
びIFステージが、命令サイクル5でも繰り返される。
この動作は、図13に示される構成において、以下のよ
うにして実現される。まず、ウエイト信号ma_wai
tが図15(a) に示されるタイミングでアサートされる
ことによって、アンドゲート1310がオフされると共
に、オアゲート1313、1312、及び1311を介
してアンドゲート1309、1308、及び1307が
オフされる。この結果、命令サイクル5において、クロ
ックCLKが入力されないことによって、PC_MA1
305、PC_EX1304、PC_ID1303、及
びPC_IF1302のそれぞれにおいて命令サイクル
4の状態が維持される。
When a memory wait occurs in the MA stage for the instruction A, the MA stage originally ending in the instruction cycle 4 is repeated in the instruction cycle 5 due to the occurrence of the memory wait.
In addition, since the execution of the MA stage for the instruction A is not completed in the instruction cycle 5, for each of the subsequent instruction streams, that is, the instructions B, C, and D, the EX stage executed in the instruction cycle 4, the ID stage, and The IF stage is repeated in instruction cycle 5 as well.
This operation is realized as follows in the configuration shown in FIG. First, the weight signal ma_wai
By asserting t at the timing shown in FIG. 15A, the AND gate 1310 is turned off, and the AND gates 1309, 1308, and 1307 are turned off via the OR gates 1313, 1312, and 1311. As a result, in the instruction cycle 5, since the clock CLK is not input, PC_MA1
The state of instruction cycle 4 is maintained in each of 305, PC_EX 1304, PC_ID 1303, and PC_IF 1302.

【0019】以上のようにして、パイプライン全体にお
いて1命令サイクルの時間長を有するウエイト時間が発
生し、その時間の分だけ現在実行されている処理が遅延
することになる。即ち、図14と図15を比較すると理
解されるように、例えば命令Bの実行は、メモリウエイ
トが発生していない場合は図14に示されるように命令
サイクル6で終了するのに対し、メモリウエイトが発生
している場合は図15に示されるように命令サイクル6
では終了せず命令サイクル7で終了する。
As described above, a wait time having a time length of one instruction cycle is generated in the entire pipeline, and the processing currently being executed is delayed by that time. That is, as can be understood by comparing FIG. 14 and FIG. 15, for example, the execution of the instruction B ends in the instruction cycle 6 as shown in FIG. 14 when the memory wait does not occur, whereas If a wait is occurring, instruction cycle 6 as shown in FIG.
Does not end, and ends in instruction cycle 7.

【0020】IFステージでメモリウエイトが発生する
場合には、オアゲート11を介してウエイト信号if_
waitがアサートされることにより、アンドゲート1
307がオフされる。この結果、PC_IF1302に
おいてウエイト状態が発生する。なお、IDステージ及
びEXステージにおいても種々の原因によりウエイトが
発生する可能性がある。IDステージでウエイトが発生
する場合には、乗算命令のようなマルチサイクル命令が
実行される場合に発生するマルチサイクルウエイトがあ
る。この場合には、オアゲート12を介してウエイト信
号id_waitがアサートされることによって、アン
ドゲート1308及び1307がオフされる。この結
果、PC_ID1303及びPC_IF1302におい
て、ウエイト状態が発生する。また、EXステージでウ
エイトが発生する場合には、メモリからロードされたオ
ペランドが次の命令で演算されるような場合に発生する
ロードユーズインターロックがある。この場合には、オ
アゲート13を介してウエイト信号id_waitがア
サートされることによって、アンドゲート1309、1
308、及び1307がオフされる。この結果、PC_
EX1304、PC_ID1303及びPC_IF13
02において、ウエイト状態が発生する。
When a memory wait occurs in the IF stage, the wait signal if_ is passed through the OR gate 11.
By asserting wait, AND gate 1
307 is turned off. As a result, a wait state occurs in PC_IF 1302. It should be noted that weights may be generated in the ID stage and the EX stage due to various causes. When a wait occurs in the ID stage, there is a multicycle wait that occurs when a multicycle instruction such as a multiply instruction is executed. In this case, the AND gates 1308 and 1307 are turned off by asserting the wait signal id_wait via the OR gate 12. As a result, a wait state occurs in PC_ID 1303 and PC_IF 1302. Further, when a wait occurs in the EX stage, there is a load use interlock that occurs when an operand loaded from the memory is operated by the next instruction. In this case, the wait signal id_wait is asserted via the OR gate 13 so that the AND gates 1309, 1
308 and 1307 are turned off. As a result, PC_
EX1304, PC_ID1303 and PC_IF13
At 02, a wait state occurs.

【0021】図16は、各命令のMAステージにおいて
メモリウエイトが発生した場合のパイプライン処理の説
明図である。この図から、パイプライン全体における処
理の遅延が更に顕著になることが理解される。
FIG. 16 is an explanatory diagram of pipeline processing when a memory wait occurs in the MA stage of each instruction. From this figure, it can be understood that the processing delay in the entire pipeline becomes more significant.

【0022】ここで一般に、プロセッサチップの内部で
外部メモリをアクセスするためのオペランドアドレスが
発生され、そのアドレスを外部メモリが認識する時点ま
での間に、一定の遅延が生ずる。この遅延の値は、プロ
セッサチップの内部のバス及びそのバスの接続回路にお
ける信号の伝搬遅延、出力バッファ駆動回路における信
号の伝搬遅延、大きい容量を有するプロセッサチップの
外部ピンを駆動するための出力バッファ自身における信
号の処理遅延、及びプロセッサチップの外部のアドレス
バスが有する配線容量及び抵抗による信号の伝搬遅延の
総和である。
Here, generally, an operand address for accessing the external memory is generated inside the processor chip, and a certain delay occurs until the external memory recognizes the address. This delay value is a signal propagation delay in a bus inside the processor chip and a circuit connecting the bus, a signal propagation delay in an output buffer driving circuit, and an output buffer for driving an external pin of a processor chip having a large capacity. It is the sum of the signal processing delay in itself and the signal propagation delay due to the wiring capacitance and resistance of the address bus outside the processor chip.

【0023】また、外部メモリがオペランドデータを出
力し、それがプロセッサチップ内で取り込まれるまでの
間にも、信号の伝搬遅延が生ずる。ここで、プロセッサ
チップの内部では、MAステージの終了時点までにアク
セスされたオペランドデータが確定しなければならな
い。従って、外部メモリがアクセスされるときの上述し
た遅延を、オペランドアドレスとオペランドデータのそ
れぞれに対して1/2命令サイクルずつと見積もると、
図17に示されるように、外部メモリアクセスに対する
各命令のMAステージにおいて1命令サイクルの時間長
を有するメモリウエイト(1ウエイト)が挿入されたと
しても、図17の(a) 及び(b) に示されるように、外部
メモリに対する実効アクセスタイムは1命令サイクルに
なってしまう。即ち、前述したように、外部のメモリに
対してはパイプラインピッチ(=1命令サイクル)の時
間間隔でアクセスをすることが困難であるゆえそれを回
避するためにMAステージにおいて1ウエイトが挿入さ
れるのにもかかわらず、上述の遅延の存在により、外部
メモリに対する実効アクセスタイムが1命令サイクルに
なってしまうのである。
Also, a signal propagation delay occurs until the external memory outputs the operand data and the data is fetched in the processor chip. Here, inside the processor chip, the operand data accessed by the end of the MA stage must be determined. Therefore, when the above delay when the external memory is accessed is estimated to be 1/2 instruction cycle for each of the operand address and the operand data,
As shown in FIG. 17, even if a memory wait (one wait) having a time length of one instruction cycle is inserted in the MA stage of each instruction for external memory access, the results are as shown in (a) and (b) of FIG. As shown, the effective access time to the external memory is one instruction cycle. That is, as described above, it is difficult to access an external memory at a time interval of a pipeline pitch (= 1 instruction cycle). Therefore, one wait is inserted in the MA stage to avoid it. However, due to the above-mentioned delay, the effective access time to the external memory becomes one instruction cycle.

【0024】そのため、従来は、更にメモリウエイトが
必要となる。即ち、例えば図18に示されるように、外
部メモリアクセスに対する各命令のMAステージにおい
て2ウエイトが挿入され、MAステージの時間長が3命
令サイクルとされることによって、図18の(a) 及び
(b) に示されるように、外部メモリに対して2命令サイ
クルの時間長を有する実効アクセスタイムが確保されて
いた。
Therefore, in the past, further memory weight is required. That is, for example, as shown in FIG. 18, 2 waits are inserted in the MA stage of each instruction for external memory access, and the time length of the MA stage is set to 3 instruction cycles.
As shown in (b), the effective access time having a time length of two instruction cycles was secured for the external memory.

【0025】上述の事実は、MAステージにおいてのみ
ならず、IFステージにおいても同様に発生する。この
ように従来技術においては、プロセッサチップの内部と
外部のインタフェースにおける信号遅延が、パイプライ
ン処理における外部メモリアクセス時の実効アクセスタ
イムを減少させてしまうため、その減少分を補償するた
めのメモリウエイトが余分に必要となり、パイプライン
全体における処理の遅延を増加させてしまうという問題
点を有していた。
The above facts occur not only in the MA stage but also in the IF stage. As described above, in the conventional technique, the signal delay in the internal and external interfaces of the processor chip reduces the effective access time at the time of external memory access in the pipeline processing. Therefore, the memory weight for compensating for the reduced amount. However, there is a problem in that the processing delay in the entire pipeline is increased because of the extra requirement.

【0026】本発明は、プロセッサチップの内部と外部
のインタフェースにおける信号遅延がパイプライン処理
における外部メモリアクセス時の実効アクセスタイムに
影響を及ぼさないことを可能にすることを目的とする。
It is an object of the present invention to make it possible to prevent the signal delay in the interface inside and outside the processor chip from affecting the effective access time at the time of accessing the external memory in the pipeline processing.

【0027】[0027]

【課題を解決するための手段】図1は、本発明のブロッ
ク図である。本発明は、まず、パイプラインの基幹を構
成するものとして、以下に示す命令フェッチ手段10
1、命令デコード手段102、命令実行手段103、メ
モリアクセス手段104、及びライトバック手段105
を有する。
FIG. 1 is a block diagram of the present invention. In the present invention, first, the instruction fetch means 10 shown below is provided as a constituent of the backbone of a pipeline.
1, instruction decoding means 102, instruction execution means 103, memory access means 104, and write back means 105
Have.

【0028】即ち、命令フェッチ手段101は、他のス
テージと並列に実行することのできる命令フェッチステ
ージIFにおいて、メモリ手段から命令をフェッチす
る。命令デコード手段102は、他のステージと並列に
実行することのできる命令デコードステージIDにおい
て、フェッチされた命令をデコードする。
That is, the instruction fetch unit 101 fetches an instruction from the memory unit in the instruction fetch stage IF which can be executed in parallel with other stages. The instruction decoding unit 102 decodes the fetched instruction at an instruction decode stage ID that can be executed in parallel with other stages.

【0029】命令実行手段103は、他のステージと並
列に実行することのできる命令実行ステージEXにおい
て、デコードされた命令を実行する。メモリアクセス手
段104は、他のステージと並列に実行することのでき
るメモリアクセスステージMAにおいて、命令実行ステ
ージEXにおいて計算されたアドレスに対してメモリ手
段にリード又はライトを行う。
The instruction execution means 103 executes the decoded instruction in the instruction execution stage EX which can be executed in parallel with other stages. In the memory access stage MA, which can be executed in parallel with other stages, the memory access means 104 reads or writes to the memory means with respect to the address calculated in the instruction execution stage EX.

【0030】そして、ライトバック手段105は、他の
ステージと並列に実行することのできるライトバックス
テージWBにおいて、メモリアクセスステージMAでメ
モリ手段から得られるオペランドデータ又は命令実行ス
テージEXにおいて処理されたオペランドデータをレジ
スタ手段に書き込む。
Then, the write-back means 105, in the write-back stage WB which can be executed in parallel with the other stages, the operand data obtained from the memory means in the memory access stage MA or the operand processed in the instruction execution stage EX. Write the data to the register means.

【0031】次に、図1で、命令フェッチステージ分割
手段106は、命令フェッチステージIFを、命令アド
レスをメモリ手段に対して出力する命令アドレス出力ス
テージIFaと、メモリ手段から命令アドレスに対応す
る命令データを入力する命令データ入力ステージIFd
に分割する。今例えば、命令フェッチ手段101、命令
デコード手段102、命令実行手段103、メモリアク
セス手段104、及びライトバック手段105が使用す
るデータ(例えばプログラムカウンタ値)をそれぞれ順
次保持するものであって、命令フェッチステージデータ
保持手段(PC_IF202)、命令デコードステージ
データ保持手段(PC_ID203)、命令実行ステー
ジデータ保持手段(PC_EX204)、メモリアクセ
スステージデータ保持手段(PC_MA205)、及び
ライトバックステージデータ保持手段(PC_WB20
6)からなるパイプラインが構成される場合を想定す
る。この場合、命令フェッチステージ分割手段106
は、命令フェッチステージデータ保持手段を、命令アド
レスを外部メモリに対して出力するステージである命令
アドレス出力ステージIFaで使用されるデータを保持
する命令アドレス出力ステージデータ保持手段(PC_
IF202)と、メモリ手段から命令アドレスに対応す
る命令データを入力するステージである命令データ入力
ステージIFdで使用されるデータを保持する命令デー
タ入力ステージデータ保持手段(PC_Fd214)に
分割する。
Next, in FIG. 1, the instruction fetch stage dividing means 106 outputs the instruction fetch stage IF to the instruction address output stage IFa for outputting the instruction address to the memory means and the instruction corresponding to the instruction address from the memory means. Instruction data input stage IFd for inputting data
Split into. Now, for example, the instruction fetch unit 101, the instruction decoding unit 102, the instruction execution unit 103, the memory access unit 104, and the data used by the write back unit 105 (for example, the program counter value) are sequentially held, and the instruction fetch unit Stage data holding means (PC_IF202), instruction decode stage data holding means (PC_ID203), instruction execution stage data holding means (PC_EX204), memory access stage data holding means (PC_MA205), and write back stage data holding means (PC_WB20).
Suppose a pipeline consisting of 6) is configured. In this case, the instruction fetch stage dividing means 106
The instruction fetch stage data holding means holds the data used in the instruction address output stage IFa which is a stage for outputting the instruction address to the external memory (PC_
IF202) and the instruction data input stage data holding means (PC_Fd 214) for holding the data used in the instruction data input stage IFd, which is the stage for inputting the instruction data corresponding to the instruction address from the memory means.

【0032】また、図1で、メモリアクセスステージ分
割手段109は、メモリアクセスステージMAを、オペ
ランドアドレスをメモリ手段に対して出力するオペラン
ドアドレス出力ステージMaと、メモリ手段に対してオ
ペランドアドレスに対応するオペランドデータをリード
又はライトするオペランドデータリード/ライトステー
ジMdに分割する。今、例えば、上述した命令フェッチ
ステージ分割手段106の説明において想定した場合と
同じ場合を想定する。この場合、メモリアクセスステー
ジ分割手段109は、メモリアクセスステージデータ保
持手段を、オペランドアドレスをメモリ手段に対して出
力するステージであるオペランドアドレス出力ステージ
Maで使用されるデータを保持するオペランドアドレス
出力ステージデータ保持手段(PC_MA205)と、
メモリ手段に対してオペランドアドレスに対応するオペ
ランドデータをリード又はライトするステージであるオ
ペランドデータリード/ライトステージMdで使用され
るデータを保持するオペランドデータリード/ライトス
テージデータ保持手段(PC_Md215)に分割す
る。
In FIG. 1, the memory access stage dividing means 109 corresponds to the operand address output stage Ma for outputting the memory access stage MA to the memory means and the operand address to the memory means. It is divided into operand data read / write stages Md for reading or writing operand data. Now, for example, assume the same case as that assumed in the description of the instruction fetch stage dividing unit 106 described above. In this case, the memory access stage dividing means 109 causes the memory access stage data holding means to hold the data used in the operand address output stage Ma which is a stage for outputting the operand address to the memory means. Holding means (PC_MA205),
The memory means is divided into operand data read / write stage data holding means (PC_Md 215) for holding data used in the operand data read / write stage Md which is a stage for reading or writing the operand data corresponding to the operand address. .

【0033】上述の発明の構成において、更に、以下に
示す命令フェッチステージ分割制御手段107及びメモ
リアクセスステージ分割制御手段110(共に、パイプ
ラインウエイト/段数制御回路801に対応する)を有
するように構成することができる。
In the above-mentioned configuration of the present invention, it further comprises an instruction fetch stage division control means 107 and a memory access stage division control means 110 (both correspond to the pipeline wait / stage number control circuit 801) shown below. can do.

【0034】まず、命令フェッチステージ分割制御手段
107は、命令フェッチステージ分割手段106が命令
フェッチステージIFを分割していない状態で、プロセ
ッサチップの外部に接続される外部メモリに対して命令
のフェッチが発生した時点において、命令フェッチステ
ージ分割手段106に対して命令フェッチステージIF
を分割させる。
First, the instruction fetch stage division control means 107 fetches instructions to an external memory connected to the outside of the processor chip while the instruction fetch stage division means 106 does not divide the instruction fetch stage IF. At the time of occurrence, the instruction fetch stage IF is sent to the instruction fetch stage dividing means 106.
To split.

【0035】また、命令フェッチステージ分割制御手段
107は、命令フェッチステージIFが分割されている
状態で、分岐命令の実行によって分岐が発生し、かつそ
の分岐に対応する分岐先命令がプロセッサチップに内蔵
される内部メモリからフェッチされる時点において、命
令フェッチステージ分割手段106に対して命令フェッ
チステージIFの分割を解除させる。
Further, the instruction fetch stage division control means 107 has a branch in the execution of the branch instruction while the instruction fetch stage IF is divided, and a branch destination instruction corresponding to the branch is built in the processor chip. At the time of fetching from the internal memory, the instruction fetch stage dividing means 106 is caused to cancel the division of the instruction fetch stage IF.

【0036】次に、メモリアクセスステージ分割制御手
段110は、メモリアクセスステージ分割手段109が
メモリアクセスステージMAを分割していない状態で、
プロセッサチップの外部に接続される外部メモリに対し
てオペランドデータのアクセスが発生した時点におい
て、メモリアクセスステージ分割手段109に対してメ
モリアクセスステージMAを分割させる。
Next, the memory access stage division control means 110, when the memory access stage division means 109 does not divide the memory access stage MA,
When access of operand data to an external memory connected to the outside of the processor chip occurs, the memory access stage dividing means 109 divides the memory access stage MA.

【0037】また、メモリアクセスステージ分割制御手
段110は、メモリアクセスステージMAが分割されて
いる状態で、メモリアクセスを伴わない命令が実行さ
れ、かつその命令に続く命令が実行するメモリアクセス
がプロセッサチップに内蔵される内部メモリに対するも
のであった時点において、メモリアクセスステージ分割
手段109に対してメモリアクセスステージMAの分割
を解除させる。
Further, the memory access stage division control means 110 executes a memory access stage MA in a divided state, executes an instruction without a memory access, and executes a memory access executed by an instruction following the instruction. When it is for the internal memory built in the memory access stage MA, the memory access stage division means 109 is caused to cancel the division of the memory access stage MA.

【0038】ここまでの発明の構成において、更に、命
令アドレス出力ステージIFaを任意の命令サイクル数
だけウエイト状態にする命令アドレス出力ステージウエ
イト制御手段108と、オペランドアドレス出力ステー
ジMaを任意の命令サイクル数だけウエイト状態にする
オペランドアドレス出力ステージウエイト制御手段11
1(共に、パイプラインウエイト/段数制御回路801
に対応する)を有するように構成することもできる。
In the configuration of the invention described above, further, the instruction address output stage wait control means 108 for putting the instruction address output stage IFa into a wait state for an arbitrary number of instruction cycles and the operand address output stage Ma for an arbitrary number of instruction cycles. Operand address output stage wait control means 11 for setting only wait state
1 (both pipeline weight / stage number control circuit 801
Corresponding to the above).

【0039】加えて、ここまでの発明の構成において、
命令フェッチ手段101によって実行される、命令アド
レス出力ステージIFaにおける命令アドレスの出力動
作と、命令データ入力ステージIFdにおける命令デー
タの入力動作は、並列に実行され、メモリアクセス手段
104によって実行される、オペランドアドレス出力ス
テージMaにおけるオペランドアドレスの出力動作と、
オペランドデータリード/ライトステージMdにおける
オペランドデータのリード又はライト動作は、並列に実
行されるように構成することができる。
In addition, in the constitution of the invention so far,
The operation of outputting the instruction address in the instruction address output stage IFa and the operation of inputting the instruction data in the instruction data input stage IFd, which are executed by the instruction fetch unit 101, are executed in parallel, and the operand is executed by the memory access unit 104. An output operation of an operand address in the address output stage Ma,
The read or write operation of the operand data in the operand data read / write stage Md can be configured to be executed in parallel.

【0040】[0040]

【作用】命令フェッチステージIFにおいて、プロセッ
サチップに内蔵される内部メモリに記憶されている命令
がフェッチされているような状態においては、命令フェ
ッチステージIFは分割されない。この結果、分岐発生
時のパイプライン処理のキャンセルによるペナルティを
小さくすることができる。
In the instruction fetch stage IF, when the instruction stored in the internal memory built into the processor chip is fetched, the instruction fetch stage IF is not divided. As a result, the penalty for canceling the pipeline processing when a branch occurs can be reduced.

【0041】一方、命令フェッチステージIFが分割さ
れていない状態で、プロセッサチップの外部に接続され
る外部メモリに対して命令のフェッチが発生した時点に
おいて、命令フェッチステージ分割制御手段107が命
令フェッチステージ分割手段106に対して命令フェッ
チステージIFを分割させる。この結果、分割された命
令フェッチステージIFが実行されている命令サイクル
において、他のステージの処理がウエイト状態になる時
間を短縮させることができ、分岐発生時以外のタイミン
グにおいて、パイプライン処理の性能を向上させること
ができる。この場合、命令アドレス出力ステージウエイ
ト制御手段108が、命令フェッチステージIFが分割
されることにより生ずる命令アドレス出力ステージのウ
エイト状態を適切に制御する。
On the other hand, when the instruction fetch stage IF is not divided and the instruction fetch occurs in the external memory connected to the outside of the processor chip, the instruction fetch stage division control means 107 causes the instruction fetch stage IF The dividing unit 106 is caused to divide the instruction fetch stage IF. As a result, in the instruction cycle in which the divided instruction fetch stage IF is executed, it is possible to shorten the time during which the processing of the other stages is in the wait state, and the performance of the pipeline processing at the timing other than when the branch occurs. Can be improved. In this case, the instruction address output stage wait control means 108 appropriately controls the wait state of the instruction address output stage which is generated by dividing the instruction fetch stage IF.

【0042】また、分岐命令の実行によって分岐が発生
し、かつその分岐に対応する分岐先命令がプロセッサチ
ップに内蔵される内部メモリからフェッチされる時点に
おいて命令フェッチステージIFの分割が解除されるこ
とにより、パイプライン処理中の有効なデータを失わせ
ることなく、パイプラインの状態を最適な状態に変更す
ることができる。
Further, the division of the instruction fetch stage IF is canceled at the time when a branch is generated by the execution of the branch instruction and the branch target instruction corresponding to the branch is fetched from the internal memory incorporated in the processor chip. This makes it possible to change the pipeline state to an optimum state without losing valid data during pipeline processing.

【0043】一方、メモリアクセスステージMAが分割
されていない状態で、プロセッサチップの外部に接続さ
れる外部メモリに対してオペランドデータのアクセスが
発生した時点において、メモリアクセスステージ分割制
御手段110がメモリアクセスステージ分割手段109
に対してメモリアクセスステージMAを分割させる。こ
の結果、分割されたメモリアクセスステージMAが実行
されている命令サイクルにおいて、他のステージの処理
がウエイト状態になる時間を短縮させることができ、分
岐発生時以外のタイミングにおいて、パイプライン処理
の性能を向上させることができる。この場合、オペラン
ドアドレス出力ステージウエイト制御手段111が、メ
モリアクセスステージMAが分割されることにより生ず
るオペランドアドレス出力ステージのウエイト状態を適
切に制御する。
On the other hand, when the access of operand data to the external memory connected to the outside of the processor chip occurs while the memory access stage MA is not divided, the memory access stage division control means 110 makes the memory access. Stage dividing means 109
, The memory access stage MA is divided. As a result, in the instruction cycle in which the divided memory access stage MA is executed, it is possible to shorten the time in which the processing of the other stages is in the wait state, and the performance of the pipeline processing at the timing other than when the branch occurs. Can be improved. In this case, the operand address output stage wait control means 111 appropriately controls the wait state of the operand address output stage generated by dividing the memory access stage MA.

【0044】また、メモリアクセスを伴わない命令が実
行され、かつその命令に続く命令が実行するメモリアク
セスがプロセッサチップに内蔵される内部メモリに対す
るものであった時点においてメモリアクセスステージM
Aの分割が解除されることにより、命令フェッチステー
ジの場合と同様に、パイプライン処理中の有効なデータ
を失わせることなく、パイプラインの状態を最適な状態
に変更することができる。
The memory access stage M is executed at the time when an instruction without memory access is executed and the memory access executed by the instruction following the instruction is for the internal memory incorporated in the processor chip.
By releasing the division of A, the state of the pipeline can be changed to the optimum state without losing valid data during pipeline processing, as in the case of the instruction fetch stage.

【0045】[0045]

【実施例】以下、図面を参照しながら本発明の実施例に
つき詳細に説明する。図2に、本発明によるパイプライ
ン制御装置の一部の実施例を示す。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 2 shows a partial embodiment of the pipeline control device according to the present invention.

【0046】図2で、1301、1303、1304、
1306〜1313で示される各部分は、図13で示さ
れる従来技術における201、203、204、206
〜213で示される各部分の機能と同じ機能を有する。
In FIG. 2, 1301, 1303, 1304,
The respective portions indicated by 1306 to 1313 are 201, 203, 204, 206 in the prior art shown in FIG.
˜213 has the same function as each part.

【0047】図2の構成が図13の構成と異なる点は、
以下の通りである。即ちまず、命令フェッチステージ
は、場合に応じて、命令アドレスをメモリに対して出力
するための第1命令フェッチステージ(以下、IFaス
テージと呼ぶ)と、命令データをメモリからフェッチす
るための第2命令フェッチステージ(以下、Fdステー
ジと呼ぶ)に分割することができる。また、メモリアク
セスステージは、場合に応じて、オペランドアドレスを
メモリに対して出力するための第1メモリアクセスステ
ージ(以下、Maステージと呼ぶ)と、オペランドデー
タをメモリに対して入力又は出力するための第2メモリ
アクセスステージ(以下、Mdステージと呼ぶ)に分割
することができる。そして、命令フェッチステージが分
割されない場合は、第1命令フェッチステージプログラ
ムカウンタ値保持部202(以下、単にPC_IF20
2と呼ぶ)の出力はマルチプレクサ220を介してPC
_ID203に入力され、命令フェッチステージが分割
される場合には、PC_IF202の出力は第2命令フ
ェッチステージプログラムカウンタ値保持部214(以
下、PC_Fd214と呼ぶ)を経由した後に、マルチ
プレクサ220を介してPC_ID203に入力され
る。また、メモリアクセスステージが分割されない場合
には、第1メモリアクセスステージプログラムカウンタ
値保持部205(以下、単にPC_MA205と呼ぶ)
の出力はマルチプレクサ221を介してPC_WB20
6に入力され、メモリアクセスステージが分割される場
合は、PC_MA205の出力は第2メモリアクセスス
テージプログラムカウンタ値保持部215(以下、PC
_Md215と呼ぶ)を経由した後に、マルチプレクサ
221を介してPC_WB206に入力される。従っ
て、命令フェッチステージ及びメモリアクセスステージ
の何れもが分割されない場合は、図2の構成は図13の
構成と同じとなる。
The configuration of FIG. 2 differs from that of FIG. 13 in that
It is as follows. That is, first, the instruction fetch stage may optionally include a first instruction fetch stage (hereinafter referred to as an IFa stage) for outputting an instruction address to the memory and a second instruction fetch stage for fetching instruction data from the memory. It can be divided into instruction fetch stages (hereinafter referred to as Fd stages). In addition, the memory access stage inputs or outputs the operand data to or from the first memory access stage (hereinafter, referred to as Ma stage) for outputting the operand address to the memory, as the case may be. Second memory access stage (hereinafter referred to as Md stage). If the instruction fetch stage is not divided, the first instruction fetch stage program counter value holding unit 202 (hereinafter, simply PC_IF20
2) is output to the PC via the multiplexer 220.
In the case where the instruction fetch stage is input to the _ID 203 and the instruction fetch stage is divided, the output of the PC_IF 202 is passed to the second instruction fetch stage program counter value holding unit 214 (hereinafter, referred to as PC_Fd 214) and then to the PC_ID 203 via the multiplexer 220. Is entered. If the memory access stage is not divided, the first memory access stage program counter value holding unit 205 (hereinafter simply referred to as PC_MA 205)
Output of PC_WB20 via multiplexer 221
6 and the memory access stage is divided, the output of the PC_MA 205 is the second memory access stage program counter value holding unit 215 (hereinafter PC
_Md 215) and then input to the PC_WB 206 via the multiplexer 221. Therefore, when neither the instruction fetch stage nor the memory access stage is divided, the configuration of FIG. 2 becomes the same as the configuration of FIG.

【0048】上述の構成を有する実施例の動作につい
て、以下に説明する。まず、図3は、内部メモリなどの
ような1命令サイクルでアクセス可能なメモリがアクセ
スされる場合のパイプライン処理の説明図である。この
場合には、命令フェッチステージ及びメモリアクセスス
テージの何れも分割されず、PC_IF202の出力は
マルチプレクサ220を介してPC_ID203に入力
され、PC_MA205の出力はマルチプレクサ221
を介してPC_WB206に入力される。即ち、この場
合の処理は、図14を使って前述した一般的なパイプラ
イン処理と同じになる。
The operation of the embodiment having the above configuration will be described below. First, FIG. 3 is an explanatory diagram of pipeline processing when a memory such as an internal memory that can be accessed in one instruction cycle is accessed. In this case, neither the instruction fetch stage nor the memory access stage is divided, the output of PC_IF 202 is input to PC_ID 203 via multiplexer 220, and the output of PC_MA 205 is multiplexer 221.
Is input to PC_WB 206 via. That is, the processing in this case is the same as the general pipeline processing described above with reference to FIG.

【0049】次に、図4は、パイプラインピッチ(=1
命令サイクル)の時間間隔でアクセスをすることが困難
な外部メモリがアクセスされる場合のパイプライン処理
の説明図である。
Next, FIG. 4 shows the pipeline pitch (= 1
FIG. 10 is an explanatory diagram of pipeline processing when an external memory that is difficult to access at an interval of (instruction cycle) is accessed.

【0050】この図を、従来技術に関する前述した図1
8と比較しながら説明する。まず、図4では、メモリア
クセスステージが、MaステージとMdステージに分割
されている点が、本発明に関連する大きな特徴である。
これに対して、従来技術に関する図18では、メモリア
クセスステージは分割されていない。この結果、図4で
は、例えば命令サイクル6において、命令Aに対するM
dステージが実行されることにより、命令Aに対するオ
ペランドデータがCPUと外部メモリとの間で授受され
るのと並行して、命令Bに対するMa(Maw)ステー
ジが実行されることによって、命令Bに対するオペラン
ドデータをアクセスするためのオペランドアドレスがC
PUから外部メモリに対して出力されることになる。即
ち、CPUが外部メモリにオペランドアドレスを指定す
るステージと、CPUが外部メモリとの間でオペランド
データを授受するステージとが分割されることにより、
これらの動作を、2つの命令間で、並列にパイプライン
処理することが可能となる。
This drawing is shown in FIG.
This will be described in comparison with 8. First, in FIG. 4, the memory access stage is divided into a Ma stage and an Md stage, which is a major feature related to the present invention.
On the other hand, in FIG. 18 relating to the conventional technique, the memory access stage is not divided. As a result, in FIG. 4, for example, in the instruction cycle 6, M for the instruction A
By executing the d stage, operand data for the instruction A is transferred between the CPU and the external memory, and at the same time, the Ma (Maw) stage for the instruction B is executed, so that the instruction B for the instruction B is executed. Operand address for accessing operand data is C
It will be output from the PU to the external memory. That is, by dividing the stage in which the CPU specifies the operand address in the external memory and the stage in which the CPU transmits and receives the operand data to and from the external memory,
These operations can be pipelined in parallel between two instructions.

【0051】この結果、図4の動作は、図18の動作に
比較して、以下に説明する優位性を有する。即ちまず、
図4と図18では、メモリアクセスを実行するために必
要な命令サイクル長は、共に3命令サイクルである。こ
の結果、両者共、図4の(c) 、(d)及び図18の(a) 、
(b) に示されるように、外部メモリに対して2命令サイ
クルの時間長を有する実効アクセスタイムが確保され
る。
As a result, the operation of FIG. 4 has the following advantages as compared with the operation of FIG. That is, first
In FIGS. 4 and 18, the instruction cycle length required to execute the memory access is 3 instruction cycles. As a result, in both cases, (c) and (d) of FIG. 4 and (a) of FIG.
As shown in (b), an effective access time having a time length of two instruction cycles is secured for the external memory.

【0052】但し、メモリアクセスステージを構成する
3命令サイクルのうちメモリウエイト状態となる時間
は、図18では2命令サイクルであるのに対して、図4
では1命令サイクルのみである。従って、メモリアクセ
スステージを構成する3命令サイクルの時間のうち他の
命令のステージを並列に実行できない時間は、図18で
は2命令サイクルとなるのに対して、図4では1命令サ
イクルで済む。
However, of the three instruction cycles which form the memory access stage, the time to enter the memory wait state is two instruction cycles in FIG.
Then, it is only one instruction cycle. Therefore, the time during which the other instruction stages cannot be executed in parallel among the three instruction cycle times that constitute the memory access stage is two instruction cycles in FIG. 18, whereas it is only one instruction cycle in FIG.

【0053】このために、命令Aに続く例えば命令Bに
対する命令実行ステージにおいて、図18においては、
命令AのMAステージで挿入されている2ウエイトの時
間長(MAw×2)と同じ時間長のメモリウエイト(E
Xw×2)が挿入されるのに対して、図4では、命令A
のMaステージで挿入されている1ウエイトの時間長
(Maw×1)と同じ時間長のメモリウエイト(EXw
×1)が挿入されるのみで済む。従って、図4では、命
令AのMdステージが実行される命令サイクル6におい
て、命令Bに対するEXステージの次のステージである
Maステージを実行することができる。命令C〜Eにつ
いても、命令サイクル6において、命令サイクル5以前
の状態が繰り返されることはない。
For this reason, in the instruction execution stage for the instruction B following the instruction A, for example, in FIG.
A memory wait (E) having the same time length as the time length (MAw × 2) of the two waits inserted in the MA stage of instruction A
Xw × 2) is inserted, the instruction A in FIG.
Memory weight (EXw) having the same time length as the time length (Maw × 1) of one weight inserted in the Ma stage of
X1) is only inserted. Therefore, in FIG. 4, in the instruction cycle 6 in which the Md stage of the instruction A is executed, the Ma stage which is the next stage to the EX stage for the instruction B can be executed. Regarding the instructions C to E, in the instruction cycle 6, the state before the instruction cycle 5 is not repeated.

【0054】結果的に、例えば命令Bが実行を終了する
までの命令サイクルの長さは、図18では10命令サイ
クルとなるのに対して、図4では9命令サイクルとな
る。更に、例えば命令Dが実行を終了するまでの命令サ
イクルの長さは、図18では16命令サイクルに達する
のに対して、図4では13命令サイクルで済む。このよ
うに、本実施例は従来技術に比較して、パイプライン全
体で、処理の遅延を減少させることができる。
As a result, for example, the instruction cycle length until the instruction B finishes executing is 10 instruction cycles in FIG. 18, whereas it is 9 instruction cycles in FIG. Further, for example, the instruction cycle length until the instruction D finishes executing reaches 16 instruction cycles in FIG. 18, whereas it is 13 instruction cycles in FIG. As described above, this embodiment can reduce the processing delay in the entire pipeline as compared with the related art.

【0055】図5は、パイプラインピッチ(=1命令サ
イクル)の時間間隔でアクセスをすることができる外部
メモリがアクセスされる場合のパイプライン処理の説明
図である。
FIG. 5 is an explanatory diagram of pipeline processing when an external memory which can be accessed at a time interval of pipeline pitch (= 1 instruction cycle) is accessed.

【0056】この場合も、図4の場合と同様に、メモリ
アクセスステージが、MaステージとMdステージに分
割される。この結果、図5の(a) 、(b) に示されるよう
に、メモリアクセスステージにおいてメモリウエイトを
挿入することなく、外部メモリに対して1命令サイクル
の時間長を有する実効アクセスタイムを確保することが
できる。
Also in this case, as in the case of FIG. 4, the memory access stage is divided into the Ma stage and the Md stage. As a result, as shown in (a) and (b) of FIG. 5, an effective access time having a time length of one instruction cycle is secured to the external memory without inserting a memory wait in the memory access stage. be able to.

【0057】以上の動作は、メモリアクセスステージだ
けでなく、命令フェッチステージにおいても、そのステ
ージが命令アドレスをメモリに対して出力するためのI
Faステージと命令データをメモリからフェッチするた
めのFdステージに分割されることにより、全く同様の
効果が実現される。
The above operation is performed not only in the memory access stage but also in the instruction fetch stage, so that the stage outputs I address to the memory.
By dividing into the Fa stage and the Fd stage for fetching instruction data from the memory, exactly the same effect is realized.

【0058】ここで、パイプライン処理を使って分岐命
令が実行される場合、一般的に、パイプラインには、分
岐命令に関するデータに続いて、その分岐命令がデコー
ドされた結果分岐が発生しなかった場合に実行される命
令群に関するデータが入力されている。従って、分岐命
令がデコードされた結果分岐が発生した場合には、分岐
命令に関するデータに続いてパイプラインに入力されて
いる命令群に関するデータをキャンセルして、分岐先の
命令群に関するデータを入力し直す必要が生ずる。
Here, when a branch instruction is executed using pipeline processing, generally, in the pipeline, following branch instruction data, the branch instruction is decoded, and as a result, no branch occurs. The data relating to the instruction group to be executed is input. Therefore, if a branch occurs as a result of the decoding of a branch instruction, the data related to the instruction group input to the pipeline following the data related to the branch instruction is canceled and the data related to the branch destination instruction group is input. There is a need to fix it.

【0059】この場合に、命令フェッチステージがIF
aステージとFdステージに分割されることによって、
パイプライン処理の段数が長くなった場合、以下に説明
するように分岐発生時のパイプライン処理のキャンセル
によるペナルティが大きくなり、パイプライン処理の性
能低下を招いてしまう。
In this case, the instruction fetch stage is IF
By being divided into a stage and Fd stage,
When the number of stages of pipeline processing becomes long, the penalty due to cancellation of pipeline processing at the time of branch occurrence increases as described below, and the performance of pipeline processing deteriorates.

【0060】上述の問題を、命令フェッチステージが分
割されていない場合と分割されている場合とを比較する
ことにより、説明する。図6は、命令フェッチステージ
が分割されていない場合において分岐が発生した場合の
パイプライン処理を示した図である。
The above problem will be described by comparing the case where the instruction fetch stage is not divided and the case where the instruction fetch stage is divided. FIG. 6 is a diagram showing pipeline processing when a branch occurs when the instruction fetch stage is not divided.

【0061】まず、命令サイクル2において、特には図
示しない命令デコードモジュールは、図2のPC_ID
203にセットされている分岐命令Aに対応するプログ
ラムカウンタ値を判別することにより、分岐命令Aをデ
コードする。
First, in the instruction cycle 2, the instruction decode module not shown in the figure
The branch instruction A is decoded by determining the program counter value corresponding to the branch instruction A set in 203.

【0062】この結果、命令デコードモジュールは、分
岐命令のオペランドデータである分岐オフセットアドレ
スを、図2のPC_adder201に出力する。PC
_adder201は、PC_IF202から出力され
ている現在のプログラムカウンタ値に上述の分岐オフセ
ットアドレスを加算する。
As a result, the instruction decoding module outputs the branch offset address, which is the operand data of the branch instruction, to the PC_adder 201 shown in FIG. PC
The _adder 201 adds the above branch offset address to the current program counter value output from the PC_IF 202.

【0063】この結果得られる分岐先命令Cに対応する
プログラムカウンタ値は、命令サイクル3において、P
C_IF202にセットされる。そして、命令サイクル
3において、特には図示しない命令フェッチモジュール
は、PC_IF202にセットされた分岐先命令Cに対
応するプログラムカウンタ値を判別することにより、図
6に示されるように、分岐先命令Cをメモリからフェッ
チする。
The program counter value corresponding to the branch destination instruction C obtained as a result is P in the instruction cycle 3.
It is set in C_IF202. Then, in the instruction cycle 3, the instruction fetch module (not shown) determines the branch destination instruction C as shown in FIG. 6 by determining the program counter value corresponding to the branch destination instruction C set in the PC_IF 202. Fetch from memory.

【0064】従って、図6に示されるように命令フェッ
チステージが分割されていない場合には、分岐命令Aの
デコードが終了するまでに命令Bの1つの命令に関する
データのみがパイプラインに入力されているため、その
1つの命令に関するデータのみがキャンセルされること
になる。具体的には、命令サイクル5と6において、命
令Bに対応するPC_MA205とPC_Md215の
内容がクリアされ、命令サイクル7において、命令Bに
対応するPC_WB206の内容がクリアされる。な
お、命令Bに対応するIFステージ、IDステージ、及
びEXステージは、それらが実行されても他の命令の実
行に影響が及ばない。このため、命令サイクル2〜4の
それぞれにおいて、命令Bに対応するPC_IF20
2、PC_ID203、及びPC_EX204の内容は
クリアする必要はない。
Therefore, when the instruction fetch stage is not divided as shown in FIG. 6, only the data relating to one instruction of the instruction B is input to the pipeline by the time the decoding of the branch instruction A is completed. Therefore, only the data related to the one instruction is canceled. Specifically, in instruction cycles 5 and 6, the contents of PC_MA 205 and PC_Md 215 corresponding to instruction B are cleared, and in instruction cycle 7, the contents of PC_WB 206 corresponding to instruction B are cleared. Note that the IF stage, the ID stage, and the EX stage corresponding to the instruction B do not affect the execution of other instructions even if they are executed. Therefore, in each of the instruction cycles 2 to 4, the PC_IF 20 corresponding to the instruction B is
2, it is not necessary to clear the contents of PC_ID 203 and PC_EX 204.

【0065】次に、図7は、命令フェッチステージがI
FaステージとFdステージに分割されている場合にお
いて分岐が発生した場合のパイプライン処理を示した図
である。
Next, in FIG. 7, the instruction fetch stage is I
It is a figure showing pipeline processing when a branch occurs in the case of being divided into a Fa stage and an Fd stage.

【0066】この場合には、分岐命令Aのデコードが終
了するまでに命令Bと命令Cの2つの命令に関するデー
タがパイプラインに入力されているため、それら2つの
データがキャンセルされることになる。
In this case, since the data relating to the two instructions B and C have been input to the pipeline by the time the decoding of the branch instruction A is completed, these two data are canceled. .

【0067】以上の説明から理解されるように、図6に
示されるように命令フェッチステージが分割されていな
い場合は、分岐命令が実行されることにより分岐が発生
し、その結果、分岐先の命令が実行されるまでに、2命
令サイクルの時間で済むのに対し、図7に示されるよう
に命令フェッチステージがIFaステージとFdステー
ジに分割されている場合は、分岐命令が実行されること
により分岐が発生し、その結果、分岐先の命令が実行さ
れるまでに、3命令サイクルの時間を要してしまう。
As can be understood from the above description, when the instruction fetch stage is not divided as shown in FIG. 6, a branch instruction is executed to cause a branch, and as a result, the branch destination Before the instruction is executed, it takes only two instruction cycles, but when the instruction fetch stage is divided into the IFa stage and the Fd stage as shown in FIG. 7, the branch instruction is executed. Causes a branch, and as a result, it takes three instruction cycles until the instruction at the branch destination is executed.

【0068】このようにして、命令フェッチステージが
分割されることによりパイプライン処理の段数が長くな
った場合に、パイプライン処理の性能が低下してしまう
のである。
In this way, if the number of stages of pipeline processing becomes long due to the division of the instruction fetch stage, the performance of pipeline processing will deteriorate.

【0069】以上の問題点を解決するために、本実施例
では、状況に応じて、命令フェッチステージを分割する
か否かを制御できることを特徴とする。なお、メモリア
クセスステージについても同様の制御が行われる。
In order to solve the above problems, the present embodiment is characterized in that whether or not the instruction fetch stage is divided can be controlled according to the situation. Similar control is performed for the memory access stage.

【0070】具体的には、命令フェッチステージが分割
されていない状態で、外部メモリに対する命令フェッチ
が発生した時点において、命令フェッチステージが分割
される。同様に、メモリアクセスステージが分割されて
いない状態で、外部メモリに対するメモリアクセスが発
生した時点において、メモリアクセスステージが分割さ
れる。
Specifically, the instruction fetch stage is divided when the instruction fetch to the external memory occurs while the instruction fetch stage is not divided. Similarly, the memory access stage is divided when the memory access to the external memory occurs in the state where the memory access stage is not divided.

【0071】そして、命令フェッチステージが分割され
ている状態で、分岐命令の実行によって分岐が発生し、
かつ分岐先命令が内部メモリからフェッチされる時点に
おいて、命令フェッチステージの分割が解除される。ま
た、メモリアクセスステージが分割されている状態で、
オペランドアクセスを伴わない命令が実行され、かつそ
の命令に続く命令が実行するオペランドアクセスが内部
メモリに対するオペランドアクセスであった時点におい
て、メモリアクセスステージの分割が解除される。一般
に、RISCプロセッサでは、メモリアクセスが発生す
る場合は、ロード命令又はストア命令が実行された場合
に限定されるため、これらの命令以外の命令が実行され
た場合に、メモリアクセスステージの分割が解除され得
る。
Then, in the state where the instruction fetch stage is divided, execution of the branch instruction causes a branch,
At the time when the branch destination instruction is fetched from the internal memory, the division of the instruction fetch stage is released. Also, with the memory access stage divided,
When the instruction without the operand access is executed and the operand access executed by the instruction following the instruction is the operand access to the internal memory, the division of the memory access stage is released. Generally, in a RISC processor, memory access occurs only when a load instruction or a store instruction is executed. Therefore, when an instruction other than these instructions is executed, the division of the memory access stage is canceled. Can be done.

【0072】図8は、上述の動作を実現するためのパイ
プラインウエイト/段数制御回路801の周辺構成図で
ある。また、図9及び図10は、この回路によって実行
される命令フェッチステージ制御動作の状態遷移図及び
タイミングチャート、図11及び図12は、この回路に
よって実行されるメモリアクセスステージ制御動作の状
態遷移図及びタイミングチャートである。
FIG. 8 is a peripheral configuration diagram of a pipeline weight / stage number control circuit 801 for realizing the above operation. 9 and 10 are state transition diagrams and timing charts of the instruction fetch stage control operation executed by this circuit, and FIGS. 11 and 12 are state transition diagrams of the memory access stage control operation executed by this circuit. 3 is a timing chart.

【0073】まず、パイプラインウエイト/段数制御回
路801によって実行される命令フェッチステージ制御
動作について説明する。図9の状態遷移図から理解され
るように、パイプラインウエイト/段数制御回路801
は、命令フェッチステージ制御動作については、3状態
の有限状態マシンとして機能する。
First, the instruction fetch stage control operation executed by the pipeline wait / stage number control circuit 801 will be described. As can be understood from the state transition diagram of FIG. 9, the pipeline weight / stage number control circuit 801
Functions as a 3-state finite state machine for instruction fetch stage control operations.

【0074】図9において、第1の状態は、IDLE状
態である。この状態では、パイプラインウエイト/段数
制御回路801は、図2に示されるパイプライン制御回
路に対しては、if_wait信号及びfd_sel信
号をアサートしない。内部メモリに記憶されている命令
(以下、内部命令と呼ぶ)がフェッチされている状態に
おいて、この状態になり得る。そして、この状態では、
命令フェッチステージは分割されず、図2において、P
C_IF202の出力は、マルチプレクサ220を介し
てPC_ID203に入力されている。このIDLE状
態においては、命令フェッチステージが分割されていな
いため、前述したように、分岐発生時のパイプライン処
理のキャンセルによるペナルティを小さくすることがで
きる。
In FIG. 9, the first state is the IDLE state. In this state, the pipeline weight / stage number control circuit 801 does not assert the if_wait signal and the fd_sel signal to the pipeline control circuit shown in FIG. This state can occur when an instruction stored in the internal memory (hereinafter referred to as an internal instruction) is being fetched. And in this state,
The instruction fetch stage is not divided, and in FIG.
The output of the C_IF 202 is input to the PC_ID 203 via the multiplexer 220. In this IDLE state, since the instruction fetch stage is not divided, as described above, the penalty for canceling the pipeline processing when a branch occurs can be reduced.

【0075】IDLE状態は、特には図示しない命令フ
ェッチモジュールからの外部命令フェッチ信号803が
アサートされるまで繰り返される。この外部命令フェッ
チ信号803は、外部メモリに記憶されている命令(以
下、外部命令と呼ぶ)に対するフェッチが発生したこと
を示す信号である。
The IDLE state is repeated until the external instruction fetch signal 803 from the instruction fetch module (not shown) is asserted. The external instruction fetch signal 803 is a signal indicating that a fetch for an instruction stored in the external memory (hereinafter referred to as an external instruction) has occurred.

【0076】そして、外部命令フェッチ信号803がア
サートされると共にメモリウエイト回数制御回路802
からのif_waiting信号がアサートされると、
IDLE状態から第2の状態であるWAIT状態への遷
移が発生する。また、外部命令フェッチ信号803はア
サートされたがメモリウエイト回数制御回路802から
のif_waiting信号がアサートされない場合に
は、第3の状態であるLAST状態への遷移が発生す
る。
The external instruction fetch signal 803 is asserted and the memory wait number control circuit 802 is activated.
When the if_waiting signal from is asserted,
A transition occurs from the IDLE state to the second state, the WAIT state. When the external instruction fetch signal 803 is asserted but the if_waiting signal from the memory wait number control circuit 802 is not asserted, a transition to the LAST state, which is the third state, occurs.

【0077】WAIT状態では、パイプラインウエイト
/段数制御回路801は、図2に示されるパイプライン
制御回路に対しては、if_wait信号及びfd_s
el信号の両方をアサートする。
In the WAIT state, the pipeline weight / stage number control circuit 801 is different from the if_wait signal and fd_s in the pipeline control circuit shown in FIG.
Assert both el signals.

【0078】このWAIT状態は、メモリウエイト回数
制御回路802からのif_waiting信号がアサ
ートされている時間だけ繰り返される。このif_wa
iting信号は、命令フェッチステージにおいてウエ
イトが挿入されない場合又は1ウエイトが挿入される場
合はアサートされず、n(n≧2)ウエイトが挿入され
る場合はn−1命令サイクルの時間だけアサートされ
る。そして、if_waiting信号がネゲートされ
ると、WAIT状態から第3の状態であるLAST状態
への遷移が発生する。
This WAIT state is repeated only during the time when the if_waiting signal from the memory wait number control circuit 802 is asserted. This if_wa
The iting signal is not asserted when the wait is not inserted or one wait is inserted in the instruction fetch stage, and is asserted only for the time of n−1 instruction cycle when the n (n ≧ 2) wait is inserted. . When the if_waiting signal is negated, a transition from the WAIT state to the LAST state, which is the third state, occurs.

【0079】LAST状態においては、パイプラインウ
エイト/段数制御回路801は、図2に示されるパイプ
ライン制御回路に対しては、fd_sel信号のアサー
トを維持し、if_wait信号はネゲートする。この
状態において、特には図示しない命令フェッチモジュー
ルは、外部命令をフェッチする。
In the LAST state, the pipeline wait / stage number control circuit 801 maintains the assertion of the fd_sel signal and negates the if_wait signal for the pipeline control circuit shown in FIG. In this state, an instruction fetch module (not shown) fetches an external instruction.

【0080】このLAST状態は、特には図示しない命
令デコードモジュールからの分岐発生信号805又は特
には図示しない命令フェッチモジュールからの内部命令
フェッチ信号804の一方又は両方がネゲートされてお
り、かつ命令フェッチモジュールからの外部命令フェッ
チ信号803又はメモリウエイト回数制御回路802か
らのif_waiting信号の一方又は両方がネゲー
トされている間だけ維持される。ここで、分岐発生信号
805は、外部命令である分岐命令が実行された結果分
岐が発生したことを示す信号である。また、内部命令フ
ェッチ信号804は、内部メモリに対する命令フェッチ
が発生したことを示す信号である。
In this LAST state, one or both of the branch occurrence signal 805 from the instruction decode module (not shown) and the internal instruction fetch signal 804 from the instruction fetch module (not shown) are negated, and the instruction fetch module The external instruction fetch signal 803 from the memory wait count control circuit 802 or the if_waiting signal from the memory wait number control circuit 802 is maintained only while it is negated. Here, the branch occurrence signal 805 is a signal indicating that a branch has occurred as a result of execution of a branch instruction that is an external instruction. The internal instruction fetch signal 804 is a signal indicating that an instruction fetch to the internal memory has occurred.

【0081】LAST状態において、特には図示しない
命令フェッチモジュールにおいて新たな外部命令に対す
るフェッチが発生し、外部命令フェッチ信号803がア
サートされると共に、メモリウエイト回数制御回路80
2からのif_waiting信号がアサートされる
と、再びWAIT状態への遷移が発生する。
In the LAST state, a fetch for a new external instruction occurs particularly in an instruction fetch module (not shown), the external instruction fetch signal 803 is asserted, and the memory wait number control circuit 80
When the if_waiting signal from 2 is asserted, the transition to the WAIT state occurs again.

【0082】以上のように、命令フェッチステージが分
割されていないIDLE状態で、外部メモリに対する命
令フェッチが発生した時点において、命令フェッチステ
ージが分割され、図2において、PC_IF202の出
力はPC_Fd214を経由した後にマルチプレクサ2
20を介してPC_ID203に入力されるようにな
る。このとき、メモリウエイト回数制御回路802から
のif_waiting信号がアサートされる場合、即
ち、パイプラインピッチ(=1命令サイクル)の時間間
隔でアクセスをすることが困難な外部メモリがアクセス
される場合には、WAIT状態において必要なウエイト
状態が生成される(前述した図4参照)。一方、メモリ
ウエイト回数制御回路802からのif_waitin
g信号がアサートされない場合、即ち、パイプラインピ
ッチの時間間隔でアクセスをすることができる外部メモ
リがアクセスされる場合には、WAIT状態は介さず
に、LAST状態への遷移が直接に発生し、命令フェッ
チステージが分割される(前述した図5参照)。そし
て、LAST状態において、命令フェッチステージが分
割された状態で命令フェッチが行われることによって、
前述したように、分岐発生時以外のタイミングにおい
て、パイプライン処理の性能を向上させることができ
る。
As described above, in the IDLE state where the instruction fetch stage is not divided, the instruction fetch stage is divided when the instruction fetch to the external memory occurs, and in FIG. 2, the output of PC_IF 202 passes through PC_Fd 214. Later multiplexer 2
It will be input to the PC_ID 203 via 20. At this time, when the if_waiting signal from the memory wait number control circuit 802 is asserted, that is, when the external memory that is difficult to access at the time interval of the pipeline pitch (= 1 instruction cycle) is accessed, , A necessary wait state is generated in the WAIT state (see FIG. 4 described above). On the other hand, if_waitin from the memory wait number control circuit 802
When the g signal is not asserted, that is, when the external memory that can be accessed at the time interval of the pipeline pitch is accessed, the transition to the LAST state occurs directly without the WAIT state, The instruction fetch stage is divided (see FIG. 5 described above). Then, in the LAST state, the instruction fetch is performed while the instruction fetch stage is divided,
As described above, the performance of pipeline processing can be improved at timings other than when a branch occurs.

【0083】前述のLAST状態において、パイプライ
ン処理がキャンセルされた時点、即ち、特には図示しな
い命令デコードモジュールからの分岐発生信号805が
アサートされ、かつ特には図示しない命令フェッチモジ
ュールからの内部命令フェッチ信号803がアサートさ
れた時点で、IDLE状態への遷移が発生する。この結
果、例えば図10に示されるように、分岐命令Aに対す
るIDステージが実行された結果分岐が発生し、かつ、
分岐先命令Dが内部命令であるならば、fd_sel信
号がネゲートされ、命令フェッチステージの分割が解除
される。
In the above-mentioned LAST state, when the pipeline processing is canceled, that is, the branch occurrence signal 805 from the instruction decoding module not shown is asserted, and the internal instruction fetch from the instruction fetch module not shown in particular. A transition to the IDLE state occurs when signal 803 is asserted. As a result, for example, as shown in FIG. 10, a branch occurs as a result of the execution of the ID stage for the branch instruction A, and
If the branch destination instruction D is an internal instruction, the fd_sel signal is negated and the division of the instruction fetch stage is released.

【0084】次に、図8に示されるパイプラインウエイ
ト/段数制御回路801によって実行されるメモリアク
セスステージ制御動作について説明する。図11の状態
遷移図から理解されるように、パイプラインウエイト/
段数制御回路801は、メモリアクセスステージ制御動
作についても、命令フェッチステージ制御動作について
と同様、3状態の有限状態マシンとして機能する。
Next, the memory access stage control operation executed by the pipeline wait / stage number control circuit 801 shown in FIG. 8 will be described. As can be seen from the state transition diagram of FIG. 11, the pipeline weight /
The stage number control circuit 801 also functions as a three-state finite state machine in the memory access stage control operation as in the instruction fetch stage control operation.

【0085】まず、IDLE状態では、パイプラインウ
エイト/段数制御回路801は、図2に示されるパイプ
ライン制御回路に対しては、ma_wait信号及びm
d_sel信号をアサートしない。この状態は、内部メ
モリに対するオペランドアクセスが実行されている状態
である。そして、この状態では、メモリアクセスステー
ジは分割されず、図2において、PC_MA205の出
力は、マルチプレクサ221を介してPC_WB206
に入力されている。
First, in the IDLE state, the pipeline wait / stage number control circuit 801 is different from the ma_wait signal and m for the pipeline control circuit shown in FIG.
Do not assert the d_sel signal. In this state, the operand access to the internal memory is being executed. Then, in this state, the memory access stage is not divided, and in FIG. 2, the output of PC_MA 205 is output to PC_WB 206 via multiplexer 221.
Has been entered in.

【0086】IDLE状態は、特には図示しないメモリ
アクセス制御回路からの外部メモリアクセス信号806
がアサートされるまで繰り返される。この外部メモリア
クセス信号806は、外部メモリに記憶されている命令
(以下、外部命令と呼ぶ)に対するフェッチが発生した
ことを示す信号である。この外部メモリアクセス信号8
06は、外部メモリに対するオペランドアクセスが発生
したことを示す信号である。
In the IDLE state, an external memory access signal 806 from a memory access control circuit (not shown) is used.
Is repeated until is asserted. The external memory access signal 806 is a signal indicating that a fetch for an instruction stored in the external memory (hereinafter referred to as an external instruction) has occurred. This external memory access signal 8
Reference numeral 06 is a signal indicating that an operand access to the external memory has occurred.

【0087】そして、外部メモリアクセス信号806が
アサートされると共にメモリウエイト回数制御回路80
2からのma_waiting信号がアサートされる
と、IDLE状態から第2の状態であるWAIT状態へ
の遷移が発生する。また、外部メモリアクセス信号80
6はアサートされたがメモリウエイト回数制御回路80
2からのma_waiting信号がアサートされない
場合には、第3の状態であるLAST状態への遷移が発
生する。
Then, the external memory access signal 806 is asserted and the memory wait number control circuit 80
When the ma_waiting signal from 2 is asserted, a transition occurs from the IDLE state to the second state, the WAIT state. In addition, the external memory access signal 80
6 was asserted, but the memory wait number control circuit 80
When the ma_waiting signal from 2 is not asserted, a transition to the LAST state, which is the third state, occurs.

【0088】WAIT状態では、パイプラインウエイト
/段数制御回路801は、図2に示されるパイプライン
制御回路に対しては、ma_wait信号及びmd_s
el信号の両方をアサートする。図4の例では、(a) 及
び(b) に示されるように、命令サイクル4のタイミング
がこのWAIT状態のタイミングである。
In the WAIT state, the pipeline weight / stage number control circuit 801 has the ma_wait signal and the md_s signal for the pipeline control circuit shown in FIG.
Assert both el signals. In the example of FIG. 4, the timing of the instruction cycle 4 is the timing of this WAIT state, as shown in (a) and (b).

【0089】このWAIT状態は、メモリウエイト回数
制御回路802からのma_waiting信号がアサ
ートされている時間だけ繰り返される。このma_wa
iting信号は、メモリアクセスステージにおいてウ
エイトが挿入されない場合又は1ウエイトが挿入される
場合はアサートされず、n(n≧2)ウエイトが挿入さ
れる場合はn−1命令サイクルの時間だけアサートされ
る。そして、ma_waiting信号がネゲートされ
ると、WAIT状態から第3の状態であるLAST状態
への遷移が発生する。
This WAIT state is repeated only while the ma_waiting signal from the memory wait number control circuit 802 is asserted. This ma_wa
The iting signal is not asserted when a wait is not inserted or one wait is inserted in the memory access stage, and is asserted only for the time of n-1 instruction cycle when an n (n ≧ 2) wait is inserted. . When the ma_waiting signal is negated, a transition from the WAIT state to the LAST state, which is the third state, occurs.

【0090】LAST状態においては、パイプラインウ
エイト/段数制御回路801は、図2に示されるパイプ
ライン制御回路に対しては、md_sel信号のアサー
トを維持し、ma_wait信号はネゲートする。この
状態において、特には図示しないメモリアクセスモジュ
ールは、外部メモリに対するオペランドアクセスを実行
する。図4の例では、(a) 及び(b) に示されるように、
命令サイクル5のタイミングが上述のタイミングであ
る。
In the LAST state, the pipeline wait / stage number control circuit 801 maintains the assertion of the md_sel signal and negates the ma_wait signal for the pipeline control circuit shown in FIG. In this state, a memory access module (not shown) executes operand access to the external memory. In the example of FIG. 4, as shown in (a) and (b),
The timing of the instruction cycle 5 is the timing described above.

【0091】LAST状態は、特には図示しない命令デ
コードモジュールからの非メモリアクセス発生信号80
8又は特には図示しないメモリアクセス制御回路からの
内部メモリアクセス信号807の一方又は両方がネゲー
トされており、かつメモリアクセス制御回路からの外部
メモリアクセス信号806又はメモリウエイト回数制御
回路802からのma_waiting信号の一方又は
両方がネゲートされている間だけ維持される。ここで、
非メモリアクセス命令発生信号808は、ロード命令及
びストア命令以外の命令が実行されたことを示す信号で
ある。また、内部メモリアクセス信号807は、内部メ
モリへのオペランドアクセスが発生したことを示す信号
である。
In the LAST state, a non-memory access generation signal 80 from an instruction decoding module (not shown) is used.
8 or particularly one or both of the internal memory access signals 807 from the memory access control circuit (not shown) are negated, and the external memory access signal 806 from the memory access control circuit or the ma_waiting signal from the memory wait number control circuit 802. Only maintained while one or both are negated. here,
The non-memory access instruction generation signal 808 is a signal indicating that an instruction other than a load instruction and a store instruction has been executed. The internal memory access signal 807 is a signal indicating that an operand access to the internal memory has occurred.

【0092】LAST状態において、特には図示しない
メモリアクセスモジュールにおいて外部メモリに対する
新たなオペランドアクセスが発生し、外部メモリアクセ
ス信号806がアサートされると共に、メモリウエイト
回数制御回路802からのma_waiting信号が
アサートされると、再びWAIT状態への遷移が発生す
る。図4の例では、(a) 及び(b) に示されるように、命
令サイクル6のタイミングで再びWAIT状態のタイミ
ングとなっている。
In the LAST state, a new operand access to the external memory occurs particularly in a memory access module (not shown), the external memory access signal 806 is asserted, and the ma_waiting signal from the memory wait number control circuit 802 is asserted. Then, the transition to the WAIT state occurs again. In the example of FIG. 4, as shown in (a) and (b), the timing of the instruction cycle 6 is the timing of the WAIT state again.

【0093】以上のように、メモリアクセスステージが
分割されていないIDLE状態において、外部メモリに
対するオペランドアクセスが発生した時点において、メ
モリアクセスステージが分割され、図2において、PC
_MA205の出力はPC_Md215を経由した後
に、マルチプレクサ221を介してPC_WB206に
入力されるようになる。そして、LAST状態におい
て、メモリアクセスステージが分割された状態でオペラ
ンドアクセスが行われる。
As described above, in the IDLE state where the memory access stage is not divided, when the operand access to the external memory occurs, the memory access stage is divided, and in FIG.
The output of the MA_MA 205 is input to the PC_WB 206 via the multiplexer 221 after passing through the PC_Md 215. Then, in the LAST state, operand access is performed in a state where the memory access stage is divided.

【0094】前述のLAST状態において、内部メモリ
又は外部命令へのオペランドアクセスを発生させない命
令が実行される時点、即ち、特には図示しない命令デコ
ードモジュールからの非メモリアクセス命令発生信号8
08がアサートされ、かつ特には図示しないメモリアク
セス制御回路からの内部メモリアクセス信号807がア
サートされた時点で、IDLE状態への遷移が発生す
る。この結果、例えば図12に示されるように、外部メ
モリに対するロード命令Aの次に、比較演算命令Bが実
行されることによってメモリアクセスが発生せず、その
次の命令Cが内部メモリに対するロード命令であった場
合に、md_sel信号がネゲートされ、メモリアクセ
スステージの分割が解除される。
In the LAST state described above, a point at which an instruction that does not generate an operand access to an internal memory or an external instruction is executed, that is, a non-memory access instruction generation signal 8 from an instruction decoding module (not shown).
When 08 is asserted and the internal memory access signal 807 from the memory access control circuit (not shown) is asserted, a transition to the IDLE state occurs. As a result, for example, as shown in FIG. 12, the memory operation is not generated by executing the comparison operation instruction B after the load instruction A for the external memory, and the next instruction C is the load instruction for the internal memory. If so, the md_sel signal is negated and the division of the memory access stage is released.

【0095】以上説明した実施例では、プログラムカウ
ンタのパイプラインに関するパイプライン制御装置の構
成例につき説明したが、本発明はこれに限られるもので
はなく、例えば、命令のオペコード又はそれをデコード
した制御信号を各モジュールに伝えるためのパイプライ
ン、或いは、命令のオペランドを各モジュールに伝える
ためのパイプラインについても本発明を適用することが
できる。
In the embodiment described above, the configuration example of the pipeline control device relating to the pipeline of the program counter has been described. However, the present invention is not limited to this. For example, the operation code of an instruction or the control obtained by decoding the operation code. The present invention can be applied to a pipeline for transmitting a signal to each module or a pipeline for transmitting an operand of an instruction to each module.

【0096】[0096]

【発明の効果】本発明によれば、パイプライン処理にお
いて、命令フェッチステージ及びメモリアクセスステー
ジのそれぞれについて、各ステージが分割される状態と
分割されない状態を切替えることが可能となる。この結
果、プロセッサチップに内蔵される内部メモリに対して
命令フェッチ又はオペランドデータのアクセスが発生し
ている場合などにおいては、各ステージが分割されない
状態となることにより、分岐発生時のパイプライン処理
のキャンセルによるペナルティを小さくすることが可能
となる。また、プロセッサチップの外部に接続される外
部メモリに対して命令フェッチ又はオペランドデータの
アクセスが発生している場合などにおいては、各ステー
ジが分割された状態となることにより、分割された命令
フェッチステージ又はメモリアクセスステージが実行さ
れている命令サイクルにおいて、他のステージの処理が
ウエイト状態になる時間を短縮させることができ、分岐
発生時以外のタイミングにおいて、パイプライン処理の
性能を向上させることが可能となる。
According to the present invention, in pipeline processing, it is possible to switch the instruction fetch stage and the memory access stage between the divided state and the non-divided state. As a result, when an instruction fetch or operand data access is occurring to the internal memory built in the processor chip, the stages are not divided, so that pipeline processing at the time of branch occurrence The penalty for cancellation can be reduced. In addition, when an instruction fetch or an operand data access to an external memory connected to the outside of the processor chip occurs, each stage becomes a divided state, and the divided instruction fetch stage Alternatively, in the instruction cycle in which the memory access stage is being executed, the processing time of other stages can be shortened and the performance of pipeline processing can be improved at timings other than when a branch occurs. Becomes

【0097】更に、分岐命令の実行によって分岐が発生
し、かつその分岐に対応する分岐先命令がプロセッサチ
ップに内蔵される内部メモリからフェッチされる時点に
おいて命令フェッチステージの分割が解除されることに
より、また、メモリアクセスを伴わない命令が実行さ
れ、かつその命令に続く命令が実行するメモリアクセス
がプロセッサチップに内蔵される内部メモリに対するも
のであった時点においてメモリアクセスステージの分割
が解除されることにより、パイプライン処理中の有効な
データを失わせることなく、パイプラインの状態を最適
な状態に変更することが可能となる。
Furthermore, when a branch occurs due to the execution of the branch instruction and the branch destination instruction corresponding to the branch is fetched from the internal memory incorporated in the processor chip, the division of the instruction fetch stage is canceled. , The division of the memory access stage is canceled at the time when an instruction without memory access is executed and the memory access executed by the instruction following the instruction is to the internal memory incorporated in the processor chip. This makes it possible to change the pipeline state to an optimum state without losing valid data during pipeline processing.

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

【図1】本発明のブロック図である。FIG. 1 is a block diagram of the present invention.

【図2】本発明によるパイプライン制御装置の一部の実
施例の構成図である。
FIG. 2 is a configuration diagram of part of an embodiment of a pipeline control device according to the present invention.

【図3】1命令サイクルでアクセス可能なメモリがアク
セスされる場合のパイプライン処理の説明図である。
FIG. 3 is an explanatory diagram of pipeline processing when an accessible memory is accessed in one instruction cycle.

【図4】パイプラインピッチの時間間隔でアクセスをす
ることが困難な外部メモリがアクセスされる場合のパイ
プライン処理の説明図である。
FIG. 4 is an explanatory diagram of pipeline processing when an external memory that is difficult to access at a time interval of a pipeline pitch is accessed.

【図5】パイプラインピッチの時間間隔でアクセスをす
ることができる外部メモリがアクセスされる場合のパイ
プライン処理の説明図である。
FIG. 5 is an explanatory diagram of pipeline processing when an external memory that can be accessed at a pipeline pitch time interval is accessed.

【図6】命令フェッチステージが分割されていない場合
において分岐が発生した場合のパイプライン処理の説明
図である。
FIG. 6 is an explanatory diagram of pipeline processing when a branch occurs when the instruction fetch stage is not divided.

【図7】命令フェッチステージがIFaステージとFd
ステージに分割されている場合において分岐が発生した
場合のパイプライン処理の説明図である。
FIG. 7 shows instruction fetch stages IFa stage and Fd.
It is an explanatory view of pipeline processing when a branch occurs in the case of being divided into stages.

【図8】パイプラインウエイト/段数制御回路801の
周辺構成図である。
FIG. 8 is a peripheral configuration diagram of a pipeline weight / stage number control circuit 801.

【図9】命令フェッチステージ制御動作の状態遷移図で
ある。
FIG. 9 is a state transition diagram of an instruction fetch stage control operation.

【図10】命令フェッチステージ制御動作のタイミング
チャートである。
FIG. 10 is a timing chart of an instruction fetch stage control operation.

【図11】メモリアクセスステージ制御動作の状態遷移
図である。
FIG. 11 is a state transition diagram of a memory access stage control operation.

【図12】メモリアクセスステージ制御動作のタイミン
グチャートである。
FIG. 12 is a timing chart of a memory access stage control operation.

【図13】従来のパイプラインプロセッサにおけるパイ
プライン制御装置の一部の構成例を示した図である。
FIG. 13 is a diagram showing a configuration example of a part of a pipeline control device in a conventional pipeline processor.

【図14】パイプライン処理の説明図である。FIG. 14 is an explanatory diagram of pipeline processing.

【図15】従来のメモリウエイトが発生した場合のパイ
プライン処理の説明図である。
FIG. 15 is an explanatory diagram of pipeline processing when a conventional memory wait occurs.

【図16】従来の命令毎にメモリウエイトが発生した場
合のパイプライン処理の説明図である。
FIG. 16 is an explanatory diagram of conventional pipeline processing when a memory wait occurs for each instruction.

【図17】従来の外部バスアクセス時のパイプライン処
理の説明図(1ウエイトの場合)である。
FIG. 17 is an explanatory diagram (in the case of 1 wait) of conventional pipeline processing at the time of accessing an external bus.

【図18】従来の外部バスアクセス時のパイプライン処
理の説明図(2ウエイトの場合)である。
FIG. 18 is an explanatory diagram (in the case of 2 waits) of conventional pipeline processing at the time of accessing an external bus.

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

101 命令フェッチ手段 102 命令デコード手段 103 命令実行手段 104 メモリアクセス手段 105 ライトバック手段 106 命令フェッチステージ分割手段 107 命令フェッチステージ分割制御手段 108 命令アドレス出力ステージウエイト制御手段 109 メモリアクセスステージ分割手段 110 メモリアクセスステージ分割制御手段 111 オペランドアドレス出力ステージウエイト制
御手段 201 アダー(PC_adder) 202 第1命令フェッチステージプログラムカウン
タ値保持部(PC_IF202) 203 命令デコードステージプログラムカウンタ値
保持部(PC_ID) 204 命令実行ステージプログラムカウンタ値保持
部(PC_EX) 205 メモリアクセスステージプログラムカウンタ値
保持部(PC_MA) 206 ライトバックステージプログラムカウンタ値
保持部(PC_WB) 207〜210、216、217 アンドゲート 211〜213、218、219 オアゲート 214 第2命令フェッチステージプログラムカウン
タ値保持部(PC_Fd) 215 第2メモリアクセスステージプログラムカウ
ンタ値保持部(PC_Md) 220、221 マルチプレクサ 801 パイプラインウエイト/段数制御回路 802 メモリウエイト回数制御回路 803 外部命令フェッチ信号 804 内部命令フェッチ信号 805 分岐発生信号 806 外部メモリアクセス信号 807 内部メモリアクセス信号 808 非メモリアクセス命令発生信号
101 instruction fetch means 102 instruction decode means 103 instruction execution means 104 memory access means 105 write back means 106 instruction fetch stage division means 107 instruction fetch stage division control means 108 instruction address output stage wait control means 109 memory access stage division means 110 memory access Stage division control means 111 Operand address output stage wait control means 201 Adder (PC_adder) 202 First instruction fetch stage program counter value holding unit (PC_IF202) 203 Instruction decode stage program counter value holding unit (PC_ID) 204 Instruction execution stage program counter value Holding Unit (PC_EX) 205 Memory Access Stage Program Counter Value Holding Unit (PC_EX A) 206 write back stage program counter value holding unit (PC_WB) 207 to 210, 216, 217 AND gates 211 to 213, 218, 219 or gate 214 second instruction fetch stage program counter value holding unit (PC_Fd) 215 second memory access Stage program counter value holding unit (PC_Md) 220, 221 Multiplexer 801 Pipeline wait / stage number control circuit 802 Memory wait number control circuit 803 External instruction fetch signal 804 Internal instruction fetch signal 805 Branch occurrence signal 806 External memory access signal 807 Internal memory access Signal 808 Non-memory access instruction generation signal

Claims (34)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 他のステージと並列に実行することので
きる命令フェッチステージ(IF)において、メモリ手
段から命令をフェッチする命令フェッチ手段(101)
と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記命令フェッチステージ(IF)を、命令アドレスを
前記メモリ手段に対して出力する命令アドレス出力ステ
ージ(IFa)と、前記メモリ手段から前記命令アドレ
スに対応する命令データを入力する命令データ入力ステ
ージ(IFd)に分割する命令フェッチステージ分割手
段(106)と、 を有することを特徴とする可変長パイプライン制御装
置。
1. An instruction fetch means (101) for fetching an instruction from a memory means in an instruction fetch stage (IF) which can be executed in parallel with another stage.
And an instruction decoding unit (102) for decoding the fetched instruction in an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction execution that can be executed in parallel with other stages. In the stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, calculation in the instruction execution stage (EX) The memory access means (104) for reading or writing to the memory means with respect to the read address and the write back stage (WB) which can be executed in parallel with other stages, in the memory access stage (MA). Operand data obtained from the memory means or the instruction execution A write-back means (105) for writing the operand data processed in the stage (EX) to a register means, and an instruction address output stage (IFa) for outputting an instruction address to the memory means by the instruction fetch stage (IF). And an instruction fetch stage dividing means (106) for dividing instruction data corresponding to the instruction address from the memory means into instruction data input stages (IFd). .
【請求項2】 前記命令フェッチステージ分割手段(1
06)が前記命令フェッチステージ(IF)を分割して
いない状態で、プロセッサチップの外部に接続される外
部メモリに対して命令のフェッチが発生した時点におい
て、前記命令フェッチステージ分割手段(106)に対
して前記命令フェッチステージ(IF)を分割させる命
令フェッチステージ分割制御手段(107)を更に有す
る、 ことを特徴とする請求項1に記載の可変長パイプライン
制御装置。
2. The instruction fetch stage dividing means (1
06) has not divided the instruction fetch stage (IF), the instruction fetch stage dividing means (106) is provided to the instruction fetch stage dividing means (106) at the time point when the instruction fetch is made to the external memory connected to the outside of the processor chip. The variable length pipeline control device according to claim 1, further comprising an instruction fetch stage division control means (107) for dividing the instruction fetch stage (IF).
【請求項3】 前記命令フェッチステージ分割制御手段
(107)は、前記命令フェッチステージ(IF)が分
割されている状態で、分岐命令の実行によって分岐が発
生し、かつ該分岐に対応する分岐先命令がプロセッサチ
ップに内蔵される内部メモリからフェッチされる時点に
おいて、前記命令フェッチステージ分割手段(106)
に対して前記命令フェッチステージ(IF)の分割を解
除させる、 ことを特徴とする請求項2に記載の可変長パイプライン
制御装置。
3. The instruction fetch stage division control means (107), when the instruction fetch stage (IF) is divided, a branch occurs by execution of a branch instruction, and a branch destination corresponding to the branch. The instruction fetch stage dividing means (106) at the time when the instruction is fetched from the internal memory built in the processor chip.
3. The variable length pipeline control device according to claim 2, wherein the instruction fetch stage (IF) is released from the division.
【請求項4】 前記命令アドレス出力ステージ(IF
a)を任意の命令サイクル数だけウエイト状態にする命
令アドレス出力ステージウエイト制御手段(108)を
更に有する、 ことを特徴とする請求項1乃至3の何れか1項に記載の
可変長パイプライン制御装置。
4. The instruction address output stage (IF
The variable length pipeline control according to any one of claims 1 to 3, further comprising an instruction address output stage wait control means (108) for putting a) into a wait state for an arbitrary number of instruction cycles. apparatus.
【請求項5】 前記命令フェッチ手段(101)によっ
て実行される、前記命令アドレス出力ステージ(IF
a)における前記命令アドレスの出力動作と、前記命令
データ入力ステージ(IFd)における前記命令データ
の入力動作は、並列に実行される、 ことを特徴とする請求項1乃至4の何れか1項に記載の
可変長パイプライン制御装置。
5. The instruction address output stage (IF) executed by the instruction fetch means (101).
5. The output operation of the instruction address in a) and the input operation of the instruction data in the instruction data input stage (IFd) are executed in parallel, according to any one of claims 1 to 4. A variable length pipeline control device as described.
【請求項6】 他のステージと並列に実行することので
きる命令フェッチステージ(IF)において、メモリ手
段から命令をフェッチする命令フェッチ手段(101)
と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記命令フェッチ手段(101)、前記命令デコード手
段(102)、前記命令実行手段(103)、前記メモ
リアクセス手段(104)、及び前記ライトバック手段
(105)が使用するデータをそれぞれ順次保持するも
のであって、命令フェッチステージデータ保持手段、命
令デコードステージデータ保持手段、命令実行ステージ
データ保持手段、メモリアクセスステージデータ保持手
段、及びライトバックステージデータ保持手段から構成
されるパイプラインと、 前記命令フェッチステージデータ保持手段を、命令アド
レスを前記メモリ手段に対して出力するステージである
命令アドレス出力ステージ(IFa)で使用されるデー
タを保持する命令アドレス出力ステージデータ保持手段
と、前記メモリ手段から前記命令アドレスに対応する命
令データを入力するステージである命令データ入力ステ
ージ(IFd)で使用されるデータを保持する命令デー
タ入力ステージデータ保持手段に分割する命令フェッチ
ステージ分割手段(106)と、 を有することを特徴とする可変長パイプライン制御装
置。
6. An instruction fetch means (101) for fetching an instruction from a memory means in an instruction fetch stage (IF) which can be executed in parallel with another stage.
And an instruction decoding unit (102) for decoding the fetched instruction in an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction execution that can be executed in parallel with other stages. In the stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, calculation in the instruction execution stage (EX) In the memory access means (104) for reading or writing to the memory means for the written address and the write back stage (WB) which can be executed in parallel with other stages, in the memory access stage (MA). Operand data obtained from the memory means or the instruction execution Write-back means (105) for writing the operand data processed in the stage (EX) to the register means, the instruction fetch means (101), the instruction decode means (102), the instruction execution means (103), and the memory access The data used by the means (104) and the write-back means (105) are sequentially retained, and include an instruction fetch stage data retaining means, an instruction decode stage data retaining means, an instruction execution stage data retaining means, and a memory access. A pipeline composed of stage data holding means and write back stage data holding means, and an instruction address output stage (IFa) which is a stage for the instruction fetch stage data holding means to output an instruction address to the memory means. Used by Address output stage data holding means for holding data to be stored and instruction data for holding data used in an instruction data input stage (IFd) which is a stage for inputting instruction data corresponding to the instruction address from the memory means. A variable length pipeline control device comprising: an instruction fetch stage dividing means (106) for dividing into input stage data holding means.
【請求項7】 前記命令フェッチステージ分割手段(1
06)が前記命令フェッチステージデータ保持手段を分
割していない状態で、プロセッサチップの外部に接続さ
れる外部メモリに対して命令のフェッチが発生した時点
において、前記命令フェッチステージ分割手段(10
6)に対して前記命令フェッチステージデータ保持手段
を分割させる命令フェッチステージ分割制御手段(10
7)を更に有する、 ことを特徴とする請求項6に記載の可変長パイプライン
制御装置。
7. The instruction fetch stage dividing means (1
06) has not divided the instruction fetch stage data holding means, the instruction fetch stage dividing means (10) at the time when an instruction fetch occurs in an external memory connected to the outside of the processor chip.
6) instruction fetch stage division control means (10) for dividing the instruction fetch stage data holding means
7. The variable length pipeline control device according to claim 6, further comprising 7).
【請求項8】 前記命令フェッチステージ分割制御手段
(107)は、前記命令フェッチステージ保持手段が分
割されている状態で、分岐命令の実行によって分岐が発
生し、かつ該分岐に対応する分岐先命令がプロセッサチ
ップに内蔵される内部メモリからフェッチされる時点に
おいて、前記命令フェッチステージ分割手段(106)
に対して前記命令フェッチステージデータ保持手段の分
割を解除させる、 ことを特徴とする請求項7に記載の可変長パイプライン
制御装置。
8. The instruction fetch stage division control means (107), when the instruction fetch stage holding means is divided, executes a branch instruction to cause a branch, and a branch destination instruction corresponding to the branch. The instruction fetch stage dividing means (106) at the time point when is fetched from the internal memory built in the processor chip.
The variable length pipeline control device according to claim 7, wherein the instruction fetch stage data holding means is released from the division.
【請求項9】 前記命令アドレス出力ステージデータ保
持手段に対して、該手段が保持するデータの出力動作を
任意の命令サイクル数だけウエイトさせる命令アドレス
出力ステージウエイト制御手段(108)を更に有す
る、 ことを特徴とする請求項6乃至8の何れか1項に記載の
可変長パイプライン制御装置。
9. An instruction address output stage weight control means (108) for causing the instruction address output stage data holding means to wait an output operation of the data held by the means for an arbitrary number of instruction cycles. The variable length pipeline control device according to any one of claims 6 to 8.
【請求項10】 前記パイプラインが保持するデータ
は、プログラムカウンタ値である、 ことを特徴とする請求項6乃至9の何れか1項に記載の
可変長パイプライン制御装置。
10. The variable length pipeline control device according to claim 6, wherein the data held by the pipeline is a program counter value.
【請求項11】 他のステージと並列に実行することの
できる命令フェッチステージ(IF)において、メモリ
手段から命令をフェッチする命令フェッチ手段(10
1)と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記メモリアクセスステージ(MA)を、オペランドア
ドレスを前記メモリ手段に対して出力するオペランドア
ドレス出力ステージ(Ma)と、前記メモリ手段に対し
て前記オペランドアドレスに対応するオペランドデータ
をリード又はライトするオペランドデータリード/ライ
トステージ(Md)に分割するメモリアクセスステージ
分割手段(109)と、 を有することを特徴とする可変長パイプライン制御装
置。
11. An instruction fetch means (10) for fetching an instruction from a memory means in an instruction fetch stage (IF) which can be executed in parallel with another stage.
1) and an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction decoding unit (102) that decodes the fetched instruction, and can be executed in parallel with other stages. In the instruction execution stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, the instruction execution stage (EX). In the memory access means (104) for reading or writing to the memory means with respect to the address calculated in the above, and the write back stage (WB) which can be executed in parallel with other stages, the memory access stage (MA ) Operand data obtained from the memory means or the instruction A write-back means (105) for writing the operand data processed in the execution stage (EX) to a register means, and a memory access stage (MA) for an operand address output stage (Ma) for outputting an operand address to the memory means. ) And memory access stage dividing means (109) for dividing the operand data corresponding to the operand address into or from the memory means into operand data read / write stages (Md). Variable length pipeline control device.
【請求項12】 前記メモリアクセスステージ分割手段
(109)が前記メモリアクセスステージ(MA)を分
割していない状態で、プロセッサチップの外部に接続さ
れる外部メモリに対して前記オペランドデータのアクセ
スが発生した時点において、前記メモリアクセスステー
ジ分割手段(109)に対して前記メモリアクセスステ
ージ(MA)を分割させるメモリアクセスステージ分割
制御手段(110)を更に有する、 ことを特徴とする請求項11に記載の可変長パイプライ
ン制御装置。
12. Accessing the operand data to an external memory connected to the outside of a processor chip in a state where the memory access stage dividing means (109) does not divide the memory access stage (MA). The memory access stage division control means (110) for dividing the memory access stage (MA) with respect to the memory access stage division means (109) at the point of time of performing, further comprising: memory access stage division control means (110). Variable length pipeline controller.
【請求項13】 前記メモリアクセスステージ分割制御
手段(110)は、前記メモリアクセスステージ(M
A)が分割されている状態で、メモリアクセスを伴わな
い命令が実行され、かつ該命令に続く命令が実行するメ
モリアクセスがプロセッサチップに内蔵される内部メモ
リに対するものであった時点において、前記メモリアク
セスステージ分割手段(109)に対して前記メモリア
クセスステージ(MA)の分割を解除させる、 ことを特徴とする請求項12に記載の可変長パイプライ
ン制御装置。
13. The memory access stage division control means (110) includes the memory access stage (M).
In the state where A) is divided, the memory is executed when an instruction without memory access is executed and the memory access executed by the instruction following the instruction is for the internal memory incorporated in the processor chip. 13. The variable length pipeline control device according to claim 12, wherein the access stage dividing means (109) is caused to cancel the division of the memory access stage (MA).
【請求項14】 前記オペランドアドレス出力ステージ
(Ma)を任意の命令サイクル数だけウエイト状態にす
るオペランドアドレス出力ステージウエイト制御手段
(111)を更に有する、 ことを特徴とする請求項11乃至13の何れか1項に記
載の可変長パイプライン制御装置。
14. The method according to claim 11, further comprising an operand address output stage wait control means (111) that puts the operand address output stage (Ma) into a wait state for an arbitrary number of instruction cycles. 2. A variable length pipeline control device according to item 1.
【請求項15】 前記メモリアクセス手段(104)に
よって実行される、前記オペランドアドレス出力ステー
ジ(Ma)における前記オペランドアドレスの出力動作
と、前記オペランドデータリード/ライトステージ(M
d)における前記オペランドデータのリード又はライト
動作は、並列に実行される、 ことを特徴とする請求項11乃至14の何れか1項に記
載の可変長パイプライン制御装置。
15. An output operation of the operand address in the operand address output stage (Ma) executed by the memory access means (104) and the operand data read / write stage (M).
The variable length pipeline control device according to any one of claims 11 to 14, wherein the read or write operation of the operand data in d) is executed in parallel.
【請求項16】 他のステージと並列に実行することの
できる命令フェッチステージ(IF)において、メモリ
手段から命令をフェッチする命令フェッチ手段(10
1)と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記命令フェッチ手段(101)、前記命令デコード手
段(102)、前記命令実行手段(103)、前記メモ
リアクセス手段(104)、及び前記ライトバック手段
(105)が使用するデータをそれぞれ順次保持するも
のであって、命令フェッチステージデータ保持手段、命
令デコードステージデータ保持手段、命令実行ステージ
データ保持手段、メモリアクセスステージデータ保持手
段、及びライトバックステージデータ保持手段から構成
されるパイプラインと、 前記メモリアクセスステージデータ保持手段を、オペラ
ンドアドレスを前記メモリ手段に対して出力するステー
ジであるオペランドアドレス出力ステージ(Ma)で使
用されるデータを保持するオペランドアドレス出力ステ
ージデータ保持手段と、前記メモリ手段に対して前記オ
ペランドアドレスに対応するオペランドデータをリード
又はライトするステージであるオペランドデータリード
/ライトステージ(Md)で使用されるデータを保持す
るオペランドデータリード/ライトステージデータ保持
手段に分割するメモリアクセスステージ分割手段(10
9)と、 を有することを特徴とする可変長パイプライン制御装
置。
16. An instruction fetch means (10) for fetching an instruction from a memory means in an instruction fetch stage (IF) which can be executed in parallel with another stage.
1) and an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction decoding unit (102) that decodes the fetched instruction, and can be executed in parallel with other stages. In the instruction execution stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, the instruction execution stage (EX). In the memory access means (104) for reading or writing to the memory means with respect to the address calculated in the above, and the write back stage (WB) which can be executed in parallel with other stages, the memory access stage (MA ) Operand data obtained from the memory means or the instruction Write-back means (105) for writing the operand data processed in the execution stage (EX) to the register means, the instruction fetch means (101), the instruction decode means (102), the instruction execution means (103), and the memory Data to be used by the access unit (104) and the write-back unit (105) are sequentially held, and each of the instruction fetch stage data holding unit, the instruction decode stage data holding unit, the instruction execution stage data holding unit, and the memory. A pipeline including an access stage data holding unit and a write back stage data holding unit, and an operand address output stage which is a stage for outputting an operand address to the memory unit Operand address output stage data holding means for holding data used in memory (Ma), and operand data read / write stage (stage for reading or writing operand data corresponding to the operand address in the memory means). Memory access stage dividing means (10) for dividing the data used in Md) into operand data read / write stage data holding means
9) and a variable length pipeline controller.
【請求項17】 前記メモリアクセスステージ分割手段
(109)が前記メモリアクセスステージデータ保持手
段を分割していない状態で、プロセッサチップの外部に
接続される外部メモリに対して前記オペランドデータの
アクセスが発生した時点において、前記メモリアクセス
ステージ分割手段(109)に対して前記メモリアクセ
スステージデータ保持手段を分割させるメモリアクセス
ステージ分割制御手段(110)を更に有する、 ことを特徴とする請求項16に記載の可変長パイプライ
ン制御装置。
17. The access of the operand data to an external memory connected to the outside of the processor chip occurs in a state where the memory access stage dividing means (109) does not divide the memory access stage data holding means. The memory access stage division control means (110) for dividing the memory access stage data holding means with respect to the memory access stage division means (109) at the time of performing, is further provided. Variable length pipeline controller.
【請求項18】 前記メモリアクセスステージ分割制御
手段(110)は、前記メモリアクセスステージ保持手
段が分割されている状態で、メモリアクセスを伴わない
命令が実行され、かつ該命令に続く命令が実行するメモ
リアクセスがプロセッサチップに内蔵される内部メモリ
に対するものであった時点において、前記メモリアクセ
スステージ分割手段(109)に対して前記メモリアク
セスステージデータ保持手段の分割を解除させる、 ことを特徴とする請求項17に記載の可変長パイプライ
ン制御装置。
18. The memory access stage division control means (110) executes an instruction without memory access and executes an instruction following the instruction while the memory access stage holding means is divided. The memory access stage dividing means (109) is caused to cancel the division of the memory access stage data holding means when the memory access is to an internal memory built in the processor chip. Item 18. The variable length pipeline control device according to item 17.
【請求項19】 前記オペランドアドレス出力ステージ
データ保持手段に対して、該手段が保持するデータの出
力動作を任意の命令サイクル数だけウエイトさせるオペ
ランドアドレス出力ステージウエイト制御手段(11
1)を更に有する、 ことを特徴とする請求項16乃至18の何れか1項に記
載の可変長パイプライン制御装置。
19. An operand address output stage wait control means (11) for causing said operand address output stage data holding means to wait the output operation of the data held by said means for an arbitrary number of instruction cycles.
The variable length pipeline control device according to any one of claims 16 to 18, further comprising 1).
【請求項20】 前記パイプラインが保持するデータ
は、プログラムカウンタ値である、 ことを特徴とする請求項16乃至19の何れか1項に記
載の可変長パイプライン制御装置。
20. The variable length pipeline control device according to claim 16, wherein the data held by the pipeline is a program counter value.
【請求項21】 他のステージと並列に実行することの
できる命令フェッチステージ(IF)において、メモリ
手段から命令をフェッチする命令フェッチ手段(10
1)と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記命令フェッチステージ(IF)を、命令アドレスを
前記メモリ手段に対して出力する命令アドレス出力ステ
ージ(IFa)と、前記メモリ手段から前記命令アドレ
スに対応する命令データを入力する命令データ入力ステ
ージ(IFd)に分割する命令フェッチステージ分割手
段(106)と、 前記メモリアクセスステージ(MA)を、オペランドア
ドレスを前記メモリ手段に対して出力するオペランドア
ドレス出力ステージ(Ma)と、前記メモリ手段に対し
て前記オペランドアドレスに対応するオペランドデータ
をリード又はライトするオペランドデータリード/ライ
トステージ(Md)に分割するメモリアクセスステージ
分割手段(109)と、 を有することを特徴とする可変長パイプライン制御装
置。
21. Instruction fetch means (10) for fetching instructions from memory means in an instruction fetch stage (IF) which can be executed in parallel with other stages.
1) and an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction decoding unit (102) that decodes the fetched instruction, and can be executed in parallel with other stages. In the instruction execution stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, the instruction execution stage (EX). In the memory access means (104) for reading or writing to the memory means with respect to the address calculated in the above, and the write back stage (WB) which can be executed in parallel with other stages, the memory access stage (MA ) Operand data obtained from the memory means or the instruction A write back means (105) for writing the operand data processed in the execution stage (EX) to a register means, and an instruction address output stage (IFa) for outputting an instruction address to the memory means. ), An instruction fetch stage dividing means (106) for dividing instruction data corresponding to the instruction address from the memory means into instruction data input stages (IFd), and the memory access stage (MA) for operand address A memory access for dividing an operand address output stage (Ma) for outputting to the memory means and an operand data read / write stage (Md) for reading or writing the operand data corresponding to the operand address with respect to the memory means. Variable pipeline control apparatus characterized by comprising a stage splitting means (109), the.
【請求項22】 前記命令フェッチステージ分割手段
(106)が前記命令フェッチステージ(IF)を分割
していない状態で、プロセッサチップの外部に接続され
る外部メモリに対して命令のフェッチが発生した時点に
おいて、前記命令フェッチステージ分割手段(106)
に対して前記命令フェッチステージ(IF)を分割させ
る命令フェッチステージ分割制御手段(107)を更に
有する、 ことを特徴とする請求項21に記載の可変長パイプライ
ン制御装置。
22. When an instruction fetch occurs in an external memory connected to the outside of a processor chip in a state where the instruction fetch stage dividing means (106) does not divide the instruction fetch stage (IF). In the instruction fetch stage dividing means (106)
22. The variable length pipeline control device according to claim 21, further comprising an instruction fetch stage division control unit (107) for dividing the instruction fetch stage (IF).
【請求項23】 前記命令フェッチステージ分割制御手
段(107)は、前記命令フェッチステージ(IF)が
分割されている状態で、分岐命令の実行によって分岐が
発生し、かつ該分岐に対応する分岐先命令がプロセッサ
チップに内蔵される内部メモリからフェッチされる時点
において、前記命令フェッチステージ分割手段(10
6)に対して前記命令フェッチステージ(IF)の分割
を解除させる、 ことを特徴とする請求項22に記載の可変長パイプライ
ン制御装置。
23. The instruction fetch stage division control means (107), when the instruction fetch stage (IF) is divided, a branch occurs by execution of a branch instruction, and a branch destination corresponding to the branch. When the instruction is fetched from the internal memory built in the processor chip, the instruction fetch stage dividing means (10
23. The variable length pipeline control device according to claim 22, wherein 6) is caused to cancel the division of the instruction fetch stage (IF).
【請求項24】 前記メモリアクセスステージ分割手段
(109)が前記メモリアクセスステージ(MA)を分
割していない状態で、プロセッサチップの外部に接続さ
れる外部メモリに対して前記オペランドデータのアクセ
スが発生した時点において、前記メモリアクセスステー
ジ分割手段(109)に対して前記メモリアクセスステ
ージ(MA)を分割させるメモリアクセスステージ分割
制御手段(110)を更に有する、 ことを特徴とする請求項21乃至23の何れか1項に記
載の可変長パイプライン制御装置。
24. Accessing the operand data to an external memory connected to the outside of a processor chip in a state where the memory access stage dividing means (109) does not divide the memory access stage (MA). 24. The memory access stage division control means (110) for dividing the memory access stage (MA) with respect to the memory access stage division means (109) at the point of time of performing, further comprising: memory access stage division control means (110). The variable length pipeline control device according to any one of claims.
【請求項25】 前記メモリアクセスステージ分割制御
手段(110)は、前記メモリアクセスステージ(M
A)が分割されている状態で、メモリアクセスを伴わな
い命令が実行され、かつ該命令に続く命令が実行するメ
モリアクセスがプロセッサチップに内蔵される内部メモ
リに対するものであった時点において、前記メモリアク
セスステージ分割手段(109)に対して前記メモリア
クセスステージ(MA)の分割を解除させる、 ことを特徴とする請求項24に記載の可変長パイプライ
ン制御装置。
25. The memory access stage division control means (110) comprises the memory access stage (M).
In the state where A) is divided, the memory is executed when an instruction without memory access is executed and the memory access executed by the instruction following the instruction is to the internal memory incorporated in the processor chip. 25. The variable length pipeline control device according to claim 24, which causes the access stage dividing means (109) to release the division of the memory access stage (MA).
【請求項26】 前記命令アドレス出力ステージ(IF
a)を任意の命令サイクル数だけウエイト状態にする命
令アドレス出力ステージウエイト制御手段(108)
と、 前記オペランドアドレス出力ステージ(Ma)を任意の
命令サイクル数だけウエイト状態にするオペランドアド
レス出力ステージウエイト制御手段(111)と、 を更に有することを特徴とする請求項21乃至25の何
れか1項に記載の可変長パイプライン制御装置。
26. The instruction address output stage (IF
Instruction address output stage wait control means (108) for putting a) into a wait state for an arbitrary number of instruction cycles
26. An operand address output stage wait control means (111) for putting the operand address output stage (Ma) into a wait state for an arbitrary number of instruction cycles, further comprising: A variable length pipeline control device according to item.
【請求項27】 前記命令フェッチ手段(101)によ
って実行される、前記命令アドレス出力ステージ(IF
a)における前記命令アドレスの出力動作と、前記命令
データ入力ステージ(IFd)における前記命令データ
の入力動作は、並列に実行され、前記メモリアクセス手
段(104)によって実行される、前記オペランドアド
レス出力ステージ(Ma)における前記オペランドアド
レスの出力動作と、前記オペランドデータリード/ライ
トステージ(Md)における前記オペランドデータのリ
ード又はライト動作は、並列に実行される、 ことを特徴とする請求項21乃至26の何れか1項に記
載の可変長パイプライン制御装置。
27. The instruction address output stage (IF), which is executed by the instruction fetch means (101).
The operand address output stage in which the output operation of the instruction address in a) and the input operation of the instruction data in the instruction data input stage (IFd) are executed in parallel and are executed by the memory access means (104). 27. The output operation of the operand address in (Ma) and the read or write operation of the operand data in the operand data read / write stage (Md) are executed in parallel. The variable length pipeline control device according to any one of claims.
【請求項28】 他のステージと並列に実行することの
できる命令フェッチステージ(IF)において、メモリ
手段から命令をフェッチする命令フェッチ手段(10
1)と、 他のステージと並列に実行することのできる命令デコー
ドステージ(ID)において、前記フェッチされた命令
をデコードする命令デコード手段(102)と、 他のステージと並列に実行することのできる命令実行ス
テージ(EX)において、前記デコードされた命令を実
行する命令実行手段(103)と、 他のステージと並列に実行することのできるメモリアク
セスステージ(MA)において、前記命令実行ステージ
(EX)において計算されたアドレスに対して前記メモ
リ手段にリード又はライトを行うメモリアクセス手段
(104)と、 他のステージと並列に実行することのできるライトバッ
クステージ(WB)において、前記メモリアクセスステ
ージ(MA)で前記メモリ手段から得られるオペランド
データ又は前記命令実行ステージ(EX)において処理
されたオペランドデータをレジスタ手段に書き込むライ
トバック手段(105)と、 前記命令フェッチ手段(101)、前記命令デコード手
段(102)、前記命令実行手段(103)、前記メモ
リアクセス手段(104)、及び前記ライトバック手段
(105)が使用するデータをそれぞれ順次保持するも
のであって、命令フェッチステージデータ保持手段、命
令デコードステージデータ保持手段、命令実行ステージ
データ保持手段、メモリアクセスステージデータ保持手
段、及びライトバックステージデータ保持手段から構成
されるパイプラインと、 前記命令フェッチステージデータ保持手段を、命令アド
レスを前記メモリ手段に対して出力するステージである
命令アドレス出力ステージ(IFa)で使用されるデー
タを保持する命令アドレス出力ステージデータ保持手段
と、前記メモリ手段から前記命令アドレスに対応する命
令データを入力するステージである命令データ入力ステ
ージ(IFd)で使用されるデータを保持する命令デー
タ入力ステージデータ保持手段に分割する命令フェッチ
ステージ分割手段(106)と、 前記メモリアクセスステージデータ保持手段を、オペラ
ンドアドレスを前記メモリ手段に対して出力するステー
ジであるオペランドアドレス出力ステージ(Ma)で使
用されるデータを保持するオペランドアドレス出力ステ
ージデータ保持手段と、前記メモリ手段に対して前記オ
ペランドアドレスに対応するオペランドデータをリード
又はライトするステージであるオペランドデータリード
/ライトステージ(Md)で使用されるデータを保持す
るオペランドデータリード/ライトステージデータ保持
手段に分割するメモリアクセスステージ分割手段(10
9)と、 を有することを特徴とする可変長パイプライン制御装
置。
28. An instruction fetch means (10) for fetching an instruction from a memory means in an instruction fetch stage (IF) which can be executed in parallel with another stage.
1) and an instruction decoding stage (ID) that can be executed in parallel with other stages, and an instruction decoding unit (102) that decodes the fetched instruction, and can be executed in parallel with other stages. In the instruction execution stage (EX), in the instruction execution means (103) that executes the decoded instruction, and in the memory access stage (MA) that can execute in parallel with other stages, the instruction execution stage (EX). In the memory access means (104) for reading or writing to the memory means with respect to the address calculated in the above, and the write back stage (WB) which can be executed in parallel with other stages, the memory access stage (MA ) Operand data obtained from the memory means or the instruction Write-back means (105) for writing the operand data processed in the execution stage (EX) to the register means, the instruction fetch means (101), the instruction decode means (102), the instruction execution means (103), and the memory Data to be used by the access unit (104) and the write-back unit (105) are sequentially held, and each of the instruction fetch stage data holding unit, the instruction decode stage data holding unit, the instruction execution stage data holding unit, and the memory. A pipeline composed of access stage data holding means and write back stage data holding means, and an instruction address output stage (IFa) which is a stage for outputting an instruction address to the memory means by the instruction fetch stage data holding means. ) Instruction address output stage data holding means for holding data used and instruction holding data used in the instruction data input stage (IFd) which is a stage for inputting instruction data corresponding to the instruction address from the memory means The instruction fetch stage dividing means (106) for dividing into the data input stage data holding means and the memory access stage data holding means are constituted by an operand address output stage (Ma) which is a stage for outputting an operand address to the memory means. Operand address output stage for holding data to be used Data holding means and operand data read / write stage (M) which is a stage for reading or writing operand data corresponding to the operand address with respect to the memory means Memory access stage dividing means (10 for dividing the operand data read / write stage data holding means for holding the data used by)
9) and a variable length pipeline controller.
【請求項29】 前記命令フェッチステージ分割手段
(106)が前記命令フェッチステージデータ保持手段
を分割していない状態で、プロセッサチップの外部に接
続される外部メモリに対して命令のフェッチが発生した
時点において、前記命令フェッチステージ分割手段(1
06)に対して前記命令フェッチステージデータ保持手
段を分割させる命令フェッチステージ分割制御手段(1
07)を更に有する、 ことを特徴とする請求項28に記載の可変長パイプライ
ン制御装置。
29. When an instruction fetch occurs in an external memory connected to the outside of a processor chip in a state where the instruction fetch stage dividing means (106) does not divide the instruction fetch stage data holding means. In the instruction fetch stage dividing means (1
06) to divide the instruction fetch stage data holding means into instruction fetch stage division control means (1
The variable length pipeline controller according to claim 28, further comprising: 07).
【請求項30】 前記命令フェッチステージ分割制御手
段(107)は、前記命令フェッチステージ保持手段が
分割されている状態で、分岐命令の実行によって分岐が
発生し、かつ該分岐に対応する分岐先命令がプロセッサ
チップに内蔵される内部メモリからフェッチされる時点
において、前記命令フェッチステージ分割手段(10
6)に対して前記命令フェッチステージデータ保持手段
の分割を解除させる、 ことを特徴とする請求項29に記載の可変長パイプライ
ン制御装置。
30. The instruction fetch stage division control means (107), when the instruction fetch stage holding means is divided, executes a branch instruction to cause a branch, and a branch destination instruction corresponding to the branch. Is fetched from the internal memory incorporated in the processor chip, the instruction fetch stage dividing means (10
30. The variable length pipeline control device according to claim 29, which causes 6) to cancel the division of the instruction fetch stage data holding means.
【請求項31】 前記メモリアクセスステージ分割手段
(109)が前記メモリアクセスステージデータ保持手
段を分割していない状態で、プロセッサチップの外部に
接続される外部メモリに対して前記オペランドデータの
アクセスが発生した時点において、前記メモリアクセス
ステージ分割手段(109)に対して前記メモリアクセ
スステージデータ保持手段を分割させるメモリアクセス
ステージ分割制御手段(110)を更に有する、 ことを特徴とする請求項28乃至30の何れか1項に記
載の可変長パイプライン制御装置。
31. Accessing the operand data to an external memory connected to the outside of a processor chip in a state where the memory access stage dividing means (109) does not divide the memory access stage data holding means. 31. The memory access stage division control means (110) for dividing the memory access stage data holding means with respect to the memory access stage division means (109) at the point of time of the operation, further comprising: memory access stage division control means (110). The variable length pipeline control device according to any one of claims.
【請求項32】 前記メモリアクセスステージ分割制御
手段(110)は、前記メモリアクセスステージ保持手
段が分割されている状態で、メモリアクセスを伴わない
命令が実行され、かつ該命令に続く命令が実行するメモ
リアクセスがプロセッサチップに内蔵される内部メモリ
に対するものであった時点において、前記メモリアクセ
スステージ分割手段(109)に対して前記メモリアク
セスステージデータ保持手段の分割を解除させる、 ことを特徴とする請求項31に記載の可変長パイプライ
ン制御装置。
32. The memory access stage division control means (110) executes an instruction without memory access and executes an instruction following the instruction in a state where the memory access stage holding means is divided. The memory access stage dividing means (109) is caused to cancel the division of the memory access stage data holding means when the memory access is to an internal memory built in the processor chip. Item 32. The variable length pipeline controller according to item 31.
【請求項33】 前記命令アドレス出力ステージデータ
保持手段に対して、該手段が保持するデータの出力動作
を任意の命令サイクル数だけウエイトさせる命令アドレ
ス出力ステージウエイト制御手段(108)と、 前記オペランドアドレス出力ステージデータ保持手段に
対して、該手段が保持するデータの出力動作を任意の命
令サイクル数だけウエイトさせるオペランドアドレス出
力ステージウエイト制御手段(111)と、 を更に有することを特徴とする請求項28乃至32の何
れか1項に記載の可変長パイプライン制御装置。
33. Instruction address output stage wait control means (108) for causing the instruction address output stage data holding means to wait the output operation of the data held by the means for an arbitrary number of instruction cycles, and the operand address. 29. Operand address output stage wait control means (111) for causing the output stage data holding means to wait for an output operation of the data held by the means for an arbitrary number of instruction cycles, further comprising: 33. The variable length pipeline control device according to any one of items 1 to 32.
【請求項34】 前記パイプラインが保持するデータ
は、プログラムカウンタ値である、 ことを特徴とする請求項28乃至33の何れか1項に記
載の可変長パイプライン制御装置。
34. The variable length pipeline control device according to claim 28, wherein the data held by the pipeline is a program counter value.
JP00025594A 1994-01-06 1994-01-06 Variable length pipeline controller Expired - Fee Related JP3461887B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP00025594A JP3461887B2 (en) 1994-01-06 1994-01-06 Variable length pipeline controller
US08/367,494 US5706459A (en) 1994-01-06 1994-12-30 Processor having a variable number of stages in a pipeline
US08/927,065 US5949996A (en) 1994-01-06 1997-09-10 Processor having a variable number of stages in a pipeline

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00025594A JP3461887B2 (en) 1994-01-06 1994-01-06 Variable length pipeline controller

Publications (2)

Publication Number Publication Date
JPH07200291A JPH07200291A (en) 1995-08-04
JP3461887B2 true JP3461887B2 (en) 2003-10-27

Family

ID=11468820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00025594A Expired - Fee Related JP3461887B2 (en) 1994-01-06 1994-01-06 Variable length pipeline controller

Country Status (1)

Country Link
JP (1) JP3461887B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100237642B1 (en) * 1996-12-30 2000-01-15 구자홍 Processor having pipe line stop signal
JP2002073330A (en) * 2000-08-28 2002-03-12 Mitsubishi Electric Corp Data processing device

Also Published As

Publication number Publication date
JPH07200291A (en) 1995-08-04

Similar Documents

Publication Publication Date Title
US5706459A (en) Processor having a variable number of stages in a pipeline
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
JP3842474B2 (en) Data processing device
US7793079B2 (en) Method and system for expanding a conditional instruction into a unconditional instruction and a select instruction
US6101596A (en) Information processor for performing processing without register conflicts
JPH10228376A (en) Method and program for processing multiple-register instruction
US6275903B1 (en) Stack cache miss handling
KR100210205B1 (en) Apparatus and method for providing a stall cache
US6189093B1 (en) System for initiating exception routine in response to memory access exception by storing exception information and exception bit within architectured register
EP1770507A2 (en) Pipeline processing based on RISC architecture
US20070260857A1 (en) Electronic Circuit
JP3790626B2 (en) Method and apparatus for fetching and issuing dual word or multiple instructions
US6055628A (en) Microprocessor with a nestable delayed branch instruction without branch related pipeline interlocks
US6237086B1 (en) 1 Method to prevent pipeline stalls in superscalar stack based computing systems
JP3461887B2 (en) Variable length pipeline controller
US6170050B1 (en) Length decoder for variable length data
US5737562A (en) CPU pipeline having queuing stage to facilitate branch instructions
US20030172258A1 (en) Control forwarding in a pipeline digital processor
JPH06214785A (en) Microprocessor
JP3199035B2 (en) Processor and execution control method thereof
JPH0651984A (en) Microprocessor
US20230315446A1 (en) Arithmetic processing apparatus and method for arithmetic processing
JP3102399B2 (en) Data processing apparatus and method
JPH07114509A (en) Memory access device
JP3147884B2 (en) Storage device and information processing device

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: 20030805

LAPS Cancellation because of no payment of annual fees