JP2000242524A - Software simulator for processor - Google Patents
Software simulator for processorInfo
- Publication number
- JP2000242524A JP2000242524A JP11039512A JP3951299A JP2000242524A JP 2000242524 A JP2000242524 A JP 2000242524A JP 11039512 A JP11039512 A JP 11039512A JP 3951299 A JP3951299 A JP 3951299A JP 2000242524 A JP2000242524 A JP 2000242524A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- state
- model
- information file
- processor
- 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
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】この発明は、プログラムをデ
バックするために使用するプロセッサのソフトウエアシ
ミュレータに関する。The present invention relates to a software simulator for a processor used for debugging a program.
【0002】[0002]
【従来の技術】図3は、従来のプロセッサのソフトウエ
アシミュレータの構成を示している。2. Description of the Related Art FIG. 3 shows a configuration of a conventional software simulator of a processor.
【0003】ソフトウエアシミュレータは、プロセッサ
と同じ動作を行うプログラムからなるシミュレータエン
ジン部11と、プロセッサが内蔵するレジスタ群をソフ
ト的に実現したレジスタ群モデル12と、プロセッサが
内蔵するデータメモリをソフト的に実現したデータメモ
リモデル13と、プロセッサが内蔵するプログラムメモ
リをソフト的に実現したプログラムメモリモデル14と
を備えている。プログラムメモリモデル14には、デバ
ック対象のプログラムが格納されている。[0003] The software simulator includes a simulator engine unit 11 composed of a program that performs the same operation as the processor, a register group model 12 that realizes a register group built in the processor in software, and a data memory built in the processor in software. And a program memory model 14 in which a program memory incorporated in the processor is implemented in software. The program memory model 14 stores a program to be debugged.
【0004】シミュレータエンジン部11に実行開始命
令が入力されると、デバック対象のプログラムが実行せ
しめられる。このような従来のプロセッサのソフトウエ
アシミュレータでは、プログラムのデバック中に、デバ
ック対象のプログラムの命令を一旦実行してしまうと、
実行過程の途中の状態に戻れなかった。このため、実行
過程の途中の状態を検証する必要が生じた場合には、再
度その状態まで、シミュレーションを行う必要があっ
た。When an execution start command is input to the simulator engine unit 11, a program to be debugged is executed. In such a conventional processor software simulator, during execution of a program, once the instruction of the program to be debugged is executed,
Could not return to the state during the execution process. Therefore, when it becomes necessary to verify a state in the middle of the execution process, it was necessary to perform the simulation again up to that state.
【0005】[0005]
【発明が解決しようとする課題】この発明は、デバック
対象のプログラムの命令を実行した後において、ソフト
ウエアシミュレータの状態を命令実行過程の途中の状態
に容易に戻すことができるプロセッサのソフトウエアシ
ミュレータを提供することを目的とする。SUMMARY OF THE INVENTION The present invention provides a software simulator for a processor which can easily return the state of a software simulator to a state in the course of instruction execution after executing an instruction of a program to be debugged. The purpose is to provide.
【0006】[0006]
【課題を解決するための手段】この発明による第1のプ
ロセッサのソフトウエアシミュレータは、命令が1つ実
行される毎に、レジスタモデルおよびメモリモデルのリ
ソース値を状態情報ファイルに保持させる手段、ならび
に命令実行後において、1命令分だけ状態を戻すための
指令が入力された場合に、状態情報ファイルの内容に基
づいて、レジスタモデルおよびデータメモリモデルのリ
ソース値を、現在の状態より1命令分だけ前の状態に戻
す手段を備えていることを特徴とする。According to a first aspect of the present invention, there is provided a software simulator of a first processor, wherein each time one instruction is executed, a resource value of a register model and a memory model is held in a state information file; When an instruction for returning the state by one instruction is input after executing the instruction, the resource values of the register model and the data memory model are changed by one instruction from the current state based on the contents of the state information file. It is characterized by having means for returning to the previous state.
【0007】この発明による第2のプロセッサのソフト
ウエアシミュレータは、命令が1つ実行される毎に、レ
ジスタモデルおよびメモリモデルのリソース値を状態情
報ファイルに保持させる手段、ならびに命令実行後にお
いて、命令実行過程の途中の所定の段階に状態を戻すた
めの指令が入力された場合に、状態情報ファイルの内容
に基づいて、レジスタモデルおよびメモリモデルのリソ
ース値を、指定された段階の状態に戻す手段を備えてい
ることを特徴とする。A software simulator for a second processor according to the present invention includes means for holding a resource value of a register model and a memory model in a state information file each time one instruction is executed, and for executing the instruction after executing the instruction. Means for returning the resource values of the register model and the memory model to the state of the designated stage based on the contents of the state information file when a command for returning the state to a predetermined stage during the execution process is input. It is characterized by having.
【0008】[0008]
【0009】以下、図1および図2を参照して、この発
明の実施の形態について説明する。An embodiment of the present invention will be described below with reference to FIGS.
【0010】図1は、プロセッサのソフトウエアシミュ
レータの構成を示している。FIG. 1 shows a configuration of a software simulator of a processor.
【0011】ソフトウエアシミュレータは、プロセッサ
と同じ動作を行うプログラムからなるシミュレータエン
ジン部1と、プロセッサが内蔵するレジスタ群をソフト
的に実現したレジスタ群モデル2と、プロセッサが内蔵
するデータメモリをソフト的に実現したデータメモリモ
デル3と、プロセッサが内蔵するプログラムメモリをソ
フト的に実現したプログラムメモリモデル4と、シミュ
レータの状態を管理する状態管理部5と、状態情報ファ
イル6とを備えている。プログラムメモリモデル4に
は、デバック対象のプログラムが格納されている。The software simulator includes a simulator engine unit 1 composed of a program that performs the same operation as the processor, a register group model 2 that implements a register group incorporated in the processor in software, and a data memory incorporated in the processor in software. And a program memory model 4 in which a program memory incorporated in the processor is implemented in software, a state management unit 5 for managing the state of the simulator, and a state information file 6. The program memory model 4 stores a program to be debugged.
【0012】シミュレータエンジン部1には、実行開始
命令(実行すべきプログラムの範囲を指定することも可
能)とともに状態管理部5による動作を作動状態または
停止状態にするための指令が入力される。状態管理部5
による動作を停止状態にするための指令がシミュレータ
エンジン部1に入力された場合には、ソフトウエアシミ
ュレータの動作は従来と全く同じとなる。The simulator engine unit 1 receives an instruction to start or stop the operation of the state management unit 5 together with an execution start instruction (the range of a program to be executed can also be specified). State management unit 5
When a command to stop the operation of the software simulator is input to the simulator engine unit 1, the operation of the software simulator is exactly the same as the conventional one.
【0013】実行開始命令とともに状態管理部5による
動作を作動状態にするための指令がシミュレータエンジ
ン部1に入力された場合には、プログラム実行中におい
て、状態管理部5は次のような動作を行う。When a command for making the operation by the state management unit 5 into an operating state is input to the simulator engine unit 1 together with the execution start instruction, the state management unit 5 performs the following operation during execution of the program. Do.
【0014】つまり、状態管理部5は、シミュレータエ
ンジン部1が命令を1つ実行する毎に、レジスタ群モデ
ル2の各レジスタモデルのリソース値およびデータメモ
リモデル3のリソース値ならびに実行した命令の内容を
状態情報ファイル6に出力する。状態情報ファイル6
は、状態管理部5から出力された最新の所定命令数分、
例えば最新の10命令分のリソース値および実行命令を
保持する。That is, each time the simulator engine unit 1 executes one instruction, the state management unit 5 sets the resource value of each register model of the register group model 2, the resource value of the data memory model 3, and the content of the executed instruction. Is output to the state information file 6. Status information file 6
Are the number of the latest predetermined instructions output from the state management unit 5,
For example, resource values and execution instructions for the latest 10 instructions are held.
【0015】このようにして、全ての命令が実行された
後において、1命令分だけ状態を戻すための指令がシミ
ュレータエンジン部1に入力されると、状態管理部5
は、状態情報ファイル6を逆にたどって、1命令分前の
リソース値に基づいて、レジスタ群モデル2およびデー
タメモリモデル3のリソース値を1命令分前の値に書き
換える。この例では、このように動作を順次行うことに
より9命令分前の状態まで戻ることができる。As described above, when a command for returning the state by one instruction is input to the simulator engine unit 1 after all the instructions have been executed, the state management unit 5
Reversely rewrites the resource value of the register group model 2 and the data memory model 3 to the value of one instruction before based on the resource value of one instruction before by following the state information file 6. In this example, by sequentially performing the operations as described above, it is possible to return to the state nine instructions earlier.
【0016】図2に示すように、レジスタモデルR1の
リソース値と、データメモリモデルのアドレス0x10
0のリソース値とを更新する命令Aが実行される場合に
は、実行前のリソース値が状態情報ファイル6に保持さ
れるため、A命令実行後において、状態情報ファイル6
を参照してA命令実行前の状態に戻ることができる。As shown in FIG. 2, the resource value of the register model R1 and the address of the data memory model 0x10
When the instruction A for updating the resource value of 0 is executed, the resource value before the execution is held in the state information file 6, so that after the execution of the A instruction, the state information file 6 is updated.
To return to the state before the execution of the A instruction.
【0017】なお、命令実行後において、命令実行過程
の途中の所定の段階に状態を戻すための指令がシミュレ
ータエンジン部1に入力された場合に、状態情報ファイ
ルの内容に基づいて、レジスタモデルおよびデータメモ
リモデルのリソース値を、指定された段階のリソース値
に書き換えるようにしてもよい。After the instruction is executed, when a command for returning the state to a predetermined stage in the course of the instruction execution is input to the simulator engine unit 1, the register model and the register model are updated based on the contents of the state information file. The resource value of the data memory model may be rewritten to a resource value at a specified stage.
【0018】[0018]
【発明の効果】この発明によれば、命令実行後におい
て、ソフトウエアシミュレータの状態を命令実行過程の
途中の状態に容易に戻すことができるようになる。According to the present invention, the state of the software simulator can be easily returned to the state in the course of the instruction execution after the execution of the instruction.
【図1】プロセッサのソフトウエアシミュレータの構成
を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration of a software simulator of a processor.
【図2】レジスタモデルR1のリソース値とデータメモ
リモデルのアドレス0x100のリソース値とを更新す
る命令Aが実行される場合に、状態情報ファイルに保持
されている情報を示す模式図である。FIG. 2 is a schematic diagram showing information held in a state information file when an instruction A for updating a resource value of a register model R1 and a resource value of an address 0x100 of a data memory model is executed.
【図3】従来のプロセッサのソフトウエアシミュレータ
の構成を示すブロック図であるFIG. 3 is a block diagram showing a configuration of a conventional software simulator of a processor.
1 シミュレータエンジン部 2 レジスタ群モデル 3 データメモリモデル 4 プログラムメモリモデル 5 状態管理部 6 状態情報ファイル DESCRIPTION OF SYMBOLS 1 Simulator engine part 2 Register group model 3 Data memory model 4 Program memory model 5 State management part 6 State information file
Claims (2)
デルおよびメモリモデルのリソース値を状態情報ファイ
ルに保持させる手段、ならびに命令実行後において、1
命令分だけ状態を戻すための指令が入力された場合に、
状態情報ファイルの内容に基づいて、レジスタモデルお
よびメモリモデルのリソース値を、現在の状態より1命
令分だけ前の状態に戻す手段、 を備えているプロセッサのソフトウエアシミュレータ。1. A means for holding a resource value of a register model and a memory model in a state information file each time one instruction is executed, and
When a command to return the status by the command is input,
Means for returning the resource values of the register model and the memory model to a state one instruction prior to the current state based on the contents of the state information file.
デルおよびメモリモデルのリソース値を状態情報ファイ
ルに保持させる手段、ならびに命令実行後において、命
令実行過程の途中の所定の段階に状態を戻すための指令
が入力された場合に、状態情報ファイルの内容に基づい
て、レジスタモデルおよびメモリモデルのリソース値
を、指定された段階の状態に戻す手段、 を備えているプロセッサのソフトウエアシミュレータ。2. A means for holding a resource value of a register model and a memory model in a state information file every time one instruction is executed, and after execution of the instruction, a state is set at a predetermined stage in the instruction execution process. Means for restoring the resource values of the register model and the memory model to the state at the specified stage based on the contents of the state information file when a command for returning is input.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11039512A JP2000242524A (en) | 1999-02-18 | 1999-02-18 | Software simulator for processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11039512A JP2000242524A (en) | 1999-02-18 | 1999-02-18 | Software simulator for processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2000242524A true JP2000242524A (en) | 2000-09-08 |
Family
ID=12555106
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP11039512A Pending JP2000242524A (en) | 1999-02-18 | 1999-02-18 | Software simulator for processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2000242524A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007004400A (en) * | 2005-06-22 | 2007-01-11 | Oki Data Corp | Program debug method |
JP6076576B1 (en) * | 2016-06-07 | 2017-02-08 | 三菱電機株式会社 | Simulation apparatus and simulation program |
-
1999
- 1999-02-18 JP JP11039512A patent/JP2000242524A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007004400A (en) * | 2005-06-22 | 2007-01-11 | Oki Data Corp | Program debug method |
JP6076576B1 (en) * | 2016-06-07 | 2017-02-08 | 三菱電機株式会社 | Simulation apparatus and simulation program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPS5975347A (en) | Simulation device of logical circuit | |
JPH10171848A (en) | Method for designing architecture system | |
JP2000242524A (en) | Software simulator for processor | |
JP3844051B2 (en) | controller | |
JP2003122410A (en) | Method for causing controller to perform computation | |
JPH0410081B2 (en) | ||
JPH08185341A (en) | Cpu simulator | |
JPH04239338A (en) | Measuring system for microprogram comprehension rate | |
JP2573391B2 (en) | Programmable controller | |
JP2747164B2 (en) | Software simulator | |
US8751210B1 (en) | Suspending procedures in simulation of a circuit design | |
JPH03266080A (en) | Logic simulation method | |
JPH10240504A (en) | Preparation method for communication program | |
JP3541094B2 (en) | Multitask control system and control method | |
JPH0353321A (en) | Information processor | |
JPH081646B2 (en) | Logic simulation device | |
JPS63180129A (en) | Program connection system | |
JPH02205143A (en) | Packet switching network information managing method | |
JPH01205337A (en) | Instruction control system | |
JPH0337719A (en) | System for expanding master file on main storage device | |
JPH08263527A (en) | System and method for simulation of cpu peripheral equipment | |
JPH0421028A (en) | Register managing method | |
JPH04259085A (en) | Memory access control method for data driven processor | |
JPH03233703A (en) | Sequence controller | |
JPS62254207A (en) | Method for extending work file area |