JPH04314139A - Debugging device - Google Patents

Debugging device

Info

Publication number
JPH04314139A
JPH04314139A JP3106756A JP10675691A JPH04314139A JP H04314139 A JPH04314139 A JP H04314139A JP 3106756 A JP3106756 A JP 3106756A JP 10675691 A JP10675691 A JP 10675691A JP H04314139 A JPH04314139 A JP H04314139A
Authority
JP
Japan
Prior art keywords
memory
patch
program
user program
bus
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
JP3106756A
Other languages
Japanese (ja)
Inventor
Atsushi Furuido
古井戸 敦
Akira Sato
亮 佐藤
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Original Assignee
Hitachi Microcomputer System Ltd
Hitachi 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 Hitachi Microcomputer System Ltd, Hitachi Ltd filed Critical Hitachi Microcomputer System Ltd
Priority to JP3106756A priority Critical patent/JPH04314139A/en
Publication of JPH04314139A publication Critical patent/JPH04314139A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Stored Programmes (AREA)

Abstract

PURPOSE:To realize the partial change of the flow of a program or processing contents irrespective of the presence of a free area of a user program and besides, without correcting directly an original program. CONSTITUTION:By providing a patch memory 42 to which a patch program related to the correction of the user program can be written and a trigger detection circuit 39 to detect that the execution of the user program reaches a prescribed patch designating place, and further, providing a bus control part 40 or multiplexers 34 to 37 as a means to enable the execution of the patch program by switching space from a lent memory 43 to the patch memory 42 based on the output of this detection circuit 39, the patch program is made capable of being written in the patch memory 42 under the executing state of the user program, and when the execution of the user program reaches the prescribed patch designating place, the patch program in a second memory is executed.

Description

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

【0001】0001

【産業上の利用分野】本発明は、デバッグ対象とされる
プログラムのデバッグを可能とするデバッグ装置に関し
、例えばインサーキット・エミュレータに適用して有効
な技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging device that enables debugging of a program to be debugged, and relates to a technique that is effective when applied to, for example, an in-circuit emulator.

【0002】0002

【従来の技術】マイクロプロセッサ応用機器の開発にお
いて、その応用システムのデバッグやシステムの詳細な
評価を行うため、インサーキット・エミュレータが使用
されている。斯るインサーキット・エミュレータは、ソ
フトウェア開発用親計算機(ホストコンピュータ)など
のシステム開発装置と、開発中の応用機器との間に接続
され、その応用機器に含まれるマイクロプロセッサ(タ
ーゲットマイクロプロセッサ)の機能を代行する一方で
デバッガとしての機能を持ち、詳細なシステムデバッグ
を支援する。このようなインサーキット・エミュレータ
においては、応用機器側のハードウェアおよびソフトウ
ェアの評価を可能とする手段としてのブレーク機能、ト
レース機能の他に、ユーザプログラムのエディト機能が
ある。
2. Description of the Related Art In the development of microprocessor application equipment, in-circuit emulators are used to debug the application system and perform detailed evaluation of the system. Such an in-circuit emulator is connected between a system development device such as a software development parent computer (host computer) and an application device under development, and is used to control the microprocessor (target microprocessor) included in the application device. While acting as a debugger, it supports detailed system debugging. Such an in-circuit emulator has a user program editing function in addition to a break function and a trace function as a means for evaluating the hardware and software on the application equipment side.

【0003】尚、インサーキット・エミュレータについ
て記載された文献の例としては、昭和63年10月1日
に日立マイクロプロセッサエンジニアリング株式会社よ
り発行された「日立マイコン技報(第2巻、第2号)」
がある。
[0003] An example of a document describing in-circuit emulators is "Hitachi Microcomputer Technical Report (Vol. 2, No. 2)," published by Hitachi Microprocessor Engineering Co., Ltd. on October 1, 1985. )”
There is.

【0004】0004

【発明が解決しようとする課題】上記機能を駆使したシ
ステムデバッグにおいてパッチを当てる場合、プログラ
ムを修正する必要がある。プログラムの一般的な修正方
法としては、ユーザプログラムを一旦停止した後にユー
ザプログラム領域内の空きエリアを見つけ、そこに修正
プログラムを書き込みプログラムの流れを修正プログラ
ム側に変更するために元のプログラム中の一部の命令を
、ジャンプ命令やジャンプサブルーチン命令等に書き換
える必要があり、それについて本発明者が検討したとこ
ろ、エミュレーション動作の実行中に待ち状態を作って
プログラム修正を行う方式では、モータの回転制御のよ
うに厳密な時間管理の下でプログラムの実行が必要とさ
れるような応用機器においては、斯る待つ状態において
プログラムの実行が途切れることによりそのプログラム
によって制御されるべきサーボモータなどの機器が制御
状態を脱して暴走する可能性があることが判明した。 また、修正用プログラムを入れるための空き領域が少な
い場合には、上記修正手段も不可能となり元のプログラ
ムを直接修正し、再コンパイルする必要があり、デバッ
グ効率が落ちることが明らかにされた。
[Problem to be Solved by the Invention] When applying a patch in system debugging that makes full use of the above functions, it is necessary to modify the program. A general method for modifying a program is to temporarily stop the user program, find an empty area in the user program area, write the modified program there, and change the flow of the program to the modified program side. It is necessary to rewrite some instructions to jump instructions, jump subroutine instructions, etc., and the inventor studied this and found that if the program is modified by creating a wait state while the emulation operation is being executed, the motor rotation In application equipment that requires the execution of a program under strict time management, such as control equipment, if the execution of the program is interrupted in such a waiting state, equipment such as servo motors that should be controlled by the program It was discovered that there is a possibility that the robot could escape from its control state and go out of control. Furthermore, it has been revealed that when there is little free space for storing a modification program, the above modification method becomes impossible, and the original program must be directly modified and recompiled, resulting in a decrease in debugging efficiency.

【0005】本発明の目的は、ユーザプログラムの空き
エリアの有無に関係なく、また、元のプログラムを直接
修正することなく、プログラムの流れや処理内容の一部
変更を可能とする技術を提供することにあり、また、本
発明の別の目的は、そのようなパッチプログラムをリア
ルタイムで挿入実行可能な技術を提供することにある。
[0005] An object of the present invention is to provide a technology that makes it possible to partially change the program flow and processing contents, regardless of whether or not there is a free area in the user program, and without directly modifying the original program. In particular, another object of the present invention is to provide a technique that allows such patch programs to be inserted and executed in real time.

【0006】本発明の前記ならびにそのほかの目的と新
規な特徴は、本明細書の記述および添付図面から明らか
になるであろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0007】[0007]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
[Means for Solving the Problems] A brief overview of typical inventions disclosed in this application is as follows.

【0008】すなわち、デバッグ対象とされるユーザプ
ログラムを格納するための第1メモリを含んでデバッグ
装置が形成されるとき、上記ユーザプログラムの実行状
態で、当該ユーザプログラムの修正に係るパッチプログ
ラムを書込み可能な第2メモリと、上記ユーザプログラ
ムの実行が所定のパッチ指定箇所に到達したことを検出
する検出手段と、この検出手段の検出結果に基づいて上
記第1メモリから上記第2メモリへの空間切換えを行う
ことによって上記第2メモリ内のパッチプログラムの実
行を可能とする空間切換え手段とを含んでデバッグ装置
を構成するものである。さらに具体的な態様では、上記
マスタマイクロプロセッサのバスと上記スレーブマイク
ロプロセッサのバスとに上記第1メモリ及び第2メモリ
を選択的に結合させるためのマルチプレクサと、上記マ
スタ側マルチプレクサ及びスレーブ側マルチプレクサの
選択動作を制御する制御部とを含んで上記空間切換え手
段を構成することができる。そしてこのとき、上記マル
チプレクサを介して上記第1メモリが上記スレーブマイ
クロプロセッサのバスに結合されて上記ユーザプログラ
ムのエミュレーション動作が継続されている状態で、上
記第2メモリを上記マスタマイクロプロセッサのバスに
結合させることにより、上記パッチプログラムの上記第
2メモリへの書込みを可能とする論理回路を上記制御部
に含めることができる。
That is, when a debug device is formed including a first memory for storing a user program to be debugged, a patch program for modifying the user program is written while the user program is being executed. a detecting means for detecting that the execution of the user program has reached a predetermined patch specified location; and a space from the first memory to the second memory based on the detection result of the detecting means. A debugging device is configured including a space switching means that enables execution of the patch program in the second memory by switching. In a more specific aspect, a multiplexer for selectively coupling the first memory and the second memory to the bus of the master microprocessor and the bus of the slave microprocessor; The space switching means may include a control section that controls the selection operation. At this time, while the first memory is coupled to the bus of the slave microprocessor via the multiplexer and the emulation operation of the user program continues, the second memory is coupled to the bus of the master microprocessor. By coupling, a logic circuit that enables writing of the patch program to the second memory can be included in the control section.

【0009】[0009]

【作用】上記した手段によれば、上記ユーザプログラム
の実行状態で、上記第2メモリへのパッチプログラム書
き込みが可能とされ、そしてユーザプログラムの実行が
所定のパッチ指定箇所に到達したときに、第2メモリ内
のパッチプログラムの実行に移行され、このことが、ユ
ーザプログラムの空きエリアの有無に関係なく、また、
元のプログラムを直接修正することなく、プログラムの
流れや処理内容の一部変更を可能とし、さらに、上記パ
ッチプログラムのリアルタイム挿入実行を可能とする。
[Operation] According to the above means, it is possible to write a patch program into the second memory while the user program is being executed, and when the execution of the user program reaches a predetermined patch specification location, the patch program can be written into the second memory while the user program is being executed. 2, the execution of the patch program in the memory is shifted to the execution of the patch program in the memory.
To make it possible to partially change the program flow and processing contents without directly modifying the original program, and also to enable real-time insertion and execution of the patch program.

【0010】0010

【実施例】図3には本発明の一実施例であるインサーキ
ット・エミュレータを含むマイクロプロセッサ開発用シ
ステムが示される。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 3 shows a microprocessor development system including an in-circuit emulator, which is an embodiment of the present invention.

【0011】図2に示されるインサーキット・エミュレ
ータ本体2は、親計算機等のシステム開発装置1と、デ
バッグ対象装置としてのマイクロプロセッサ応用機器3
との間に接続され、その応用機器3に含まれるターゲッ
トマイクロプロセッサの機能を代行する一方でデバッガ
としての機能を持ち、詳細なシステムデバッグを支援す
る。システム開発装置1とインサーキット・エミュレー
タ本体2とはシリアル回線バスラインによって結合され
、このバスラインによって両者間でのデータのやりとり
が可能とされる。また、インサーキット・エミュレータ
本体2からはインタフェースケーブル4が引き出され、
このケーブル4の先端に設けられたプラグ4aが、応用
機器3のターゲットマイクロプロセッサ用ソケット5に
結合されることにより、インサーキット・エミュレータ
2本体において所定のエミュレーション動作が可能とさ
れる。
The in-circuit emulator body 2 shown in FIG. 2 includes a system development device 1 such as a parent computer, and a microprocessor application device 3 as a device to be debugged.
The microprocessor 3 is connected between the application device 3 and performs the functions of the target microprocessor included in the application device 3, while also functioning as a debugger and supporting detailed system debugging. The system development device 1 and the in-circuit emulator main body 2 are connected by a serial bus line, and this bus line allows data to be exchanged between the two. In addition, the interface cable 4 is pulled out from the in-circuit emulator main body 2,
A plug 4a provided at the tip of this cable 4 is coupled to a target microprocessor socket 5 of the application device 3, thereby enabling a predetermined emulation operation in the main body of the in-circuit emulator 2.

【0012】図2には上記インサーキット・エミュレー
タ2の詳細な構成が示される。
FIG. 2 shows a detailed configuration of the in-circuit emulator 2. As shown in FIG.

【0013】図2に示されるようにインサーキット・エ
ミュレータ本体2には、マイクロプロセッサ応用機器3
に含まれるターゲットマイクロプロセッサの機能を代行
してその応用機器の動作制御すなわちエミュレーション
を行うためのスレーブマイクロプロセッサ(以下、SM
CUと記す)11と、各種デバッグ機能を達成するため
の制御を司るマスタマイクロプロセッサ(以下、MMC
Uと記す)16が設けられる。
As shown in FIG. 2, the in-circuit emulator body 2 includes a microprocessor application device 3.
A slave microprocessor (hereinafter referred to as SM
CU) 11, and a master microprocessor (hereinafter referred to as MMC) that controls control for achieving various debugging functions.
(denoted as U) 16 is provided.

【0014】上記SMCU11が、応用機器3における
ターゲットマイクロプロセッサの機能を代行制御(エミ
ュレーション)するとき、SMCU11はMMCU16
の制御から切り離され、またSMCU11の制御動作状
態が予め定められている状態に到達してブレークされる
とき、当該SMCU11はMMCU16の制御を受ける
ことになる。このような制御状態の切り換えがエミュレ
ーション制御部12によって行われる。
When the SMCU 11 performs proxy control (emulation) of the functions of the target microprocessor in the application device 3, the SMCU 11
When the control operation state of the SMCU 11 reaches a predetermined state and is broken, the SMCU 11 is controlled by the MMCU 16. Such switching of control states is performed by the emulation control section 12.

【0015】インサーキット・エミュレータ本体2には
、上記エミュレーション制御部12の他に、SMCU1
1の制御状態やスレーブバス21の状態を監視して、そ
の状態が予め設定された状態に達したときエミュレーシ
ョン動作を停止するためのブレーク制御部13、スレー
ブバス21に与えられるデータやアドレスさらには制御
情報を逐次トレースして蓄えるリアルタイムトレース部
14、応用機器3に含まれるべきデータメモリやプログ
ラムを代行するための代行メモリ部15を有し、それら
が、スレーブバス21を介してSMCU11に、またマ
スタバス22を介してMMCU16に接続されている。 そして上記各ブロックの機能実行は、インサーキット・
エミュレータ本体2に接続された親計算機のコンソール
10によってコントロールされる。
In addition to the emulation control section 12, the in-circuit emulator body 2 includes an SMCU 1.
1 and the state of the slave bus 21 and stop the emulation operation when the state reaches a preset state, the data and address given to the slave bus 21, and It has a real-time trace section 14 that sequentially traces and stores control information, and a substitute memory section 15 that substitutes data memory and programs to be included in the application device 3. It is connected to the MMCU 16 via the master bus 22. The function execution of each block above is performed in-circuit.
It is controlled by a console 10 of a parent computer connected to the emulator main body 2.

【0016】さらにインサーキット・エミュレータ本体
2内には、MMCU16がコンソール10との間でデー
タ通信を行うためのシリアルインタフェース回路17が
設けられ、また、SMCU11からは、インタフェース
回路18を介して上記ケーブル4が引き出される。
Furthermore, a serial interface circuit 17 is provided in the in-circuit emulator body 2 for data communication between the MMCU 16 and the console 10, and the cable is connected from the SMCU 11 via the interface circuit 18. 4 is drawn out.

【0017】図1には、図3に示されるインサーキット
・エミュレータ本体2における主要部の詳細な構成が示
される。
FIG. 1 shows a detailed configuration of the main parts of the in-circuit emulator main body 2 shown in FIG. 3. As shown in FIG.

【0018】図1に示されるように、スレーブバス21
はスレーブアドレスバス30,スレーブデータバス31
を含み、マスタバス22はマスタアドレスバス32、マ
スタデータバス33を含む。図2における代行メモリ部
15には、特に制限されないが、デバッグ対象とされる
ユーザプログラムを格納するための貸し出し用メモリ(
第1メモリ)42の他に、ユーザプログラムの実行状態
で、当該ユーザプログラムの修正に係るパッチプログラ
ムを書込可能なパッチメモリ(第2メモリ)43が含ま
れ、さらにそれらの周辺部には、特に制限されないが、
データ伝達路切換えのためのマルチプレクサ(MPX)
34,35,36,37,パッチメモリ42のアドレス
カウンタ38,ユーザプログラムの実行が所定のパッチ
指定箇所に到達したことを検出する検出手段としてのト
リガ検出回路39,貸し出しメモリ43とパッチメモリ
42の空間切換えを行うためのバス制御部40,バス制
御部40からの割り込み制御のための割り込み制御部4
1などが配置される。
As shown in FIG. 1, the slave bus 21
are slave address bus 30, slave data bus 31
The master bus 22 includes a master address bus 32 and a master data bus 33. The proxy memory unit 15 in FIG. 2 includes, but is not particularly limited to, a rental memory for storing a user program to be debugged (
In addition to the first memory) 42, a patch memory (second memory) 43 is included in which a patch program for modifying the user program can be written while the user program is being executed. Although not particularly limited,
Multiplexer (MPX) for data transmission path switching
34, 35, 36, 37, an address counter 38 of the patch memory 42, a trigger detection circuit 39 as a detection means for detecting that the execution of the user program has reached a predetermined patch designated location, a rental memory 43 and a patch memory 42; A bus control unit 40 for space switching, and an interrupt control unit 4 for controlling interrupts from the bus control unit 40.
1 etc. are arranged.

【0019】上記バス制御部40は、上記トリガ検出回
路39からの検出信号TRGの指示により割り込み制御
部41に対して割り込み要求信号RQをローレベルにア
サートする。指示をうけた割り込み制御部41はSMC
U11に対して割り込み信号IRQを発行する。また、
バス制御部40は、貸し出しメモリ43とパッチメモリ
42を選択するためのセレクト信号M1,M2を生成す
る機能を有する。特に制限されないが、イニシャライズ
時等データ設定を行う際には、セレクト信号Sがローレ
ベルにアサートされ、それによりマルチプレクサ34,
35,36,37がそれぞれB端子側に切り換えられる
。またセレクト信号Sがハイレベルにアサートされた場
合には、マルチプレクサ34,35,36,37はそれ
ぞれA端子側に切り換えられる。上記の各制御信号RQ
,S信号の切り換えタイミングはSMCU11のクロッ
ク信号CLKに同期される。またパッチメモリ42用の
アドレスカウンタ38のカウンタ用クロックCKはCL
Kに基づいて生成される。上記カウンタ38の初期値は
、上記MMCU16からデータバス33を介して設定可
能とされ、それにより任意の値から上記CLK信号のタ
イミングで計数動作を開始することができる。
The bus control section 40 asserts an interrupt request signal RQ to a low level to the interrupt control section 41 according to the instruction of the detection signal TRG from the trigger detection circuit 39. The interrupt control unit 41 that received the instruction is the SMC
An interrupt signal IRQ is issued to U11. Also,
The bus control unit 40 has a function of generating select signals M1 and M2 for selecting the rental memory 43 and the patch memory 42. Although not particularly limited, when performing data setting such as during initialization, the select signal S is asserted to a low level, and the multiplexer 34,
35, 36, and 37 are each switched to the B terminal side. Further, when the select signal S is asserted to a high level, the multiplexers 34, 35, 36, and 37 are respectively switched to the A terminal side. Each of the above control signals RQ
, S signals are synchronized with the clock signal CLK of the SMCU 11. Further, the counter clock CK of the address counter 38 for the patch memory 42 is CL.
Generated based on K. The initial value of the counter 38 can be set from the MMCU 16 via the data bus 33, so that counting can be started from any value at the timing of the CLK signal.

【0020】図4には上記バス制御部40の詳細な構成
例が示される。
FIG. 4 shows a detailed configuration example of the bus control section 40.

【0021】51はDラッチ回路であり、このDラッチ
回路51は、SMCU11からのクロックCLKに同期
して、上記トリガ検出回路39の出力TRGと、当該D
ラッチ回路51のQ*出力(*はローアクティブ若しく
はデータ反転を示す)との論理積をラッチする。このD
ラッチ回路51のQ出力がリクエスト信号RQとして図
1の割り込み制御部41に伝達される。52はカウンタ
であり、このカウンタ52は上記クロックCLに同期し
て上記Dラッチ回路51のQ*出力を計数する。このカ
ウンタ52の出力と、制御信号E1*との論理積が、パ
ッチメモリ42をスレーブ側に接続するためのタイミン
グ信号とされ、後段のラッチ回路53にプリセットされ
る。上記制御信号E1*は、貸し出しメモリ43をマス
タ空間に切り換えるための指示信号とされ、貸し出しメ
モリ43のイニシャライズ、又はユーザプログラムのロ
ード時にエミュレーション制御部12によってアサート
される。パッチプログラムの終了を示すリターン命令が
スレーブデータバス31現れたか否かがコンパレータ5
4でチェックされ、このコンパレータ54の出力と制御
信号E2*との論理積によって上記ラッチ回路53がク
リアされる。制御信号E2*は、パッチメモリ42をマ
スタ空間に切り換えるための指示信号とされ、パッチメ
モリ42へのパッチプログラム書込みの際に、エミュレ
ーション制御部12によってアサートされる。上記ラッ
チ回路53の出力は、図1に示されるマルチプレクサ3
4乃至37の選択動作のためのセレクト信号Sとされる
。またこのセレクト信号Sは、バス制御部40内のマル
チプレクサ55,56に、それらの選択制御信号として
伝達される。57はマスタアドレスバス32の例えば上
位数ビットをデコードするデコーダであり、このデコー
ダ57のデコード出力がマルチプレクサ55のA端子、
マルチプレクサ56のB端子に伝達される。さらにマル
チプレクサ55のB端子及びマルチプレクサ56のA端
子には、ユーザプログラム実行中を示す制御信号E3*
がエミュレーション制御部12から入力されるようにな
っており、マルチプレクサ55,56では、上記ラッチ
回路53の出力状態に応じて、制御信号E3*又はデコ
ーダ57の出力が選択可能とされる。マルチプレクサ5
5の選択出力M1は、貸し出しメモリ43へ、また、マ
ルチプレクサ56の選択出力はパッチメモリ42へ伝達
される。さらに制御信号E3*と、マルチプレクサ56
の出力との論理和がパッチメモリ42用のアドレスカウ
ンタ38を動作させるためのオン信号CONとして当該
カウンタ38に伝達される。
51 is a D latch circuit, and this D latch circuit 51 synchronizes with the output TRG of the trigger detection circuit 39 and the D
The AND with the Q* output (* indicates low active or data inversion) of the latch circuit 51 is latched. This D
The Q output of the latch circuit 51 is transmitted to the interrupt control section 41 in FIG. 1 as a request signal RQ. 52 is a counter, and this counter 52 counts the Q* output of the D latch circuit 51 in synchronization with the clock CL. The logical product of the output of the counter 52 and the control signal E1* is used as a timing signal for connecting the patch memory 42 to the slave side, and is preset in the latch circuit 53 at the subsequent stage. The control signal E1* is an instruction signal for switching the rental memory 43 to the master space, and is asserted by the emulation control unit 12 when initializing the rental memory 43 or loading a user program. The comparator 5 determines whether a return command indicating the end of the patch program has appeared on the slave data bus 31.
4, and the latch circuit 53 is cleared by ANDing the output of the comparator 54 and the control signal E2*. The control signal E2* is an instruction signal for switching the patch memory 42 to the master space, and is asserted by the emulation control unit 12 when writing a patch program to the patch memory 42. The output of the latch circuit 53 is the multiplexer 3 shown in FIG.
This is the select signal S for selection operations 4 to 37. This select signal S is also transmitted to multiplexers 55 and 56 in the bus control section 40 as their selection control signals. 57 is a decoder that decodes, for example, the upper few bits of the master address bus 32, and the decoded output of this decoder 57 is sent to the A terminal of the multiplexer 55;
The signal is transmitted to the B terminal of multiplexer 56. Furthermore, the B terminal of the multiplexer 55 and the A terminal of the multiplexer 56 are connected to a control signal E3* indicating that the user program is being executed.
is inputted from the emulation control unit 12, and the multiplexers 55 and 56 can select the control signal E3* or the output of the decoder 57 depending on the output state of the latch circuit 53. multiplexer 5
The selection output M1 of the multiplexer 56 is transmitted to the rental memory 43, and the selection output of the multiplexer 56 is transmitted to the patch memory 42. Furthermore, the control signal E3* and the multiplexer 56
The logical OR with the output of is transmitted to the address counter 38 for the patch memory 42 as an on signal CON for operating the address counter 38.

【0022】次に上記構成のエミュレーション動作につ
いて説明する。
Next, the emulation operation of the above configuration will be explained.

【0023】エミュレーション動作を開始するに際して
、セレクト信号Sをハイレベルに、制御信号M1をロー
レベルにそれぞれアサートすることによって貸し出しメ
モリ43がMMCU16のマスタバス22と接続状態と
なり、貸し出しメモリ43の初期設定すなわちユーザプ
ログラムのダウンロードまたはユーザのプログラム入力
が可能とされる。このとき制御信号M1は貸し出しメモ
リ43を有効にするとともにマルチプレクサ36のバス
46,47も有効にする。上記初期設定によりユーザの
デバッグ対象プログラムが貸し出しメモリ43上に置か
れる。次にエミュレーション制御部12からの指示によ
り、バス制御部40から出力されるセレクト信号S及び
M1信号がローレベルとされる。それによりSMCU1
1のスレーブバス21に貸し出しメモリ43が接続され
た状態となり、デバッグ対象とされるユーザプログラム
の実行が開始される。
When starting the emulation operation, by asserting the select signal S to high level and the control signal M1 to low level, the rental memory 43 is connected to the master bus 22 of the MMCU 16, and the initial setting of the rental memory 43 is performed. It is possible to download a user program or input a program by the user. At this time, the control signal M1 enables the rental memory 43 and also enables the buses 46 and 47 of the multiplexer 36. With the above initial settings, the program to be debugged by the user is placed on the rental memory 43. Next, according to an instruction from the emulation control section 12, the select signal S and the M1 signal output from the bus control section 40 are set to low level. As a result, SMCU1
The rental memory 43 is connected to the slave bus 21 of No. 1, and the execution of the user program to be debugged is started.

【0024】次に、制御信号M2がローレベルにアサー
トされた場合には、パッチメモリ42がMMCU16の
マスタバス22に接続され、パッチメモリ42にユーザ
プログラム修正部分の書込み可能状態とされる。ユーザ
は必要に応じてパッチメモリ42にプログラム修正部分
を入力し、貸し出しメモリ43と置き換えるアドレスま
たは条件をMMCU16からトリガ検出回路39に設定
する。MMCU16はこの段階でカウンタ38の初期化
(パッチメモリ42の先頭番地の設定)を行う。上記M
MCU16によるパッチメモリ42、トリガ検出回路3
9及び、カウンタ38の設定の間にもSMCU11によ
って、貸し出しメモリ43内のユーザプログラムのエミ
ュレーション動作が継続されている。以上の設定が完了
した段階でトリガ検出回路39では、上記トリガ条件設
定内容とSMCU11のスレーブバス21との比較が逐
次行われる。その比較において、条件一致すなわちデバ
ッグ対象プログラムがパッチ指定箇所に到達したことが
検出された場合には、当該トリガ検出回路39によって
検出信号TRGがアサートされる。
Next, when the control signal M2 is asserted to a low level, the patch memory 42 is connected to the master bus 22 of the MMCU 16, and the patch memory 42 is enabled to write the modified portion of the user program. The user inputs a program correction part into the patch memory 42 as necessary, and sets an address or condition for replacing the rental memory 43 from the MMCU 16 to the trigger detection circuit 39. At this stage, the MMCU 16 initializes the counter 38 (setting the starting address of the patch memory 42). Above M
Patch memory 42 and trigger detection circuit 3 by MCU 16
9 and the setting of the counter 38, the SMCU 11 continues to emulate the user program in the rental memory 43. When the above settings are completed, the trigger detection circuit 39 successively compares the trigger condition settings with the slave bus 21 of the SMCU 11. In the comparison, if it is detected that the conditions match, that is, that the program to be debugged has reached the specified patch location, the trigger detection circuit 39 asserts the detection signal TRG.

【0025】バス制御部40では、検出信号TRGがア
サートされた場合に、クロック信号CLKに同期して割
り込み要求信号RQが発行され、スタッキング後セレク
ト信号Sがハイレベルとされ、制御信号M2がローレベ
ルとされる。それによりSMCU11のデータバス31
とカウンタ38がパッチメモリ42のデータバス44、
アドレスバス45に接続される。接続後SMCU11の
クロック信号CLKに同期したカウンタ用クロックCK
によりカウンタ38の計数動作が開始され、この計数出
力値をアドレスとしてパッチメモリ42の内容(修正に
係るプログラム)が順にSMCU11に送られ、それに
より当該SMCU11でパッチプログラムが実行される
。パッチプログラムの終了は、パッチプログラムの最後
の部分に書かれたリターン命令の検出により可能とされ
る。つまり、上記のリターン命令がバス制御部40内の
コンパレータ54でラッチ回路53がクリアされること
によりセレクト信号Sがローレベルとされ、それにより
、プログラム領域が貸し出しメモリ43に戻される。 以上の動作によりデバッグ対象とされるユーザプログラ
ムを停止することなく、パッチプログラムの挿入を完了
する。
In the bus control unit 40, when the detection signal TRG is asserted, an interrupt request signal RQ is issued in synchronization with the clock signal CLK, the select signal S is set to high level after stacking, and the control signal M2 is set to low level. level. As a result, data bus 31 of SMCU 11
and the counter 38 are connected to the data bus 44 of the patch memory 42,
Connected to address bus 45. Counter clock CK synchronized with clock signal CLK of SMCU11 after connection
The counting operation of the counter 38 is started, and the contents of the patch memory 42 (program related to correction) are sequentially sent to the SMCU 11 using this counted output value as an address, and the patch program is executed by the SMCU 11. Termination of the patch program is made possible by detecting a return instruction written in the last part of the patch program. That is, the above return command causes the comparator 54 in the bus control unit 40 to clear the latch circuit 53, thereby setting the select signal S to a low level, thereby returning the program area to the lending memory 43. With the above operations, the insertion of the patch program is completed without stopping the user program to be debugged.

【0026】上記実施例によれば以下の作用効果を得る
ことができる。
According to the above embodiment, the following effects can be obtained.

【0027】(1)ユーザプログラムの実行状態で、当
該ユーザプログラムの修正に係るパッチプログラムを書
込み可能なパッチメモリ42と、上記ユーザプログラム
の実行が所定のパッチ指定箇所に到達したことを検出す
るトリガ検出回路39と、この検出回路39の検出結果
に基づいて貸し出しメモリ43からパッチメモリ42へ
の空間切換えを行うことによってパッチプログラムの実
行を可能とする手段として、バス制御部40や、マルチ
プレクサ34乃至37を有することにより、ユーザプロ
グラムの実行状態で、上記パッチメモリ42へのパッチ
プログラム書き込みが可能とされ、そしてユーザプログ
ラムの実行が所定のパッチ指定箇所に到達したときに、
第2メモリ内のパッチプログラムの実行に移行されるこ
とにより、ユーザプログラムの空きエリアの有無に関係
なく、また、元のユーザプログラムを直接修正すること
なく、プログラムの流れや処理内容の一部変更が可能と
され、さらに、上記パッチプログラムのリアルタイム挿
入実行が可能とされる。
(1) A patch memory 42 into which a patch program for modifying the user program can be written while the user program is being executed, and a trigger that detects that the execution of the user program has reached a predetermined patch specified location. The detection circuit 39 and the bus control unit 40 and the multiplexer 34 are used as means for enabling the execution of the patch program by switching the space from the rental memory 43 to the patch memory 42 based on the detection result of the detection circuit 39. 37, it is possible to write a patch program into the patch memory 42 while the user program is being executed, and when the execution of the user program reaches a predetermined patch designated location,
By shifting to the execution of the patch program in the second memory, part of the program flow and processing contents can be changed regardless of whether there is free space in the user program or without directly modifying the original user program. Furthermore, it is possible to insert and execute the patch program in real time.

【0028】(2)MMCU16とSMCU11とに上
記貸し出しメモリ43を選択的に結合させるための貸し
出しメモリ側マルチプレクサ36,37と、MMCU1
6とSMCU11とに上記パッチメモリ42を選択的に
結合させるためのパッチメモリ側マルチプレクサ34,
35と、それらマルチプレクサの選択動作を制御する制
御部とを設けることにより、上記空間切換え手段の機能
を容易に実現することができる。
(2) Rental memory side multiplexers 36 and 37 for selectively coupling the rental memory 43 to the MMCU 16 and SMCU 11;
6 and the patch memory side multiplexer 34 for selectively coupling the patch memory 42 to the SMCU 11;
35 and a control unit that controls the selection operations of these multiplexers, the function of the space switching means described above can be easily realized.

【0029】(3)マルチプレクサ36,37を介して
上記貸し出しメモリ43がSMCU11のバス21に結
合されてユーザプログラムのエミュレーション動作が継
続されている状態で、パッチメモリ42をMMCU16
のバス22に結合させることにより、上記パッチプログ
ラムの上記パッチメモリ42への書込みを可能とする機
能をバス制御部40内の論理回路によって適確に実現す
ることができる。
(3) While the rental memory 43 is connected to the bus 21 of the SMCU 11 via the multiplexers 36 and 37 and the emulation operation of the user program is continued, the patch memory 42 is transferred to the MMCU 16.
By coupling the bus 22 to the bus 22, the function of writing the patch program into the patch memory 42 can be appropriately realized by the logic circuit within the bus control unit 40.

【0030】(4)上記(1)の作用効果によりエミュ
レーションの効率向上を図ることができる。
(4) Emulation efficiency can be improved by the effect of (1) above.

【0031】以上本発明の一実施例について説明したが
、本発明は上記実施例に限定されるものではなく、本発
明の要旨を逸脱しない範囲において種々変更可能である
Although one embodiment of the present invention has been described above, the present invention is not limited to the above embodiment, and can be modified in various ways without departing from the gist of the present invention.

【0032】例えば、上記実施例では、パッチメモリ4
2およびカウンタ38は一つであるが、カウンタ38を
複数設け、さらにそれらの選択手段を設けることにより
、一つのパッチメモリ42上にアドレスを換えて複数の
パッチプログラムを登録可能としても良いし、あるいは
パッチメモリ42自体を複数もたせてもよい。またパッ
チメモリ42のデータバスを拡張して、空きビットにパ
ッチプログラムの終了ポイントを記録しておくことによ
りバス制御部40の制御を補足してもよい。
For example, in the above embodiment, the patch memory 4
2 and counter 38, but by providing a plurality of counters 38 and further providing means for selecting them, it may be possible to register a plurality of patch programs on one patch memory 42 by changing the address, Alternatively, a plurality of patch memories 42 may be provided. Further, the data bus of the patch memory 42 may be expanded and the end point of the patch program may be recorded in an empty bit to supplement the control of the bus control unit 40.

【0033】また、上記実施例では、パッチメモリ42
への切り換えの際に割り込みをSMCU11に発行する
ものとして説明したが、割り込みを使用せずにそのまま
SMCU11のデータバスに対してパッチプログラムを
挿入することにより、ジャンプ命令等を併用してプログ
ラムの流れを変更するようにしてもよい。その他、トリ
ガ検出回路をブレークまたはトレース用トリガ回路を流
用することで回路規模を縮小することも可能であり、そ
の登録済みのトリガ条件のオン・オフ機能を設けること
によりエミュレータの使い勝手を向上できる。
Furthermore, in the above embodiment, the patch memory 42
Although we have explained that an interrupt is issued to the SMCU 11 when switching to the may be changed. In addition, it is possible to reduce the circuit scale by breaking the trigger detection circuit or reusing the trace trigger circuit, and by providing an on/off function for the registered trigger conditions, the usability of the emulator can be improved.

【0034】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるインサ
ーキット・エミュレータに適用した場合について説明し
たが、本発明はそれに限定されるものではなく、テスタ
などエミュレーション機能を有するその他のデバッグ装
置に適用することができる。
In the above description, the invention made by the present inventor was mainly applied to an in-circuit emulator, which is the background field of application, but the present invention is not limited thereto, and is applicable to a tester. It can be applied to other debugging devices having emulation functions such as the following.

【0035】本発明は、少なくともデバッグ対象プログ
ラムを実行するプロセッサに結合若しくはそれを含む条
件のものに適用することができる。
The present invention can be applied to conditions that are coupled to or include at least a processor that executes a program to be debugged.

【0036】[0036]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
Effects of the Invention The effects obtained by typical inventions disclosed in this application are briefly explained below.

【0037】すなわち、ユーザプログラムの実行状態で
、第2メモリへのパッチプログラム書き込みが可能とさ
れ、そしてユーザプログラムの実行が所定のパッチ指定
箇所に到達したときに、第2メモリ内のパッチプログラ
ムの実行に移行されることにより、ユーザプログラムの
空きエリアの有無に関係なく、また、元のプログラムを
直接修正することなく、プログラムの流れや処理内容の
一部変更が可能とされ、さらに、上記パッチプログラム
のリアルタイム挿入実行が可能とされる。
That is, it is possible to write the patch program into the second memory while the user program is being executed, and when the execution of the user program reaches a predetermined patch specification location, the patch program in the second memory is written. By moving to execution, it is possible to partially change the program flow and processing contents regardless of whether or not there is free space in the user program, and without directly modifying the original program. It is possible to insert and execute programs in real time.

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

【図1】図1は本発明の一実施例に係るインサーキット
・エミュレータの主要部の詳細な構成ブロック図である
FIG. 1 is a detailed configuration block diagram of the main parts of an in-circuit emulator according to an embodiment of the present invention.

【図2】図2は本発明の一実施例に係るインサーキット
・エミュレータの全体的な構成ブロック図である。
FIG. 2 is an overall configuration block diagram of an in-circuit emulator according to an embodiment of the present invention.

【図3】図3は上記インサーキット・エミュレータを含
むマイクロプロセッサ開発用システムの構成ブロック図
である。
FIG. 3 is a block diagram of a microprocessor development system including the in-circuit emulator.

【図4】図4は図1に示されるバス制御部の論理回路図
である。
FIG. 4 is a logic circuit diagram of the bus control section shown in FIG. 1;

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

2  インサーキット・エミュレータ本体11  スレ
ーブマイクロプロセッサ 12  エミュレーション制御部 13  ブレーク制御部 14  トレースメモリ 15  代行メモリ 16  マスタマイクロプロセッサ 17  シリアルインタフェース 18  インタフェース 21  スレーブバス 22  マスタバス 34乃至37  マルチプレクサ 38  カウンタ 39  トリガ検出回路 40  バス制御部 41  割り込み制御部 42  パッチメモリ 43  貸し出しメモリ
2 In-circuit emulator body 11 Slave microprocessor 12 Emulation control unit 13 Break control unit 14 Trace memory 15 Alternative memory 16 Master microprocessor 17 Serial interface 18 Interface 21 Slave bus 22 Master buses 34 to 37 Multiplexer 38 Counter 39 Trigger detection circuit 40 Bus Control unit 41 Interrupt control unit 42 Patch memory 43 Rental memory

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】  デバッグ対象とされるユーザプログラ
ムを格納するための第1メモリを含み、このユーザプロ
グラムのデバッグを可能とするデバッグ装置において、
上記ユーザプログラムの実行状態で、当該ユーザプログ
ラムの修正に係るパッチプログラムを書込み可能な第2
メモリと、上記ユーザプログラムの実行が所定のパッチ
指定箇所に到達したことを検出する検出手段と、この検
出手段の検出結果に基づいて上記第1メモリから上記第
2メモリへの空間切換えを行うことによって上記第2メ
モリ内のパッチプログラムの実行を可能とする空間切換
え手段とを含むことを特徴とするデバッグ装置。
1. A debugging device including a first memory for storing a user program to be debugged and capable of debugging the user program, comprising:
While the above user program is running, there is a second
a memory, a detection means for detecting that the execution of the user program has reached a predetermined patch designated location, and a space switching from the first memory to the second memory based on the detection result of the detection means. and space switching means that enables execution of the patch program in the second memory.
【請求項2】  各種デバッグ機能を達成するためのマ
スタマイクロプロセッサと、エミュレーションを行うた
めのスレーブマイクロプロセッサとを含むとき、上記空
間切換え手段は、上記マスタマイクロプロセッサのバス
と上記スレーブマイクロプロセッサのバスとに上記第1
メモリ及び第2メモリを選択的に結合させるためのマル
チプレクサと、上記マスタ側マルチプレクサ及びスレー
ブ側マルチプレクサの選択動作を制御する制御部とを含
んで成る請求項1記載のデバッグ装置。
2. When the space switching means includes a master microprocessor for achieving various debugging functions and a slave microprocessor for performing emulation, the space switching means is configured to switch between a bus of the master microprocessor and a bus of the slave microprocessor. Toni above 1st
2. The debugging device according to claim 1, comprising: a multiplexer for selectively coupling the memory and the second memory; and a control section for controlling selection operations of the master-side multiplexer and the slave-side multiplexer.
【請求項3】  上記制御部は、上記マルチプレクサを
介して上記第1メモリが上記スレーブマイクロプロセッ
サのバスに結合されて上記ユーザプログラムのエミュレ
ーション動作が継続されている状態で、上記第2メモリ
を上記マスタマイクロプロセッサのバスに結合させるこ
とにより、上記パッチプログラムの上記第2メモリへの
書込みを可能とする論理回路を含む請求項2記載のデバ
ッグ装置。
3. The control unit controls the second memory to be connected to the second memory while the first memory is coupled to the bus of the slave microprocessor through the multiplexer and the emulation operation of the user program is continued. 3. A debugging device according to claim 2, further comprising a logic circuit coupled to a bus of a master microprocessor to enable writing of said patch program into said second memory.
JP3106756A 1991-04-11 1991-04-11 Debugging device Withdrawn JPH04314139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3106756A JPH04314139A (en) 1991-04-11 1991-04-11 Debugging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3106756A JPH04314139A (en) 1991-04-11 1991-04-11 Debugging device

Publications (1)

Publication Number Publication Date
JPH04314139A true JPH04314139A (en) 1992-11-05

Family

ID=14441761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3106756A Withdrawn JPH04314139A (en) 1991-04-11 1991-04-11 Debugging device

Country Status (1)

Country Link
JP (1) JPH04314139A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006338271A (en) * 2005-06-01 2006-12-14 Nec Electronics Corp Test system and test method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006338271A (en) * 2005-06-01 2006-12-14 Nec Electronics Corp Test system and test method

Similar Documents

Publication Publication Date Title
KR970011212B1 (en) Data processor with developement support features
US5132971A (en) In-circuit emulator
US4633417A (en) Emulator for non-fixed instruction set VLSI devices
US6668339B1 (en) Microprocessor having a debug interruption function
US20020144235A1 (en) Debugging embedded systems
JPH08185336A (en) Microprocessor and methods for transmitting and tracing signal between microprocessor and debugging tool
JPH011039A (en) In-circuit emulator
JPH06314213A (en) Debugging device
JPH0798692A (en) Microcomputer
JP2002202900A (en) Debug device
US5129079A (en) Computer system having subinstruction surveillance capability
JP2974601B2 (en) Microprocessor and debug system
JPH04314139A (en) Debugging device
JP2001092686A (en) Semiconductor device
RU2110833C1 (en) In-circuit emulator
JPH02186448A (en) Integrated circuit with debugging environment
KR20010052868A (en) Method and system for updating user memory in emulator systems
JPH04123235A (en) Debugging method and system for microprogram
JPH07121396A (en) Emulator
JPH01306933A (en) Debugging device
KR930004425B1 (en) Computer system with debugging function and method therefor
JPS61112250A (en) Data processing system
GB2293254A (en) Emulator for debugging embedded software for almost any microprocessor
JPS59202546A (en) Debugging device
JPH04160650A (en) Microprocessor

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980711