JP2005276065A - Emulator - Google Patents

Emulator Download PDF

Info

Publication number
JP2005276065A
JP2005276065A JP2004091807A JP2004091807A JP2005276065A JP 2005276065 A JP2005276065 A JP 2005276065A JP 2004091807 A JP2004091807 A JP 2004091807A JP 2004091807 A JP2004091807 A JP 2004091807A JP 2005276065 A JP2005276065 A JP 2005276065A
Authority
JP
Japan
Prior art keywords
rom
cpu
program
address
ram
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
JP2004091807A
Other languages
Japanese (ja)
Inventor
Kiyouichi Suzuki
亨市 鈴木
Hideaki Ishihara
秀昭 石原
Naoki Ito
直紀 伊藤
Kenji Yamada
健二 山田
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2004091807A priority Critical patent/JP2005276065A/en
Publication of JP2005276065A publication Critical patent/JP2005276065A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an emulator capable of determining a number of break points on a program, and changing the break points determined on the program in a short time in examining the operation of an evaluated controller. <P>SOLUTION: A microcomputer for evaluation 13 emulates the operation of the evaluated controller by allowing CPU 16 to execute the program stored in ROM 17. Here, a most significant bit 17a of ROM 17 is designated as a bit for stopping, and the most significant bit 17a of an address where the determination of break point is desired, is set. In a case when the most significant bit 17a of the address is set when CPU 16 accesses ROM 17, a Halt signal is given to CPU 16, thus CPU 16 is stopped at the address. Whereby the program can be properly debugged by monitoring a condition of the microcomputer for evaluation 13 in a state that CPU 16 is stopped. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、ROMに記憶されたプログラムをCPUが実行することにより評価対象の制御装置の動作をエミュレートするエミュレータに関する。   The present invention relates to an emulator that emulates the operation of a control device to be evaluated by a CPU executing a program stored in a ROM.

図4は、エミュレータの動作を示している。この図4において、エミュレータ1には、評価対象の制御装置の動作をエミュレートするマイコン2が設けられている。このマイコン2は、CPU3、ROM4、RAM5を備え、ホストのパソコンからROM4に書込まれたプログラムに従ってCPU3が動作するようになっており、このマイコン2の状態を観察することによりプログラムをデバッグするようにしている。このようにマイコン2の状態を観察するには、マイコン2の動作状態では困難であることから、CPU3を任意のアドレスであるブレークポイントで停止させた状態でマイコン2の状態を観察するようにしている。つまり、アドレス比較器6にブレークポイントのアドレスを記憶しておき、命令バスのアドレスがブレークポイントと一致したところで、アドレス比較器6から最優先でCPU3に受け付けられるNMI(Non Maskable Interrupt )信号を出力するようにしている。これにより、CPU3の動作がプログラムのブレークポイントで停止するので、その停止状態でマイコン2の状態を観察することにより、プログラムを適切にデバッグすることが可能となる(特許文献1参照)。
特公平07−093177号公報
FIG. 4 shows the operation of the emulator. In FIG. 4, the emulator 1 is provided with a microcomputer 2 that emulates the operation of the control device to be evaluated. The microcomputer 2 includes a CPU 3, a ROM 4, and a RAM 5. The CPU 3 operates in accordance with a program written in the ROM 4 from a host personal computer. The program is debugged by observing the state of the microcomputer 2. I have to. Since it is difficult to observe the state of the microcomputer 2 in this way, it is difficult to observe the state of the microcomputer 2 with the CPU 3 stopped at a breakpoint that is an arbitrary address. Yes. That is, the address of the breakpoint is stored in the address comparator 6, and when the address of the instruction bus coincides with the breakpoint, an NMI (Non Maskable Interrupt) signal that is accepted by the CPU 3 with the highest priority from the address comparator 6 is output. Like to do. As a result, the operation of the CPU 3 stops at the breakpoint of the program, so that the program can be debugged appropriately by observing the state of the microcomputer 2 in the stopped state (see Patent Document 1).
Japanese Patent Publication No. 07-093177

しかしながら、アドレス比較器6は、一般的に複数個、例えば8チャンネル分しか用意されていないので、一般的に行うCPUの評価では不足している。
また、プログラムを実行途中で停止して評価する方法として、プログラムにブレークポイント(HALT命令)を設定し、ブレークポイントでプログラムを停止することが行われている。このようにプログラムにブレークポイントを設定する方法では、ブレークポイントを任意に多数設定することができるものの、このようなブレークポイントの変更にはROM4に記憶されたプログラム全体の書換えが必要であり、1回の書換えで必要となる時間が数分要することから、プログラムをデバッグするのに多大の時間を要する。
However, since a plurality of address comparators 6 are generally prepared, for example, for 8 channels, the CPU evaluation is generally insufficient.
Also, as a method of stopping and evaluating a program during execution, a breakpoint (HALT instruction) is set in the program and the program is stopped at the breakpoint. In this way, in the method of setting breakpoints in a program, a number of breakpoints can be arbitrarily set. However, such breakpoint changes require rewriting of the entire program stored in the ROM 4. Since it takes several minutes to rewrite the program, it takes a lot of time to debug the program.

本発明は上記事情に鑑みてなされたもので、その目的は、評価対象の制御装置の動作を検査する際に、プログラムに多数のブレークポイントを設定することが可能となると共に、プログラムに設定するブレークポイントの変更を短時間で行うことができるエミュレータを提供することにある。   The present invention has been made in view of the above circumstances. The purpose of the present invention is to set a number of breakpoints in a program and to set the program when inspecting the operation of a control device to be evaluated. An object of the present invention is to provide an emulator capable of changing breakpoints in a short time.

請求項1の発明によれば、評価対象の制御装置の動作を検査するために、ROMに記憶されたプログラムの任意のアドレスにブレークポイントを設定するには、そのアドレスに対応した停止用ビットをセットする。
そして、停止用ビットがセットされたアドレスをCPUがアクセスすると、出力手段がCPUに対して最優先割込の停止信号を出力する。これにより、CPUは、停止信号を最優先で受付けて停止状態となるので、その状態でCPUの状態を観測することができる。従って、ROMの任意のアドレスにブレークポイントを設定することができるので、多数のブレークポイントを設定することができる。
According to the first aspect of the present invention, in order to set the breakpoint at an arbitrary address of the program stored in the ROM in order to check the operation of the control device to be evaluated, the stop bit corresponding to the address is set. set.
When the CPU accesses the address in which the stop bit is set, the output means outputs a stop signal of the highest priority interrupt to the CPU. As a result, the CPU receives the stop signal with the highest priority and enters the stop state, so that the state of the CPU can be observed in that state. Accordingly, since breakpoints can be set at arbitrary addresses in the ROM, a large number of breakpoints can be set.

請求項2の発明によれば、ROMの一部の所定アドレス領域をRAMに置換えることができるので、そのRAMの所定アドレス領域に停止命令を書込むことによりブレークポイントを設定した場合、RAMに対するプログラムの書換え時間はROMに対する書換え時間よりも大幅に短いことから、ブレークポイントの書換え時間を短縮することができる。
請求項3の発明によれば、ROMをRAMに置換えることができる所定アドレス領域を変更することができるので、ROM全体のアドレスにわたってブレークポイントの書換え時間を大幅に短縮することができる。
According to the second aspect of the present invention, a predetermined address area of a part of the ROM can be replaced with the RAM. Therefore, when a breakpoint is set by writing a stop instruction in the predetermined address area of the RAM, Since the program rewrite time is significantly shorter than the ROM rewrite time, the breakpoint rewrite time can be shortened.
According to the third aspect of the present invention, since the predetermined address area in which the ROM can be replaced with the RAM can be changed, the breakpoint rewriting time can be greatly reduced over the entire address of the ROM.

以下、本発明を車両用ECUが搭載される回路基板をデバッグするシステムに適用した場合の一実施例について図1ないし図3を参照して説明する。図2は、システム全体の電気的構成を示すブロック図である。ホストとしてのパソコン11にはエミュレータ12が接続されており、パソコン11は、エミュレータ12との間でデータを授受する。
このエミュレータ12とは、ユーザアプリケーションの動作確認を行うためのもので、最終的には、シングルチップマイコン(CPU、ROM、RAM、I/Oを1つのパッケージに収めたマイコン)のROMに実装されるユーザプログラムの動作と同等の動作を行う装置であり、一般的には1命令毎に汎用レジスタ、RAM、I/Oの変化などを確認することができる。また、ROM上の所定のアドレス実行、RAM、I/Oなどがある値になった場合の条件などにより連続実行状態によるユーザプログラムを一時停止状態に遷移させて、汎用レジスタ、RAM、I/Oなどの状態を確認することができる装置である。
Hereinafter, an embodiment in which the present invention is applied to a system for debugging a circuit board on which a vehicle ECU is mounted will be described with reference to FIGS. FIG. 2 is a block diagram showing the electrical configuration of the entire system. An emulator 12 is connected to a personal computer 11 as a host, and the personal computer 11 exchanges data with the emulator 12.
The emulator 12 is used to check the operation of the user application. Finally, the emulator 12 is mounted on the ROM of a single-chip microcomputer (a microcomputer in which a CPU, ROM, RAM, and I / O are contained in one package). A device that performs an operation equivalent to the operation of a user program, and generally changes in general-purpose registers, RAM, I / O, etc. can be confirmed for each instruction. In addition, the user program in the continuous execution state is shifted to a pause state depending on conditions such as execution of a predetermined address on the ROM, RAM, I / O, etc., and the general-purpose register, RAM, I / O It is a device that can check the state of.

エミュレータ12には、評価対象となるシングルチップマイコンに内蔵されているCPUの動作をエミュレートするための評価用マイコン13が搭載されており、その動作はICEコントローラ14により制御されるようになっている。ICEコントローラ14は、I/F15を介してパソコン11から制御用データを受信すると共に、評価用マイコン13の観察データをパソコン11に送信する。   The emulator 12 is equipped with an evaluation microcomputer 13 for emulating the operation of the CPU built in the single-chip microcomputer to be evaluated, and the operation is controlled by the ICE controller 14. Yes. The ICE controller 14 receives control data from the personal computer 11 via the I / F 15 and transmits observation data of the evaluation microcomputer 13 to the personal computer 11.

パソコン11には、オペレーティングシステム上で動作するアプリケーションとしてのICE用コントロールソフトウエアがインストールされており、そのコントロールソフトウエアは、必要に応じてユーザにより起動される。
評価用マイコン13は、CPU16、ROM17、RAM18、代替RAM19を備えて構成されている。ROM17には、パソコン11側からICEコントローラ14を介してプログラムがダウンロードされ、CPU16は、ROM17からプログラムを読出すことにより評価対象のシングルチップマイコンの動作をエミュレートするようになっている。
The personal computer 11 is installed with ICE control software as an application operating on the operating system, and the control software is activated by the user as necessary.
The evaluation microcomputer 13 includes a CPU 16, a ROM 17, a RAM 18, and an alternative RAM 19. A program is downloaded to the ROM 17 from the personal computer 11 via the ICE controller 14, and the CPU 16 reads the program from the ROM 17 to emulate the operation of the single-chip microcomputer to be evaluated.

ここで、ROM17のビット数は、CPU16の処理ビット数よりも少なくとも1ビット付加されたビット数のものが用いられており、本実施例では、最上位ビット(停止用ビットに相当)17aとして1ビットが付加されたものを用いている。この付加された最上位ビット17aは、後述するようにHALT命令に対応するものである。Halt信号出力回路(出力手段に相当)20は、ROM17がCPU16によりアクセスされて記憶している命令を出力した際に最上位ビット17aを入力するように設けられており、最上位ビット17aがセットされていたときはCPU16に対してHalt信号を出力するように構成されている。   Here, the number of bits of the ROM 17 is the number of bits added with at least one bit more than the number of processing bits of the CPU 16, and in this embodiment, the most significant bit (corresponding to a stop bit) 17a is 1 Those with bits added are used. The added most significant bit 17a corresponds to the HALT instruction as will be described later. The Halt signal output circuit (corresponding to the output means) 20 is provided to input the most significant bit 17a when the ROM 17 outputs an instruction stored by being accessed by the CPU 16, and the most significant bit 17a is set. When it has been set, the Halt signal is output to the CPU 16.

評価対象としての回路基板21は、評価対象のシングルチップマイコンが搭載される基板であり、本実施例ではドアロック制御用の車両用ECUを構成するものである。この場合、エミュレータ12により確認したい内容は、ドアロックキー及び車速を入力要素、ドアロックを出力要素として、個別ドアロックキーの入力確認、集中ドアロックキーの入力確認、車速による集中ドアロック制御である。   The circuit board 21 as an evaluation target is a board on which the single chip microcomputer to be evaluated is mounted, and in this embodiment, constitutes a vehicle ECU for door lock control. In this case, the contents to be confirmed by the emulator 12 include the door lock key and the vehicle speed as input elements, the door lock as an output element, individual door lock key input confirmation, centralized door lock key input confirmation, and centralized door lock control by vehicle speed. is there.

この車両用ECUにおいて評価対象のシングルチップマイコンが搭載される部分には、当該シングルチップマイコンに代えてソケット(図示せず)が搭載されている。そのソケットには、エミュレータ12から延びる図示しないエミュレーションケーブルの先端に配置されたプローブが接続されるようになっており、CPU16は、双方向バッファ22及びI/F23を介してまたは直接回路基板21に電気的に接続されるようになっている。   In this vehicular ECU, a socket (not shown) is mounted in place of the single-chip microcomputer to be evaluated in the portion where the single-chip microcomputer to be evaluated is mounted. The socket is connected to a probe disposed at the tip of an emulation cable (not shown) extending from the emulator 12. The CPU 16 is connected to the circuit board 21 via the bidirectional buffer 22 and the I / F 23 or directly. It is designed to be electrically connected.

ところで、評価対象のプログラムを評価する際はROM17のプログラムを頻繁に書換える必要があることから、本実施例では、ROM17のアドレス空間のうちの所定アドレス領域を代替RAM19に置換えることにより、書換え時間の短縮を図り、評価効率を向上するようにしている。但し、単純にROM17の全てのアドレス領域をRAMに変更してしまうと、評価用マイコン13は、データ保持の面での信頼性及びチップサイズ面でのデメリットが大きいため、ROM17の容量(例えば256Kバイト)未満の容量(例えば2Kバイト)のみ内蔵する。また、接続されるアドレスを可変(例えば16Mバイト空間)とすることによりROM17全領域の書換えに対応するようにしている。   By the way, since it is necessary to frequently rewrite the program in the ROM 17 when evaluating the program to be evaluated, in this embodiment, rewriting is performed by replacing the predetermined address area in the address space of the ROM 17 with the alternative RAM 19. The time is shortened and the evaluation efficiency is improved. However, if the entire address area of the ROM 17 is simply changed to the RAM, the evaluation microcomputer 13 has large demerits in terms of data retention and chip size, and therefore the capacity of the ROM 17 (for example, 256K). Only a capacity less than (byte) (for example, 2 Kbytes) is incorporated. Further, by changing the address to be connected (for example, 16 Mbyte space), the entire area of the ROM 17 can be rewritten.

このような機能を実現するために、本実施例では、図3に示すチップセレクト回路(アクセス切替手段に相当)24が設けられている。このチップセレクト回路24は、アドレスデコード回路25とROM/RAMセレクト回路26とからなる。CPU16からのアドレスバスのうち上位8ビットはチップセレクト(CS)として使用されており、アドレスデコード回路25にてデコードすることによりROM/RAMセレクト回路26を通じてROM17、RAM18、代替RAM19の複数のチップのうち一つのチップをデータの読出し或いは書込みの対象として選択するようになっている。ROM17、RAM18、代替RAM19の各チップにはCPU16からのアドレスバスの下位16ビットが接続されており、チップセレクト回路24によりチップセレクトされた状態でアドレスバスの下位16ビットにより選択された所定アドレスがCPU16によりアクセスされる。この場合、アドレスデコード回路25には図示しないレジスタが設けられており、アドレスバスの上位8ビットのビットパターンがレジスタに書込まれたビットパターンと一致したときに本来選択されるべきROM17に代えて代替RAM19を選択するようになっており、アドレスデコード回路25のレジスタを書換えることにより、代替RAM19と置換えられるROM17を変更することができる。   In order to realize such a function, in this embodiment, a chip select circuit (corresponding to access switching means) 24 shown in FIG. 3 is provided. The chip select circuit 24 includes an address decode circuit 25 and a ROM / RAM select circuit 26. The upper 8 bits of the address bus from the CPU 16 are used as a chip select (CS), and are decoded by the address decode circuit 25 and then read out from the ROM 17, RAM 18, and alternative RAM 19 through the ROM / RAM select circuit 26. One of the chips is selected as a data reading or writing target. The lower 17 bits of the address bus from the CPU 16 are connected to each chip of the ROM 17, RAM 18, and alternative RAM 19, and a predetermined address selected by the lower 16 bits of the address bus when the chip is selected by the chip select circuit 24. Accessed by the CPU 16. In this case, the address decode circuit 25 is provided with a register (not shown), which replaces the ROM 17 that should be originally selected when the bit pattern of the upper 8 bits of the address bus matches the bit pattern written in the register. The alternative RAM 19 is selected, and the ROM 17 replaced with the alternative RAM 19 can be changed by rewriting the register of the address decoding circuit 25.

要するに、CPU16からのアドレスの上位8ビットにより代替RAM19がチップセレクトされたときは、代替RAM19のアドレス領域と一致するアドレス領域のROM17が無効となることから、ROM17の所定アドレス領域を代替RAM19に置換えることが可能となる。また、アドレスデコード回路25が有する図示しないレジスタを書換えることにより、ROM17に代えて代替RAM19が有効となる所定アドレス領域をROM17全体のアドレス領域にわたって変更することが可能となる。   In short, when the alternative RAM 19 is chip-selected by the upper 8 bits of the address from the CPU 16, the ROM 17 in the address area that matches the address area of the alternative RAM 19 becomes invalid. It is possible to In addition, by rewriting a register (not shown) included in the address decoding circuit 25, it becomes possible to change a predetermined address area in which the alternative RAM 19 is valid instead of the ROM 17 over the entire address area of the ROM 17.

次に上記構成の作用について説明する。
さて、ユーザがアプリケーションのプログラムを完成したときは、そのプログラムの動作をエミュレータ12で検査する。つまり、作成したプログラムの確度を向上させるためにデバッグするのである。
ここで、プログラムを固定的なアドレスで停止して検査したい場合は、パソコン11のICE用コントロールソフトウエアを起動し、プログラムの任意の位置にブレークポイントを指定する。このような指定は、プログラムをニーモニックで示したエディタ画面においてブレークポイントを示すソースコードを挿入する。
Next, the operation of the above configuration will be described.
When the user completes the application program, the emulator 12 checks the operation of the program. In other words, debugging is performed to improve the accuracy of the created program.
Here, when it is desired to stop and inspect the program at a fixed address, the control software for ICE of the personal computer 11 is activated and a breakpoint is designated at an arbitrary position of the program. Such a specification inserts a source code indicating a breakpoint in an editor screen showing the program in mnemonics.

ICE用コントロールソフトウエアは、プログラムのソースコードを2進数のオブジェクトコードにアセンブルする際にブレークポイントを示すソースコードを検出したときは、そのブレークポイントに対応した命令のオブジェクトコードの最上位ビット17aに1を付加する。従って、ユーザが複数のブレークポイントを指定した場合は、そのブレークポイントに対応する複数のアドレスの最上位ビット17aがセットされることになる。この場合、ブレークポイントの数が限定されることはなく、ユーザは、ブレークポイントの数を意識することなく設定することができる。   When the ICE control software detects a source code indicating a breakpoint when assembling the program source code into a binary object code, the control software for ICE stores the most significant bit 17a of the object code of the instruction corresponding to the breakpoint. 1 is added. Therefore, when the user designates a plurality of breakpoints, the most significant bits 17a of a plurality of addresses corresponding to the breakpoints are set. In this case, the number of breakpoints is not limited, and the user can set without being aware of the number of breakpoints.

そして、ICE用コントロールソフトウエアは、オブジェクトコードをICEコントローラ14に出力し、ICEコントローラ14がオブジェクトコードのプログラムをROMにダウンロードした状態でCPU16を起動すると、CPU16は、ROM17に記憶されたプログラムにしたがって動作する。
ここで、CPU16がROM17の所定アドレスにアクセスした際に、そのアドレスの最上位ビット17aがセットされていた場合は、Halt信号出力回路20からCPU16に対してHalt信号が出力される。このHalt信号はCPU16に対して最優先で受付けられるNMI信号であることから、CPU16は、現在の状態にかかわらずブレークポイントが設定されたアドレスで停止することになる。従って、ユーザは、パソコン11に対する操作によりCPU16のレジスタの内容、アドレスバス、データバスの出力状態、RAM18の記憶内容を観測することにより、プログラムが正常に動作しているかを判断し、正常に動作していない場合は、プログラムをデバッグし、ROM17に再度ダウンロードして再実行する。この場合、必要に応じてブレークポイントの位置を変更することにより、任意のアドレスでCPU16を停止してデバッグを効率よく行うことができる。
Then, the ICE control software outputs the object code to the ICE controller 14. When the ICE controller 14 starts up the CPU 16 with the object code program downloaded to the ROM, the CPU 16 follows the program stored in the ROM 17. Operate.
Here, when the CPU 16 accesses a predetermined address in the ROM 17, if the most significant bit 17 a of the address is set, a halt signal is output from the halt signal output circuit 20 to the CPU 16. Since the Halt signal is an NMI signal received with the highest priority for the CPU 16, the CPU 16 stops at the address where the breakpoint is set regardless of the current state. Therefore, the user determines whether the program is operating normally by observing the contents of the register of the CPU 16, the output state of the address bus and the data bus, and the storage contents of the RAM 18 by operating the personal computer 11. If not, the program is debugged, downloaded again to the ROM 17 and re-executed. In this case, by changing the position of the breakpoint as necessary, the CPU 16 can be stopped at an arbitrary address and debugging can be performed efficiently.

ところで、上述したようなROM17の最上位ビット17aとして停止用ビットを設けた場合、ブレークポイントを頻繁に変更するには適していない。これは、ROM17の書換えには数分間という比較的長時間を要することから、ROM17の書換えを頻繁に行った場合には、デバッグ時間に多大な時間を要するからである。
そこで、本実施例では、このようにブレークポイントを頻繁に変更するような場合は、ある特定範囲の狭いアドレス領域をデバッグするような場合であることに着目し、その所定アドレス領域をROM17から代替RAM19に置換えることにより書換え時間の短縮を図った。
By the way, when a stop bit is provided as the most significant bit 17a of the ROM 17 as described above, it is not suitable for frequently changing breakpoints. This is because rewriting of the ROM 17 requires a relatively long time of several minutes, and when the ROM 17 is frequently rewritten, a long time is required for debugging.
Therefore, in this embodiment, paying attention to the fact that breakpoints are frequently changed in this way is a case of debugging a narrow address area of a specific range, the predetermined address area is replaced from the ROM 17. Rewriting time was shortened by replacing with the RAM 19.

即ち、ユーザは、ブレークポイントを頻繁に変更したい所定アドレス領域のアドレスをCPU16が出力した場合に、その上位8ビットのデータによりチップセレクト回路24がROM17に代えて代替RAM19をチップセレクトするようにチップセレクト回路24のレジスタを設定する。
そして、プログラムの所定アドレス領域における任意のブレークポイントにHALT命令が挿入されたプログラムをROM17に書込む。この場合、所定アドレス領域以外のアドレスに関しては、ROM17がチップセレクトされることから、当該ROM17に命令が書込まれ、所定アドレス領域に関しては、代替RAM19がチップセレクトされることから、当該代替RAM19に命令が書込まれることになる。
That is, when the CPU 16 outputs an address in a predetermined address area where breakpoints are frequently changed, the chip selects the alternative RAM 19 in place of the ROM 17 by the chip select circuit 24 using the upper 8 bits of data. The register of the select circuit 24 is set.
Then, the program in which the HALT instruction is inserted at an arbitrary breakpoint in the predetermined address area of the program is written in the ROM 17. In this case, since the ROM 17 is chip-selected for an address other than the predetermined address area, an instruction is written in the ROM 17 and, for the predetermined address area, the alternative RAM 19 is chip-selected. An instruction will be written.

このようなROM17及び代替RAM19への命令の書込み終了状態でエミュレータ12を起動すると、評価用マイコン13のCPU16は、ROM17にアクセスすることにより命令を順に読込んで実行する。そして、CPU16が所定アドレス領域をアクセスすると、ROM17に代えて代替RAM19がチップセレクトされるようになるので、CPU16は、代替RAM19に記憶された命令を実行するようになる。   When the emulator 12 is activated in such a state that the writing of instructions to the ROM 17 and the alternative RAM 19 is completed, the CPU 16 of the evaluation microcomputer 13 reads and executes the instructions in sequence by accessing the ROM 17. When the CPU 16 accesses the predetermined address area, the alternative RAM 19 is chip-selected instead of the ROM 17, so that the CPU 16 executes the instruction stored in the alternative RAM 19.

そして、CPU16が代替RAM19に記憶されたHALT命令を実行すると、そのアドレスで停止することから、その停止状態でマイコン13の状態を観測することが可能となる。
ここで、所定アドレス領域でブレークポイントを変更したい場合は、HALT命令の位置を変更したプログラムを書込む。この場合、所定アドレス領域以外のアドレスに関しては、ROM17に既に書込まれていることから、所定アドレス領域だけ修正された命令を書込む。これにより、代替RAM19のみプログラムが書換えられるので、プログラムの書換え時間を大幅に短縮することができる。
When the CPU 16 executes the HALT instruction stored in the alternative RAM 19, the CPU 16 stops at that address, so that the state of the microcomputer 13 can be observed in the stopped state.
Here, if it is desired to change a breakpoint in a predetermined address area, a program in which the position of the HALT instruction is changed is written. In this case, since an address other than the predetermined address area has already been written in the ROM 17, an instruction corrected only in the predetermined address area is written. Thereby, since the program is rewritten only in the alternative RAM 19, the rewriting time of the program can be greatly shortened.

このような実施例によれば、ROM17の最上位ビット17aとして1ビットが付加されたものを用い、CPU16によりアクセスされたアドレスの最上位ビット17aがセットされていたときは、CPU16に対してHalt信号を与えるようにしたので、アドレス比較器を用いてブレークポイントを設定する従来例のものと違って、固定的なブレークポイントを多数設定することができる。   According to such an embodiment, when the most significant bit 17a of the ROM 17 with 1 bit added is used and the most significant bit 17a of the address accessed by the CPU 16 is set, the CPU 16 is halted. Since a signal is provided, many fixed breakpoints can be set unlike the conventional example in which breakpoints are set using an address comparator.

また、所定アドレス領域においてブレークポイントが頻繁に変更されるような場合は、CPU16が所定アドレス領域をアクセスした際にチップセレクト回路24によるチップセレクトをROM17から代替RAM19に変更するようにしたので、ブレークポイントが設定されたプログラムをROMに書換える従来例のものに比較して、ブレークポイントを頻繁に変更する場合の書換え時間を大幅に短縮することができる。   If breakpoints are frequently changed in the predetermined address area, the chip select by the chip select circuit 24 is changed from the ROM 17 to the alternative RAM 19 when the CPU 16 accesses the predetermined address area. Compared to the conventional example in which the program in which the points are set is rewritten in the ROM, the rewrite time when the breakpoints are frequently changed can be greatly shortened.

しかも、チップセレクト回路24により代替RAM19が有効となる所定アドレス領域をROM17全体にわたって変更可能としたので、ROM17の何れのアドレス領域にHALT命令を挿入し、そのHALT命令の位置を所定アドレス領域で頻繁に変更するにしても、プログラムの書換え時間の短縮を図ることができる。
本発明は、上記実施例に限定されることなく、次のように変形または拡張できる。
In addition, since the predetermined address area in which the alternative RAM 19 is valid can be changed over the entire ROM 17 by the chip select circuit 24, the HALT instruction is inserted into any address area of the ROM 17, and the position of the HALT instruction is frequently set in the predetermined address area. Even if it is changed to, the rewriting time of the program can be shortened.
The present invention is not limited to the above embodiment, but can be modified or expanded as follows.

ROM17のビット数としては、CPU16の処理ビット数に1ビットを加えたものを必ずしも使用する必要はなく、汎用のものを用いることにより複数ビットが付加されたものを用いるようにしてもよい。
停止用ビットをROM17の最上位ビット17aに設けるのに代えて、ROMの各アドレスと対応したアドレスを有するメモリの1ビットを用いるようにしてもよい。
As the number of bits of the ROM 17, it is not always necessary to use the number of processing bits of the CPU 16 plus 1 bit, and a general-purpose one added with a plurality of bits may be used.
Instead of providing the stop bit in the most significant bit 17a of the ROM 17, one bit of the memory having an address corresponding to each address of the ROM may be used.

チップセレクト回路24によるチップセレクトに代えて、CPU16により所定アドレス領域が選択されたときは、ROM17に代えて代替RAM19へアクセスを切替えるようにしてもよい。   Instead of the chip select by the chip select circuit 24, when a predetermined address area is selected by the CPU 16, the access may be switched to the alternative RAM 19 instead of the ROM 17.

本発明の一実施例における動作状態を説明するための図The figure for demonstrating the operation state in one Example of this invention エミュレータの機能ブロック図Emulator function block diagram チップセレクト回路を示すブロック図Block diagram showing chip select circuit 従来例を示す図1相当図1 equivalent diagram showing a conventional example

符号の説明Explanation of symbols

図面中、11はパソコン、12はエミュレータ、13は評価用マイコン、16はCPU、17はROM、17aは最上位ビット(停止用ビット)、18はRAM、19は代替RAM、20はHalt信号出力回路(出力手段)、24はチップセレクト回路(アクセス切替手段)である。

In the drawing, 11 is a personal computer, 12 is an emulator, 13 is an evaluation microcomputer, 16 is a CPU, 17 is a ROM, 17a is a most significant bit (stop bit), 18 is a RAM, 19 is a substitute RAM, and 20 is a halt signal output. A circuit (output means) 24 is a chip select circuit (access switching means).

Claims (3)

ROMに記憶されたプログラムをCPUが実行することにより評価対象の制御装置の動作をエミュレートするエミュレータにおいて、
前記ROMの各アドレスに対応して設けられた停止用ビットと、
前記CPUにより前記ROMのアドレスがアクセスされたときは、そのアドレスに対応した停止用ビットの状態を判断し、当該停止用ビットがセットされていたときは、前記CPUに対して最優先割込の停止信号を出力する出力手段とを備えたことを特徴とするエミュレータ。
In an emulator that emulates the operation of a control device to be evaluated by a CPU executing a program stored in a ROM,
A stop bit provided corresponding to each address of the ROM;
When the address of the ROM is accessed by the CPU, the state of the stop bit corresponding to the address is determined, and when the stop bit is set, the CPU has the highest priority interrupt. An emulator comprising output means for outputting a stop signal.
前記ROMよりも小さなメモリ容量の代替RAMと、
前記ROMの所定アドレス領域が前記CPUによりアクセスされたときは、そのアクセスを無効とすると共に、前記代替RAMに対するアクセスを有効化するアクセス切替手段とを備え、
前記代替RAMに停止命令が設定されたプログラムを書込むことを特徴とする請求項1記載のエミュレータ。
An alternative RAM having a smaller memory capacity than the ROM;
When a predetermined address area of the ROM is accessed by the CPU, the access is invalidated, and access switching means for enabling access to the alternative RAM is provided.
2. The emulator according to claim 1, wherein a program in which a stop instruction is set is written in the alternative RAM.
前記アクセス切替手段は、前記CPUによりアクセスされる際の所定アドレス領域を変更可能に設けられていることを特徴とする請求項2記載のエミュレータ。

3. The emulator according to claim 2, wherein the access switching means is provided so that a predetermined address area when accessed by the CPU can be changed.

JP2004091807A 2004-03-26 2004-03-26 Emulator Pending JP2005276065A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004091807A JP2005276065A (en) 2004-03-26 2004-03-26 Emulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004091807A JP2005276065A (en) 2004-03-26 2004-03-26 Emulator

Publications (1)

Publication Number Publication Date
JP2005276065A true JP2005276065A (en) 2005-10-06

Family

ID=35175644

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004091807A Pending JP2005276065A (en) 2004-03-26 2004-03-26 Emulator

Country Status (1)

Country Link
JP (1) JP2005276065A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210334197A1 (en) * 2020-04-28 2021-10-28 Salesforce.Com, Inc. Browser-based tests for hybrid applications using a launcher plug-in

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01155599A (en) * 1987-12-11 1989-06-19 Nec Home Electron Ltd Memory device
JPH03266141A (en) * 1990-03-16 1991-11-27 Nec Corp Microprocessor system
JPH04337844A (en) * 1991-05-15 1992-11-25 Fujitsu Ltd Semiconductor memory device and semiconductor integrated circuit device
JPH05334071A (en) * 1992-05-28 1993-12-17 Matsushita Electric Ind Co Ltd One-chip microcomputer
JPH0793177A (en) * 1993-09-27 1995-04-07 Nec Corp Emulation chip and in-circuit emulator
JP2001265620A (en) * 2000-03-22 2001-09-28 Kyocera Corp Program debugging system for rom
JP2001318802A (en) * 2000-05-10 2001-11-16 Nec Microsystems Ltd In-circuit emulator
JP2002007164A (en) * 2000-06-27 2002-01-11 Seiko Epson Corp Chip for semiconductor integrated circuit and emulation system
JP2002082819A (en) * 2000-09-11 2002-03-22 Hitachi Ltd Semiconductor integrated circuit device
JP2003316484A (en) * 2002-04-25 2003-11-07 Denso Corp System for supporting cpu development and protecting device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01155599A (en) * 1987-12-11 1989-06-19 Nec Home Electron Ltd Memory device
JPH03266141A (en) * 1990-03-16 1991-11-27 Nec Corp Microprocessor system
JPH04337844A (en) * 1991-05-15 1992-11-25 Fujitsu Ltd Semiconductor memory device and semiconductor integrated circuit device
JPH05334071A (en) * 1992-05-28 1993-12-17 Matsushita Electric Ind Co Ltd One-chip microcomputer
JPH0793177A (en) * 1993-09-27 1995-04-07 Nec Corp Emulation chip and in-circuit emulator
JP2001265620A (en) * 2000-03-22 2001-09-28 Kyocera Corp Program debugging system for rom
JP2001318802A (en) * 2000-05-10 2001-11-16 Nec Microsystems Ltd In-circuit emulator
JP2002007164A (en) * 2000-06-27 2002-01-11 Seiko Epson Corp Chip for semiconductor integrated circuit and emulation system
JP2002082819A (en) * 2000-09-11 2002-03-22 Hitachi Ltd Semiconductor integrated circuit device
JP2003316484A (en) * 2002-04-25 2003-11-07 Denso Corp System for supporting cpu development and protecting device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210334197A1 (en) * 2020-04-28 2021-10-28 Salesforce.Com, Inc. Browser-based tests for hybrid applications using a launcher plug-in

Similar Documents

Publication Publication Date Title
US6094730A (en) Hardware-assisted firmware tracing method and apparatus
US6662314B1 (en) Microcomputer including program for rewriting data in an internal flash memory
JPH06314213A (en) Debugging device
US6798713B1 (en) Implementing software breakpoints
US7506206B2 (en) Mechanism for providing program breakpoints in a microcontroller with flash program memory
US5901283A (en) Microcomputer
JP2006507586A (en) Apparatus and method for analyzing embedded system
JP2007257441A (en) Processor and processor control method
CN101095119B (en) Device and method for analyzing embedded systems with test interfaces
CN114168073B (en) Solid state disk debugging space access method and device
JP2005276065A (en) Emulator
JP2001265620A (en) Program debugging system for rom
KR100543152B1 (en) Microprocessor and processing method of microprocessor
JP2006293824A (en) Semiconductor device
JP2004094451A (en) On-chip jtag interface circuit and system lsi
JPH1040130A (en) Microcomputer
US7596717B2 (en) Microcomputer and debugging method
JP4848126B2 (en) Microcomputer, data protection method for nonvolatile memory in microcomputer
KR100273280B1 (en) Debugging logic control circuit
JP2002541582A (en) Method and system for updating user memory in an emulator system
JPS6061841A (en) Control system of program evaluating device
JP2006318172A (en) Microcomputer
JP2000194580A (en) Cpu development assisting device
JP2000259448A (en) Program debugging device
JP3149575B2 (en) In-circuit emulator

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070305

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090515

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090616

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090804

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100615