JPH04262426A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH04262426A
JPH04262426A JP3022550A JP2255091A JPH04262426A JP H04262426 A JPH04262426 A JP H04262426A JP 3022550 A JP3022550 A JP 3022550A JP 2255091 A JP2255091 A JP 2255091A JP H04262426 A JPH04262426 A JP H04262426A
Authority
JP
Japan
Prior art keywords
program
boundary
program counter
value
register
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
JP3022550A
Other languages
Japanese (ja)
Inventor
Toshirou Harui
治居 敏朗
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 Engineering Ltd
Original Assignee
NEC Engineering Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP3022550A priority Critical patent/JPH04262426A/en
Publication of JPH04262426A publication Critical patent/JPH04262426A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To make debugging of the hardware of a microprocessor and its program by knowing the occurrence of runaway of the program and an address at which the runaway started. CONSTITUTION:In the initial state, the maximum value of the memory in the system is written in an upper boundary register 3, while in an lower boundary register 4 the minimum value of the memory in the system is written, and a compare circuit 6 is set up so as not to execute comparison with a value in a program counter 5. When starting the execution of the program, it is set so as to first write in the upper boundary register 3 the upper limit of a range that the program itself acts in the beginning and the lower limit thereof in the lower boundary register 4, followed by starting to make the compare circuit 6 carry out the comparison function. After that, the compare circuit 6 always compare the content in the program counter 5 with the contents of upper boundary and lower boundary registers 3 and 4, and when the value in the program counter 5 exceeds a range that boundary registers show, the compare circuit 6 externally informs of the situation through terminal 8 and at the same time a sequencer 7 is informed of this situation, and then stops the function of the compare circuit 6. Sequencer 7, when it is informed that the value in the program counter 5 exceeds the range, sets a predetermined specific value in the program counter 5.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はマイクロプロセッサを使
ったシステムでのプログラム開発においてデバッグを容
易にするための回路を組み込んだマイクロプロセッサに
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor incorporating a circuit for facilitating debugging during program development in a system using a microprocessor.

【0002】0002

【従来の技術】情報処理装置において開発中のシステム
をデバッグする時は、プログラムの流れを1ステップ或
いは数ステップずつ順に実行させて、ハードウェアの動
作やソフトウェアが意図した論理通りに動いているかに
ついて調査を行う。
[Background Art] When debugging a system under development in an information processing device, the flow of the program is executed one step or several steps at a time to check whether the hardware and software are working according to the intended logic. Conduct research.

【0003】この場合、ハードウェアが安定して動作を
始めた後は、ソフトウェアの論理を追いかけて行くこと
により不具合を発見することができるが、ハードウェア
が安定していない開発の初期の段階においては、ソフト
ウェアの意図した通りには動かず、実行途中からそのプ
ログラムの動作範囲外のメモリ領域でプログラムが実行
されることがある。これをプログラムの暴走と呼ぶ。
[0003] In this case, once the hardware has started operating stably, defects can be discovered by following the logic of the software, but in the early stages of development when the hardware is not stable. The software may not work as intended, and the program may be executed in a memory area outside the program's operating range midway through execution. This is called a runaway program.

【0004】このプログラムの暴走の原因を調査するこ
とは困難であり、従来は、回路の各部での動作波形を取
り、異常な動作波形を示しているものがないかどうかを
調べることにより原因追跡を行っていた。
It is difficult to investigate the cause of this program runaway, and conventionally the cause has been traced by taking the operating waveforms of each part of the circuit and checking whether there are any abnormal operating waveforms. was going on.

【0005】[0005]

【発明が解決しようとする課題】上述した従来の方法で
は、異常波形を捕らえることは偶然にしかできないので
、小型システムで最近非常に多く使われるようになった
マイクロプロセッサを使ったシステムにおいてはプロセ
ッサの内部を調査することができず、暴走の原因を突き
止めることは非常に困難なことであった。
[Problems to be Solved by the Invention] With the conventional method described above, abnormal waveforms can only be captured by chance. Unable to investigate the inside of the vehicle, it was extremely difficult to determine the cause of the rampage.

【0006】[0006]

【課題を解決するための手段】本発明のマイクロプロセ
ッサは、プログラムの実行範囲の上限を示す第1の境界
レジスタと、下限を示す第2の境界レジスタと、前記第
1,第2の境界レジスタの内容とプログラム実行アドレ
スを持つプログラムカウンタの値を比較する比較回路と
を備え、前記プログラムの実行途中に前記第1,第2の
境界レジスタで示された範囲を逸脱したとき外部にその
状態を示す信号を出力すると共に前記プログラムの実行
を中止し予め設定されている特別なプログラムに制御を
渡すことを特徴とする。
[Means for Solving the Problems] A microprocessor of the present invention includes a first boundary register indicating an upper limit of a program execution range, a second boundary register indicating a lower limit, and the first and second boundary registers. and a comparison circuit that compares the contents of the program counter with the value of the program counter having the program execution address, and when the program deviates from the range indicated by the first and second boundary registers during the execution of the program, the state is transmitted to the outside. The program is characterized in that it outputs a signal indicating the program, stops execution of the program, and passes control to a special program set in advance.

【0007】また、前記第1,第2の境界レジスタの示
す範囲を逸脱したとき、逸脱する直前の前記プログラム
カウンタの内容を待避するためのレジスタを有している
[0007] Furthermore, the program counter includes a register for saving the contents of the program counter immediately before the deviation from the range indicated by the first and second boundary registers.

【0008】[0008]

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

【0009】図1は本発明のマイクロプロセッサの第1
の実施例を示すブロック図である。同図においてマイク
ロプロセッサはマイクロプロセッサ内での演算実行など
に使われる複数のレジスタから構成されるレジスタファ
イル1と、演算を実行する演算回路2と、プログラムの
上限値を持つ上限境界レジスタ3と、プログラムの下限
値を持つ下限境界レジスタ4と、プログラムカウン5と
、プログラムカウンタ5の値と上限,下限境界レジスタ
3,4の値を比較する比較回路6と、プログラムの実行
順を制御するシーケンサ7と、プログラムが境界を越し
たことを外部に伝えるための端子8と、マイクロプロセ
ッサ内でデータを伝えるためのローカルデータバス11
とを備えている。
FIG. 1 shows a first diagram of a microprocessor according to the present invention.
It is a block diagram showing an example of. In the figure, the microprocessor includes a register file 1 consisting of a plurality of registers used for executing operations within the microprocessor, an arithmetic circuit 2 for executing operations, and an upper limit boundary register 3 having the upper limit value of the program. A lower limit boundary register 4 having the lower limit value of the program, a program counter 5, a comparison circuit 6 that compares the value of the program counter 5 with the values of the upper and lower limit boundary registers 3 and 4, and a sequencer 7 that controls the program execution order. , a terminal 8 for informing the outside that the program has crossed the boundary, and a local data bus 11 for transmitting data within the microprocessor.
It is equipped with

【0010】次に、本実施例のマイクロプロセッサを使
ってデバッグする時の手法について説明する。初期状態
において、上限境界レジスタ3にはシステム内のメモリ
の最大値が、また下限境界レジスタ4にはシステム内の
メモリの最小値が書き込まれている。また比較回路6は
プログラムカウンタ5の値との比較を実行しないように
設定されている。
Next, a method for debugging using the microprocessor of this embodiment will be explained. In the initial state, the maximum memory value in the system is written in the upper boundary register 3, and the minimum memory value in the system is written in the lower boundary register 4. Furthermore, the comparison circuit 6 is set not to perform comparison with the value of the program counter 5.

【0011】実行を開始するとき、プログラムは最初に
自身の動作する範囲の上限を上限境界レジスタ3に、下
限を下限境界レジスタ4に書き込んだ後、比較回路6に
よる比較機能を開始するように設定する。この設定が実
施された後、比較回路6は常時プログラムカウンタ5と
上限,下限境界レジスタ3,4の内容とを比較する。プ
ログラムカウンタ5の値が境界レジスタの示す範囲を越
えたとき、比較回路6は端子8を通して外部に状況を知
らせると同時にシーケンサ7にこの状況を知らせた後、
比較回路6の機能を停止させる。シーケンサ7は境界を
越えたことが通知されたとき予め定められている特別な
値をプログラムカウンタ5に設定し、その後は特別なプ
ログラムの実行が開始される。
When starting execution, the program first writes the upper limit of its operating range to the upper limit boundary register 3 and the lower limit to the lower limit boundary register 4, and then sets the comparison circuit 6 to start the comparison function. do. After this setting is performed, the comparator circuit 6 constantly compares the program counter 5 with the contents of the upper and lower boundary registers 3 and 4. When the value of the program counter 5 exceeds the range indicated by the boundary register, the comparator circuit 6 notifies the outside of the situation through the terminal 8, and at the same time notifies the sequencer 7 of this situation.
The function of the comparator circuit 6 is stopped. When the sequencer 7 is notified that the boundary has been crossed, it sets a predetermined special value in the program counter 5, and thereafter starts executing the special program.

【0012】図2は本発明のマイクロプロセッサの第2
の実施例を示すブロック図である。同図において、第2
の実施例は第1の実施例のマイクロプロセッサにプログ
ラムカウンタ5の内容を常時複写して待避している待避
レジスタ12を付加したものである。
FIG. 2 shows the second microprocessor of the present invention.
It is a block diagram showing an example of. In the same figure, the second
This embodiment is obtained by adding a save register 12 that constantly copies and saves the contents of the program counter 5 to the microprocessor of the first embodiment.

【0013】本実施例のマイクロプロセッサの動作は第
1の実施例のマイクロプロセッサと同じである。ただ、
本実施例においては、プログラムカウンタ5の値は上限
,下限境界レジスタ3,4に境界値が設定され、比較が
実行されると同時に待避レジスタ12に待避が開始され
る。また、プログラムカウンタ5の値が境界を越えたと
き待避が停止される。このため、待避レジスタ12の内
容には境界を越える直前の値が保持される。従って、境
界を越えたとき実行される特別なプログラムにより、こ
の待避レジスタ12の内容を調べれば、プログラムのど
の番地から暴走を始めたかを知ることができる。
The operation of the microprocessor of this embodiment is the same as that of the first embodiment. just,
In this embodiment, boundary values are set for the value of the program counter 5 in the upper and lower boundary registers 3 and 4, and saving in the saving register 12 is started at the same time as the comparison is executed. Further, when the value of the program counter 5 exceeds the boundary, saving is stopped. Therefore, the content of the save register 12 retains the value immediately before the boundary is crossed. Therefore, by checking the contents of this save register 12 using a special program that is executed when the boundary is crossed, it is possible to know from which address in the program the runaway started.

【0014】[0014]

【発明の効果】以上説明したように本発明は、動作する
プログラムの範囲を示すレジスタを設け、このレジスタ
の内容とプログラムカウンタの内容を常時比較するよう
にし、プログラムの動作範囲が設定された範囲を越えた
とき外部からそれを知ることができるようにしたので、
プログラムの暴走を知ることができる。
As explained above, the present invention provides a register that indicates the range of an operating program, and constantly compares the contents of this register with the contents of the program counter. We made it possible to know from the outside when the limit has been exceeded.
You can find out if the program is running out of control.

【0015】また、この時のプログラムカウンタの値が
保持されているため、暴走を始めた番地を容易に知るこ
とができるので、ハードウェアとプログラムのデバッグ
が容易になるという効果がある。
Furthermore, since the value of the program counter at this time is held, the address at which the runaway started can be easily known, which has the effect of facilitating debugging of the hardware and program.

【図面の簡単な説明】[Brief explanation of the drawing]

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

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

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

1    レジスタファイル 2    演算回路 3    上限境界レジスタ 4    下限境界レジスタ 5    プログラムカウンタ 6    比較回路 7    シーケンサ 8    端子 11    ローカルデータバス 12    待避レジスタ 1 Register file 2 Arithmetic circuit 3 Upper bound register 4 Lower boundary register 5 Program counter 6 Comparison circuit 7 Sequencer 8 Terminal 11 Local data bus 12 Save register

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】  プログラムの実行範囲の上限を示す第
1の境界レジスタと、下限を示す第2の境界レジスタと
、前記第1,第2の境界レジスタの内容とプログラム実
行アドレスを持つプログラムカウンタの値を比較する比
較回路とを備え、前記プログラムの実行途中に前記第1
,第2の境界レジスタで示された範囲を逸脱したとき外
部にその状態を示す信号を出力すると共に前記プログラ
ムの実行を中止し予め設定されている特別なプログラム
に制御を渡すことを特徴とするマイクロプロセッサ。
1. A program counter comprising: a first boundary register indicating an upper limit of a program execution range; a second boundary register indicating a lower limit; and a program counter having contents of the first and second boundary registers and a program execution address. and a comparison circuit for comparing values, and during execution of the program, the first
, when the range indicated by the second boundary register is exceeded, a signal indicating the state is outputted to the outside, the execution of the program is stopped, and control is passed to a special program set in advance. microprocessor.
【請求項2】  前記第1,第2の境界レジスタの示す
範囲を逸脱したとき、逸脱する直前の前記プログラムカ
ウンタの内容を待避するためのレジスタを有することを
特徴とする請求項1記載のマイクロプロセッサ。
2. The microcontroller according to claim 1, further comprising a register for saving the contents of the program counter immediately before the deviation from the range indicated by the first and second boundary registers. processor.
JP3022550A 1991-02-18 1991-02-18 Microprocessor Pending JPH04262426A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3022550A JPH04262426A (en) 1991-02-18 1991-02-18 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3022550A JPH04262426A (en) 1991-02-18 1991-02-18 Microprocessor

Publications (1)

Publication Number Publication Date
JPH04262426A true JPH04262426A (en) 1992-09-17

Family

ID=12085953

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3022550A Pending JPH04262426A (en) 1991-02-18 1991-02-18 Microprocessor

Country Status (1)

Country Link
JP (1) JPH04262426A (en)

Similar Documents

Publication Publication Date Title
EP0702297A1 (en) A data processor with breakpoint circuit and method therefor
EP0638864B1 (en) Development support system for microcomputer with internal cache
US5257269A (en) Error controller for use in debugging microprocessor
JPH04262426A (en) Microprocessor
JPH02264340A (en) Microprocessor
JPH0581087A (en) Processor monitoring system
JPH074669Y2 (en) Interrupt request processing circuit
JP2754899B2 (en) Return address monitoring circuit of debug device
JPS63143636A (en) Break point controller
JPH04310138A (en) Debugging method for data transmitter
JP2624798B2 (en) Processing unit debugging mechanism
JPS6034132B2 (en) programmable controller
JPH0830485A (en) Debugging device
JPH01207837A (en) System diagnostic system
JPH04330549A (en) Controller
JPH02264339A (en) Information processor
JPS6091458A (en) Program debug device of microprocessor
JPH01161544A (en) Program tracing system
JPH01114945A (en) Tracing system for data processor
JPH02244232A (en) Information processor
JPS63124143A (en) Information processor
JPH05128281A (en) Microcomputer
JPH0635760A (en) Buffer device with tracing function
JPH0782447B2 (en) DMA data transfer control device
JPH0944374A (en) Program debugging device