JPH064283A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH064283A
JPH064283A JP4180553A JP18055392A JPH064283A JP H064283 A JPH064283 A JP H064283A JP 4180553 A JP4180553 A JP 4180553A JP 18055392 A JP18055392 A JP 18055392A JP H064283 A JPH064283 A JP H064283A
Authority
JP
Japan
Prior art keywords
signal
instruction
level
external memory
cycle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4180553A
Other languages
Japanese (ja)
Inventor
Norio Masui
規雄 桝井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4180553A priority Critical patent/JPH064283A/en
Publication of JPH064283A publication Critical patent/JPH064283A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Microcomputers (AREA)

Abstract

PURPOSE:To provide the microprocessor which can cancel the external memory access of ineffective instruction fetch. CONSTITUTION:When a pipeline flash signal 117 or an advanced lunch signal 118 is detected by a logic gate 103 and the external memory access of instruction fetch being in course of access is made ineffective, an instruction fetch cancel signal 104 is generated indicating that the external memory access of this instruction fetch is ineffective. Consequently, the program execution speed is increased because the wait time of the external memory access of next effective fetch due to that of unnecessary instruction fetch is shortened.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、パイプライン処理機
構を備え、命令フェッチの外部メモリアクセスを行うマ
イクロプロセッサに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor which has a pipeline processing mechanism and performs external memory access for instruction fetch.

【0002】[0002]

【従来の技術】マイクロプロセッサにおいては、通常、
各々の命令の実行は、命令フェッチ、命令デコード、オ
ペランドアドレスの計算、オペランドデータフェッチ、
演算実行、結果のライトなど、数サイクルの逐次的操作
を経て終了する。従来よりマイクロプロセッサの中に
は、高速処理を達成するために、これらの動作を、分割
して流れ作業的に行うことによって、複数の命令の実行
を同時に重ね合わせて行うパイプライン処理機構を有す
るものがある。
2. Description of the Related Art In a microprocessor,
Execution of each instruction includes instruction fetch, instruction decode, operand address calculation, operand data fetch,
After several cycles of sequential operations such as execution of operations and writing of results, the process ends. 2. Description of the Related Art Conventionally, a microprocessor has a pipeline processing mechanism in which, in order to achieve high-speed processing, these operations are divided and carried out in a flow-like manner, so that execution of a plurality of instructions is performed simultaneously at the same time. There is something.

【0003】図5は従来のパイプライン処理機構を備え
たマイクロプロセッサを示すブロック図であり、図にお
いて、501は従来のマイクロプロセッサ、105はメ
モリ、502は応答回路である。106はマイクロプロ
セッサ501内のパイプライン処理機構で、複数のステ
ージから成る。106Aは命令フェッチステージ(以
下、IFステージという)、106Bはデコードステー
ジ(以下、Dステージという)、106Cはオペランド
アドレス計算ステージ(以下、Aステージという)、1
06Dはオペランドフェッチステージ(以下、OFステ
ージという)、106Eは命令実行ステージ(以下、E
ステージという)である。107はIFステージ106
A内のプログラムカウンタ、108はマイクロプロセッ
サ501内の外部メモリアクセス制御部(以下、アクセ
ス部という)である。109はマイクロプロセッサ50
1及び応答回路502に入力されるクロック信号、11
0はマイクロプロセッサ501及び応答回路502に入
力されるリセット信号である。111はアクセス部10
8から応答回路502に入力されるアドレスストローブ
信号(以下、AS信号という)、112はアクセス部1
08から応答回路502に入力されるデータストローブ
信号(以下、DS信号という)、113は応答回路50
2からアクセス部108に入力されるデータトランスフ
ァコンプリート信号(以下、DC信号という)である。
FIG. 5 is a block diagram showing a conventional microprocessor having a pipeline processing mechanism. In the figure, 501 is a conventional microprocessor, 105 is a memory, and 502 is a response circuit. Reference numeral 106 denotes a pipeline processing mechanism in the microprocessor 501, which includes a plurality of stages. 106A is an instruction fetch stage (hereinafter, IF stage), 106B is a decode stage (hereinafter, D stage), 106C is an operand address calculation stage (hereinafter, A stage), 1
06D is an operand fetch stage (hereinafter referred to as OF stage), 106E is an instruction execution stage (hereinafter referred to as E)
It is called a stage). 107 is the IF stage 106
A program counter in A, 108 is an external memory access control unit (hereinafter referred to as an access unit) in the microprocessor 501. 109 is a microprocessor 50
1 and a clock signal input to the response circuit 502, 11
0 is a reset signal input to the microprocessor 501 and the response circuit 502. 111 is the access unit 10
8 is an address strobe signal (hereinafter referred to as an AS signal) input to the response circuit 502, and 112 is the access unit 1.
08 is a data strobe signal (hereinafter referred to as a DS signal) input to the response circuit 502, and 113 is the response circuit 50.
2 is a data transfer complete signal (hereinafter referred to as a DC signal) input to the access unit 108.

【0004】114はメモリ105からアクセス部10
8に入力される外部データバスである。115A〜11
5Eはマイクロプロセッサ501の内部データバスであ
り、115Aはアクセス部108からIFステージ10
6Aへ、115BはIFステージ106AからDステー
ジ106Bへ、115CはDステージ106BからAス
テージ106Cへ、115DはAステージ106Cから
OFステージ106Dへ、115EはOFステージ10
6DからEステージ106Eへ、それぞれ入力される。
116はIFステージ106Aからアクセス部108に
入力される命令フェッチ外部メモリアクセス要求信号
(以下、IF要求信号という)である。117はEステ
ージ106EからIFステージ106A、Dステージ1
06B、Aステージ106C、及びOFステージ106
D、の各ステージに入力されるパイプラインフラッシュ
信号(以下、フラッシュ信号という)である。118は
Dステージ106BからIFステージ106Aに入力さ
れる先行分岐信号である。
Reference numeral 114 denotes the access unit 10 from the memory 105.
8 is an external data bus to be input. 115A-11
5E is an internal data bus of the microprocessor 501, and 115A is from the access unit 108 to the IF stage 10.
6A, 115B to IF stage 106A to D stage 106B, 115C to D stage 106B to A stage 106C, 115D to A stage 106C to OF stage 106D, and 115E to OF stage 10.
Input from 6D to E stage 106E, respectively.
Reference numeral 116 denotes an instruction fetch external memory access request signal (hereinafter referred to as an IF request signal) input from the IF stage 106A to the access unit 108. Reference numeral 117 denotes E stage 106E to IF stage 106A, D stage 1
06B, A stage 106C, and OF stage 106
It is a pipeline flash signal (hereinafter referred to as a flash signal) input to each stage of D. Reference numeral 118 is a preceding branch signal input from the D stage 106B to the IF stage 106A.

【0005】図6は、応答回路502の一例を示す構成
図である。図において、109〜113は図5に示した
ものと同一である。601は論理ゲート、602は遅延
回路、603はフリップフロップ(以下、FFという)
である。論理ゲート601はDS信号112及びリセッ
ト信号110が入力され、内部信号604を出力する。
遅延回路602はリセット信号110及びAS信号11
1及びクロック信号109が入力され、内部信号605
を出力する。FF603は内部信号604及び内部信号
605が入力され、DC信号113を出力する。
FIG. 6 is a block diagram showing an example of the response circuit 502. In the figure, 109 to 113 are the same as those shown in FIG. Reference numeral 601 is a logic gate, 602 is a delay circuit, and 603 is a flip-flop (hereinafter referred to as FF).
Is. The logic gate 601 receives the DS signal 112 and the reset signal 110 and outputs an internal signal 604.
The delay circuit 602 has a reset signal 110 and an AS signal 11
1 and the clock signal 109 are input, and the internal signal 605
Is output. The internal signal 604 and the internal signal 605 are input to the FF 603, and the DC signal 113 is output.

【0006】図7は、マイクロプロセッサ501がメモ
リ105に対して命令フェッチの外部メモリアクセスを
行なっている間に、パイプラインフラッシュが発生した
場合の動作を説明するためのタイミングチャートであ
る。図7において、109,111〜114,116〜
118は図5に示したものと同一である。
FIG. 7 is a timing chart for explaining the operation in the case where a pipeline flush occurs while the microprocessor 501 is accessing the memory 105 for fetching an external memory. In FIG. 7, 109, 111-114, 116-
Reference numeral 118 is the same as that shown in FIG.

【0007】図8は、マイクロプロセッサ501がメモ
リ105に対して命令フェッチの外部メモリアクセスを
行っている間に、先行分岐が発生した場合の動作を説明
するためのタイミングチャートである。図8において、
109,111〜114,116〜118は図5に示し
たものと同一である。
FIG. 8 is a timing chart for explaining the operation in the case where a preceding branch occurs while the microprocessor 501 is accessing the memory 105 for external memory access for instruction fetch. In FIG.
109, 111 to 114, 116 to 118 are the same as those shown in FIG.

【0008】次に動作について説明する。以下の説明に
おいて、メモリ105は命令コードを格納しており、ク
ロック信号109の6周期でアクセスできる性能である
ものとする。110〜113,116〜118の各信号
は負論理であるものとする。また、1サイクルはクロッ
ク信号109の2周期とする。信号のLレベルからHレ
ベルへの変化点を立ち上がり、HレベルからLレベルへ
の変化点を立ち下がりと記述する。
Next, the operation will be described. In the following description, it is assumed that the memory 105 stores the instruction code and has the performance of being accessible in 6 cycles of the clock signal 109. It is assumed that the signals 110 to 113 and 116 to 118 have negative logic. Further, one cycle is two cycles of the clock signal 109. The transition point from the L level to the H level of the signal is described as rising, and the transition point from the H level to the L level is described as falling.

【0009】まず、図5を用いて、マイクロプロセッサ
501内の各ブロックの動作について説明する。IFス
テージ106Aは、命令フェッチを行う場合、IF要求
信号116をクロック信号109の1周期間Lレベルと
してアクセス部108に命令フェッチの外部メモリアク
セスの起動を要求する。アクセス部108は、IF要求
信号116がLレベルになったことを検出した時点で、
外部メモリアクセス中でなければ、直ちにプログラムカ
ウンタ107の保持値をアドレスとして外部メモリアク
セスを開始し、外部メモリアクセス中であれば、終了し
た時点からプログラムカウンタ107の保持値をアドレ
スとして外部メモリアクセスを開始する。アクセス部1
08の外部メモリアクセスによりメモリ105からフェ
ッチされた命令コードは、内部データバス115Aを介
してIFステージ106Aに入力される。命令コードを
フェッチしたIFステージ106Aは、次のサイクルで
内部データバス115Bを介して命令コードをDステー
ジ106Bに入力するとともに、プログラムカウンタ1
07をインクリメントして次の命令コードのフェッチを
行う。Dステージ106Bは、内部データバス115B
を介して受け取った命令コードをデコードし、次のサイ
クルでデコード結果であるDコードを内部データバス1
15Cを介してAステージ106Cに入力する。Aステ
ージ106Cは内部データバス115Cを介して受け取
ったDコードにより必要に応じてオペランドのアドレス
計算を行い、次のサイクルでDコード及びオペランドの
アドレス値を内部データバス115Dを介してOFステ
ージ106Dに入力する。OFステージ106Dは、必
要に応じて内部データバス115Dを介して受け取った
オペランドのアドレス値により図示しない経路を通じ、
アクセス部108を介してオペランドのフェッチを行
い、次のサイクルでDコード及びオペランドを内部デー
タバス115Eを介してEステージ106Eに入力す
る。Eステージ106Eは、内部データバス115Eを
介して受け取ったDコード及びオペランドにより命令を
実行する。
First, the operation of each block in the microprocessor 501 will be described with reference to FIG. When performing the instruction fetch, the IF stage 106A sets the IF request signal 116 to the L level for one cycle of the clock signal 109 and requests the access unit 108 to activate the external memory access for the instruction fetch. When the access unit 108 detects that the IF request signal 116 has become L level,
If the external memory is not being accessed, the external memory access is started immediately using the value held in the program counter 107 as an address. If the external memory is being accessed, the external memory access is made using the value held in the program counter 107 as the address from the end. Start. Access section 1
The instruction code fetched from the memory 105 by the external memory access 08 is input to the IF stage 106A via the internal data bus 115A. The IF stage 106A, which has fetched the instruction code, inputs the instruction code to the D stage 106B via the internal data bus 115B in the next cycle, and at the same time, the program counter 1
07 is incremented to fetch the next instruction code. The D stage 106B has an internal data bus 115B.
The instruction code received via the internal data bus 1 is decoded and the D code which is the decoding result is decoded in the next cycle.
Input to A stage 106C via 15C. The A stage 106C calculates the address of the operand as required by the D code received via the internal data bus 115C, and in the next cycle, outputs the D code and the address value of the operand to the OF stage 106D via the internal data bus 115D. input. The OF stage 106D uses a path (not shown) depending on the address value of the operand received via the internal data bus 115D, if necessary.
The operand is fetched through the access unit 108, and the D code and the operand are input to the E stage 106E through the internal data bus 115E in the next cycle. The E stage 106E executes an instruction with the D code and operand received via the internal data bus 115E.

【0010】106Aから106Eの各ステージは、そ
れぞれ並列に動作を行う。Eステージ106Eで分岐命
令を実行した場合、分岐命令の実行の次に分岐先のアド
レスの命令を実行する必要がある。しかし、106Aか
ら106Dの各ステージでは、分岐命令にアドレス順に
引き続く命令の処理が既に行われているため、これらの
処理を無効化するとともに、IFステージ106Aに分
岐先のアドレスの命令をフェッチさせる必要がある。こ
のため、Eステージ106Eは分岐命令を実行すると、
フラッシュ信号117をクロック信号109の1周期間
Lレベルとする。106Aから106Dの各ステージ
は、フラッシュ信号117がLレベルになったことを検
出すると初期化される。また、IFステージ106A
は、フラッシュ信号117による初期化の後、分岐先の
アドレス値をEステージ106Eから図示しない経路を
介してプログラムカウンタ107にセットして、分岐先
のアドレスの命令フェッチを開始する。
The stages 106A to 106E operate in parallel. When a branch instruction is executed at the E stage 106E, it is necessary to execute the instruction at the branch destination address after the execution of the branch instruction. However, in each stage of 106A to 106D, since the processing of the instruction following the branch instruction in the address order has already been performed, it is necessary to invalidate these processing and cause the IF stage 106A to fetch the instruction of the branch destination address. There is. Therefore, when the E stage 106E executes the branch instruction,
The flash signal 117 is set to L level for one cycle of the clock signal 109. Each of the stages 106A to 106D is initialized when it detects that the flash signal 117 has become L level. Also, the IF stage 106A
After initialization by the flash signal 117, sets the branch destination address value in the program counter 107 from the E stage 106E via a path not shown, and starts instruction fetch of the branch destination address.

【0011】命令の中には先行分岐命令がある。先行分
岐命令は、Eステージ106Eにおける分岐命令実行時
のパイプラインフラッシュによる時間の損失を減少する
ための分岐命令であり、Dステージ106Bで検出され
る。Dステージ106Bはデコードした命令が先行分岐
命令であった場合、分岐先のアドレスを計算し、先行分
岐信号118をクロック信号109の1周期間Lレベル
とする。IFステージ106Aは、先行分岐信号118
がLレベルになったことを検出すると初期化される。ま
た、IFステージ106Aは、先行分岐信号118によ
る初期化の後、分岐先のアドレス値をDステージ106
Bから図示しない経路を介してプログラムカウンタ10
7にセットして、分岐先のアドレスの命令フェッチを開
始する。
Among the instructions, there is a preceding branch instruction. The preceding branch instruction is a branch instruction for reducing the time loss due to pipeline flush at the time of executing the branch instruction in the E stage 106E, and is detected in the D stage 106B. When the decoded instruction is the preceding branch instruction, the D stage 106B calculates the address of the branch destination and sets the preceding branch signal 118 to the L level for one cycle of the clock signal 109. The IF stage 106A outputs the preceding branch signal 118.
When it is detected that the L level has become L level, it is initialized. Further, the IF stage 106A sets the address value of the branch destination to the D stage 106 after initialization by the preceding branch signal 118.
Program counter 10 from B via a route not shown
7 is set and the instruction fetch of the branch destination address is started.

【0012】次に図6を用いて、応答回路502の動作
について説明する。論理ゲート601はDS信号112
がHレベルまたはリセット信号110がLレベルの条件
を満足している間は内部信号604をHレベルとし、上
記の条件を満足していない時は内部信号604をLレベ
ルとする。遅延回路602は、AS信号111がLレベ
ルになると、AS信号111がLレベルである間のクロ
ック信号109の立ち上がりからクロック信号109の
立ち上がりをカウントし、カウント数が5となるクロッ
ク信号109の立ち上がりで内部信号605をHレベル
とし、次のクロック信号109の立ち上がりで内部信号
605をLレベルとする。また、遅延回路602は、リ
セット信号110がLレベルになると初期化され、内部
信号605をLレベルとする。
Next, the operation of the response circuit 502 will be described with reference to FIG. The logic gate 601 outputs the DS signal 112.
Is at the H level or the reset signal 110 satisfies the L level condition, the internal signal 604 is at the H level, and when the above condition is not satisfied, the internal signal 604 is at the L level. When the AS signal 111 becomes L level, the delay circuit 602 counts the rising of the clock signal 109 from the rising of the clock signal 109 while the AS signal 111 is at L level, and the rising number of the clock signal 109 becomes 5 Then, the internal signal 605 is set to the H level, and the internal signal 605 is set to the L level at the next rising of the clock signal 109. Further, the delay circuit 602 is initialized when the reset signal 110 becomes L level, and sets the internal signal 605 to L level.

【0013】FF603は、内部信号605がHレベル
になるとセットされてDC信号113をLレベルとし、
内部信号604がHレベルになるとリセットされてDC
信号113をHレベルとする。したがって、DC信号1
13は、AS信号111がLレベルになり、AS信号1
11がLレベルである間のクロック信号109の立ち上
がりから数えて5つ目のクロック信号109の立ち上が
りでLレベルとなり、次のDS信号112の立ち上がり
でHレベルとなる。また、リセット信号110がLレベ
ルになると、遅延回路602が初期化されるとともにD
C信号113はHレベルとなる。
The FF 603 is set when the internal signal 605 becomes H level, and sets the DC signal 113 to L level,
When the internal signal 604 becomes H level, it is reset and DC
The signal 113 is set to H level. Therefore, DC signal 1
13, the AS signal 111 becomes L level, and the AS signal 1
While 11 is at L level, it becomes L level at the fifth rising edge of the clock signal 109 counted from the rising edge of the clock signal 109, and becomes H level at the next rising edge of the DS signal 112. When the reset signal 110 becomes L level, the delay circuit 602 is initialized and D
The C signal 113 becomes H level.

【0014】図5,図6,図7を用いて、マイクロプロ
セッサ501がメモリ105に対して命令フェッチの外
部メモリアクセスを行っている間にパイプラインフラッ
シュが発生した場合の動作を説明する。以下、説明の便
宜上、図7ではクロック信号109の各周期に番号1〜
18をつけている。また、周期n−1から周期nにかけ
てのクロック信号109の立ち上がりを周期nの立ち上
がりと記述し、周期n中のクロック信号109の立ち下
がりを周期nの立ち下がりと記述する。周期1から命令
Aのフェッチを行う。周期1の立ち上がりで、IFステ
ージ106AはIF要求信号116をLレベルとし、ア
クセス部108は、外部メモリアクセス中でないため、
プログラムカウンタ107の保持値をアドレスとして命
令Aのフェッチの外部メモリアクセスを開始し、図示し
ない外部アドレスバスを介してメモリ105にアドレス
を与える。周期1の立ち下がりで、アクセス部108は
AS信号111をLレベルとしてアドレスを与えたこと
を示す。周期2の立ち上がりで、アクセス部108はD
S信号112をLレベルとしてデータ読み込み中である
ことを示す。アクセス部108は、周期2の立ち下がり
でAS信号111をHレベルにもどす。
The operation when the pipeline flush occurs while the microprocessor 501 is accessing the memory 105 for external memory for instruction fetch will be described with reference to FIGS. 5, 6 and 7. FIG. Hereinafter, for convenience of explanation, in FIG.
I am wearing 18. Further, the rising edge of the clock signal 109 from the cycle n-1 to the cycle n is described as a rising edge of the cycle n, and the falling edge of the clock signal 109 during the cycle n is described as a falling edge of the cycle n. The instruction A is fetched from the cycle 1. At the rising edge of cycle 1, the IF stage 106A sets the IF request signal 116 to the L level, and the access unit 108 is not accessing the external memory.
An external memory access for fetching the instruction A is started using the value held in the program counter 107 as an address, and the address is given to the memory 105 via an external address bus (not shown). At the trailing edge of cycle 1, the access unit 108 sets the AS signal 111 to the L level and gives an address. At the rising edge of cycle 2, the access unit 108 sets D
The S signal 112 is set to L level to indicate that data is being read. The access unit 108 returns the AS signal 111 to the H level at the trailing edge of the cycle 2.

【0015】メモリ105は、周期5の間に外部データ
バス114上に命令Aのコードを出力する。応答回路5
02は、AS信号111がLレベルである間のクロック
信号109の立ち上がり(周期2の立ち上がり)から数
えて5つ目のクロック信号109の立ち上がり(周期6
の立ち上がり)でDC信号113をLレベルとして、外
部データバス114上に有効なデータ(この場合は命令
Aのコード)が出力されたことを示す。アクセス部10
8は、DC信号113がLレベルになったことを検出す
ると、外部データバス114上のデータ(この場合は命
令Aのコード)を読み込み、内部データバス115Aを
介してIFステージ106Aに命令Aのコードを与え
る。アクセス部108は、次のクロック信号109の立
ち上がり(周期7の立ち上がり)でDS信号112をH
レベルにもどしてマイクロプロセッサ501がデータ
(この場合は命令Aのコード)の読み込みを完了したこ
とを示す。
The memory 105 outputs the code of the instruction A on the external data bus 114 during the cycle 5. Response circuit 5
02 is the fifth rising edge of the clock signal 109 (the rising edge of the cycle 2) of the clock signal 109 while the AS signal 111 is at the L level (the rising edge of the cycle 6).
At the rising edge), the DC signal 113 is set to the L level to indicate that valid data (the code of the instruction A in this case) has been output to the external data bus 114. Access unit 10
When detecting that the DC signal 113 has become the L level, 8 reads the data on the external data bus 114 (in this case, the code of the instruction A) and transfers the instruction A of the instruction A to the IF stage 106A via the internal data bus 115A. Give the code. The access unit 108 sets the DS signal 112 to H level at the next rise of the clock signal 109 (rise of cycle 7).
It returns to the level and indicates that the microprocessor 501 has completed reading the data (in this case, the code of the instruction A).

【0016】応答回路502は、DS信号112の立ち
上がり(周期7の立ち上がり)でDC信号113をHレ
ベルにもどす。以上の1から6の6周期で命令Aのフェ
ッチの外部メモリアクセスが完了する。IFステージ1
06Aは、プログラムカウンタ107の保持値をインク
リメントして、命令Bのフェッチを周期7から命令Aの
フェッチと同様に行う。ここで、周期8の立ち下がりか
ら周期9の立ち下がりの間、フラッシュ信号117がL
レベルになったとする。周期8の立ち下がりで、106
Aから106Dの各ステージは初期化される。IFステ
ージ106Aは分岐先のアドレス値をEステージ106
Eから図示しない経路を介してプログラムカウンタ10
7にセットして、分岐先のアドレスの命令Xのフェッチ
を開始するために、周期9の立ち上がりから周期10の
立ち上がりの間、IF要求信号116をLレベルにす
る。しかし、アクセス部108は、命令Bのフェッチの
外部メモリアクセス中であるため、命令Xのフェッチの
外部メモリアクセスの開始を命令Bのフェッチの外部メ
モリアクセス終了まで待たせる。周期13の立ち上がり
で、命令Bのフェッチの外部メモリアクセスが完了する
と、アクセス部108は読み込んだ命令Bのコードを捨
て、周期13から命令Aのフェッチと同様の動作で命令
Xのフェッチの外部メモリアクセスを行う。
The response circuit 502 returns the DC signal 113 to the H level at the rising edge of the DS signal 112 (the rising edge of the cycle 7). The external memory access for fetching the instruction A is completed in the above 6 cycles of 1 to 6. IF stage 1
06A increments the value held in the program counter 107, and fetches the instruction B from cycle 7 in the same manner as fetching the instruction A. Here, from the falling edge of the cycle 8 to the falling edge of the cycle 9, the flash signal 117 is
Suppose you have reached the level. At the fall of cycle 8, 106
Each stage from A to 106D is initialized. The IF stage 106A outputs the address value of the branch destination to the E stage 106.
Program counter 10 from E via a route not shown
7, the IF request signal 116 is set to the L level from the rising edge of the cycle 9 to the rising edge of the cycle 10 in order to start fetching the instruction X at the branch destination address. However, since the external memory access for fetching the instruction B is in progress, the access unit 108 makes the start of the external memory access for fetching the instruction X wait until the end of the external memory access for fetching the instruction B. When the external memory access for fetching the instruction B is completed at the rising edge of the cycle 13, the access unit 108 discards the code of the instruction B read, and the external memory for fetching the instruction X is operated in the same operation as the fetch of the instruction A from the cycle 13. Access.

【0017】図5,図6,図8を用いて、マイクロプロ
セッサ501がメモリ105に対して命令フェッチの外
部メモリアクセスを行っている間に先行分岐が発生した
場合の動作を説明する。周期1〜6の6周期は、図7の
周期1〜6の命令Aのフェッチの外部メモリアクセスの
動作と同一である。IFステージ106Aは、プログラ
ムカウンタ107の保持値をインクリメントして、命令
Bのフェッチを周期7から命令Aのフェッチと同様に行
う。ここで、周期8の立ち下がりから周期9の立ち下が
りの間、先行分岐信号118がLレベルになったとす
る。周期8の立ち下がりで、IFステージ106Aは初
期化され、分岐先のアドレス値をDステージ106Bか
ら図示しない経路を介してプログラムカウンタ107に
セットして、分岐先のアドレスの命令Yのフェッチを開
始するために、周期9の立ち上がりから周期10の立ち
上がりの間、IF要求信号116をLレベルにする。し
かし、アクセス部108は、命令Bのフェッチの外部メ
モリアクセス中であるため、命令Yのフェッチの外部メ
モリアクセスの開始を命令Bのフェッチの外部メモリア
クセス終了まで待たせる。周期13の立ち上がりで、命
令Bのフェッチの外部メモリアクセスが完了すると、ア
クセス部108は読み込んだ命令Bのコードを捨て、周
期13から命令Aのフェッチと同様の動作で命令Yのフ
ェッチの外部メモリアクセスを行う。
The operation when the preceding branch occurs while the microprocessor 501 is accessing the memory 105 for external memory for instruction fetch will be described with reference to FIGS. 5, 6 and 8. The six cycles of cycles 1 to 6 are the same as the external memory access operation for fetching the instruction A in cycles 1 to 6 of FIG. The IF stage 106A increments the value held in the program counter 107, and fetches the instruction B from cycle 7 in the same manner as the fetching of the instruction A. Here, it is assumed that the preceding branch signal 118 is at the L level from the fall of the cycle 8 to the fall of the cycle 9. At the trailing edge of cycle 8, the IF stage 106A is initialized, the branch destination address value is set in the program counter 107 from the D stage 106B via a path not shown, and the fetch of the instruction Y at the branch destination address is started. In order to do so, the IF request signal 116 is set to the L level from the rising of the cycle 9 to the rising of the cycle 10. However, since the external memory access for fetching the instruction B is in progress, the access unit 108 makes the start of the external memory access for fetching the instruction Y wait until the external memory access for fetching the instruction B ends. When the external memory access for fetching the instruction B is completed at the rising edge of the cycle 13, the access unit 108 discards the code of the read instruction B, and performs the same operation as the fetch of the instruction A from the cycle 13 to the external memory for fetching the instruction Y. Access.

【0018】[0018]

【発明が解決しようとする課題】従来のマイクロプロセ
ッサは以上のように構成されているので、命令フェッチ
の外部メモリアクセス中にパイプラインフラッシュや先
行分岐が起った場合、この外部メモリアクセスによりフ
ェッチされる命令(図7,図8では命令B)は無効とな
るにもかかわらず、この外部メモリアクセスが終了する
まで次の有効な命令(図7,図8では命令X,命令Y)
のフェッチの外部メモリアクセスを起動できないという
問題点があった。
Since the conventional microprocessor is constructed as described above, if a pipeline flush or a preceding branch occurs during an instruction fetch external memory access, the fetch is performed by this external memory access. Although the instruction to be executed (instruction B in FIGS. 7 and 8) is invalid, the next valid instruction (instruction X and instruction Y in FIGS. 7 and 8) until this external memory access is completed.
There was a problem that external memory access for fetching could not be started.

【0019】この発明は上記のような問題点を解消する
ためになされたもので、パイプラインフラッシュや先行
分岐により無効となった命令フェッチの外部メモリアク
セスをアクセス途中でキャンセルできるマイクロプロセ
ッサを得ることを目的とする。
The present invention has been made in order to solve the above problems, and provides a microprocessor capable of canceling an external memory access of an instruction fetch invalidated by a pipeline flush or a preceding branch during the access. With the goal.

【0020】[0020]

【課題を解決するための手段】この発明に係るマイクロ
プロセッサは、フラッシュ信号と先行分岐信号との何れ
か一方を検出して、現在アクセス中の命令フェッチの外
部メモリアクセスが無効となったことを示す命令フェッ
チキャンセル信号を出力する検出手段を備えたものであ
る。
The microprocessor according to the present invention detects that either the flash signal or the preceding branch signal is detected and the external memory access of the currently fetched instruction fetch is invalid. The detection means for outputting the instruction fetch cancel signal shown is provided.

【0021】[0021]

【作用】この発明における命令フェッチキャンセル信号
は、パイプラインフラッシュや先行分岐の発生時に、現
在アクセス中の命令フェッチの外部メモリアクセスを、
外部回路を介して強制的に終了させることができる。
The instruction fetch cancel signal according to the present invention indicates the external memory access of the instruction fetch currently being accessed when a pipeline flush or a preceding branch occurs.
It can be forcibly terminated via an external circuit.

【0022】[0022]

【実施例】【Example】

実施例1.以下、この発明の一実施例を図について説明
する。図1において、105〜118は図5に示した従
来例のものと同一である。101はこの発明の一実施例
によるマイクロプロセッサ、102は応答回路、103
はマイクロプロセッサ101内に設けた検出手段として
の論理ゲートである。論理ゲート103には、フラッシ
ュ信号117及び先行分岐信号118が入力される。1
04は論理ゲート103から出力される命令フェッチキ
ャンセル信号104である。この命令フェッチキャンセ
ル信号104は、応答回路102に入力される。
Example 1. An embodiment of the present invention will be described below with reference to the drawings. 1, 105 to 118 are the same as those of the conventional example shown in FIG. 101 is a microprocessor according to an embodiment of the present invention, 102 is a response circuit, 103
Is a logic gate provided as a detection means in the microprocessor 101. The flash signal 117 and the preceding branch signal 118 are input to the logic gate 103. 1
Reference numeral 04 is an instruction fetch cancel signal 104 output from the logic gate 103. The instruction fetch cancel signal 104 is input to the response circuit 102.

【0023】図2は、応答回路102の一実施例を示す
構成図である。図2において、104,109〜113
は図1に示したものと同一である。201〜204は論
理ゲート、205は遅延回路、206はフリップフロッ
プ(以下、FFという)である。論理ゲート201はD
S信号112及びリセット信号110が入力され、内部
信号207を出力する。論理ゲート202はリセット信
号110及び命令フェッチキャンセル信号104が入力
され、内部信号208を出力する。論理ゲート203は
クロック信号109及びDS信号112及び命令フェッ
チキャンセル信号104が入力され、内部信号209を
出力する。遅延回路205はAS信号111、クロック
信号109及び内部信号208が入力され、内部信号2
10を出力する。論理ゲート204は内部信号209及
び内部信号210が入力され、内部信号211を出力す
る。FF206は内部信号207及び内部信号211が
入力され、DC信号113を出力する。
FIG. 2 is a block diagram showing an embodiment of the response circuit 102. In FIG. 2, 104, 109 to 113
Is the same as that shown in FIG. 201 to 204 are logic gates, 205 is a delay circuit, and 206 is a flip-flop (hereinafter referred to as FF). Logic gate 201 is D
The S signal 112 and the reset signal 110 are input and the internal signal 207 is output. The logic gate 202 receives the reset signal 110 and the instruction fetch cancel signal 104, and outputs an internal signal 208. The clock signal 109, the DS signal 112, and the instruction fetch cancel signal 104 are input to the logic gate 203 and the internal signal 209 is output. The delay circuit 205 receives the AS signal 111, the clock signal 109, and the internal signal 208, and receives the internal signal 2
10 is output. The internal signal 209 and the internal signal 210 are input to the logic gate 204, and the internal signal 211 is output. The FF 206 receives the internal signal 207 and the internal signal 211, and outputs the DC signal 113.

【0024】図3は、マイクロプロセッサ101がメモ
リ105に対して命令フェッチの外部メモリアクセスを
行っている間に、パイプラインフラッシュが発生した場
合の動作を説明するためのタイミングチャートである。
図3において、104,109,111〜114,11
6〜118は図1に示したものと同一である。
FIG. 3 is a timing chart for explaining the operation when the pipeline flush occurs while the microprocessor 101 is accessing the memory 105 for external memory fetching an instruction.
In FIG. 3, 104, 109, 111 to 114, 11
6 to 118 are the same as those shown in FIG.

【0025】図4は、マイクロプロセッサ101がメモ
リ105に対して命令フェッチの外部メモリアクセスを
行っている間に、先行分岐が発生した場合の動作を説明
するためのタイミングチャートである。図4において、
104,109,111〜114,116〜118は図
1に示したものと同一である。
FIG. 4 is a timing chart for explaining the operation when the preceding branch occurs while the microprocessor 101 is accessing the memory 105 for external memory access for instruction fetch. In FIG.
104, 109, 111-114, 116-118 are the same as those shown in FIG.

【0026】次に動作について説明する。以下の説明に
おいて、命令フェッチキャンセル信号104は負論理で
あるものとする。
Next, the operation will be described. In the following description, the instruction fetch cancel signal 104 has a negative logic.

【0027】まず図1を用いて、命令フェッチキャンセ
ル信号104について説明する。論理ゲート103は、
フラッシュ信号117と先行分岐信号118のいずれか
一方がLレベルの条件を満足している間は、命令フェッ
チキャンセル信号104をLレベルとし、上記の条件を
満足していない時には、命令フェッチキャンセル信号1
04をHレベルとする。
First, the instruction fetch cancel signal 104 will be described with reference to FIG. The logic gate 103 is
While one of the flash signal 117 and the preceding branch signal 118 satisfies the L level condition, the instruction fetch cancel signal 104 is set to the L level, and when the above condition is not satisfied, the instruction fetch cancel signal 1
04 is set to H level.

【0028】次に図2を用いて、応答回路102の動作
について説明する。論理ゲート201はDS信号112
がHレベルまたはリセット信号110がLレベルの条件
を満足している間は内部信号207をHレベルとし、上
記の条件を満足していない時は内部信号207をLレベ
ルとする。論理ゲート202はリセット信号110がL
レベルまたは命令フェッチキャンセル信号104がLレ
ベルの条件を満足している間は内部信号208をLレベ
ルとし、上記の条件を満足していない時は内部信号20
8をHレベルとする。論理ゲート203はクロック信号
109がHレベルでかつDS信号112がLレベルでか
つ命令フェッチキャンセル信号104がLレベルの条件
がそろっている間は内部信号209をHレベルとし、上
記の条件がそろっていない時は内部信号209をLレベ
ルとする。遅延回路205は、AS信号111がLレベ
ルになると、このLレベルである間のクロック信号10
9の立ち上がりからクロック信号109の立ち上がりを
カウントし、カウント数が5となるクロック信号109
の立ち上がりで内部信号201をHレベルとし、次のク
ロック信号109の立ち上がりで内部信号210をLレ
ベルとする。また、遅延回路205は、内部信号208
がLレベルになると初期化され、内部信号210をLレ
ベルとする。したがって、遅延回路205が初期化され
るのは、リセット信号110がLレベルまたは命令フェ
ッチキャンセル信号104がLレベルの条件を満足した
ときである。
Next, the operation of the response circuit 102 will be described with reference to FIG. The logic gate 201 outputs the DS signal 112
Is at the H level or the reset signal 110 satisfies the L level condition, the internal signal 207 is at the H level, and when the above condition is not satisfied, the internal signal 207 is at the L level. The reset signal 110 of the logic gate 202 is L
The internal signal 208 is set to the L level while the level or the instruction fetch cancel signal 104 satisfies the L level condition, and the internal signal 20 is set when the above condition is not satisfied.
8 is set to H level. The logic gate 203 sets the internal signal 209 to the H level while the clock signal 109 is at the H level, the DS signal 112 is at the L level, and the instruction fetch cancel signal 104 is at the L level, and the above conditions are satisfied. When there is not, the internal signal 209 is set to L level. When the AS signal 111 becomes L level, the delay circuit 205 receives the clock signal 10 while the AS signal 111 is at L level.
The clock signal 109 that counts the rising edge of the clock signal 109 from the rising edge of 9 and has a count of 5
The internal signal 201 is set to the H level at the rising edge of, and the internal signal 210 is set to the L level at the next rising edge of the clock signal 109. In addition, the delay circuit 205 uses the internal signal 208.
Is initialized when L becomes L level, and the internal signal 210 becomes L level. Therefore, the delay circuit 205 is initialized when the reset signal 110 satisfies the L level or the instruction fetch cancel signal 104 satisfies the L level.

【0029】論理ゲート204は内部信号209がHレ
ベルまたは内部信号210がHレベルの条件を満足して
いる間は内部信号211をHレベルとし、上記条件を満
足していない時は内部信号211をLレベルとする。F
F206は、内部信号211がHレベルになるとセット
されてDC信号113をLレベルとし、内部信号207
がHレベルになるとリセットされてDC信号113をH
レベルとする。したがってDC信号113は、AS信号
111がLレベルになり、このLレベルである間のクロ
ック信号109の立ち上がりから数えて5つ目のクロッ
ク信号109の立ち上がりでLレベルとなり、次のDS
信号112の立ち上がりでHレベルとなる。また、DS
信号112がLレベルである時に、すなわちマイクロプ
ロセッサ101がメモリ105をアクセスしている間
に、命令フェッチキャンセル信号104がLレベルにな
ると、遅延回路205は初期化され、DC信号113
は、命令フェッチキャンセル信号104がLレベルであ
る間のクロック信号109の立ち上がりでLレベルとな
り、次のDS信号112の立ち上がりでHレベルとな
る。また、リセット信号110がLレベルになると、遅
延回路205が初期化されるとともにDC信号113は
Hレベルとなる。
The logic gate 204 sets the internal signal 211 to the H level while the internal signal 209 satisfies the H level condition or the internal signal 210 satisfies the H level condition, and outputs the internal signal 211 when the above condition is not satisfied. Set to L level. F
The F206 is set when the internal signal 211 becomes H level, sets the DC signal 113 to L level, and the internal signal 207
Is reset to H level and DC signal 113 is set to H level.
Level. Therefore, the DC signal 113 becomes the L level at the fifth rising edge of the clock signal 109 counted from the rising edge of the clock signal 109 while the AS signal 111 becomes the L level, and the next DS
The signal 112 rises to the H level. Also, DS
When the signal 112 is at L level, that is, when the microprocessor 101 is accessing the memory 105 and the instruction fetch cancel signal 104 becomes L level, the delay circuit 205 is initialized and the DC signal 113 is generated.
Becomes L level at the rising of the clock signal 109 while the instruction fetch cancel signal 104 is at the L level, and becomes H level at the next rising of the DS signal 112. When the reset signal 110 goes low, the delay circuit 205 is initialized and the DC signal 113 goes high.

【0030】図1,図2,図3を用いて、マイクロプロ
セッサ101がメモリ105に対して命令フェッチの外
部メモリアクセスを行っている間にパイプラインフラッ
シュが発生した場合の動作を説明する。周期1〜6の6
周期は、従来例の図7の周期1〜6の命令Aのフェッチ
の外部メモリアクセスの動作と同一である。IFステー
ジ106Aは、プログラムカウンタ107の保持値をイ
ンクリメントして、命令Bのフェッチを周期7から命令
Aのフェッチと同様に行う。ここで、周期8の立ち下が
りから周期9の立ち下がりの間、フラッシュ信号117
がLレベルになったとする。周期8の立ち下がりで、I
Fステージ106Aが初期化され、分岐先のアドレス値
をEステージ106Eから図示しない経路を介してプロ
グラムカウンタ107にセットして、分岐先のアドレス
の命令Xのフェッチを開始するために、周期9の立ち上
がりから周期10の立ち上がりの間、IF要求信号11
6をLレベルにする。しかし、アクセス部108は、命
令Bのフェッチの外部メモリアクセス中であるため、命
令Xのフェッチの外部メモリアクセスの開始を命令Bの
フェッチの外部メモリアクセス終了まで待たせる。
The operation when the pipeline flush occurs while the microprocessor 101 is accessing the memory 105 for external memory for instruction fetch will be described with reference to FIGS. 1, 2 and 3. 6 of cycles 1-6
The cycle is the same as the operation of external memory access for fetching the instruction A in cycles 1 to 6 of FIG. 7 of the conventional example. The IF stage 106A increments the value held in the program counter 107, and fetches the instruction B from cycle 7 in the same manner as the fetching of the instruction A. Here, from the falling edge of the cycle 8 to the falling edge of the cycle 9, the flash signal 117
Is at the L level. At the falling edge of cycle 8, I
The F stage 106A is initialized, the address value of the branch destination is set in the program counter 107 from the E stage 106E via a path not shown, and the fetch of the instruction X at the branch destination address is started. From the rising edge to the rising edge of the cycle 10, the IF request signal 11
Set 6 to L level. However, since the external memory access for fetching the instruction B is in progress, the access unit 108 makes the start of the external memory access for fetching the instruction X wait until the end of the external memory access for fetching the instruction B.

【0031】また、フラッシュ信号117が周期8の立
ち下がりから周期9の立ち下がりの間Lレベルになった
ため、命令フェッチキャンセル信号104が周期8の立
ち下がりから周期9の立ち下がりの間Lレベルになる。
応答回路102では、DS信号112がLレベルである
時に、すなわちマイクロプロセッサ101がメモリ10
5をアクセスしている間に、命令フェッチキャンセル信
号104がLレベルになったため、遅延回路205が初
期化され、DC信号113は、命令フェッチキャンセル
信号104がLレベルである間のクロック信号109の
立ち上がり(周期9の立ち上がり)でLレベルとなる。
アクセス部108は、DC信号113がLレベルになっ
たことを検出すると、外部データバス114上のデータ
(この場合は有効なデータは出力されていない)を読み
込み、捨てる。アクセス部108は、次のクロック信号
109の立ち上がり(周期10の立ち上がり)でDS信
号112をHレベルにもどす。応答回路102は、DS
信号112の立ち上がり(周期10の立ち上がり)でD
C信号113をHレベルにもどす。したがって、周期1
0の立ち上がりで、命令Bのフェッチの外部メモリアク
セスを強制的に終了したことになり、周期10から命令
Aのフェッチと同様の動作で分岐先アドレスの命令Xの
フェッチの外部メモリアクセスを行う。すなわち、図7
の従来例より3周期早く外部メモリアクセスを行うこと
ができる。
Further, since the flash signal 117 changes to the L level from the falling edge of the cycle 8 to the falling edge of the cycle 9, the instruction fetch cancel signal 104 changes to the L level from the falling edge of the cycle 8 to the falling edge of the cycle 9. Become.
In the response circuit 102, when the DS signal 112 is at the L level, that is, the microprocessor 101 makes the memory 10
Since the instruction fetch cancel signal 104 becomes L level while accessing 5, the delay circuit 205 is initialized, and the DC signal 113 is the clock signal 109 of the clock signal 109 while the instruction fetch cancel signal 104 is L level. At the rising edge (at the rising edge of cycle 9), the L level is reached.
When detecting that the DC signal 113 has become L level, the access unit 108 reads the data on the external data bus 114 (in this case, valid data is not output) and discards it. The access unit 108 returns the DS signal 112 to the H level at the next rise of the clock signal 109 (rise of the cycle 10). The response circuit 102 is a DS
D at the rise of the signal 112 (rise of the cycle 10)
The C signal 113 is returned to the H level. Therefore, cycle 1
At the rising edge of 0, the external memory access for fetching the instruction B is forcibly terminated, and the external memory access for fetching the instruction X at the branch destination address is performed in the same operation as the fetch of the instruction A from the cycle 10. That is, FIG.
The external memory can be accessed three cycles earlier than the conventional example.

【0032】図1,図2,図4を用いて、マイクロプロ
セッサ101がメモリ105に対して命令フェッチの外
部メモリアクセスを行っている間に先行分岐が発生した
場合の動作を説明する。周期1〜6の6周期は、従来例
の図7の周期1〜6の命令Aのフェッチの外部メモリア
クセスの動作と同一である。IFステージ106Aは、
プログラムカウンタ107の保持値をインクリメントし
て、命令Bのフェッチを周期7から命令Aのフェッチと
同様に行う。ここで、周期8の立ち下がりから周期9の
立ち下がりの間、先行分岐信号118がLレベルになっ
たとする。周期8の立ち下がりで、IFステージ106
Aが初期化され、分岐先のアドレス値をDステージ10
6Bから図示しない経路を介してプログラムカウンタ1
07にセットして、分岐先のアドレスの命令Yのフェッ
チを開始するために、周期9の立ち上がりから周期10
の立ち上がりの間、IF要求信号116をLレベルにす
る。しかし、アクセス部108は、命令Bのフェッチの
外部メモリアクセス中であるため、命令Yのフェッチの
外部メモリアクセスの開始を命令Bのフェッチの外部メ
モリアクセス終了まで待たせる。
The operation when the preceding branch occurs while the microprocessor 101 is accessing the memory 105 for external memory for instruction fetch will be described with reference to FIGS. 1, 2 and 4. The 6 cycles of cycles 1 to 6 are the same as the external memory access operation for fetching the instruction A in cycles 1 to 6 of FIG. The IF stage 106A is
The value held in the program counter 107 is incremented, and the instruction B is fetched from cycle 7 in the same manner as the instruction A fetch. Here, it is assumed that the preceding branch signal 118 is at the L level from the fall of the cycle 8 to the fall of the cycle 9. At the falling edge of cycle 8, the IF stage 106
A is initialized and the address value of the branch destination is set to the D stage 10
Program counter 1 from 6B via a route not shown
Set to 07 to start fetching the instruction Y at the branch destination address.
The IF request signal 116 is set to the L level during the rising edge of. However, since the external memory access for fetching the instruction B is in progress, the access unit 108 makes the start of the external memory access for fetching the instruction Y wait until the external memory access for fetching the instruction B ends.

【0033】また、先行分岐信号118が周期8の立ち
下がりから周期9の立ち下がりの間Lレベルになったた
め、命令フェッチキャンセル信号104が周期8の立ち
下がりから周期9の立ち下がりの間Lレベルになる。応
答回路102では、DS信号112がLレベルである時
に、すなわちマイクロプロセッサ101がメモリ105
をアクセスしている間に、命令フェッチキャンセル信号
104がLレベルになったため、遅延回路205が初期
化され、DC信号113は、命令フェッチキャンセル信
号104がLレベルである間のクロック信号109の立
ち上がり(周期9の立ち上がり)でLレベルとなる。ア
クセス部108は、DC信号113がLレベルになった
ことを検出すると、外部データバス114上のデータ
(この場合は有効なデータは出力されていない)を読み
込み、捨てる。アクセス部108は、次のクロック信号
109の立ち上がり(周期10の立ち上がり)でDS信
号112をHレベルにもどす。応答回路102は、DS
信号112の立ち上がり(周期10の立ち上がり)でD
C信号113をHレベルにもどす。したがって、周期1
0の立ち上がりで、命令Bのフェッチの外部メモリアク
セスを強制的に終了したことになり、周期10から命令
Aのフェッチと同様の動作で分岐先アドレスの命令Yの
フェッチの外部メモリアクセスを行う。すなわち、図8
の従来例より3周期早く外部メモリアクセスを行うこと
ができる。
Since the preceding branch signal 118 has changed to the L level from the fall of the cycle 8 to the fall of the cycle 9, the instruction fetch cancel signal 104 is at the L level from the fall of the cycle 8 to the fall of the cycle 9. become. In the response circuit 102, when the DS signal 112 is at the L level, that is, the microprocessor 101 makes the memory 105
Since the instruction fetch cancel signal 104 has changed to the L level during access to the delay circuit 205, the delay circuit 205 is initialized and the DC signal 113 rises in the clock signal 109 while the instruction fetch cancel signal 104 is at the L level. At the (rising edge of cycle 9), the L level is reached. When detecting that the DC signal 113 has become L level, the access unit 108 reads the data on the external data bus 114 (in this case, valid data is not output) and discards it. The access unit 108 returns the DS signal 112 to the H level at the next rise of the clock signal 109 (rise of the cycle 10). The response circuit 102 is a DS
D at the rise of the signal 112 (rise of the cycle 10)
The C signal 113 is returned to the H level. Therefore, cycle 1
At the rising edge of 0, the external memory access for fetching the instruction B is forcibly ended, and the external memory access for fetching the instruction Y at the branch destination address is performed in the same operation as the fetch of the instruction A from the cycle 10. That is, FIG.
The external memory can be accessed three cycles earlier than the conventional example.

【0034】[0034]

【発明の効果】以上のように、この発明によれば、フラ
ッシュ信号、先行分岐信号の何れか一方が検出されたと
き、外部メモリアクセスが無効であることを示す命令フ
ェッチキャンセル信号を出力するように構成したので、
パイプラインフラッシュや先行分岐の発生時に、この命
令フェッチキャンセル信号を用いて、現在アクセス中の
命令フェッチの外部メモリアクセスが無効であることを
外部に示し、この命令フェッチの外部メモリアクセスを
強制的に終了させることができる。したがって、無駄な
命令フェッチの外部メモリアクセスにより、次の有効な
命令フェッチの外部メモリアクセスが待たされる時間を
減少でき、これによりプログラムの実行速度が上がると
いう効果がある。
As described above, according to the present invention, the instruction fetch cancel signal indicating that the external memory access is invalid is output when either the flush signal or the preceding branch signal is detected. Since it was configured to
When a pipeline flush or a preceding branch occurs, this instruction fetch cancel signal is used to externally indicate that the external memory access of the instruction fetch currently being accessed is invalid, and the external memory access of this instruction fetch is forced. Can be terminated. Therefore, it is possible to reduce the waiting time for the external memory access of the next valid instruction fetch due to the wasteful external memory access of the instruction fetch, which has the effect of increasing the program execution speed.

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

【図1】この発明の一実施例によるマイクロプロセッサ
を示すブロック図である。
FIG. 1 is a block diagram showing a microprocessor according to an embodiment of the present invention.

【図2】応答回路の一実施例を示す構成図である。FIG. 2 is a configuration diagram showing an embodiment of a response circuit.

【図3】マイクロプロセッサがメモリに対して命令フェ
ッチの外部メモリアクセスを行っている間にパイプライ
ンフラッシュが発生した場合の動作を説明するためのタ
イミングチャートである。
FIG. 3 is a timing chart for explaining an operation in the case where a pipeline flush occurs while a microprocessor is accessing an external memory for fetching an instruction from a memory.

【図4】マイクロプロセッサがメモリに対して命令フェ
ッチの外部メモリアクセスを行っている間に先行分岐が
発生した場合の動作を説明するためのタイミングチャー
トである。
FIG. 4 is a timing chart for explaining an operation in the case where a preceding branch occurs while the microprocessor is performing external memory access for instruction fetch to the memory.

【図5】従来のマイクロプロセッサを示すブロック図で
ある。
FIG. 5 is a block diagram showing a conventional microprocessor.

【図6】従来の応答回路の一例を示す構成図である。FIG. 6 is a configuration diagram showing an example of a conventional response circuit.

【図7】従来のマイクロプロセッサがメモリに対して命
令フェッチの外部メモリアクセスを行っている間にパイ
プラインフラッシュが発生した場合の動作を説明するた
めのタイミングチャートである。
FIG. 7 is a timing chart for explaining an operation in the case where a pipeline flush occurs while a conventional microprocessor is accessing an external memory for instruction fetch to a memory.

【図8】従来のマイクロプロセッサがメモリに対して命
令フェッチの外部メモリアクセスを行っている間に先行
分岐が発生した場合の動作を説明するためのタイミング
チャートである。
FIG. 8 is a timing chart for explaining an operation in the case where a preceding branch occurs while a conventional microprocessor is accessing an external memory for instruction fetch to a memory.

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

101 マイクロプロセッサ 103 論理ゲート(検出手段) 104 命令フェッチキャンセル信号 106 パイプライン処理機構 117 パイプラインフラッシュ信号 118 先行分岐信号 101 Microprocessor 103 Logic Gate (Detecting Means) 104 Instruction Fetch Cancel Signal 106 Pipeline Processing Mechanism 117 Pipeline Flush Signal 118 Preceding Branch Signal

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 パイプライン処理機構を備え、命令フェ
ッチの外部メモリアクセスを行うマイクロプロセッサに
おいて、上記パイプライン処理機構が分岐命令を実行し
たときに出力するパイプラインフラッシュ信号と先行分
岐命令をデコードしたときに出力する先行分岐信号とが
加えられるように成され、何れか一方の信号を検出した
とき現在実行中の外部メモリアクセスが無効であること
を示すための命令フェッチキャンセル信号を出力する検
出手段を設けたことを特徴とするマイクロプロセッサ。
1. A microprocessor having a pipeline processing mechanism for accessing an external memory for instruction fetch, wherein a pipeline flush signal output when the pipeline processing mechanism executes a branch instruction and a preceding branch instruction are decoded. And a preceding branch signal that is output at a time, and when either one of the signals is detected, a detection unit that outputs an instruction fetch cancel signal for indicating that the external memory access currently being executed is invalid A microprocessor provided with.
JP4180553A 1992-06-16 1992-06-16 Microprocessor Pending JPH064283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4180553A JPH064283A (en) 1992-06-16 1992-06-16 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4180553A JPH064283A (en) 1992-06-16 1992-06-16 Microprocessor

Publications (1)

Publication Number Publication Date
JPH064283A true JPH064283A (en) 1994-01-14

Family

ID=16085293

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4180553A Pending JPH064283A (en) 1992-06-16 1992-06-16 Microprocessor

Country Status (1)

Country Link
JP (1) JPH064283A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007514244A (en) * 2003-12-22 2007-05-31 インテル・コーポレーション Direct memory access unit with instruction predecoder

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007514244A (en) * 2003-12-22 2007-05-31 インテル・コーポレーション Direct memory access unit with instruction predecoder

Similar Documents

Publication Publication Date Title
US5636353A (en) Superscalar processor with direct result bypass between execution units having comparators in execution units for comparing operand and result addresses and activating results bypassing
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
US5041968A (en) Reduced instruction set computer (RISC) type microprocessor executing instruction functions indicating data location for arithmetic operations and result location
US5226166A (en) Parallel operation processor with second command unit
EP0166431A2 (en) An information processing apparatus having an instruction prefetch circuit
KR880001418B1 (en) Data processor
US20050102659A1 (en) Methods and apparatus for setting up hardware loops in a deeply pipelined processor
EP0279953A2 (en) Computer system having mixed macrocode and microcode instruction execution
JPH064283A (en) Microprocessor
US5421026A (en) Data processor for processing instruction after conditional branch instruction at high speed
JP2798121B2 (en) Data processing device
US6032249A (en) Method and system for executing a serializing instruction while bypassing a floating point unit pipeline
JP3520372B2 (en) Elimination of critical path in operation of memory control unit and input / output control unit
JPH0193825A (en) Prefetch queue control system
JPS6259829B2 (en)
JP2000029696A (en) Processor, and pipeline process control method
JP3184363B2 (en) Microprocessor device
JP2636074B2 (en) Microprocessor
JP2806690B2 (en) Microprocessor
JP3414579B2 (en) Programmable controller
JPH0248733A (en) Information processor
JPH06161778A (en) Multi-flow instruction control method and instruction processor
KR950014161B1 (en) Two stage instructin pipe-line processing method of array processor
JPH08272608A (en) Pipeline processor
JPS61133439A (en) Instruction advance fetch control system