JPH07105000A - Fetch error control device - Google Patents

Fetch error control device

Info

Publication number
JPH07105000A
JPH07105000A JP5252748A JP25274893A JPH07105000A JP H07105000 A JPH07105000 A JP H07105000A JP 5252748 A JP5252748 A JP 5252748A JP 25274893 A JP25274893 A JP 25274893A JP H07105000 A JPH07105000 A JP H07105000A
Authority
JP
Japan
Prior art keywords
instruction
fetch
error
execution
signal
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.)
Withdrawn
Application number
JP5252748A
Other languages
Japanese (ja)
Inventor
Hideaki Shioda
英明 塩田
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.)
Fuji Electric Co Ltd
Fuji Facom Corp
Original Assignee
Fuji Electric Co Ltd
Fuji Facom 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 Fuji Electric Co Ltd, Fuji Facom Corp filed Critical Fuji Electric Co Ltd
Priority to JP5252748A priority Critical patent/JPH07105000A/en
Publication of JPH07105000A publication Critical patent/JPH07105000A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Retry When Errors Occur (AREA)

Abstract

(57)【要約】 (修正有) 【目的】 命令のフェッチと実行をパイプライン方式で
並行して行う中央処理装置(CPU)において、命令の
フェッチエラーが検出された時、CPUのパイプライン
動作を停止することなく、高速に命令フェッチの再試行
を行う。 【構成】 命令のフェッチエラーが検出されると、エラ
ー検出手段54は命令実行手段56による命令実行を停
止するべきか否かを判別し、エラー信号57をフェッチ
エラー計数手段55に出力する。このとき再試行制御手
段51は、フェッチエラーの検出された命令の命令アド
レスを再びアドレスバス4に送出し、フェッチの再試行
を行う。また命令変更手段53は、このときフェッチさ
れた命令コードを直ちに他の命令コードに変更して、命
令実行手段56に送る。命令実行手段56はフェッチさ
れた命令コードの代わりに、送られてきた他の命令コー
ドを実行する。フェッチエラー計数手段55はエラー信
号57の出力回数を計数し、計数値が一定値を越える
と、異常処理に移行する。
(57) [Summary] (Modified) [Purpose] When an instruction fetch error is detected in a central processing unit (CPU) that performs instruction fetch and execution in parallel in a pipeline manner, the pipeline operation of the CPU Retry instruction fetch at high speed without stopping. When an instruction fetch error is detected, the error detection means 54 determines whether or not the instruction execution by the instruction execution means 56 should be stopped, and outputs an error signal 57 to the fetch error counting means 55. At this time, the retry control means 51 sends the instruction address of the instruction in which the fetch error is detected to the address bus 4 again to retry the fetch. Further, the instruction changing means 53 immediately changes the fetched instruction code to another instruction code and sends it to the instruction executing means 56. The instruction executing means 56 executes the other instruction code sent in place of the fetched instruction code. The fetch error counting means 55 counts the number of times the error signal 57 is output, and when the count value exceeds a certain value, the process proceeds to the abnormal processing.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータ、コント
ローラ等に用いられる中央処理装置の制御方式に係わ
り、さらに詳しくは、マイクロコンピュータのフェッチ
エラー制御装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control system for a central processing unit used in a computer, a controller, etc., and more particularly to a fetch error control device for a microcomputer.

【0002】[0002]

【従来の技術】コンピュータ、コントローラ等の各種情
報処理装置において、中央処理装置(CPU)による処
理の信頼性と安定性を向上させることは常に大きな課題
であり、そのために様々な技術が導入されてきた。CP
Uによる命令実行時の誤動作を防止するために、実行さ
れる命令コードがプログラムメモリから正しく読み出さ
れているかどうかをバス上で監視するフェッチエラー監
視技術もその一つである。
2. Description of the Related Art In various information processing apparatuses such as computers and controllers, improving the reliability and stability of processing by a central processing unit (CPU) has always been a major issue, and various techniques have been introduced for that purpose. It was CP
One of them is a fetch error monitoring technique for monitoring on the bus whether or not the instruction code to be executed has been correctly read from the program memory in order to prevent the U from malfunctioning when the instruction is executed.

【0003】一般には、CPU外部にパリティチェック
機構やバス転送時間監視機構などの、命令フェッチエラ
ー検出機構を設け、フェッチエラーを検出した場合に
は、異常検出信号をCPUに出力する方法がよく用いら
れている。
Generally, an instruction fetch error detection mechanism such as a parity check mechanism and a bus transfer time monitoring mechanism is provided outside the CPU, and when a fetch error is detected, an abnormality detection signal is output to the CPU. Has been.

【0004】従来のCPUにおいては、CPU外部の命
令フェッチエラー検出機構より異常検出信号を受け取る
と、直ちに割り込みやトラップ等の例外処理を発生させ
ることによりフェッチの再試行処理、すなわちフェッチ
リトライ処理を行っている。
In a conventional CPU, when an abnormality detection signal is received from an instruction fetch error detection mechanism outside the CPU, an exception process such as an interrupt or a trap is immediately generated to perform a fetch retry process, that is, a fetch retry process. ing.

【0005】図12は従来のCPUの内部構成を示して
いる。図12のCPUは命令フェッチ部11と命令実行
部21が並行して処理を行うパイプライン構造を持ち、
アドレスバス16とデータバス17により図12不図示
のプログラムメモリに接続されている。異常検出信号1
8はデータバス17上の命令コードを監視している命令
フェッチエラー検出機構より出力される。
FIG. 12 shows the internal structure of a conventional CPU. The CPU of FIG. 12 has a pipeline structure in which the instruction fetch unit 11 and the instruction execution unit 21 perform processing in parallel,
An address bus 16 and a data bus 17 are connected to a program memory not shown in FIG. Abnormality detection signal 1
8 is output from the instruction fetch error detection mechanism that monitors the instruction code on the data bus 17.

【0006】命令フェッチ部11においては、まず、フ
ェッチプログラムカウンタレジスタ14に格納されてい
るフェッチされる命令の命令アドレスが、アドレスバス
16に出力される。次にプログラムメモリからこの命令
アドレスに従って取り出された命令コードが、データバ
ス17を介してフェッチインストラクションレジスタ1
5に取り込まれる。そしてフェッチプログラムカウンタ
レジスタ14は命令アドレスをアドレス更新カウンタ1
3及び命令実行部21内の実行プログラムカウンタレジ
スタ22に送り、フェッチインストラクションレジスタ
15は取り込んだ命令コードを命令実行部21内の実行
インストラクションレジスタ23に送る。
In the instruction fetch unit 11, first, the instruction address of the fetched instruction stored in the fetch program counter register 14 is output to the address bus 16. Next, the instruction code fetched from the program memory according to this instruction address is fetched via the data bus 17 into the fetch instruction register 1
Taken in 5. Then, the fetch program counter register 14 transfers the instruction address to the address update counter 1
3 and the execution program counter register 22 in the instruction execution unit 21, and the fetch instruction register 15 sends the fetched instruction code to the execution instruction register 23 in the instruction execution unit 21.

【0007】命令実行部21においては、命令実行器2
4は命令フェッチ部11より引き渡された命令アドレス
と命令コードを、それぞれ実行プログラムカウンタレジ
スタ22と実行インストラクションレジスタ23から取
り出し、命令の実行処理を行う。制御・演算命令等の場
合はレジスタファイル25を参照しながら命令を実行す
る。もし実行した命令が分岐命令であった場合は、分岐
命令検出信号27を論理「1」に設定して、その分岐命
令に記述された分岐先アドレス26と共に命令フェッチ
部11のマルチプレクサ12に対して出力する。
In the instruction execution unit 21, the instruction executor 2
Reference numeral 4 fetches the instruction address and instruction code delivered from the instruction fetch unit 11 from the execution program counter register 22 and the execution instruction register 23, respectively, and executes instruction execution processing. In the case of a control / arithmetic instruction, the instruction is executed with reference to the register file 25. If the executed instruction is a branch instruction, the branch instruction detection signal 27 is set to logic “1”, and the branch destination address 26 described in the branch instruction is sent to the multiplexer 12 of the instruction fetch unit 11. Output.

【0008】マルチプレクサ12は分岐命令検出信号2
7が論理「0」のときは、アドレス更新カウンタ13に
よりインクリメントされた命令アドレスを選択して、フ
ェッチプログラムカウンタレジスタ14にセットし、分
岐命令検出信号27が論理「1」のときは分岐先アドレ
ス26を選択してフェッチプログラムカウンタレジスタ
14にセットする。
The multiplexer 12 receives the branch instruction detection signal 2
When 7 is a logic "0", the instruction address incremented by the address update counter 13 is selected and set in the fetch program counter register 14, and when the branch instruction detection signal 27 is a logic "1", the branch destination address is selected. 26 is selected and set in the fetch program counter register 14.

【0009】ここで、命令フェッチエラー検出機構によ
り、フェッチされた命令コードに異常が検出された場合
は、異常検出信号18が論理「1」となって異常検出を
直ちに命令実行器24に通知する。命令実行器24はこ
れを受けて、命令の実行を一時中断してパイプライン動
作を停止し、異常のあった命令を再度フェッチするため
に割り込みやトラップなどの例外処理を発生して、フェ
ッチリトライルーチンを起動する。
When an abnormality is detected in the fetched instruction code by the instruction fetch error detection mechanism, the abnormality detection signal 18 becomes logic "1" and the instruction execution unit 24 is immediately notified of the abnormality detection. . In response to this, the instruction executor 24 temporarily suspends the execution of the instruction to stop the pipeline operation, generates an exception process such as an interrupt or a trap to fetch the abnormal instruction again, and then performs the fetch retry. Invoke the routine.

【0010】図13はこのフェッチリトライルーチンの
一例を示すフローチャートである。例外処理が発生する
と、図13のステップS101において、まず発生要因
のチェックが行われる。例外処理の発生要因がフェッチ
エラーであったときは(S102、YES)S103で
リトライカウンタがインクリメントされ、そのほかの要
因であったときは(S102、NO)他のエラー処理に
移る(S107)。
FIG. 13 is a flow chart showing an example of this fetch retry routine. When the exception process occurs, the cause of the occurrence is first checked in step S101 of FIG. If the cause of the exception process is a fetch error (S102, YES), the retry counter is incremented in S103, and if it is another factor (S102, NO), the process proceeds to another error process (S107).

【0011】次にS104においてリトライカウンタの
値がある一定回数に達したかどうかがチェックされ、リ
トライカウンタがカウントアップしたときは(S10
4、YES)、フェッチエラーが一定回数連続して起こ
ったものとして、命令フェッチのリトライを断念し、C
PUの動作を停止する(S108)。リトライカウンタ
がカウントアップしていなければ(S104、NO)、
S105でフェッチインストラクションレジスタ15や
実行インストラクションレジスタ23をクリアしてフェ
ッチされた命令コードを破棄し、続いてS106でフェ
ッチプログラムカウンタレジスタ14に同じ命令アドレ
スを再セットした後、通常のプログラム処理に復帰す
る。
Next, in S104, it is checked whether the value of the retry counter has reached a certain number of times, and when the retry counter counts up (S10
4, YES), assuming that the fetch error has occurred a certain number of times consecutively, giving up the instruction fetch retry,
The operation of the PU is stopped (S108). If the retry counter is not counting up (S104, NO),
In S105, the fetch instruction register 15 and the execution instruction register 23 are cleared to discard the fetched instruction code, and subsequently in S106, the same instruction address is set in the fetch program counter register 14, and then the normal program processing is resumed. .

【0012】このように従来のCPUにおいては、フェ
ッチエラーが検出された時の命令フェッチの再試行を、
割り込みやトラップ等のフェッチリトライルーチンによ
り行っている。
As described above, in the conventional CPU, the retry of the instruction fetch when the fetch error is detected is
It is performed by a fetch retry routine such as an interrupt or trap.

【0013】[0013]

【発明が解決しようとする課題】しかしながら従来のC
PUにおける命令コードのフェッチエラー制御方法で
は、次のような問題がある。 (1)異常のあった命令を再フェッチするためにフェッ
チプログラムカウンタレジスタに再度同じ命令アドレス
をセットするには、CPUが他の処理を停止させて例外
処理を発生させなければならず、多くの処理時間が必要
である。 (2)また異常のあった命令をフェッチインストラクシ
ョンレジスタと実行インストラクションレジスタから消
去するためにも、やはりCPUが例外処理を発生させな
ければならず、多くの処理時間が必要である。 (3)さらにフェッチエラーが検出されるたびに例外処
理を発生させるので、連続してフェッチエラーが発生す
ると図13の処理を何度も繰り返すことになり、処理時
間も発生回数に比例して増大する。実際には、予め決め
られた一定回数のフェッチリトライを連続して実行し、
それでも正常な命令コードをフェッチすることができな
かった場合に、CPUが例外処理を発生させる形態が望
ましい。
However, the conventional C
The instruction error fetch error control method in the PU has the following problems. (1) In order to set the same instruction address again in the fetch program counter register to refetch an abnormal instruction, the CPU must stop other processing and generate exception processing. Processing time is required. (2) Also, in order to erase an abnormal instruction from the fetch instruction register and the execution instruction register, the CPU must also generate an exception process, which requires a lot of processing time. (3) Since exception processing is generated each time a fetch error is detected, if fetch errors occur continuously, the processing of FIG. 13 will be repeated many times, and the processing time will increase in proportion to the number of occurrences. To do. Actually, a predetermined number of fetch retries are continuously executed,
Even if the normal instruction code cannot be fetched, it is desirable that the CPU causes exception processing.

【0014】さらにこのようなフェッチリトライのため
の複雑な制御を例外処理ルーチンによって行うには、そ
の処理手順をユーザーがプログラムによって構築する必
要がある。
Further, in order to perform such complicated control for fetch retry by the exception processing routine, the user needs to construct the processing procedure by a program.

【0015】一部のCPUには、これら一連の処理を全
てマイクロコードによって制御するものもあるが、その
実行中にCPUは、命令フェッチ部及び命令実行部の処
理を一時停止しなければならず、多くの待ち時間が必要
になる問題は同様に存在する。
Some CPUs control all of these series of processing by microcode, but the CPU must suspend the processing of the instruction fetch unit and the instruction execution unit during the execution thereof. There are also problems that require a lot of latency as well.

【0016】また上述のようなフェッチエラー制御方法
では、近年盛んに導入されつつある、パイプラインの多
段化技術やRISCアーキテクチャ(Reduced Instruct
ionSet Computer Architecture )のマイクロコードレ
ス化技術に効果的に対応することができない。
In the fetch error control method as described above, pipeline multi-stage technology and RISC architecture (Reduced Instruct), which have been actively introduced in recent years.
ionSet Computer Architecture) microcodeless technology cannot be effectively dealt with.

【0017】本発明の目的は、命令のフェッチエラーが
検出された時、CPUのパイプライン動作を乱したり、
処理を停止させたりすることなく、高速に命令フェッチ
の再試行を行うことが可能なフェッチエラー制御装置を
提供することである。
An object of the present invention is to disturb the pipeline operation of the CPU when an instruction fetch error is detected,
An object of the present invention is to provide a fetch error control device capable of retrying instruction fetch at high speed without stopping the processing.

【0018】[0018]

【課題を解決するための手段】図1は本発明のフェッチ
エラー制御装置を備える中央処理装置(CPU)の原理
ブロック図である。図1でCPU1はアドレスバス4と
データバス5を介して外部のプログラムメモリと接続さ
れている。
FIG. 1 is a block diagram showing the principle of a central processing unit (CPU) having a fetch error control device according to the present invention. In FIG. 1, the CPU 1 is connected to an external program memory via an address bus 4 and a data bus 5.

【0019】本発明はデータバス5を介してプログラム
メモリから入力される命令を格納するフェッチ手段52
と、フェッチ手段52に格納された命令を実行する命令
実行手段56とを有し、命令のフェッチとフェッチされ
た命令の実行を並行して処理するパイプライン構造をも
つCPU1におけるフェッチエラー制御装置であって、
エラー検出手段54と、再試行制御手段51、命令変更
手段53、フェッチエラー計数手段55とを備える。
The present invention is a fetch means 52 for storing an instruction input from the program memory via the data bus 5.
And a fetch execution control unit 56 for executing the instruction stored in the fetch unit 52, and a fetch error control device in the CPU 1 having a pipeline structure for processing the fetch of the instruction and the execution of the fetched instruction in parallel. There
The error detection means 54, the retry control means 51, the instruction change means 53, and the fetch error counting means 55 are provided.

【0020】エラー検出手段54は、フェッチエラー検
出信号6により命令のフェッチエラーの検出を通知され
たとき、命令実行手段56による命令の実行を停止すべ
きか否かを判別し、命令の実行を停止すべきであれば、
フェッチエラー計数手段55に対してエラー信号38を
出力する。
When the error detection means 54 is notified by the fetch error detection signal 6 that an instruction fetch error has been detected, the error detection means 54 determines whether or not the instruction execution means 56 should stop the instruction execution, and stops the instruction execution. If you should,
The error signal 38 is output to the fetch error counting means 55.

【0021】このとき再試行制御手段51は、フェッチ
エラーの発生した該命令のアドレスをアドレスバス4に
対して再度出力し、プログラムメモリからの該命令のフ
ェッチを再度行う。
At this time, the retry control means 51 outputs the address of the instruction in which the fetch error has occurred to the address bus 4 again, and fetches the instruction from the program memory again.

【0022】また命令変更手段53はこのとき、フェッ
チされてフェッチ手段52に格納されている前記フェッ
チエラーの発生した命令を、直ちに命令実行手段56の
動作に影響を与えないような他の命令に変更して、命令
実行手段56に出力し、命令実行手段56は変更後の命
令である他の命令を実行処理する。
At this time, the instruction changing unit 53 replaces the instruction fetched and stored in the fetch unit 52 with the fetch error with another instruction which does not immediately affect the operation of the instruction executing unit 56. The instruction is changed and output to the instruction executing means 56, and the instruction executing means 56 executes other instruction which is the changed instruction.

【0023】フェッチエラー計数手段55は、エラー検
出手段54からのエラー信号57の出力回数を計数し、
その計数値が一定値を越えたとき、命令実行手段56に
対して例外処理信号58を出力する。命令実行手段56
は例外処理信号58を受け取ると、命令の実行を停止
し、異常処理のための例外処理を発生させる。
The fetch error counting means 55 counts the number of times the error signal 57 is output from the error detecting means 54,
When the count value exceeds a certain value, the exception processing signal 58 is output to the instruction executing means 56. Instruction executing means 56
When the exception processing signal 58 is received, the instruction execution is stopped and exception processing for abnormal processing is generated.

【0024】[0024]

【作用】フェッチエラー検出信号6によって、命令のフ
ェッチエラーの発生がCPUに通知されると、エラー検
出手段54が命令実行手段56の実行処理を停止させる
か否かを判別するので、実行を停止させる必要のないと
きは、命令実行手段56は実行処理を継続することがで
きる。
When the fetch error detection signal 6 notifies the CPU of the occurrence of an instruction fetch error, the error detection means 54 determines whether or not to stop the execution processing of the instruction execution means 56, so the execution is stopped. When it is not necessary to execute it, the instruction executing means 56 can continue the execution processing.

【0025】また命令のフェッチエラーが発生した時、
フェッチエラーの検出された命令を再度フェッチするた
めに、再試行制御手段51が当該命令の命令アドレスを
自動的にアドレスバス4に送出するので、命令の再フェ
ッチのために命令実行手段56の動作を停止させること
はない。
When an instruction fetch error occurs,
In order to fetch the instruction in which the fetch error is detected again, the retry control means 51 automatically sends the instruction address of the instruction to the address bus 4. Therefore, the operation of the instruction executing means 56 for refetching the instruction. Never stop.

【0026】このとき、命令実行手段56は命令変更手
段53により変更された、実行動作に影響を及ぼさない
他の命令を実行するので、フェッチエラーの発生した命
令の実行による実行エラーを起こさずに済み、またパイ
プライン動作を継続しながら、フェッチリトライが成功
するまで待つことができる。
At this time, the instruction executing means 56 executes another instruction which is changed by the instruction changing means 53 and does not affect the execution operation, so that the execution error due to the execution of the instruction having the fetch error does not occur. In addition, while continuing the pipeline operation, it is possible to wait until the fetch retry succeeds.

【0027】さらにフェッチエラー計数手段55は、エ
ラー信号57の出力回数を計数し、この回数が予め決め
られた一定回数を越えた時、例外処理信号58を出力す
る。命令実行手段56はこの例外処理信号58を受け
て、割り込みやトラップ等の例外処理を発生させ、異常
検出処理を実行する。このようにすれば、フェッチエラ
ーが連続して発生した場合、一定回数続けてフェッチリ
トライを行った後に例外処理を発生させるので、続けて
フェッチリトライを行っている間はCPU1のパイプラ
イン動作を停止させなくて済む。
Further, the fetch error counting means 55 counts the number of times the error signal 57 is output, and when the number of times exceeds a predetermined fixed number, it outputs an exception processing signal 58. The instruction execution means 56 receives the exception processing signal 58, generates exception processing such as interrupts and traps, and executes abnormality detection processing. In this way, when fetch errors occur continuously, exception processing is performed after fetch retry is performed a fixed number of times. Therefore, the pipeline operation of the CPU 1 is stopped while fetch fetch is continuously performed. You don't have to.

【0028】[0028]

【実施例】以下、図面を参照しながら、本発明の実施例
を説明する。図2はパリティチェックによる命令フェッ
チエラー検出機構を示している。図2においてCPU1
はアドレスバス4とデータバス5によりプログラムメモ
リ2と接続されており、データバス5上にはパリティチ
ェック機構3が接続されている。CPU1はフェッチす
るべき命令コードのアドレスをアドレスバス4上に出力
し、プログラムメモリ2からその命令コードをデータバ
ス5を介して取り出す。このとき、パリティチェック機
構3はデータバス5上に取り出された命令コードのパリ
ティを監視しており、パリティ異常を検出するとフェッ
チエラー検出信号6をCPU1に出力する。CPU1は
このフェッチエラー検出信号6により、データバス5上
に取り出された命令コードに異常があることを知らされ
る。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 2 shows an instruction fetch error detection mechanism by parity check. CPU1 in FIG.
Is connected to the program memory 2 by an address bus 4 and a data bus 5, and a parity check mechanism 3 is connected on the data bus 5. The CPU 1 outputs the address of the instruction code to be fetched onto the address bus 4, and fetches the instruction code from the program memory 2 via the data bus 5. At this time, the parity check mechanism 3 monitors the parity of the instruction code fetched on the data bus 5, and outputs a fetch error detection signal 6 to the CPU 1 when a parity abnormality is detected. The CPU 1 is informed by the fetch error detection signal 6 that the instruction code fetched on the data bus 5 is abnormal.

【0029】図3は本発明のフェッチエラー制御装置を
用いた一実施例のCPUの構成図である。図3のCPU
は命令のフェッチを行う命令フェッチ部31とフェッチ
された命令を実行する命令実行部41の2段より成るパ
イプライン構造を持ち、格段の処理が並行して実行され
る。
FIG. 3 is a block diagram of a CPU of an embodiment using the fetch error control device of the present invention. CPU in Figure 3
Has a pipeline structure including two stages of an instruction fetch unit 31 that fetches an instruction and an instruction execution unit 41 that executes the fetched instruction, and significant processing is executed in parallel.

【0030】また命令フェッチ部31はアドレスバス4
とデータバス5により図2のプログラムメモリ2に接続
され、プログラムメモリ2からデータバス5上に出力さ
れる命令コードは、例えば図2のパリティチェック機構
3のようなフェッチエラー検出機構により監視されてい
る。フェッチエラー検出機構はこの命令コードにフェッ
チエラーを検出すると、フェッチエラー検出信号6を論
理「1」に設定してCPU1に対して出力する。
Further, the instruction fetch unit 31 uses the address bus 4
2 is connected to the program memory 2 of FIG. 2 by a data bus 5 and the instruction code output from the program memory 2 onto the data bus 5 is monitored by a fetch error detection mechanism such as the parity check mechanism 3 of FIG. There is. When the fetch error detection mechanism detects a fetch error in this instruction code, it sets the fetch error detection signal 6 to logic "1" and outputs it to the CPU 1.

【0031】図2では命令フェッチエラーの検出手段と
して、CPU1外部に設けられたパリティチェック機構
3を用いているが、これをCPU1内部に設けたり、あ
るいはまた、パリティチェック機構3以外のフェッチエ
ラー検出機構を用いることも可能である。これらの場合
も、フェッチエラーが検出されると、フェッチエラー検
出信号6が論理「1」に設定される。
In FIG. 2, the parity check mechanism 3 provided outside the CPU 1 is used as the instruction fetch error detecting means. However, this may be provided inside the CPU 1 or the fetch error detection other than the parity check mechanism 3 is detected. It is also possible to use a mechanism. Also in these cases, when a fetch error is detected, the fetch error detection signal 6 is set to logic "1".

【0032】図3の命令フェッチ部31は、フェッチプ
ログラムカウンタレジスタ33、フェッチインストラク
ションレジスタ34、エラー検出回路36、再試行制御
回路32、命令書換え回路35及びフェッチエラー計数
回路37より構成され、命令実行部41は実行プログラ
ムカウンタレジスタ42、実行インストラクションレジ
スタ43、命令実行器44及びレジスタファイル45よ
り構成される。
The instruction fetch unit 31 of FIG. 3 is composed of a fetch program counter register 33, a fetch instruction register 34, an error detection circuit 36, a retry control circuit 32, an instruction rewriting circuit 35 and a fetch error counting circuit 37, and executes an instruction. The unit 41 is composed of an execution program counter register 42, an execution instruction register 43, an instruction executor 44, and a register file 45.

【0033】図3で命令フェッチ部31と命令実行部4
1の実行プログラムカウンタレジスタ42、実行インス
トラクションレジスタ43、命令実行器44がフェッチ
エラー制御装置を形成している。命令フェッチ部31の
再試行制御回路32とフェッチプログラムカウンタレジ
スタ33は図1の再試行制御手段51に対応し、フェッ
チインストラクションレジスタ34はフェッチ手段52
に対応する。また命令書換え回路35、エラー検出回路
36、フェッチエラー計数回路37はそれぞれ、命令変
更手段53、エラー検出手段54、フェッチエラー計数
手段55に対応している。命令実行部41は命令実行手
段56に対応する。
The instruction fetch unit 31 and the instruction execution unit 4 shown in FIG.
1, the execution program counter register 42, the execution instruction register 43, and the instruction executor 44 form a fetch error control device. The retry control circuit 32 and the fetch program counter register 33 of the instruction fetch unit 31 correspond to the retry control means 51 of FIG. 1, and the fetch instruction register 34 is the fetch means 52.
Corresponding to. The instruction rewriting circuit 35, the error detecting circuit 36, and the fetch error counting circuit 37 correspond to the instruction changing means 53, the error detecting means 54, and the fetch error counting means 55, respectively. The instruction executing section 41 corresponds to the instruction executing means 56.

【0034】フェッチエラー検出機構から出力されたフ
ェッチエラー検出信号6は、エラー検出回路36、再試
行制御回路32、命令書換え回路35に入力される。命
令フェッチ部31のフェッチプログラムカウンタレジス
タ33は格納されたフェッチする命令の命令アドレスを
アドレスバス4に送出し、フェッチインストラクション
レジスタ34は、フェッチプログラムカウンタレジスタ
33から送出された命令アドレスに応じてフェッチさ
れ、データバス5より入力される命令コードを格納す
る。
The fetch error detection signal 6 output from the fetch error detection mechanism is input to the error detection circuit 36, the retry control circuit 32, and the instruction rewriting circuit 35. The fetch program counter register 33 of the instruction fetch unit 31 sends the stored instruction address of the instruction to be fetched to the address bus 4, and the fetch instruction register 34 is fetched according to the instruction address sent from the fetch program counter register 33. , And stores the instruction code input from the data bus 5.

【0035】フェッチプログラムカウンタレジスタ33
はまた、命令アドレスを再試行制御回路32及び命令実
行部41内の実行プログラムカウンタレジスタ42に送
り、再試行制御回路32はフェッチエラー検出信号6が
論理「1」のとき、フェッチリトライを行うために、フ
ェッチプログラムカウンタレジスタ33から送られた命
令アドレスを再びフェッチプログラムカウンタレジスタ
33に戻す。
Fetch program counter register 33
Also sends the instruction address to the retry control circuit 32 and the execution program counter register 42 in the instruction execution unit 41, and the retry control circuit 32 performs the fetch retry when the fetch error detection signal 6 is logic "1". Then, the instruction address sent from the fetch program counter register 33 is returned to the fetch program counter register 33 again.

【0036】フェッチインストラクションレジスタ34
は取り込んだ命令コードを、命令書換え回路35を介し
て、命令実行部41内の実行インストラクションレジス
タ43に送る。フェッチエラー検出信号6が論理「1」
のとき、命令書換え回路35はフェッチインストラクシ
ョンレジスタ34から入力された命令コードを実行イン
ストラクションレジスタ43に送らずに、代わりに命令
書換え回路35内に格納していた他の命令コードを送
る。
Fetch instruction register 34
Sends the fetched instruction code to the execution instruction register 43 in the instruction executing section 41 via the instruction rewriting circuit 35. Fetch error detection signal 6 is logic "1"
At this time, the instruction rewriting circuit 35 does not send the instruction code input from the fetch instruction register 34 to the execution instruction register 43, but instead sends the other instruction code stored in the instruction rewriting circuit 35.

【0037】命令実行部41の命令実行器44は実行プ
ログラムカウンタレジスタ42と実行インストラクショ
ンレジスタ43から、それぞれ命令アドレスと命令コー
ドを取り出し、その命令コードを実行する。このとき、
必要に応じてデータをレジスタファイル45から取り出
し、演算結果等をレジスタファイル45に格納する。実
行した命令が分岐命令のときは、分岐先アドレス61を
再試行制御回路32に対して出力し、また分岐命令検出
信号62を論理「1」に設定して、再試行制御回路32
とエラー検出回路36に対して出力する。
The instruction executor 44 of the instruction executor 41 retrieves an instruction address and an instruction code from the execution program counter register 42 and the execution instruction register 43, and executes the instruction code. At this time,
Data is taken out from the register file 45 as necessary, and the calculation result and the like are stored in the register file 45. When the executed instruction is a branch instruction, the branch destination address 61 is output to the retry control circuit 32, and the branch instruction detection signal 62 is set to logic "1" to set the retry control circuit 32.
To the error detection circuit 36.

【0038】エラー検出回路36はフェッチエラー検出
信号6と分岐命令検出信号62の値から、命令実行部4
1の実行処理を停止するべきと判定すると、エラー信号
38を論理「1」に設定し、フェッチエラー計数回路3
7に送る。
The error detection circuit 36 uses the values of the fetch error detection signal 6 and the branch instruction detection signal 62 to determine the instruction execution unit 4
If it is determined that the execution processing of 1 should be stopped, the error signal 38 is set to logic "1", and the fetch error counting circuit 3
Send to 7.

【0039】フェッチエラー計数回路37は、CPU1
から入力されるリード 外1 信号
The fetch error counting circuit 37 includes the CPU 1
1 signal outside the lead input from

【0040】[0040]

【外1】 [Outer 1]

【0041】63に同期して、エラー信号38が論理
「1」になる回数を計数し、計数値が予め決められた一
定値に達すると、例外処理信号39を論理「1」に設定
して命令実行器44に出力する。命令実行器44は例外
処理信号39が論理「1」になると、命令の実行処理を
停止し、例外処理を発生させて異常処理に移行する。
In synchronization with 63, the number of times the error signal 38 becomes logic "1" is counted, and when the count value reaches a predetermined constant value, the exception processing signal 39 is set to logic "1". Output to the instruction executor 44. When the exception processing signal 39 becomes logic "1", the instruction executor 44 stops the instruction execution processing, causes exception processing, and shifts to abnormal processing.

【0042】ここで、図4、5を参照しながら、図3の
エラー検出回路36の一実施例について説明する。図3
のエラー検出回路36は、フェッチエラー検出信号6と
分岐命令検出信号62の値に基づいて、命令実行部41
による命令コードの実行を停止すべきか否かを判別し、
停止すべきであればエラー信号38を論理「1」とし
て、フェッチエラー計数回路54に出力する。
An embodiment of the error detection circuit 36 shown in FIG. 3 will be described with reference to FIGS. Figure 3
Error detection circuit 36 of the instruction execution unit 41 based on the values of the fetch error detection signal 6 and the branch instruction detection signal 62.
Determine whether to stop the execution of the instruction code by
If it should be stopped, the error signal 38 is output as logic "1" to the fetch error counting circuit 54.

【0043】図4はエラー検出回路36の一実施例の動
作を説明するフローチャートである。図4のステップS
151において、エラー検出回路36はまずフェッチエ
ラー検出信号6の値を判定する。フェッチエラー検出信
号6が論理「0」のときは、命令実行器44の処理を停
止させる必要がないので、エラー信号38を論理「0」
に設定する(S154)。
FIG. 4 is a flow chart for explaining the operation of one embodiment of the error detection circuit 36. Step S in FIG.
At 151, the error detection circuit 36 first determines the value of the fetch error detection signal 6. When the fetch error detection signal 6 is logic "0", it is not necessary to stop the processing of the instruction executor 44, so the error signal 38 is set to logic "0".
Is set (S154).

【0044】フェッチエラー検出信号6が論理「1」の
ときは、S152において分岐命令検出信号62の値を
判定する。分岐命令検出信号62が論理「1」であれ
ば、分岐先のアドレスへ命令実行器44の制御が移行
し、フェッチされた分岐命令に後続する命令コードは実
行されないので、フェッチエラーが発生したにも係わら
ず、実行エラーが起こる危険はない。従って命令の実行
を停止させる必要がないので、エラー信号38を論理
「0」に設定する(S154)。
When the fetch error detection signal 6 is logic "1", the value of the branch instruction detection signal 62 is determined in S152. If the branch instruction detection signal 62 is logic "1", the control of the instruction executor 44 shifts to the address of the branch destination, and the instruction code following the fetched branch instruction is not executed. Nevertheless, there is no danger of an execution error. Therefore, since it is not necessary to stop the execution of the instruction, the error signal 38 is set to logic "0" (S154).

【0045】フェッチエラー検出信号6が論理「1」
で、かつ分岐命令検出信号62が論理「0」のときは、
命令実行器44により実行される命令コードが正常でな
く、実行エラーが起こる可能性があるので、エラー信号
38を論理「1」に設定する(S153)。
The fetch error detection signal 6 is logic "1".
And the branch instruction detection signal 62 is logic "0",
Since the instruction code executed by the instruction executor 44 is not normal and an execution error may occur, the error signal 38 is set to logic "1" (S153).

【0046】このような動作を行うエラー検出回路36
の一実施例を図5に示す。図5のエラー検出回路36
は、命令実行器44からの分岐命令検出信号62の値を
反転して出力するインバータ71と、インバータ71の
出力とフェッチエラー検出信号6との論理積をとって、
エラー信号38として出力するANDゲート72から構
成される。
The error detection circuit 36 performing such an operation
An example of this is shown in FIG. The error detection circuit 36 of FIG.
Is the logical product of an inverter 71 that inverts and outputs the value of the branch instruction detection signal 62 from the instruction executor 44, and the output of the inverter 71 and the fetch error detection signal 6,
The AND gate 72 outputs the error signal 38.

【0047】ANDゲート72の出力、つまりエラー信
号38は、フェッチエラー検出信号6が論理「1」で、
かつ分岐命令検出信号62が論理「0」のとき、すなわ
ち、フェッチされた命令コードにフェッチエラーが検出
され、かつ先に実行された命令が分岐命令でなかったと
きのみ論理「1」となり、その他の場合は論理「0」と
なる。従って、フェッチエラーが発生しても、先に実行
された命令が分岐命令であれば、フェッチエラーが発生
したことがフェッチエラー計数回路37に伝えられない
ので、フェッチエラー計数回路37はこの場合のフェッ
チエラーをエラーとして計数しない。
The output of the AND gate 72, that is, the error signal 38, is obtained when the fetch error detection signal 6 is logic "1",
And when the branch instruction detection signal 62 is logic "0", that is, when a fetch error is detected in the fetched instruction code and the previously executed instruction is not a branch instruction, it becomes logic "1". In the case of, the logical value is “0”. Therefore, even if a fetch error occurs, if the previously executed instruction is a branch instruction, the fact that a fetch error has occurred cannot be notified to the fetch error counting circuit 37. Do not count fetch errors as errors.

【0048】次に、図6、7を参照しながら、図3の再
試行制御回路32の一実施例について説明する。図3の
再試行制御回路52は、フェッチエラー検出信号6と分
岐命令検出信号62の値に応じて、次にフェッチする命
令のアドレス生成を行う。
Next, an embodiment of the retry control circuit 32 shown in FIG. 3 will be described with reference to FIGS. The retry control circuit 52 of FIG. 3 generates an address of an instruction to be fetched next according to the values of the fetch error detection signal 6 and the branch instruction detection signal 62.

【0049】図6は図3の再試行制御回路32の動作を
説明するフローチャートである。図6のステップS20
1において、再試行制御回路32は、まず命令実行器4
4からの分岐命令検出信号62が論理「1」かどうかを
判定し、論理「1」であれば次に分岐先命令をフェッチ
する必要があるので、命令実行器44から与えられる分
岐先アドレス61をフェッチプログラムカウンタレジス
タ33に対して出力する(S204)。
FIG. 6 is a flow chart for explaining the operation of the retry control circuit 32 shown in FIG. Step S20 of FIG.
1, the retry control circuit 32 first determines the instruction executor 4
It is determined whether the branch instruction detection signal 62 from 4 is logic "1", and if it is logic "1", the branch destination instruction needs to be fetched next. Is output to the fetch program counter register 33 (S204).

【0050】分岐命令検出信号62が論理「0」のとき
は、次にS202においてフェッチエラー検出信号6が
論理「1」かどうかを判定する。フェッチエラー検出信
号6が論理「0」であれば、プログラム上後続する命令
の命令アドレスをフェッチプログラムカウンタレジスタ
33に対して出力する(S203)。フェッチエラー検
出信号6が論理「1」であれば、命令コードのフェッチ
リトライを行うために、フェッチプログラムカウンタレ
ジスタ33からの命令アドレスを更新せずに、そのまま
フェッチプログラムカウンタレジスタ33に再出力する
(S205)。
When the branch instruction detection signal 62 is logic "0", it is determined in step S202 whether the fetch error detection signal 6 is logic "1". If the fetch error detection signal 6 is logic "0", the instruction address of the instruction following the program is output to the fetch program counter register 33 (S203). If the fetch error detection signal 6 is logic "1", the instruction address from the fetch program counter register 33 is re-output as it is to the fetch program counter register 33 without updating the instruction address in order to fetch the instruction code. S205).

【0051】このような動作を行う再試行制御回路32
の一実施例を図7に示す。図7の再試行制御回路32
は、フェッチプログラムカウンタレジスタ33からの命
令アドレスをインクリメントして出力するアドレス更新
カウンタ74と、フェッチプログラムカウンタレジスタ
33からの命令アドレス、アドレス更新カウンタ74の
出力、分岐先アドレス61のいずれかを選択して出力す
るマルチプレクサ73から構成される。
The retry control circuit 32 which performs such an operation
An example of this is shown in FIG. The retry control circuit 32 of FIG.
Selects either the address update counter 74 that increments and outputs the instruction address from the fetch program counter register 33, the instruction address from the fetch program counter register 33, the output of the address update counter 74, or the branch destination address 61. It is comprised from the multiplexer 73 which outputs.

【0052】マルチプレクサ73は、フェッチエラー検
出信号6と分岐命令検出信号62が共に論理「0」のと
きは、アドレス更新カウンタ74により更新された命令
アドレスを、後続命令の命令アドレスとして出力する。
また分岐命令検出信号62が論理「1」のときは、既に
フェッチされている命令コードは自動的に無効となるの
で、フェッチエラー検出信号6の値に依らず、分岐先ア
ドレス61を出力する。分岐命令検出信号62が論理
「0」でかつ、フェッチエラー検出信号6が論理「1」
のときは、エラーの検出された命令コードのフェッチリ
トライを行うために、フェッチプログラムカウンタレジ
スタ33からの命令アドレスをそのまま出力する。
When the fetch error detection signal 6 and the branch instruction detection signal 62 are both logic "0", the multiplexer 73 outputs the instruction address updated by the address update counter 74 as the instruction address of the subsequent instruction.
When the branch instruction detection signal 62 is logic "1", the instruction code that has already been fetched is automatically invalidated, so that the branch destination address 61 is output regardless of the value of the fetch error detection signal 6. The branch instruction detection signal 62 is logic "0" and the fetch error detection signal 6 is logic "1".
In the case of, the instruction address from the fetch program counter register 33 is output as it is in order to perform the fetch retry of the instruction code in which the error is detected.

【0053】マルチプレクサ73の出力は、フェッチプ
ログラムカウンタレジスタ33に格納された後、次の命
令フェッチの際に、命令アドレスとしてアドレスバス4
に出力される。
The output of the multiplexer 73 is stored in the fetch program counter register 33 and then used as an instruction address in the address bus 4 when the next instruction is fetched.
Is output to.

【0054】次に、図8、9を参照しながら、図3の命
令書換え回路35の一実施例について説明する。図3の
命令書換え回路35は、フェッチエラー検出信号6を受
けて、フェッチインストラクションレジスタ34より入
力される命令コードを書き換えて、実行インストラクシ
ョンレジスタ43に送る。
Next, one embodiment of the instruction rewriting circuit 35 shown in FIG. 3 will be described with reference to FIGS. The instruction rewriting circuit 35 shown in FIG. 3 receives the fetch error detection signal 6, rewrites the instruction code input from the fetch instruction register 34, and sends it to the execution instruction register 43.

【0055】図8は図3の命令書換え回路35の動作を
説明するフローチャートである。図8のステップS21
1において、命令書換え回路35はフェッチエラー検出
信号6が論理「1」かどうかを判定し、論理「1」であ
れば、フェッチインストラクションレジスタ34からの
エラーの検出された命令コードを破棄し、代わりに命令
実行器24の動作に影響を与えないような、他の命令コ
ードを実行インストラクションレジスタ43に対して出
力する(S213)。フェッチエラー検出信号6が論理
「0」であれば、フェッチインストラクションレジスタ
34からの命令コードは正常なので、そのまま実行イン
ストラクションレジスタ43に対して出力する(S21
2)。
FIG. 8 is a flow chart for explaining the operation of the instruction rewriting circuit 35 of FIG. Step S21 of FIG.
1, the instruction rewriting circuit 35 determines whether or not the fetch error detection signal 6 is logic "1". If it is logic "1", the instruction code in which the error is detected from the fetch instruction register 34 is discarded, and Then, another instruction code that does not affect the operation of the instruction executor 24 is output to the execution instruction register 43 (S213). If the fetch error detection signal 6 is logic "0", the instruction code from the fetch instruction register 34 is normal, and is output to the execution instruction register 43 as it is (S21).
2).

【0056】このような動作を行う命令書換え回路35
の一実施例を図9に示す。図9の命令書換え回路35
は、書換え用の命令コードを予め格納しておく命令書換
えレジスタ75と、命令書換えレジスタ75より出力さ
れる命令コード、またはフェッチインストラクションレ
ジスタ34より入力される命令コードのいずれかを選択
して出力するマルチプレクサ76から構成される。
The instruction rewriting circuit 35 performing such an operation.
An example of this is shown in FIG. The instruction rewriting circuit 35 of FIG.
Is an instruction rewriting register 75 in which an instruction code for rewriting is stored in advance, an instruction code output from the instruction rewriting register 75, or an instruction code input from the fetch instruction register 34 is selected and output. It is composed of a multiplexer 76.

【0057】命令書換えレジスタ75には、命令実行器
44の動作に影響を与えないような命令コード、例えば
ノーオペレーションコード(NOPコード)が格納され
る。マルチプレクサ76は、フェッチエラー検出信号6
が論理「0」のときは、フェッチインストラクションレ
ジスタ34より入力される命令コードをそのまま出力
し、フェッチエラー検出信号6が論理「1」のときは、
命令書換えレジスタ75に格納されている命令コード、
例えばNOPコードを出力する。
The instruction rewriting register 75 stores an instruction code which does not affect the operation of the instruction executor 44, for example, a no operation code (NOP code). The multiplexer 76 receives the fetch error detection signal 6
Is logical "0", the instruction code input from the fetch instruction register 34 is output as it is, and when the fetch error detection signal 6 is logical "1",
The instruction code stored in the instruction rewriting register 75,
For example, a NOP code is output.

【0058】マルチプレクサ76の出力は実行インスト
ラクションレジスタ43に格納されるが、このとき実行
プログラムカウンタレジスタ42にはフェッチプログラ
ムカウンタレジスタ33に格納された命令アドレス、つ
まりフェッチインストラクションレジスタ34より入力
される命令コードに対応する命令アドレスが格納され
る。
The output of the multiplexer 76 is stored in the execution instruction register 43. At this time, the instruction address stored in the fetch program counter register 33, that is, the instruction code input from the fetch instruction register 34, is stored in the execution program counter register 42. The instruction address corresponding to is stored.

【0059】命令実行器44は実行プログラムカウンタ
レジスタ42の命令アドレスを読み出し、実行インスト
ラクションレジスタ43に格納された命令コードを、プ
ログラムメモリ2からフェッチした命令コードと解釈し
て実行する。これがNOPコードであった場合は実際に
は何も行わないので、命令実行器44によるプログラム
処理に影響を与えることはない。従って、フェッチエラ
ーが発生したときでも、命令実行器44は処理を停止す
ることがなく、次にフェッチリトライが成功した時、連
続して再フェッチされた命令コードを実行することがで
きる。
The instruction executor 44 reads the instruction address of the execution program counter register 42, interprets the instruction code stored in the execution instruction register 43 as the instruction code fetched from the program memory 2, and executes it. If this is a NOP code, nothing is actually done, so that it does not affect the program processing by the instruction executor 44. Therefore, even if a fetch error occurs, the instruction executor 44 does not stop the processing, and when the next fetch retry succeeds, the instruction code that has been refetched continuously can be executed.

【0060】図3では命令書換え回路35がフェッチイ
ンストラクションレジスタ34と実行インストラクショ
ンレジスタ43の間に接続されている。しかしながら本
発明はこれに限定するものではなく、命令書換え回路3
5をCPU内の他の場所に設けることもできる。例えば
命令書換え回路35を実行インストラクションレジスタ
43と命令実行器44の間に接続して、実行インストラ
クションレジスタ43から出力される命令コードを書き
換えるような構成も可能である。
In FIG. 3, the instruction rewriting circuit 35 is connected between the fetch instruction register 34 and the execution instruction register 43. However, the present invention is not limited to this, and the instruction rewriting circuit 3
5 can also be provided elsewhere in the CPU. For example, the instruction rewriting circuit 35 may be connected between the execution instruction register 43 and the instruction executor 44 to rewrite the instruction code output from the execution instruction register 43.

【0061】最後に、図10、11を参照しながら、図
3のフェッチエラー計数回路37の一実施例について説
明する。図3のフェッチエラー計数回路37は、エラー
検出回路36からのエラー信号38が連続して論理
「1」となる回数を計数し、それが一定回数に達する
と、命令実行器44に対して例外処理信号39を出力す
る。
Finally, an embodiment of the fetch error counting circuit 37 of FIG. 3 will be described with reference to FIGS. The fetch error counting circuit 37 of FIG. 3 counts the number of times that the error signal 38 from the error detection circuit 36 continuously becomes a logic “1”, and when it reaches a certain number, an exception is issued to the instruction executor 44. The processed signal 39 is output.

【0062】図10はフェッチエラー計数回路37の動
作を説明するフローチャートである。図10のステップ
S221において、フェッチエラー計数回路37はエラ
ー信号38が論理「1」かどうかを判定する。エラー信
号38が論理「0」であれば、命令実行器44の処理を
停止させる必要がないので、計数値をクリアし(S22
5)、例外処理信号39を論理「0」に設定する(S2
26)。エラー信号38が論理「1」であれば、計数値
をインクリメントする(S222)。
FIG. 10 is a flow chart for explaining the operation of the fetch error counting circuit 37. In step S221 of FIG. 10, the fetch error counting circuit 37 determines whether the error signal 38 is logic "1". If the error signal 38 is logic "0", it is not necessary to stop the processing of the instruction executor 44, so the count value is cleared (S22).
5), exception processing signal 39 is set to logic "0" (S2)
26). If the error signal 38 is logic "1", the count value is incremented (S222).

【0063】ステップS223においてフェッチエラー
計数回路54は、計数値が予め設定された一定値に到達
したかどうかを判定する。同一命令に対するフェッチエ
ラーが連続して発生し、フェッチエラーの計数値が一定
値に達すると、命令実行器44に対して例外処理を要求
するために、例外処理信号39を論理「1」に設定する
(S224)。計数値が一定値に達していなければ、ス
テップS221に戻る。
In step S223, the fetch error counting circuit 54 determines whether or not the count value has reached a preset constant value. When fetch errors for the same instruction occur successively and the count value of the fetch errors reaches a certain value, the exception processing signal 39 is set to logic "1" in order to request the exception processing from the instruction executor 44. Yes (S224). If the count value has not reached the fixed value, the process returns to step S221.

【0064】このような動作を行うフェッチエラー計数
回路37の一実施例を図11に示す。図11のフェッチ
エラー計数回路37はクロック同期方式のカウンタ77
により構成され、エラー信号38がカウンタ77のカウ
ント端子(CNT)とクリア端子 外2 に入力され、
例外処理信号は出力端子(OUT)から出力される。
FIG. 11 shows an embodiment of the fetch error counting circuit 37 which performs such an operation. The fetch error counting circuit 37 of FIG. 11 is a clock synchronous type counter 77.
The error signal 38 is input to the count terminal (CNT) and the clear terminal 2 of the counter 77,
The exception processing signal is output from the output terminal (OUT).

【0065】[0065]

【外2】 [Outside 2]

【0066】カウンタ77のクロック端子(CLK)に
は同期クロックとして、命令実行器44により生成され
るリード 外3 信号63が入力される。 外4 信号
63
The external terminal 3 signal 63 generated by the instruction executor 44 is input to the clock terminal (CLK) of the counter 77 as a synchronous clock. Outside 4 signal 63

【0067】[0067]

【外3】 [Outside 3]

【0068】[0068]

【外4】 [Outside 4]

【0069】は、CPU1がプログラムメモリ2から命
令コードをフェッチして、フェッチインストラクション
レジスタ34に格納するために用いる命令フェッチ用の
信号である。
Is a signal for instruction fetch used by the CPU 1 to fetch an instruction code from the program memory 2 and store it in the fetch instruction register 34.

【0070】カウント端子に入力されるエラー信号38
は、RD信号63によりその論理「1」の回数がカウン
トされる。エラー信号38が論理「0」のときはクリア
端子により計数値がクリアされ、例外処理信号39は論
理「0」となる。計数値が予め決められた一定値、例え
ば3回に達すると、例外処理信号39が論理「1」とな
る。命令実行器44はこれを受けて、実行処理を停止
し、例外処理を発生させる。
Error signal 38 input to the count terminal
Is counted by the RD signal 63. When the error signal 38 is logic "0", the count value is cleared by the clear terminal, and the exception processing signal 39 is logic "0". When the count value reaches a predetermined constant value, for example, three times, the exception processing signal 39 becomes logic "1". In response to this, the instruction executor 44 stops the execution process and causes an exception process.

【0071】この予め決められた一定値は3回に限られ
るものではなく、任意の値とすることができるのは言う
までもない。また、カウンタ77に計数上限値の設定機
構を設けることにより、例外処理信号39を論理「1」
にする一定計数値をプログラマブルにするような構成も
可能である。
It is needless to say that the predetermined constant value is not limited to three times and can be any value. Further, by providing the counter 77 with a counting upper limit value setting mechanism, the exception processing signal 39 is set to logic "1".
A configuration is also possible in which the constant count value is set to be programmable.

【0072】尚図4および図5では、分岐命令検出信号
62が論理「1」のときは、フェッチエラー検出信号6
が論理「1」となってもフェッチエラー計数回路54の
計数値をインクリメントしない構成をとっている。しか
し本発明はこれに限定するものではなく、フェッチエラ
ー検出信号6をエラー信号38として、直接フェッチエ
ラー計数回路54に入力することにより、データバス5
上の命令コードにフェッチエラーが検出される度に計数
値をインクリメントするような構成も可能である。この
ようなエラー検出回路を用いた場合は、図4、5の実施
例の場合よりも、例外処理が発生する頻度が高くなる。
In FIG. 4 and FIG. 5, when the branch instruction detection signal 62 is logic "1", the fetch error detection signal 6
Has a logic "1", the count value of the fetch error counting circuit 54 is not incremented. However, the present invention is not limited to this, and by directly inputting the fetch error detection signal 6 as the error signal 38 to the fetch error counting circuit 54, the data bus 5
A configuration is possible in which the count value is incremented each time a fetch error is detected in the above instruction code. When such an error detection circuit is used, exception processing occurs more frequently than in the embodiments of FIGS.

【0073】[0073]

【発明の効果】本発明のフェッチエラー制御回路によれ
ば、CPUによる命令フェッチにエラーが生じた時、C
PUの命令フェッチサイクルや命令実行サイクルを停止
したり、あるいはCPU内部のパイプライン動作を乱し
たりすることなく、命令フェッチの再試行動作を高速に
行うことができる。
According to the fetch error control circuit of the present invention, when an error occurs in the instruction fetch by the CPU, C
The instruction fetch retry operation can be performed at high speed without stopping the PU instruction fetch cycle or instruction execution cycle or disturbing the pipeline operation inside the CPU.

【0074】また致命的な異常等により命令フェッチの
再試行がなかなか成功しない場合は、命令実行部にこれ
を通知し、異常処理のための例外処理を発生させること
ができる。
When the retry of the instruction fetch is not successful due to a fatal abnormality or the like, the instruction execution unit can be notified of this and exception processing for the abnormal processing can be generated.

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

【図1】本発明のフェッチエラー制御装置の原理ブロッ
ク図である。
FIG. 1 is a principle block diagram of a fetch error control device of the present invention.

【図2】フェッチエラー検出機構を示す図である。FIG. 2 is a diagram showing a fetch error detection mechanism.

【図3】本発明の一実施例のフェッチエラー制御装置を
用いたCPUの構成図である。
FIG. 3 is a configuration diagram of a CPU using a fetch error control device according to an embodiment of the present invention.

【図4】本発明のエラー検出回路の動作を示すフローチ
ャートである。
FIG. 4 is a flowchart showing the operation of the error detection circuit of the present invention.

【図5】エラー検出回路の一実施例である。FIG. 5 is an example of an error detection circuit.

【図6】本発明の再試行制御回路の動作を示すフローチ
ャートである。
FIG. 6 is a flowchart showing the operation of the retry control circuit of the present invention.

【図7】再試行制御回路の一実施例である。FIG. 7 is an example of a retry control circuit.

【図8】本発明の命令書換え回路の動作を示すフローチ
ャートである。
FIG. 8 is a flowchart showing the operation of the instruction rewriting circuit of the present invention.

【図9】命令書換え回路の一実施例である。FIG. 9 is an example of an instruction rewriting circuit.

【図10】本発明のフェッチエラー計数回路の動作を示
すフローチャートである。
FIG. 10 is a flowchart showing the operation of the fetch error counting circuit of the present invention.

【図11】フェッチエラー計数回路の一実施例である。FIG. 11 is an example of a fetch error counting circuit.

【図12】従来例におけるCPUの構成図である。FIG. 12 is a configuration diagram of a CPU in a conventional example.

【図13】フェッチリトライルーチンの処理を示すフロ
ーチャートである。
FIG. 13 is a flowchart showing processing of a fetch retry routine.

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

1 中央処理装置(CPU) 2 プログラムメモリ 3 パリティチェック機構 4、16 アドレスバス 5、17 データバス 6 フェッチエラー検出信号 11、31 命令フェッチ部 12、73、76 マルチプレクサ 13、74 アドレス更新カウンタ 14、33 フェッチプログラムカウンタレジスタ 15、34 フェッチインストラクションレジスタ 18 異常検出信号 21、41 命令実行部 22、42 実行プログラムカウンタレジスタ 23、43 実行インストラクションレジスタ 24、44 命令実行器 25、45 レジスタファイル 26、61 分岐先アドレス 27、62 分岐命令検出信号 32 再試行制御回路 35 命令書換え回路 36 エラー検出回路 37 フェッチエラー計数回路 38、57 エラー信号 39、58 例外処理信号 51 再試行制御手段 52 フェッチ手段 53 命令変更手段 54 エラー検出手段 55 フェッチエラー計数手段 56 命令実行手段 63 RD信号 71 インバータ 72 ANDゲート 75 命令書換えレジスタ 77 カウンタ 1 Central Processing Unit (CPU) 2 Program Memory 3 Parity Check Mechanism 4, 16 Address Bus 5, 17 Data Bus 6 Fetch Error Detection Signal 11, 31 Instruction Fetch Unit 12, 73, 76 Multiplexer 13, 74 Address Update Counter 14, 33 Fetch program counter register 15, 34 Fetch instruction register 18 Abnormality detection signal 21, 41 Instruction execution unit 22, 42 Execution program counter register 23, 43 Execution instruction register 24, 44 Instruction executor 25, 45 Register file 26, 61 Branch destination address 27, 62 Branch instruction detection signal 32 Retry control circuit 35 Instruction rewriting circuit 36 Error detection circuit 37 Fetch error counting circuit 38, 57 Error signal 39, 58 Exception processing signal 1 retry control means 52 fetches means 53 command change means 54 error detection unit 55 fetches the error counting means 56 instruction execution unit 63 RD signal 71 inverter 72 the AND gate 75 an instruction of rewriting the register 77 counter

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 データバス(5)から入力される命令を
格納するフェッチ手段(52)と、該フェッチ手段(5
2)に格納された命令を実行する命令実行手段(56)
とを有する中央処理装置(1)において、フェッチエラ
ー検出信号(6)により命令のフェッチエラーの検出を
通知されたとき、前記命令実行手段(56)による命令
の実行を停止すべきか否かを判別し、命令の実行を停止
すべきであれば、前記命令実行手段(56)に対してエ
ラー信号(57)を出力するエラー検出手段(54)を
備えたことを特徴とするフェッチエラー制御装置。
1. A fetch means (52) for storing an instruction input from a data bus (5), and the fetch means (5).
Instruction executing means (56) for executing the instruction stored in 2)
In the central processing unit (1) having the following, when the instruction fetch error detection signal (6) notifies that the instruction fetch error is detected, it is determined whether or not the instruction execution means (56) should stop the instruction execution. If the instruction execution is to be stopped, the fetch error control device is provided with an error detection means (54) for outputting an error signal (57) to the instruction execution means (56).
【請求項2】 前記フェッチエラー検出信号(6)によ
り命令のフェッチエラーの検出を通知されたとき、再度
該命令のアドレスをアドレスバス(4)に出力し、再度
前記命令のフェッチを行う再試行制御手段(51)を備
えることを特徴とする請求項1記載のフェッチエラー制
御装置。
2. A retry for outputting the address of the instruction again to the address bus (4) when notified of the detection of the instruction fetch error by the fetch error detection signal (6), and fetching the instruction again. The fetch error control device according to claim 1, further comprising a control means (51).
【請求項3】 前記フェッチエラー検出信号(6)によ
り命令のフェッチエラーの検出を通知されたとき、フェ
ッチされて前記フェッチ手段(52)内に格納されてい
る該命令を、直ちに他の命令に変更して前記命令実行手
段(56)に出力する命令変更手段(53)を備え、前
記命令実行手段(56)が、前記命令変更手段(53)
より入力された前記他の命令を実行することを特徴とす
る請求項1記載のフェッチエラー制御装置。
3. When the fetch error detection signal (6) notifies the detection of an instruction fetch error, the fetched instruction stored in the fetch means (52) is immediately transferred to another instruction. An instruction changing means (53) for changing and outputting to the instruction executing means (56) is provided, and the instruction executing means (56) is the instruction changing means (53).
2. The fetch error control device according to claim 1, wherein the other instruction input by the other is executed.
【請求項4】 前記エラー検出手段(54)から出力さ
れる前記エラー信号(57)の出力回数を計数し、前記
出力回数の計数値が一定値を越えたとき、前記命令実行
手段(56)に対して例外処理信号(58)を出力する
フェッチエラー計数手段(55)を、前記エラー検出手
段(54)と前記命令実行手段(56)の間に備え、前
記命令実行手段(56)は、前記例外処理信号(58)
により前記出力回数の計数値が一定値を越えたことを通
知されると、命令の実行処理を停止することを特徴とす
る請求項1記載のフェッチエラー制御装置。
4. The instruction execution means (56), which counts the number of times the error signal (57) is output from the error detection means (54), and when the count value of the output times exceeds a certain value. A fetch error counting means (55) for outputting an exception processing signal (58) is provided between the error detecting means (54) and the instruction executing means (56), and the instruction executing means (56) includes: The exception handling signal (58)
2. The fetch error control device according to claim 1, wherein the instruction execution process is stopped when the fact that the count value of the output count exceeds a certain value is notified by.
JP5252748A 1993-10-08 1993-10-08 Fetch error control device Withdrawn JPH07105000A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5252748A JPH07105000A (en) 1993-10-08 1993-10-08 Fetch error control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5252748A JPH07105000A (en) 1993-10-08 1993-10-08 Fetch error control device

Publications (1)

Publication Number Publication Date
JPH07105000A true JPH07105000A (en) 1995-04-21

Family

ID=17241737

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5252748A Withdrawn JPH07105000A (en) 1993-10-08 1993-10-08 Fetch error control device

Country Status (1)

Country Link
JP (1) JPH07105000A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007018454A (en) * 2005-07-11 2007-01-25 Toshiba Corp Microprocessor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007018454A (en) * 2005-07-11 2007-01-25 Toshiba Corp Microprocessor

Similar Documents

Publication Publication Date Title
JPH07248897A (en) Method and device for recovery from exception in computer system
JPH0517588B2 (en)
EP0372751A2 (en) Pipelined data-processing apparatus
JPH05204709A (en) Processor
JPH04188229A (en) floating point arithmetic processing unit
CN101156137A (en) Selecting subroutine return mechanism
US6990569B2 (en) Handling problematic events in a data processing apparatus
US5237664A (en) Pipeline circuit
JPH07105000A (en) Fetch error control device
EP0113982A2 (en) A data processing system
JP2626675B2 (en) Apparatus and method for generating data-induced state signal
JPH0384632A (en) Data processor
JPH07262032A (en) Information processing equipment
JPH04235638A (en) Microprocessor provided with prefetching function
JP3171615B2 (en) Data transfer retry control method
JP2562838B2 (en) Processor and store buffer control method
JPH06324861A (en) System and method for controlling cpu
JPH0248733A (en) information processing equipment
JP2793386B2 (en) Computer error information storage device for computer
JPH03225433A (en) Single-chip microcomputer
JP2950080B2 (en) Microcomputer
JPH0147818B2 (en)
JPS62159231A (en) Instruction prefetching device
JPS63214856A (en) Data protection control system for data processing unit
JPH03186956A (en) Cpu bus data diagnosis device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20001226