JPH05108384A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH05108384A
JPH05108384A JP3272775A JP27277591A JPH05108384A JP H05108384 A JPH05108384 A JP H05108384A JP 3272775 A JP3272775 A JP 3272775A JP 27277591 A JP27277591 A JP 27277591A JP H05108384 A JPH05108384 A JP H05108384A
Authority
JP
Japan
Prior art keywords
address
program counter
microprocessor
execution unit
comparator
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
JP3272775A
Other languages
Japanese (ja)
Inventor
Takahiro Shigemasa
孝弘 重政
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP3272775A priority Critical patent/JPH05108384A/en
Publication of JPH05108384A publication Critical patent/JPH05108384A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To interrupt a microprocessor and to perform the proper processing such as resetting in the case the microprocessor starts to run away to process a non-program area or process a part not to be processed even in a program area. CONSTITUTION:A microprocessor 1 is provided with an execution part 5 having a program counter 3, an address register 7, and a comparator 9. The execution part 5 sets interruption start address data to the address register 7. The comparator 9 compares the address data held in the address register 7 with the value of a program counter 3 to judged the equality. In this case, the comparator 9 gives an interruption signal Sint to the execution part 5 when the value of the program counter 3 equals to the address data. Thus, the proper processing such as resetting can be performed.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、暴走した場合の復帰を
高速に可能としたマイクロプロセッサに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor capable of recovering from a runaway at high speed.

【0002】[0002]

【従来の技術】この種のマイクロプロセッサは、周知の
とおり、一つあるいは数個の集積回路に、その要素が集
約されている処理機構であると定義されている。このマ
イクロプロセッサは、プログラムカウンタの内容により
割り込みを発生させる仕組みはハードウェア上ではな
い。そこで、従来のマイクロプロセッサでは、ソフトウ
ェア制御により、指定アドレスに必要な命令を挿入する
等の手段をとっていた。
2. Description of the Related Art As is well known, a microprocessor of this type is defined as a processing mechanism in which its elements are integrated in one or several integrated circuits. This microprocessor does not have a mechanism for generating an interrupt depending on the contents of the program counter on hardware. Therefore, in the conventional microprocessor, means such as inserting a necessary instruction into a designated address is taken by software control.

【0003】[0003]

【発明が解決しようとする課題】このような従来のマイ
クロプロセッサにおいては、上述したようにソフトウェ
ア制御により、指定アドレスに必要な命令を挿入する等
の手段をとっているため、このプロセッサが暴走してし
まったときには、復帰手段としてソフトウェア制御を使
用することができなかった。このため、従来、ウォッチ
ドックタイマのような外付けハードウェアを追加し、こ
のウォッチドックタイマがオーバータイムした場合に上
述のプロセッサをリセットする等の方法をとっていた。
したがって、ウォッチドックタイマがオーバータイムす
るまで上記プロセッサをリセットすることができず、正
常な状態に復帰するまでに時間がかかるという問題点が
あった。
In such a conventional microprocessor, as described above, the software control causes a necessary instruction to be inserted into a designated address and the like, so that the processor is out of control. When it happened, software control could not be used as a recovery means. Therefore, conventionally, a method such as adding external hardware such as a watchdog timer and resetting the above-mentioned processor when the watchdog timer is overtime has been adopted.
Therefore, there is a problem that the processor cannot be reset until the watchdog timer is overtime, and it takes time to return to the normal state.

【0004】本発明は、上述した問題点を解消し、正常
状態に復帰するまでの時間を短縮化してなるマイクロプ
ロセッサを提供することを目的とする。
It is an object of the present invention to provide a microprocessor which solves the above-mentioned problems and shortens the time required to return to a normal state.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するため
に、請求項1記載に発明によるマイクロプロセッサは、
プログラムカウンタを有し、ソフトウェアの命令に従い
各種の処理を実行する実行部と、この実行部からの指示
によりアドレスデータを保持する1個のアドレスレジス
タと、このアドレスレジスタに保持されたアドレスデー
タとプログラムカウンタの内容とを比較し、その比較結
果の一致信号により上記実行部に対して割り込みを発生
させる比較器とを具備したことを特徴とするものであ
る。
In order to achieve the above object, a microprocessor according to the present invention according to claim 1 comprises:
An execution unit that has a program counter and executes various processes in accordance with software instructions, one address register that holds address data according to an instruction from the execution unit, and the address data and the program that are held in this address register A comparator for comparing the contents of the counter and generating an interrupt to the execution unit in response to a match signal of the comparison result is provided.

【0006】請求項2記載の発明によるマイクロプロセ
ッサは、プログラムカウンタを有し、ソフトウェアの命
令に従い各種の処理を実行する実行部と、この実行部か
らの指示によりアドレスデータを保持する複数のアドレ
スレジスタと、これらアドレスレジスタに保持されたア
ドレスデータとプログラムカウンタの内容とを比較し、
プログラムカウンタの内容が両アドレスレジスタのアド
レスデータの範囲内である場合に割り込みを発生させる
比較器とを具備したことを特徴とするものである。
According to a second aspect of the present invention, there is provided a microprocessor having a program counter, which executes various processes in accordance with software instructions, and a plurality of address registers which hold address data according to instructions from the execution section. And compare the address data held in these address registers with the contents of the program counter,
And a comparator for generating an interrupt when the content of the program counter is within the range of the address data of both address registers.

【0007】請求項3記載の発明によるマイクロプロセ
ッサは、プログラムカウンタを有し、ソフトウェアの命
令に従い各種の処理を実行する実行部と、この実行部か
らの指示によりアドレスデータを保持する複数のアドレ
スレジスタと、これらアドレスレジスタに保持されたア
ドレスデータとプログラムカウンタの内容とを比較し、
プログラムカウンタの内容が両アドレスレジスタのアド
レスデータの範囲外である場合に割り込みを発生させる
比較器とを具備したことを特徴とするものである。
According to a third aspect of the present invention, there is provided a microprocessor having a program counter, which executes various processes in accordance with software instructions, and a plurality of address registers which hold address data according to instructions from the execution section. And compare the address data held in these address registers with the contents of the program counter,
And a comparator for generating an interrupt when the contents of the program counter are out of the range of the address data of both address registers.

【0008】本発明では、実行部内のプログラムカウン
タの値と、実行部によりアドレスレジスタに設定された
アドレスデータとを比較器で比較可能とし、プログラム
カウンタの値とアドレスデータとの間で、アドレスデー
タと一致、アドレスデータ間の範囲内外という関係のい
ずれかで割り込みを発生させているので、正常状態に復
帰するまでの時間を短縮化することができる。
According to the present invention, the value of the program counter in the execution unit and the address data set in the address register by the execution unit can be compared with each other, and the address data is exchanged between the value of the program counter and the address data. Since the interrupt is generated in accordance with either of the above, and the relationship between the address data being within or outside the range, the time required to return to the normal state can be shortened.

【0009】[0009]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

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

【0011】図1に示すマイクロプロセッサ1は、プロ
グラムカウンタ(PC)3を有する実行部5と、一つの
アドレスレジスタ7と、比較器9とを備えている。実行
部5は、ソフトウェアの命令に従い各種の処理を実行す
る。実行部5は、ソフトウェアの命令に従い割り込み発
生番地であるアドレスデータをアドレスレジスタ7に設
定できる。実行部5に内蔵するプログラムカウンタ3の
出力は、比較器9に入力される。アドレスレジスタ7に
設定されたアドレスデータを比較器9に入力される。比
較器9は、アドレスレジスタ7に保持されたアドレスデ
ータとプログラムカウンタ3の内容を比較し、その比較
結果の一致信号により実行部5に対して割込み信号Sin
t を発生させるようになっている。
The microprocessor 1 shown in FIG. 1 comprises an execution unit 5 having a program counter (PC) 3, one address register 7, and a comparator 9. The execution unit 5 executes various processes in accordance with software instructions. The execution unit 5 can set address data, which is an interrupt generation address, in the address register 7 according to a software instruction. The output of the program counter 3 incorporated in the execution unit 5 is input to the comparator 9. The address data set in the address register 7 is input to the comparator 9. The comparator 9 compares the address data held in the address register 7 with the contents of the program counter 3, and an interrupt signal Sin is sent to the execution unit 5 by a match signal of the comparison result.
It is designed to generate t.

【0012】このようなマイクロプロセッサの実施例の
動作を説明する。
The operation of the embodiment of such a microprocessor will be described.

【0013】マイクロプロセッサ1において、実行部5
はソフトウェアの命令に従い、アドレスレジスタ7に割
り込み発生アドレスを書き込む。このアドレスレジスタ
7に書き込まれた割り込み発生アドレスは、プログラム
カウンタ3からの値と比較器9において比較される。こ
の比較器9では、一致を検出したときに、実行部5に対
して割込み信号Sint を与える。したがって、ソフトウ
エアが暴走したときでも、このアドレスレジスタ7に設
定された割り込み発生アドレスにプログラムカウンタ3
の値が達すればリセットがかかり、正常への復帰が高速
化される。
In the microprocessor 1, the execution unit 5
Writes the interrupt generation address in the address register 7 according to the software instruction. The interrupt generation address written in the address register 7 is compared with the value from the program counter 3 in the comparator 9. The comparator 9 gives an interrupt signal Sint to the execution unit 5 when a match is detected. Therefore, even when the software runs out of control, the program counter 3 is set to the interrupt generation address set in the address register 7.
When the value of reaches, the reset is applied and the return to normal is speeded up.

【0014】図2は、本発明に係るマイクロプロセッサ
の他の実施例を示すブロック図である。
FIG. 2 is a block diagram showing another embodiment of the microprocessor according to the present invention.

【0015】図2に示すマイクロプロセッサ11は、プ
ログラムカウンタ(PC)13を有する実行部15と、
二つのアドレスレジスタ17A,17Bと、比較器19
とを備えている。実行部15は、ソフトウェアの命令に
従い各種の処理を実行する。実行部15は、ソフトウェ
アの命令に従い、割り込み発生アドレスデータをアドレ
スレジスタ17Aに設定し、割り込み終了アドレスデー
タをアドレスレジスタ17Bに設定できる。プログラム
カウンタ13の出力は比較器19に接続されている。ア
ドレスレジスタ17A,17Bの出力は、比較器19に
接続されている。比較器19は、アドレスレジスタ17
A,17Bに保持されたアドレスデータの間にプログラ
ムカウンタ13の内容が入っていれば実行部15に対し
て割込み信号Sint を発生できるようにしてある。
The microprocessor 11 shown in FIG. 2 includes an execution unit 15 having a program counter (PC) 13,
Two address registers 17A and 17B and a comparator 19
It has and. The execution unit 15 executes various processes according to software instructions. The execution unit 15 can set the interrupt generation address data in the address register 17A and the interrupt end address data in the address register 17B according to the software instruction. The output of the program counter 13 is connected to the comparator 19. The outputs of the address registers 17A and 17B are connected to the comparator 19. The comparator 19 includes an address register 17
If the contents of the program counter 13 are included between the address data held in A and 17B, the interrupt signal Sint can be generated for the execution unit 15.

【0016】上述した他の実施例の作用を説明する。The operation of the other embodiment described above will be described.

【0017】マイクロプロセッサ1において、実行部5
はソフトウェアの命令に従い、アドレスレジスタ17A
に割り込み発生アドレスを書き込むとともに、アドレス
レジスタ17Bに割り込み終了アドレスを書き込む。ア
ドレスレジスタ17Aに書き込まれた割り込み発生開始
アドレスと、アドレスレジスタ17Bに書き込まれた割
り込み発生終了アドレスとは、比較器19に与えられ
る。これらアドレスは、比較器19において、プログラ
ムカウンタ13からの値と比較され、プログラムカウン
タ13からの値が割り込み発生開始アドレスと終了アド
レスの範囲内であったときに、割込み信号Sint を発生
する。したがって、ソフトウエアが暴走したときでも、
このアドレスレジスタ17A,17Bに設定されたアド
レス間にプログラムカウンタ13の値が入ればリセット
がかかり、正常への復帰が高速化される。
In the microprocessor 1, the execution unit 5
Address register 17A according to the software instruction
The interrupt generation address is written in and the interrupt end address is written in the address register 17B. The interrupt generation start address written in the address register 17A and the interrupt generation end address written in the address register 17B are given to the comparator 19. These addresses are compared with the value from the program counter 13 in the comparator 19, and when the value from the program counter 13 is within the range of the interrupt generation start address and the end address, the interrupt signal Sint is generated. Therefore, even if the software runs out of control,
If the value of the program counter 13 is entered between the addresses set in the address registers 17A and 17B, the program counter 13 is reset to speed up the return to normal.

【0018】なお、上述した他の実施例では、比較器1
9は、アドレスレジスタ17A,17Bに設定された割
込み発生アドレス,割り込み終了アドレスの間にプログ
ラムカウンタ13の値が入っていれば割込み信号Sint
を発生するようにしたが、アドレスレジスタ17A,1
7Bに設定された割込み発生アドレスと割り込み終了ア
ドレスの範囲外にプログラムカウンタ13の値が達した
ときに割込み信号Sint を発生するようにしてもよい。
このような実施例によっても、ソフトウエアが暴走した
ときでも、このアドレスレジスタ17A,17Bに設定
されたアドレスの範囲外にプログラムカウンタ13の値
が達すればリセットがかかり、正常への復帰が高速化さ
れる。
In the other embodiment described above, the comparator 1
9 is an interrupt signal Sint if the value of the program counter 13 is between the interrupt generation address and the interrupt end address set in the address registers 17A and 17B.
Is generated, the address register 17A, 1
The interrupt signal Sint may be generated when the value of the program counter 13 reaches outside the range of the interrupt generation address and the interrupt end address set in 7B.
According to such an embodiment as well, even if the software runs out of control, if the value of the program counter 13 reaches outside the range of the addresses set in the address registers 17A and 17B, the program is reset and the speed of returning to normal is increased. To be done.

【0019】[0019]

【発明の効果】以上説明したように請求項1記載の発明
によれば、マイクロプロセッサ内のプログラムカウンタ
の値がソフトウェアから指示したアドレスの値と一致し
たときに、マイクロプロセッサに対して割り込みをかけ
ることができるため、マイクロプロセッサが暴走して非
プログラム領域を実行しようとした時、割り込み処理ル
ーチンが実行され、例えばリセットを行えば直ちに復帰
ができるという効果がある。
As described above, according to the first aspect of the invention, when the value of the program counter in the microprocessor coincides with the value of the address designated by software, an interrupt is issued to the microprocessor. Therefore, when the microprocessor runs out of control and tries to execute the non-program area, the interrupt processing routine is executed, and for example, there is an effect that the reset can be immediately performed.

【0020】請求項2記載の発明によれば、マイクロプ
ロセッサ内のプログラムカウンタの値がソフトウェアか
ら指示したアドレスの範囲内を示すとき、マイクロプロ
セッサに対して割り込みをかけることができるため、マ
イクロプロセッサが暴走して非プログラム領域を実行し
ようとした時、割り込み処理ルーチンが実行され、例え
ばリセットを行えば直ちに復帰ができるという効果があ
る。
According to the second aspect of the invention, when the value of the program counter in the microprocessor indicates within the range of the address designated by software, the microprocessor can be interrupted. When an attempt is made to run out of the non-program area due to a runaway, an interrupt processing routine is executed, and for example, resetting allows immediate return.

【0021】請求項3記載の発明によれば、マイクロプ
ロセッサ内のプログラムカウンタの値がソフトウェアか
ら指示したアドレスの範囲外を示すとき、マイクロプロ
セッサに対して割り込みをかけることができるため、マ
イクロプロセッサが暴走して非プログラム領域を実行し
ようとした時、割り込み処理ルーチンが実行され、例え
ばリセットを行えば直ちに復帰ができるという効果があ
る。
According to the third aspect of the present invention, when the value of the program counter in the microprocessor indicates that the value is out of the range of the address designated by software, the microprocessor can be interrupted. When an attempt is made to run out of the non-program area due to a runaway, an interrupt processing routine is executed, and for example, resetting allows immediate return.

【0022】また、上記請求項1、2または3記載の発
明によれば、指示されるアドレスの値はソフトウェア制
御であるため、プログラム領域の異なるソフトウェアに
対しアドレスの値の設定は個別に対応でき、しかも途中
でアドレスの設定値を変更することも可能であるという
効果がある。
According to the first, second or third aspect of the present invention, since the instructed address value is controlled by software, the address value can be set individually for software in different program areas. Moreover, there is an effect that the set value of the address can be changed on the way.

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

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

【図2】本発明の他の実施例を示すブロック図である。FIG. 2 is a block diagram showing another embodiment of the present invention.

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

1 マイクロプロセッサ 3 プログラムカウンタ 5 実行部 7 アドレスレジスタ 9 比較器 11 マイクロプロセッサ 13 プログラムカウンタ 15 実行部 17A アドレスレジスタ 17B アドレスレジスタ 19 比較器 1 Microprocessor 3 Program Counter 5 Execution Unit 7 Address Register 9 Comparator 11 Microprocessor 13 Program Counter 15 Execution Unit 17A Address Register 17B Address Register 19 Comparator

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 プログラムカウンタを有し、ソフトウェ
アの命令に従い各種の処理を実行する実行部と、 この実行部からの指示によりアドレスデータを保持する
1個のアドレスレジスタと、 このアドレスレジスタに保持されたアドレスデータと前
記プログラムカウンタの内容とを比較し、その比較結果
の一致信号により上記実行部に対して割り込みを発生さ
せる比較器とを具備したことを特徴としたマイクロプロ
セッサ。
1. An execution unit having a program counter, which executes various processes in accordance with software instructions, one address register which holds address data according to an instruction from the execution unit, and an address register which is held in this address register. And a comparator which compares the address data with the contents of the program counter and generates an interrupt to the execution unit in response to a match signal of the comparison result.
【請求項2】 プログラムカウンタを有し、ソフトウェ
アの命令に従い各種の処理を実行する実行部と、 この実行部からの指示によりアドレスデータを保持する
複数のアドレスレジスタと、 これらアドレスレジスタに保持されたアドレスデータと
前記プログラムカウンタの内容とを比較し、前記プログ
ラムカウンタの内容が前記両アドレスレジスタのアドレ
スデータの範囲内である場合に割り込みを発生させる比
較器とを具備したことを特徴とするマイクロプロセッ
サ。
2. An execution unit having a program counter for executing various processes in accordance with software instructions, a plurality of address registers for holding address data according to instructions from the execution unit, and an address unit held by these address registers. And a comparator which compares address data with the contents of the program counter and generates an interrupt when the contents of the program counter are within the range of the address data of the both address registers. ..
【請求項3】 プログラムカウンタを有し、ソフトウェ
アの命令に従い各種の処理を実行する実行部と、 この実行部からの指示によりアドレスデータを保持する
複数のアドレスレジスタと、 これらアドレスレジスタに保持されたアドレスデータと
前記プログラムカウンタの内容とを比較し、前記プログ
ラムカウンタの内容が前記両アドレスレジスタのアドレ
スデータの範囲外である場合に割り込みを発生させる比
較器とを具備したことを特徴とするマイクロプロセッ
サ。
3. An execution unit having a program counter, which executes various processes in accordance with software instructions, a plurality of address registers for holding address data according to instructions from the execution unit, and an address unit held by these address registers. And a comparator which compares address data with the contents of the program counter and generates an interrupt when the contents of the program counter are out of the range of the address data of the two address registers. ..
JP3272775A 1991-10-21 1991-10-21 Microprocessor Pending JPH05108384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3272775A JPH05108384A (en) 1991-10-21 1991-10-21 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3272775A JPH05108384A (en) 1991-10-21 1991-10-21 Microprocessor

Publications (1)

Publication Number Publication Date
JPH05108384A true JPH05108384A (en) 1993-04-30

Family

ID=17518576

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3272775A Pending JPH05108384A (en) 1991-10-21 1991-10-21 Microprocessor

Country Status (1)

Country Link
JP (1) JPH05108384A (en)

Similar Documents

Publication Publication Date Title
US4763296A (en) Watchdog timer
JP2513417B2 (en) Information processing device
JPH0810437B2 (en) Guest execution control method for virtual machine system
JPH05108384A (en) Microprocessor
JPS60124746A (en) Data processing unit
JPH0573296A (en) Microcomputer
JP2758624B2 (en) Speed control method of micro program
JPS6242301B2 (en)
JP2503210B2 (en) Micro program controller
JP2695775B2 (en) How to recover from computer system malfunction
JPS63155330A (en) Microprogram controller
JP3405513B2 (en) Redundant controller for programmable controller
JPS6118045A (en) Detecting system of program runaway
JP2833259B2 (en) Program repeat control method and program repeat control device
KR950005523B1 (en) Step-run processing method of programmable logic controller
JPH06222960A (en) Cpu reset circuit
JP2998299B2 (en) Processor control unit
JPH02259845A (en) Processor
JPH05334099A (en) Write circuit for state setting register
JPH08263324A (en) Debug facilitation device
JPH05216701A (en) Recovery time adjusting circuit for input/output instruction
JPH0331940A (en) Microprogram controller
JPH0378832A (en) Data processor
JPH0452973B2 (en)
JPH05204685A (en) Electronic computer