JPH04344947A - Program controller - Google Patents
Program controllerInfo
- Publication number
- JPH04344947A JPH04344947A JP3118158A JP11815891A JPH04344947A JP H04344947 A JPH04344947 A JP H04344947A JP 3118158 A JP3118158 A JP 3118158A JP 11815891 A JP11815891 A JP 11815891A JP H04344947 A JPH04344947 A JP H04344947A
- Authority
- JP
- Japan
- Prior art keywords
- data
- instruction
- register
- address
- program
- 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
Links
- 238000001514 detection method Methods 0.000 abstract description 8
- 239000013589 supplement Substances 0.000 abstract 1
- 230000006870 function Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
Description
【0001】0001
【産業上の利用分野】本発明はプログラム制御装置に関
し、特にデバッグ機能を有するプログラム制御装置に関
する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program control device, and more particularly to a program control device having a debug function.
【0002】0002
【従来の技術】一般にプログラム制御装置では、プログ
ラムのデバッグを行い易くするために、プログラムが格
納されている制御記憶部の中の予め任意に指定したアド
レスでプログラムを実行を一時停止できるようにした機
能を備えている。2. Description of the Related Art Generally, in a program control device, in order to facilitate debugging of a program, execution of a program can be temporarily stopped at a predetermined address in a control storage unit where the program is stored. It has functions.
【0003】すなわち、プログラム制御装置は制御記憶
部に供給する制御記憶アドレス(アドレスデータ)と比
較するためのアドレスデータを格納する比較アドレスレ
ジスタを備え、プログラムの実行毎にこの比較アドレス
レジスタの内容と制御記憶部に供給する制御記憶アドレ
スとを比較して、両者の一致が検出された場合にプログ
ラムの実行を停止できるようにした機能を備えている。
デバッグに際しては、プログラムの実行を一時停止すべ
き命令の格納されている制御記憶アドレスを、例えばコ
ンソール等から入力し、比較アドレスレジスタに格納し
てからプログラムの実行を開始させる。そして、上述の
機能によりプログラムが指定された命令アドレス(制御
記憶アドレス)で停止すると、この状態で各種のレジス
タの内容やその他の内部状態等をチェックすることによ
り、プログラムによる処理がここまで所望通りに動作し
ているか否かを確認する。これが済むと、必要に応じて
再び次の停止すべきアドレスを指定して現在の停止して
いるアドレス(またはその他のアドレス)からプログラ
ムを再び開始する。That is, the program control device is equipped with a comparison address register that stores address data for comparison with a control storage address (address data) supplied to the control storage section, and the contents of this comparison address register and the contents of the comparison address register are updated each time a program is executed. It has a function of comparing the control memory address supplied to the control memory unit and stopping the execution of the program if a match is detected between the two. When debugging, a control storage address in which an instruction to temporarily stop program execution is stored is input from, for example, a console, stored in a comparison address register, and then program execution is started. When the program stops at the specified instruction address (control memory address) using the above function, by checking the contents of various registers and other internal states in this state, the processing by the program is performed as desired. Check whether it is working. Once this is done, the next address to stop is specified again if necessary, and the program is restarted from the current stopped address (or any other address).
【0004】0004
【発明が解決しようとする課題】上述したプログラム制
御装置では、ある命令アドレスの時点であるレジスタが
ある値であるというような条件下での任意ルーチンのデ
バッグを行う場合には、予め何回目になるかが分かって
いれば特定のルーチンのアドレスで停止可能であるが、
一般にプログラムはソフトウェア命令の順番あるいは外
部要因(入出力装置からの割り込み等)により複雑な動
作をするために予測が不可能であり、実際はそのような
条件での停止はできなかった。[Problem to be Solved by the Invention] In the program control device described above, when debugging an arbitrary routine under the condition that a certain register has a certain value at the time of a certain instruction address, it is necessary to It is possible to stop at a specific routine address if you know what will happen, but
In general, programs cannot be predicted because they perform complex operations depending on the order of software instructions or external factors (interrupts from input/output devices, etc.), and in reality, programs cannot be stopped under such conditions.
【0005】この問題を解決するために、特定ルーチン
中にあるレジスタがある値になったらユニークなアドレ
スに分岐(あるいはプログラムを停止させるような命令
実行)するようなデバッグ専用のルーチンを追加するこ
とが考えられる。しかしながら、プログラム実行の全て
のタイミングで平等に行われるものではなく、最小限必
要と思われる箇所にその都度デバッグ専用ルーチンを追
加する必要がある。To solve this problem, add a debugging routine that branches to a unique address (or executes an instruction that stops the program) when a register in a specific routine reaches a certain value. is possible. However, this is not done equally at all timings of program execution, and it is necessary to add a dedicated debugging routine each time where it is considered to be the minimum necessary.
【0006】本発明の目的は、デバッグ専用ルーチンの
追加を不要とするとともに、プログラムの実行の全ての
タイミングで平等にプログラムの停止が行えるプログラ
ム制御装置を提供することにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a program control device that does not require the addition of a debugging routine and can equally stop a program at all timings of program execution.
【0007】[0007]
【課題を解決するための手段】本発明のプログラム制御
装置は、プログラムを格納する制御記憶手段から読み出
された前記プログラムの第1の命令を格納する命令レジ
スタと、比較対象となるデータを内部バスに出力するた
めの第2の命令を格納するバス出力命令レジスタと、前
記内部バス上のデータと比較するためのデータを格納す
る比較データレジスタと、この比較データレジスタから
のデータと前記内部バス上のデータとを比較するデータ
比較手段と、前記命令レジスタ及び前記バス出力命令レ
ジスタからの前記第1の命令及び前記第2の命令のいず
れかを選択して命令実行手段に供給する選択手段と、前
記制御記憶手段に前記命令実行手段から供給される制御
記憶アドレスデータと比較するためのアドレスデータを
格納する比較アドレスレジスタと、前記制御記憶アドレ
スデータと前記比較アドレスレジスタからの前記アドレ
スデータとを比較するアドレス比較手段と、前記バス出
力命令レジスタに格納された前記第2の命令が前記命令
実行手段に供給され前記データ比較手段がデータとの一
致を検出し且つ前記アドレス比較手段が前記制御記憶ア
ドレスデータと前記アドレスデータとの一致を検出した
場合に前記命令実行手段における命令実行を停止させる
制御手段とを備える。[Means for Solving the Problems] The program control device of the present invention includes an instruction register for storing a first instruction of a program read from a control storage means for storing the program, and an internal register for storing data to be compared. a bus output instruction register that stores a second instruction for outputting to the bus; a comparison data register that stores data for comparison with data on the internal bus; and a bus output instruction register that stores data for comparison with data on the internal bus; data comparing means for comparing the above data with the above data; and selecting means for selecting either the first instruction or the second instruction from the instruction register and the bus output instruction register and supplying the selected one to the instruction execution means. , a comparison address register for storing address data for comparison with the control storage address data supplied from the instruction execution means in the control storage means; and a comparison address register for storing the control storage address data and the address data from the comparison address register. The address comparison means to be compared and the second instruction stored in the bus output instruction register are supplied to the instruction execution means, the data comparison means detects a match with the data, and the address comparison means and control means for stopping instruction execution in the instruction execution means when a match between address data and the address data is detected.
【0008】[0008]
【実施例】次に、本発明の実施例について図面を参照し
て説明する。Embodiments Next, embodiments of the present invention will be described with reference to the drawings.
【0009】本発明の一実施例を示す図1を参照すると
、プログラム制御装置は、制御記憶1、命令レジスタ2
、バス出力命令レジスタ3、選択回路4、実行制御部5
、フリップフロップ(以下、F/Fと略記する)6、比
較データレジスタ7、データ一致検出回路8、アンドゲ
ート9、比較アドレスレジスタ10、アドレス一致検出
回路11及びアンドゲート12を有している。Referring to FIG. 1 showing one embodiment of the present invention, a program control device includes a control memory 1, an instruction register 2,
, bus output instruction register 3, selection circuit 4, execution control unit 5
, a flip-flop (hereinafter abbreviated as F/F) 6, a comparison data register 7, a data coincidence detection circuit 8, an AND gate 9, a comparison address register 10, an address coincidence detection circuit 11, and an AND gate 12.
【0010】このプログラム制御装置において、制御記
憶部1に格納されたプログラムの命令は、実行制御部5
で生成され信号線50によって供給される命令アドレス
によって命令レジスタ2に読み出され、選択回路4で選
択されて実行制御部5に供給され実行される。この場合
、F/F6の出力は論理“0”となっており、選択回路
4は命令レジスタ2を選択している。F/F6は命令実
行毎に値が反転する機能を持ち、命令レジスタ2内の命
令を実行後は論理“1”となる。これにより、選択回路
4はバス出力命令レジスタ3を選択し、命令レジスタ以
外は図示してないがプログラム制御装置内で使用されて
いる任意のレジスタの内容を内部バスに出力するための
命令が実行制御部5に供給される。バス出力データは信
号線80を介してデータ一致検出回路8に供給され、比
較データレジスタ7のデータと比較される。一方、命令
レジスタ2の内容は、F/F6の出力が論理“1”の場
合に保持され、論理“0”の場合のみ制御記憶部1から
の命令が格納される。In this program control device, program instructions stored in the control storage unit 1 are stored in the execution control unit 5.
The command is read out to the command register 2 according to the command address generated by the command address and supplied through the signal line 50, selected by the selection circuit 4, and supplied to the execution control section 5 for execution. In this case, the output of the F/F 6 is logic "0", and the selection circuit 4 selects the instruction register 2. The F/F 6 has a function of inverting its value every time an instruction is executed, and becomes logic "1" after executing the instruction in the instruction register 2. As a result, the selection circuit 4 selects the bus output instruction register 3, and executes an instruction to output the contents of any register used in the program control device to the internal bus, although other than the instruction register is not shown. The signal is supplied to the control unit 5. The bus output data is supplied to the data match detection circuit 8 via the signal line 80 and compared with the data in the comparison data register 7. On the other hand, the contents of the instruction register 2 are held when the output of the F/F 6 is logic "1", and the instruction from the control storage unit 1 is stored only when the output is logic "0".
【0011】以上の動作を図2に示すタイミングチャー
トを参照しながら説明する。図2のクロックはプログラ
ム制御装置内で使用されている実行処理用のクロックで
あり本図の場合F/F6の動作切替の駆動を行っている
。F/F6の出力が論理“0”であり、且つ命令レジス
タ2に命令Aが格納された状態では、実行制御部5へは
命令Aが供給されて実行される。その結果、命令レジス
タ2には、次に実行すべき命令Bが制御記憶部1から読
み出されて格納される。また、これと同時に、F/F6
の出力が論理“1”に反転することにより、次に実行制
御部5へはバス出力命令レジスタ3に格納されていた命
令であるバス出力命令Zが供給されて実行される。以後
、同様な動作が繰り返されることによって、通常のプロ
グラムのA→B→Cの実行が、それぞれの命令の間にバ
ス出力命令Zが挿入されてA→Z→B→Z→Cの様な実
行が実現される。但し、バス出力命令Zは任意のレジス
タをバス出力するのみで一切のハードウェア状態は変え
ないものである。The above operation will be explained with reference to the timing chart shown in FIG. The clock in FIG. 2 is a clock for execution processing used within the program control device, and in the case of this figure, drives the operation switching of the F/F 6. When the output of the F/F 6 is logic "0" and the instruction A is stored in the instruction register 2, the instruction A is supplied to the execution control unit 5 and executed. As a result, the next instruction B to be executed is read from the control storage section 1 and stored in the instruction register 2. Also, at the same time, F/F6
By inverting the output to logic "1", the bus output instruction Z, which is the instruction stored in the bus output instruction register 3, is then supplied to the execution control unit 5 and executed. Thereafter, by repeating the same operation, the normal program A → B → C execution will be changed to A → Z → B → Z → C with a bus output instruction Z inserted between each instruction. Execution is realized. However, the bus output command Z only outputs an arbitrary register to the bus and does not change any hardware state.
【0012】以上の動作中、データ一致検出回路8はバ
ス出力と比較データレジスタ7のデータ出力とを比較す
るが、さらにアンドゲート9によりF/F6の出力との
論理積がとられるため、信号線90にはバス出力命令Z
によるバス出力と比較データレジスタ7のデータ出力と
が一致した場合にのみ論理“1”が出力される。During the above operation, the data coincidence detection circuit 8 compares the bus output with the data output of the comparison data register 7, and since the AND gate 9 performs a logical product with the output of the F/F 6, the signal Line 90 has a bus output command Z
A logic "1" is output only when the bus output from the comparison data register 7 matches the data output from the comparison data register 7.
【0013】また、アドレス一致検出回路11は信号線
50によって供給される命令アドレスと比較アドレスレ
ジスタ10のデータとを比較するが、さらにアンドゲー
ト12により信号線90の論理信号との論理積がとられ
るため、信号線120にはバス出力命令Zによるバス出
力と比較データレジスタ7とが一致し、且つ命令アドレ
スと比較アドレスレジスタ10のデータとが一致した場
合にのみ論理“1”が出力される。この論理“1”信号
は実行制御部5にプログラム停止信号として供給される
。Further, the address match detection circuit 11 compares the instruction address supplied via the signal line 50 with the data in the comparison address register 10, and furthermore, the AND gate 12 performs a logical product with the logic signal on the signal line 90. Therefore, a logic "1" is output to the signal line 120 only when the bus output by the bus output instruction Z and the comparison data register 7 match, and the instruction address and the data of the comparison address register 10 match. . This logic "1" signal is supplied to the execution control section 5 as a program stop signal.
【0014】なお、バス出力命令レジスタ3、比較デー
タレジスタ7及び比較アドレスレジスタ10には、予め
コンソール(図示省略)から比較対象レジスタのバス出
力を指示する命令、期待データ及び期待アドレスが供給
されて格納される。Note that the bus output command register 3, comparison data register 7, and comparison address register 10 are supplied in advance with an instruction to instruct bus output of the register to be compared, expected data, and expected address from a console (not shown). Stored.
【0015】[0015]
【発明の効果】以上説明したように本発明によれば、プ
ログラムのそれぞれの命令実行の間にハードウェア動作
として任意に指定した命令アドレスで任意に指定したレ
ジスタが期待する値になったか否かをチェックし、期待
値になった場合にプログラムを停止することにより、デ
バッグ専用ルーチンの追加を不要とし、さらにプログラ
ムの実行の全てのタイミングで平等にプログラムの停止
が行える。この結果、デバッグの効率化が達成される。[Effects of the Invention] As explained above, according to the present invention, during the execution of each instruction of a program, it is determined as a hardware operation whether a register arbitrarily specified by an arbitrarily specified instruction address has reached the expected value. By checking this and stopping the program when the expected value is reached, there is no need to add a dedicated debugging routine, and the program can be stopped equally at all timings of program execution. As a result, debugging becomes more efficient.
【図1】本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing one embodiment of the present invention.
【図2】本実施例のプログラム制御装置における動作の
一部を示すタイミングチャートである。FIG. 2 is a timing chart showing a part of the operation in the program control device of this embodiment.
1 制御記憶部
2 命令レジスタ
3 バス出力命令レジスタ
4 選択回路
5 実行制御部
6 フリップフロップ(F/F)7 比較
データレジスタ
8 データ一致検出回路
9 アンドゲート
10 比較アドレスレジスタ
11 アドレス一致検出回路
12 アンドゲート1 Control storage unit 2 Instruction register 3 Bus output instruction register 4 Selection circuit 5 Execution control unit 6 Flip-flop (F/F) 7 Comparison data register 8 Data match detection circuit 9 AND gate 10 Comparison address register 11 Address match detection circuit 12 AND Gate
Claims (1)
ら読み出された前記プログラムの第1の命令を格納する
命令レジスタと、比較対象となるデータを内部バスに出
力するための第2の命令を格納するバス出力命令レジス
タと、前記内部バス上のデータと比較するためのデータ
を格納する比較データレジスタと、この比較データレジ
スタからのデータと前記内部バス上のデータとを比較す
るデータ比較手段と、前記命令レジスタ及び前記バス出
力命令レジスタからの前記第1の命令及び前記第2の命
令のいずれかを選択して命令実行手段に供給する選択手
段と、前記制御記憶手段に前記命令実行手段から供給さ
れる制御記憶アドレスデータと比較するためのアドレス
データを格納する比較アドレスレジスタと、前記制御記
憶アドレスデータと前記比較アドレスレジスタからの前
記アドレスデータとを比較するアドレス比較手段と、前
記バス出力命令レジスタに格納された前記第2の命令が
前記命令実行手段に供給され前記データ比較手段がデー
タ一致を検出し且つ前記アドレス比較手段が前記制御記
憶アドレスデータと前記アドレスデータとの一致を検出
した場合に前記命令実行手段における命令実行を停止さ
せる制御手段と、を備えることを特徴とするプログラム
制御装置。1. An instruction register for storing a first instruction of the program read from a control storage means for storing the program, and a second instruction for outputting data to be compared to an internal bus. a bus output command register for comparing data on the internal bus, a comparison data register for storing data to be compared with data on the internal bus, and data comparison means for comparing data from the comparison data register with data on the internal bus; selecting means for selecting either the first instruction or the second instruction from the instruction register and the bus output instruction register and supplying the selected instruction to the instruction execution means; and supplying the instruction execution means to the control storage means. a comparison address register for storing address data to be compared with the control storage address data to be compared; address comparison means for comparing the control storage address data and the address data from the comparison address register; and the bus output instruction register. when the second instruction stored in the second instruction is supplied to the instruction execution means, the data comparison means detects a data match, and the address comparison means detects a match between the control storage address data and the address data; A program control device comprising: control means for stopping instruction execution in the instruction execution means.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3118158A JPH04344947A (en) | 1991-05-23 | 1991-05-23 | Program controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3118158A JPH04344947A (en) | 1991-05-23 | 1991-05-23 | Program controller |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH04344947A true JPH04344947A (en) | 1992-12-01 |
Family
ID=14729539
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3118158A Pending JPH04344947A (en) | 1991-05-23 | 1991-05-23 | Program controller |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH04344947A (en) |
-
1991
- 1991-05-23 JP JP3118158A patent/JPH04344947A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4870562A (en) | Microcomputer capable of accessing internal memory at a desired variable access time | |
| US4987537A (en) | Computer capable of accessing a memory by supplying an address having a length shorter than that of a required address for the memory | |
| US5361348A (en) | Debug circuit of a signal processor | |
| US4747045A (en) | Information processing apparatus having an instruction prefetch circuit | |
| JPH0447856B2 (en) | ||
| US6877113B2 (en) | Break determining circuit for a debugging support unit in a semiconductor integrated circuit | |
| JPH1078887A (en) | Debug system and debugging method | |
| US20050192791A1 (en) | Method for emulating an integrated circuit and semiconductor chip for practicing the method | |
| JPS62197834A (en) | Microprogram controller | |
| JPH04230533A (en) | Interruption control circuit | |
| JPS63197247A (en) | Microprogram controller | |
| JP3405513B2 (en) | Redundant controller for programmable controller | |
| JPS63197246A (en) | Microprogram controller | |
| JPH09146662A (en) | Suspend / resume method and computer system | |
| JPH05108550A (en) | Central processing unit | |
| JP3366235B2 (en) | Data read control device | |
| JPH02103643A (en) | Interruption generation circuit for debug | |
| JPH09319592A (en) | Microcomputer | |
| JPH02264339A (en) | information processing equipment | |
| JPH04181334A (en) | Interruption generating circuit for debugging | |
| JPS63197245A (en) | Microprogram controller | |
| JPH0944374A (en) | Program debugging device | |
| JPH09160786A (en) | Microprocessor | |
| JPH0683986A (en) | Single chip microcomputer | |
| JPH01276335A (en) | Microprogram controller |