JPH11282693A - Mcu simulation device, its simulation method and computer redable recording medium recording simulation program - Google Patents

Mcu simulation device, its simulation method and computer redable recording medium recording simulation program

Info

Publication number
JPH11282693A
JPH11282693A JP10084612A JP8461298A JPH11282693A JP H11282693 A JPH11282693 A JP H11282693A JP 10084612 A JP10084612 A JP 10084612A JP 8461298 A JP8461298 A JP 8461298A JP H11282693 A JPH11282693 A JP H11282693A
Authority
JP
Japan
Prior art keywords
simulation
memory
unit
simulation unit
mcu
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
JP10084612A
Other languages
Japanese (ja)
Inventor
Hidenao Bito
英直 尾藤
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP10084612A priority Critical patent/JPH11282693A/en
Publication of JPH11282693A publication Critical patent/JPH11282693A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To make it possible to reduce labor for compiling/linking even when many derived micro central units(MCUs) should be prepared. SOLUTION: The MCU simulation device includes an input means 100 for inputting a program to be debugged and respective instructions, a mapping information generation means 210 for generating the description of processing depending upon a specific address from a source program as mapping information, a compiling/linking means 220 for compiling and/or linking respective simulation parts by description independent of the specific address in the source program, a simulation means 230 for generating access information describing an access between respective simulation parts and executing simulation, and an output means 300 for outputting a simulation result.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、組込型ソフトウェ
ア開発用マイクロコンピュータのシミュレーション装置
であって、とくに周辺入出力装置のシミュレーションを
行うことのできるMCU(マイクロセントラルユニッ
ト)シミュレーション装置、そのシミュレーション方法
及びそのシミュレーションプログラムを記録したコンピ
ュータ読み取り可能な記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a simulation device for a microcomputer for embedded software development, and more particularly to an MCU (micro central unit) simulation device capable of simulating a peripheral input / output device, and a simulation method therefor. And a computer-readable recording medium storing the simulation program.

【0002】[0002]

【従来の技術】まず、シミュレーションの対象となる現
実の組込みシステムにおけるシステム構成例を図14に
示す。このシステムにおけるMCU(マイクロセントラ
ルユニット)は、入力されるターゲットプログラムの実
行を行うCPUと、ハードウェアからの入力信号をCP
Uへの入力信号に変換したり、逆にCPUからの出力信
号をハードウェアを制御する出力信号へ変換する入出力
装置a、b、cとから構成されている。
2. Description of the Related Art First, an example of a system configuration in a real embedded system to be simulated is shown in FIG. An MCU (micro central unit) in this system includes a CPU for executing an input target program and a CP for inputting signals from hardware.
It comprises input / output devices a, b, and c for converting an input signal to the U or an output signal from the CPU to an output signal for controlling hardware.

【0003】CPUから周辺の入出力装置a、b、cに
対する命令は、個々の入出力装置a、b、cに備えられ
たI/Oレジスタに対するリード/ライト命令によって
一般的に行われる。各I/Oレジスタは、CPUから見
れば、アクセス可能なメモリの一部である。
An instruction from the CPU to the peripheral input / output devices a, b, and c is generally given by a read / write instruction to an I / O register provided in each of the input / output devices a, b, and c. Each I / O register is a part of an accessible memory when viewed from the CPU.

【0004】このような組込みシステムの制御を行うタ
ーゲットプログラムの開発では、周辺入出力装置の制御
についても合わせて検証を行う必要があるので、周辺入
出力装置を含んだMCUを忠実にシミュレーションする
ことのできるMCUシミュレーション装置が求められて
きた。このようなMCUシミュレーション装置を実現さ
せるためには、MCUがCPUや入出力装置a、b、c
などによって構成されているので、従来のMCUシミュ
レーション装置では、CPUのシミュレーションを行う
CPUシミュレーション部や入出力装置a、b、cのシ
ミュレーションを行うI/Oシミュレーション部a、
b、cなどによって構成して実現させていた。
In the development of a target program for controlling such an embedded system, it is necessary to verify the control of the peripheral input / output devices together. Therefore, it is necessary to faithfully simulate the MCU including the peripheral input / output devices. There is a need for an MCU simulation device that can perform the above. In order to realize such an MCU simulation apparatus, the MCU includes a CPU and input / output devices a, b, and c.
In the conventional MCU simulation device, the CPU simulation unit that simulates the CPU and the I / O simulation unit a that simulates the input / output devices a, b, and c.
It is realized by being constituted by b, c, and the like.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上述し
たような従来のMCUシミュレーション装置では、MC
Uシミュレーション装置の各シミュレーション部をコン
パイルするためのソースプログラム中に特定のアドレス
に依存した処理が埋め込まれていたため、CPUをシミ
ュレーションするCPUシミュレーション部やその他の
バスシミュレーション部、I/Oシミュレーション部な
どの全てのシミュレーション部が固定的にリンクされて
いた。
However, in the conventional MCU simulation apparatus as described above, the MC
Since a process depending on a specific address is embedded in a source program for compiling each simulation unit of the U simulation device, a CPU simulation unit for simulating a CPU, another bus simulation unit, an I / O simulation unit, and the like are used. All simulation sections were fixedly linked.

【0006】このような従来のMCUシミュレーション
装置において、N個の派生MCUをシミュレーションし
なければならない場合について図15を用いて説明す
る。
A case where N derived MCUs must be simulated in such a conventional MCU simulation apparatus will be described with reference to FIG.

【0007】MCUのシミュレーションを行う場合に
は、MCUシミュレーション装置の各シミュレーション
部のコンパイル、リンクを行うソースプログラムが必要
である。このソースプログラム内に特定のアドレスに依
存した記述があると、エディタなどによって、その記述
を各派生MCU毎に更新しなければならない。そして、
その更新されたソースプログラム01、02、03をそ
れぞれコンパイル/リンクすることによって、それぞれ
のMCUシミュレーション装置01、02、03を生成
していた。
To simulate an MCU, a source program for compiling and linking each simulation unit of the MCU simulation device is required. If there is a description depending on a specific address in this source program, the description must be updated for each derived MCU using an editor or the like. And
By compiling / linking the updated source programs 01, 02, and 03, the respective MCU simulation apparatuses 01, 02, and 03 are generated.

【0008】このように、各シミュレーション部が固定
的にリンクされた従来のシミュレーション装置では、N
個の派生MCUが存在する場合には、N回のソースプロ
グラムの更新と、N回のコンパイル/リンクによって、
N個の派生MCUシミュレーション装置を用意しなけれ
ばならなかった。
As described above, in the conventional simulation device in which the respective simulation units are fixedly linked, N
If there are N derived MCUs, N updates of the source program and N compiles / links give
N derivative MCU simulation devices had to be prepared.

【0009】組込みシステムでは、外部に接続されるハ
ードウェアのそれぞれに適した周辺入出力装置がそれぞ
れ存在するため、たとえCPUコアが同じであってもさ
まざまな入出力装置を有するMCUが数多く存在し、同
一の装置構成でもI/Oレジスタの割り当てられるアド
レスだけが異なるものが多く存在する。そのために、ソ
ースプログラム中に特定のアドレスに依存した記述があ
ると、N回のソースプログラムの更新と、N回のコンパ
イル/リンクが必要になっていた。
In an embedded system, since there are peripheral input / output devices suitable for each of externally connected hardware, there are many MCUs having various input / output devices even if the CPU core is the same. In many cases, only the addresses assigned to the I / O registers are different even in the same device configuration. Therefore, if there is a description depending on a specific address in the source program, it is necessary to update the source program N times and compile / link N times.

【0010】この場合に、ソースプログラムの更新には
それほど手間はかからないが、ソースプログラムのコン
パイル/リンクには大きな手間がかかるため、従来のシ
ミュレーション装置によってN個の派生MCUシミュレ
ーション装置を用意しなければならない場合には大きな
問題となっていた。
In this case, updating the source program does not take much time, but compiling / linking the source program takes a lot of time. Therefore, it is necessary to prepare N derivative MCU simulation apparatuses using a conventional simulation apparatus. If not, it was a big problem.

【0011】また、新たなCPUが出てきたときには、
ソースプログラムのうちのCPUに関するプログラムを
書き換えて、再び図15に示すようにソースプログラム
の更新とコンパイル/リンクを行わなければならなかっ
た。これでは、変更されたCPUに関するプログラムだ
けでなく、入出力装置に関するプログラムについても、
再び更新とコンパイル/リンクを行わなければならない
ため、無駄な処理が行われていた。
When a new CPU comes out,
It is necessary to rewrite the program relating to the CPU among the source programs and update and compile / link the source program again as shown in FIG. In this way, not only the program related to the changed CPU, but also the program related to the input / output device,
Since updating and compiling / linking have to be performed again, useless processing has been performed.

【0012】本発明は上記事情に鑑みてなされたもので
あり、その目的は、多くの派生MCUシミュレーション
装置を用意しなければならない場合でも、N回のコンパ
イル/リンクを行う必要のないMCUシミュレーション
装置、そのシミュレーション方法及びそのシミュレーシ
ョンプログラムを記録したコンピュータ読み取り可能な
記録媒体を提供することにある。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an MCU simulation apparatus which does not need to compile / link N times even when many derived MCU simulation apparatuses must be prepared. And a computer-readable recording medium storing the simulation method and the simulation program.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するため
に、第1の発明であるMCUシミュレーション装置はC
PUの動作をシミュレーションするCPUシミュレーシ
ョン部とI/O登録情報を有しCPUの周辺入出力装置
のシミュレーションを行うI/Oシミュレーション部と
メモリ登録情報を有しメモリのシミュレーションを行う
メモリシミュレーション部と前記各シミュレーション部
間のアクセス制御を行うバスシミュレーション部とによ
ってMCUのシミュレーションを行うMCUシミュレー
ション装置であって、シミュレーションしようとする被
デバックプログラムとソースプログラムとを入力する入
力手段と、この入力手段により入力された前記ソースプ
ログラムから特定のアドレスに依存した処理についての
記述をマッピング情報として生成するマッピング情報生
成手段と、前記入力手段により入力された前記ソースプ
ログラムから特定のアドレスに依存しない処理につい
て、前記CPUシミュレーション部、前記I/Oシミュ
レーション部、前記メモリシミュレーション部をそれぞ
れ別々にコンパイルとリンクを行うコンパイル/リンク
手段と、このコンパイル/リンク手段によって、コンパ
イルとリンクのされた前記CPUシミュレーション部と
前記I/Oシミュレーション部と前記メモリシミュレー
ション部と、前記バスシミュレーション部とを具備し、
前記マッピング情報と前記I/O登録情報と前記メモリ
登録情報とから各シミュレーション部間のアクセスにつ
いて記述するアクセス情報を生成し、このアクセス情報
によりシミュレーションを行うシミュレーション手段
と、このシミュレーション手段のシミュレーションの結
果を出力する出力手段とを含むことを特徴とする。
In order to achieve the above object, an MCU simulation apparatus according to a first aspect of the present invention has
A CPU simulation unit for simulating the operation of the PU, an I / O simulation unit having I / O registration information for simulating a peripheral input / output device of the CPU, a memory simulation unit having memory registration information for simulating a memory, and An MCU simulation device for simulating an MCU by a bus simulation unit for controlling access between simulation units, comprising: input means for inputting a debugged program to be simulated and a source program; Mapping information generating means for generating, as mapping information, a description of a process depending on a specific address from the source program, and specifying the description from the source program input by the input means. Compile / link means for compiling and linking the CPU simulation section, the I / O simulation section, and the memory simulation section separately, and compiling and linking are performed by the compiling / linking section. The CPU simulation unit, the I / O simulation unit, the memory simulation unit, and the bus simulation unit.
Simulation means for generating access information describing access between simulation units from the mapping information, the I / O registration information, and the memory registration information, and performing a simulation based on the access information; and a simulation result of the simulation means And output means for outputting

【0014】この第1の発明によれば、さまざまな入出
力装置を有する複数のMCUをシミュレーションする場
合でも、それぞれの入出力装置に対応したI/Oシミュ
レーション部を動的にリンクするだけで、複数のMCU
のシミュレーションを行うことができる。
According to the first aspect, even when a plurality of MCUs having various input / output devices are simulated, only the I / O simulation units corresponding to the respective input / output devices are dynamically linked. Multiple MCUs
Simulation can be performed.

【0015】また、本発明のMCUシミュレーション装
置の別の効果として、新しいCPUが出てきたときで
も、周辺入出力装置が同じものであれば、CPUのみを
新たなCPUソースプログラムでコンパイル/リンクし
直すことにより、新たなCPUを含むMCUのシミュレ
ーションを行うことができる。
Another effect of the MCU simulation apparatus of the present invention is that even when a new CPU comes out, if the peripheral input / output device is the same, only the CPU is compiled / linked with the new CPU source program. By doing so, it is possible to simulate the MCU including the new CPU.

【0016】第2の発明であるMCUのシミュレーショ
ン方法は、CPUの動作をシミュレーションするCPU
シミュレーション部とI/O登録情報を有しCPUの周
辺入出力装置のシミュレーションを行うI/Oシミュレ
ーション部とメモリ登録情報を有しメモリのシミュレー
ションを行うメモリシミュレーション部と前記各シミュ
レーション部間のアクセス制御を行うバスシミュレーシ
ョン部とを利用してMCUのシミュレーションを行うM
CUのシミュレーション方法であって、ソースプログラ
ムから特定のアドレスに依存した処理についての記述を
マッピング情報として生成するマッピング情報生成ステ
ップと、前記ソースプログラムから特定のアドレスに依
存しない処理について、前記CPUシミュレーション
部、前記I/Oシミュレーション部、前記メモリシミュ
レーション部をそれぞれ別々にコンパイルとリンクを行
うコンパイル/リンクステップと、前記マッピング情報
と前記I/O登録情報と前記メモリ登録情報とから前記
各シミュレーション部間のアクセスについて記述するア
クセス情報を生成し、このアクセス情報により前記各シ
ミュレーション部を利用してシミュレーションを行うシ
ミュレーションステップとを含むことを特徴とする。
According to a second aspect of the present invention, there is provided an MCU simulation method which simulates the operation of a CPU.
An I / O simulation unit having a simulation unit and I / O registration information for simulating a peripheral input / output device of a CPU, a memory simulation unit having memory registration information for simulating a memory, and access control between the simulation units M that simulates an MCU using a bus simulation unit that performs
A CU simulation method, comprising: a mapping information generating step of generating, as mapping information, a description of a process dependent on a specific address from a source program; and a CPU simulation unit for a process independent of a specific address from the source program. A compiling / linking step of separately compiling and linking the I / O simulation section and the memory simulation section; and interpolating between the simulation sections based on the mapping information, the I / O registration information, and the memory registration information. Generating access information describing access, and performing a simulation using each of the simulation units based on the access information.

【0017】この第2の発明によれば、第1の発明によ
る効果と同様の効果を奏するMCUのシミュレーション
方法を実現することができる。
According to the second aspect of the present invention, it is possible to realize an MCU simulation method having the same effect as that of the first aspect of the present invention.

【0018】第3の発明であるMCUのシミュレーショ
ンプログラムを記録したコンピュータ読み取り可能な記
録媒体は、CPUの動作をシミュレーションするCPU
シミュレーション部とI/O登録情報を有しCPUの周
辺入出力装置のシミュレーションを行うI/Oシミュレ
ーション部とメモリ登録情報を有しメモリのシミュレー
ションを行うメモリシミュレーション部と前記各シミュ
レーション部間のアクセス制御を行うバスシミュレーシ
ョン部とを利用してMCUのシミュレーションを行うM
CUのシミュレーションプログラムを記録したコンピュ
ータ読み取り可能な記録媒体であって、ソースプログラ
ムから特定のアドレスに依存した処理についての記述を
マッピング情報として生成するマッピング情報生成処理
と、前記ソースプログラムから特定のアドレスに依存し
ない処理について、前記CPUシミュレーション部、前
記I/Oシミュレーション部、前記メモリシミュレーシ
ョン部をそれぞれ別々にコンパイルとリンクを行うコン
パイル/リンク処理と、前記マッピング情報と前記I/
O登録情報と前記メモリ登録情報とから前記各シミュレ
ーション部間のアクセスについて記述するアクセス情報
を生成し、このアクセス情報により前記各シミュレーシ
ョン部を利用してシミュレーションを行うシミュレーシ
ョン処理とを含み、これら処理をコンピュータに実行さ
せることを特徴とする。
According to a third aspect of the present invention, there is provided a computer-readable recording medium on which an MCU simulation program is recorded.
An I / O simulation unit having a simulation unit and I / O registration information for simulating a peripheral input / output device of a CPU, a memory simulation unit having memory registration information for simulating a memory, and access control between the simulation units M that simulates an MCU using a bus simulation unit that performs
A computer-readable recording medium on which a simulation program of a CU is recorded, wherein a mapping information generation process for generating a description of a process dependent on a specific address from a source program as mapping information, Compile / link processing for compiling and linking each of the CPU simulation section, the I / O simulation section, and the memory simulation section separately;
A simulation process of generating access information describing access between the simulation units from the O registration information and the memory registration information, and performing a simulation using the simulation units based on the access information. It is characterized by being executed by a computer.

【0019】この第3の発明によれば、第1の発明によ
る効果と同様の効果を奏するMCUのシミュレーション
プログラムを記録したコンピュータ読み取り可能な記録
媒体を実現することができる。
According to the third aspect, it is possible to realize a computer-readable recording medium on which an MCU simulation program having the same effect as that of the first aspect is recorded.

【0020】[0020]

【発明の実施の形態】以下、本発明に係るMCUシミュ
レーション装置、そのシミュレーション方法及びそのシ
ミュレーションプログラムを記録したコンピュータ読み
取り可能な記録媒体の一実施形態を図面に基づいて説明
する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an embodiment of an MCU simulation apparatus, a simulation method thereof, and a computer-readable recording medium storing the simulation program according to the present invention will be described with reference to the drawings.

【0021】図1は本発明のMCUシミュレーション装
置の構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of an MCU simulation apparatus according to the present invention.

【0022】図1に示すように、本発明に係るMCUシ
ミュレーション装置は、シミュレーションしようとする
被デバックプログラムやソースプログラム、各命令など
を入力する入力手段100と、ソースプログラムから特
定のアドレスに依存した処理についての記述をマッピン
グ情報として生成するマッピング情報生成手段210
と、ソースプログラムから特定のアドレスに依存しない
処理についての記述によって、コンパイルやリンクを行
うコンパイル/リンク手段220と、CPUシミュレー
ション部とI/Oシミュレーション部とメモリシミュレ
ーション部とバスシミュレーション部とを具備し、マッ
ピング情報とI/O登録情報とメモリ登録情報とから各
シミュレーション部間のアクセスについて記述するアク
セス情報を生成し、このアクセス情報によりシミュレー
ションを行うシミュレーション手段230と、シミュレ
ーションの結果を出力する出力手段300とから構成さ
れている。
As shown in FIG. 1, the MCU simulation apparatus according to the present invention depends on an input means 100 for inputting a debugged program or a source program to be simulated, each instruction, etc., and a specific address from the source program. Mapping information generating means 210 for generating a description of a process as mapping information
And a compiling / linking means 220 for compiling and linking according to a description of processing independent of a specific address from a source program, a CPU simulation section, an I / O simulation section, a memory simulation section, and a bus simulation section. Simulation means 230 for generating access information describing access between simulation units from mapping information, I / O registration information, and memory registration information, and performing a simulation based on the access information; and output means for outputting a simulation result. 300.

【0023】ここで、シミュレーション手段230は、
図2に示すように、仮想レジスタ101を含むCPUシ
ミュレーション部231と、仮想I/Oレジスタ102
と各仮想I/Oレジスタ102に関する登録情報を有す
るI/Oレジスタ登録情報103とを含むI/Oシミュ
レーション部232と、仮想メモリ104と各仮想メモ
リに関する登録情報を有するメモリ登録情報105とを
含むメモリシミュレーション部233と、アクセス情報
106を含むバスシミュレーション部234とから構成
されている。
Here, the simulation means 230
As shown in FIG. 2, a CPU simulation unit 231 including a virtual register 101 and a virtual I / O register 102
And an I / O simulation unit 232 including the I / O register registration information 103 having registration information on each virtual I / O register 102, and a memory registration information 105 having registration information on each virtual memory 104 and each virtual memory. It comprises a memory simulation unit 233 and a bus simulation unit 234 including the access information 106.

【0024】なお、入力手段100は、キーボード、マ
ウス、ライトペン、又はフレキシブルディスク装置等が
含まれ、処理手段200は、各種の処理を行うためのC
PUと、この処理の命令を記憶する記憶手段とを含む通
常のコンピュータシステムが含まれ、また、出力手段3
00は、ディスプレイ装置やプリンタ装置等が含まれ
る。上記処理手段200に含まれるマッピング情報生成
手段210、コンパイル/リンク手段220、シミュレ
ーション手段230の各処理の命令やタイミング制約は
記憶手段に保持されており、必要に応じてCPUにロー
ドされ、実行がなされる。通常の場合、実行の制御は、
操作者が入力手段100に対して命令(コマンド)の入
力を行うことにより行われる。
The input means 100 includes a keyboard, a mouse, a light pen, a flexible disk device and the like, and the processing means 200 has a C for performing various processes.
A conventional computer system including a PU and storage means for storing instructions for this processing is included.
00 includes a display device, a printer device, and the like. Instructions and timing constraints for the respective processes of the mapping information generating means 210, the compiling / linking means 220, and the simulation means 230 included in the processing means 200 are stored in the storage means, and are loaded into the CPU as necessary and executed. Done. Usually, control of execution is
This is performed by an operator inputting a command (command) to the input unit 100.

【0025】次に、本発明のMCUシミュレーション装
置の動作について説明することで、本発明のMCUのシ
ミュレーション方法についても説明する。
Next, the operation of the MCU simulation apparatus of the present invention will be described, and the MCU simulation method of the present invention will also be described.

【0026】まず、入力手段100に被デバックプログ
ラムDPやソースプログラムSP、各命令を入力する。
被デバックプログラムDPとはデバッグ対象となるプロ
グラムのことである。
First, a program to be debugged DP, a source program SP, and each instruction are input to the input means 100.
The debugged program DP is a program to be debugged.

【0027】入力手段100に各プログラムや各命令が
入力されると、マッピング情報生成手段210ではソー
スプログラムSPの記述の中から特定のアドレスに依存
した処理についての記述をマッピング情報MIとして生
成する。このマッピング情報MIは、仮想I/Oレジス
タ102をターゲットメモリの任意のアドレスに割り付
けるために、バスシミュレーション部234に提供され
る情報である。マッピング情報MIの内容は図3に示す
ように、それぞれの仮想I/Oレジスタに対して、開始
アドレスとデータ長とレジスタを識別するためのユニー
クなIDとで構成されている。IDは数字、レジスタ名
などの別は問わない。マッピング情報MIはシミュレー
ションするターゲットMCUの周辺入出力装置の構成に
照らし合わせて用意されるものである。
When each program or each instruction is input to the input unit 100, the mapping information generating unit 210 generates a description of a process depending on a specific address from the description of the source program SP as mapping information MI. This mapping information MI is information provided to the bus simulation unit 234 to allocate the virtual I / O register 102 to an arbitrary address of the target memory. As shown in FIG. 3, the content of the mapping information MI is composed of a start address, a data length, and a unique ID for identifying the register for each virtual I / O register. The ID does not matter whether it is a number or a register name. The mapping information MI is prepared according to the configuration of the peripheral input / output device of the target MCU to be simulated.

【0028】次に、マッピング情報MIが生成される
と、コンパイル/リンク手段220によりシミュレーシ
ョン手段230の各シミュレーション部のコンパイルと
リンクが行われる。
Next, when the mapping information MI is generated, the compiling / linking means 220 compiles and links each simulation unit of the simulation means 230.

【0029】このコンパイルとリンクでは、ソースプロ
グラムの記述の中から、CPUや各周辺入出力装置毎に
別のソースプログラム、すなわちCPUソースプログラ
ムやI/Oソースプログラムを用意して、CPUや各周
辺入出力装置毎にそれぞれコンパイルとリンクを行う。
この際、特定のアドレスに依存した処理についてはマッ
ピング情報MIに記述されているので、用意するCPU
ソースプログラムなどの中には特定のアドレスに依存し
ない処理についての記述のみが含まれている。
In the compiling and linking, from the description of the source program, another source program for each CPU and each peripheral input / output device, that is, a CPU source program and an I / O source program are prepared, and the CPU and each peripheral input / output device are prepared. Compile and link each I / O device.
At this time, since the processing depending on the specific address is described in the mapping information MI,
The source program or the like contains only a description of a process that does not depend on a specific address.

【0030】ここで、本発明のプログラムモジュール構
成を図4に示す。
FIG. 4 shows a program module configuration according to the present invention.

【0031】MCUシミュレーション装置01のシミュ
レーションを行う場合には、まずCPUソースプログラ
ムaによりCPUシミュレーション部aのコンパイル/
リンクを行い、同様にI/Oソースプログラムa、b、
c、dによりI/Oシミュレーション部a、b、c、d
をそれぞれコンパイル/リンクする。各ソースプログラ
ムは特定のアドレスに依存した処理をプログラム中に含
まないので、いろいろな種類の入出力装置を有するMC
Uをそれぞれシミュレーションする場合には、周辺入出
力装置a、b、c、dのシミュレーションを行う各I/
Oシミュレーション部a、b、c、dをそれぞれ動的に
CPUシミュレーション部とリンクするだけで、それぞ
れのMCUのシミュレーションを行うMCUシミュレー
ション装置を作成することができる。例えば、入出力装
置a、bを含むMCU01のシミュレーションを行う場
合には、シミュレーション時にCPUシミュレーション
部aとI/Oシミュレーション部a,bとを動的にリン
クすることでMCU01のシミュレーションを行うMC
Uシミュレーション装置01を作成することができ、入
出力装置a、b、cを含むMCU02のシミュレーショ
ンを行う場合には、シミュレーション時にCPUシミュ
レーション部aとI/Oシミュレーション部a、b、c
を動的にリンクすることでMCU02のシミュレーショ
ンを行うMCUシミュレーション装置02を作成するこ
とができる。
When simulating the MCU simulation device 01, first, the CPU source program a compiles / compiles the CPU simulation unit a.
Link, and I / O source programs a, b,
I / O simulation units a, b, c, d by c and d
Is compiled / linked. Since each source program does not include a process depending on a specific address in the program, MC having various types of input / output devices is used.
When simulating U respectively, each I / O for simulating the peripheral input / output devices a, b, c, d
By simply dynamically linking the O simulation units a, b, c, and d with the CPU simulation unit, an MCU simulation apparatus that simulates each MCU can be created. For example, when simulating the MCU 01 including the input / output devices a and b, the CPU simulating the MCU 01 is performed by dynamically linking the CPU simulation unit a and the I / O simulation units a and b during the simulation.
The U simulation device 01 can be created, and when simulating the MCU 02 including the input / output devices a, b, and c, the CPU simulation unit a and the I / O simulation units a, b, c
The MCU simulation device 02 that simulates the MCU 02 can be created by dynamically linking.

【0032】図5に本願のMCUシミュレーション装置
のイメージを示す。実行前には、I/Oシミュレーショ
ン部a、b、cを持つMCUシミュレーション装置50
1がある。MCUシミュレーション装置501は実行前
の状態なので、各I/Oシミュレーション部のI/Oレ
ジスタはバスシミュレーション部のアドレスに割り付け
られていない状態である。
FIG. 5 shows an image of the MCU simulation apparatus of the present invention. Before execution, the MCU simulation apparatus 50 having the I / O simulation units a, b, and c
There is one. Since the MCU simulation apparatus 501 is in a state before execution, the I / O register of each I / O simulation unit is not allocated to an address of the bus simulation unit.

【0033】このMCUシミュレーション装置501か
ら派生品A,B,Cを生成する場合には、各I/Oシミ
ュレーション部a、b、cのI/OレジスタA、B、・
・、Iをマッピング情報A、B、Cを参照して、バスシ
ミュレーション部の各アドレスに割り付けることにより
生成される。
When derivative products A, B, and C are generated from the MCU simulation device 501, the I / O registers A, B,.
, I are generated by allocating I to each address of the bus simulation unit with reference to the mapping information A, B, C.

【0034】周辺入出力装置は、装置毎に動作を制御す
るモードやパラメータを指定するI/Oレジスタを持
ち、通常はMCU上の任意のアドレスに割り付けられ、
その任意のアドレスへのデータのリード/ライトによっ
て動作するものである。
The peripheral input / output device has an I / O register for designating a mode and a parameter for controlling the operation for each device, and is usually assigned to an arbitrary address on the MCU.
It operates by reading / writing data to or from the arbitrary address.

【0035】本発明ではシミュレーション対象となるタ
ーゲットシステムのI/Oレジスタのアドレス構成を考
慮してI/Oレジスタの割り付けるべきアドレス情報を
記したマッピング情報A,B,Cを用意し、実行時にシ
ミュレーション装置に指定する。この指定されたマッピ
ング情報に基づいて任意のアドレスに仮想I/Oレジス
タを割り付けることができ、実行時には派生品A,B,
Cをそれぞれ構築できることになる。従って、一つの実
行モジュールで周辺入出力装置の構成の異なる複数のM
CUのシミュレーションを実現することができる。
According to the present invention, mapping information A, B, and C are prepared in which address information to be allocated to the I / O registers is prepared in consideration of the address configuration of the I / O registers of the target system to be simulated. Specify the device. A virtual I / O register can be assigned to an arbitrary address based on the specified mapping information.
C can be constructed respectively. Therefore, a plurality of Ms having different configurations of peripheral input / output devices can be executed by one execution module.
Simulation of a CU can be realized.

【0036】また、本実施形態のMCUシミュレーショ
ン装置の別の効果として、新しいCPUが出てきたとき
でも、周辺入出力装置が同じものであれば、CPUのみ
を新たなCPUソースプログラムでコンパイル/リンク
することによりシミュレーションを行うことができる。
Another effect of the MCU simulation apparatus of this embodiment is that even when a new CPU comes out, if the peripheral input / output devices are the same, only the CPU is compiled / linked with the new CPU source program. By doing so, a simulation can be performed.

【0037】例えば、図4に示すように、新たにCPU
bが出てきたときには、CPUソースプログラムbを用
意してコンパイル/リンクし、既存の周辺入出力装置
b、c、dを利用して動的にリンクするだけで、MCU
03のシミュレーションをするMCUシミュレーション
装置03を実現することができる。従来では、特定のア
ドレスに依存した処理がソースプログラム中に含まれて
いたので、CPUや周辺入出力装置の1つが変われば、
ソースプログラムの全てを書き換えなければならなかっ
たのに対して、本願ではCPUソースプログラムだけを
書き換えればよいので大幅にシミュレーションする際の
労力が軽減されることになる。
For example, as shown in FIG.
b, the CPU source program b is prepared, compiled / linked, and dynamically linked using the existing peripheral input / output devices b, c, d.
It is possible to realize the MCU simulation device 03 that performs the simulation of the third embodiment. Conventionally, processing dependent on a specific address was included in the source program, so if the CPU or one of the peripheral input / output devices changed,
Although the entire source program has to be rewritten, in the present application, only the CPU source program needs to be rewritten, so that the labor required for the simulation is greatly reduced.

【0038】次に、コンパイル・リンク手段220によ
る各シミュレーション部のコンパイル、リンクが終了す
ると、シミュレーション手段230によるシミュレーシ
ョンが行われる。このシミュレーション手段230では
マッピング処理シーケンスと命令実行処理シーケンスと
の2つの処理が行われる。
Next, when the compiling and linking of each simulation unit by the compiling and linking means 220 is completed, the simulation by the simulation means 230 is performed. In the simulation means 230, two processes of a mapping process sequence and an instruction execution process sequence are performed.

【0039】まず、マッピング処理シーケンスの処理を
図6に示すフローチャートに基づいて説明する。このマ
ッピング処理シーケンスでは、I/Oレジスタ登録情報
103、メモリ登録情報105、マッピング情報MIと
からアクセス情報106を生成する。
First, the processing of the mapping processing sequence will be described with reference to the flowchart shown in FIG. In this mapping processing sequence, the access information 106 is generated from the I / O register registration information 103, the memory registration information 105, and the mapping information MI.

【0040】まず、図6に示すようにI/Oレジスタ登
録情報103をI/Oシミュレーション部232から取
得する(S601)。このI/Oレジスタ登録情報10
3はI/Oシミュレーション部232が初期化されると
きに登録されるものとする。
First, as shown in FIG. 6, the I / O register registration information 103 is obtained from the I / O simulation unit 232 (S601). This I / O register registration information 10
3 is registered when the I / O simulation unit 232 is initialized.

【0041】このI/Oレジスタ登録情報の内容は図7
に示すように、レジスタを識別するためのユニークなI
Dとリードイベント処理部のアドレスとライトイベント
処理部のアドレスとで構成されている。
The contents of the I / O register registration information are shown in FIG.
As shown in the figure, a unique I
D, the address of the read event processing unit, and the address of the write event processing unit.

【0042】ここで、イベント処理部とは、仮想I/O
レジスタへの読み込み、書き込み時に実行される処理が
記述されているホストマシン上の先頭のアドレスのこと
をいい、リードイベント処理部アドレスがI/Oレジス
タの読み込み時に処理されるべきイベント処理ルーチン
のアドレスであり、ライトイベント処理部アドレスがI
/Oレジスタの書き込み時に処理されるべきイベント処
理ルーチンのアドレスである。
Here, the event processing unit is a virtual I / O
Refers to the first address on the host machine where the processing to be executed at the time of reading and writing to the register is described. The read event processing section address is the address of the event processing routine to be processed at the time of reading the I / O register. And the write event processing unit address is I
This is the address of the event processing routine to be processed when writing to the / O register.

【0043】次に、メモリ登録情報105をメモリシミ
ュレーション部233から取得する(S602)。この
メモリ登録情報105はメモリシミュレーション部23
3が初期化されるときに登録されるものとし、その内容
は図7のI/Oレジスタ登録情報と同じである。
Next, the memory registration information 105 is obtained from the memory simulation unit 233 (S602). This memory registration information 105 is stored in the memory simulation unit 23.
3 is initialized when it is initialized, and its contents are the same as the I / O register registration information in FIG.

【0044】次に、マッピング情報生成手段210で生
成されたマッピング情報MIを取得する(S603)。
そして、取得したI/Oレジスタ登録情報103あるい
はメモリ登録情報105に記述されたIDとマッピング
情報MIのIDとを対応させることにより、アクセス情
報106を図8に示すように生成する(S604)。
Next, the mapping information MI generated by the mapping information generating means 210 is obtained (S603).
Then, the access information 106 is generated as shown in FIG. 8 by associating the ID described in the acquired I / O register registration information 103 or the memory registration information 105 with the ID of the mapping information MI (S604).

【0045】このアクセス情報106は任意のアドレス
に対するリードイベント処理部あるいはライトイベント
処理部の情報を表している。
The access information 106 represents information of a read event processing unit or a write event processing unit for an arbitrary address.

【0046】そして、アクセス情報106が作成された
ことにより、CPUシミュレーション部231から任意
の仮想I/Oレジスタ102や仮想メモリ104へのア
クセスが発生した場合でも、全てこのアクセス情報10
6を参照することによってアクセスを行うことができ
る。図8に示すようにアクセス情報はアドレス、データ
長、リードイベント処理部アドレス、ライトイベント処
理部アドレスによって構成されている。ただし、本実施
形態では、一つのアドレスに対応する一つのアクセス情
報が割り付けられているが、アドレスによって呼び出す
べきイベント処理部のアドレスが特定できるものであれ
ば、アクセス情報の構成はとくに問わないものとする。
When the access information 106 is created and the CPU simulation unit 231 accesses an arbitrary virtual I / O register 102 or virtual memory 104, the access information 10
6 can be accessed. As shown in FIG. 8, the access information includes an address, a data length, a read event processing unit address, and a write event processing unit address. However, in the present embodiment, one access information corresponding to one address is assigned, but the configuration of the access information is not particularly limited as long as the address of the event processing unit to be called can be specified by the address. And

【0047】また、図6のフローチャートではI/Oレ
ジスタ登録情報103、メモリ登録情報105、マッピ
ング情報MIの順に取得したが、この順序は任意に変更
することができる。
In the flowchart of FIG. 6, the I / O register registration information 103, the memory registration information 105, and the mapping information MI are obtained in this order, but this order can be arbitrarily changed.

【0048】次に、命令実行処理シーケンスを図9、図
10、図11、図12のフローチャートに基づいて説明
する。
Next, the instruction execution processing sequence will be described with reference to the flowcharts of FIGS. 9, 10, 11, and 12.

【0049】まず、図9のフローチャートに従ってCP
Uシミュレーション部231での処理が開始される。C
PUシミュレーション部231は、被デバッグプログラ
ムDPを解読し、命令コードを仮想的に実行するもので
ある。即ち、ターゲットとするシステムのCPUの動作
をシミュレーションするためのものである。
First, according to the flowchart of FIG.
The processing in the U simulation unit 231 is started. C
The PU simulation unit 231 decodes the program to be debugged DP and virtually executes the instruction code. That is, it is for simulating the operation of the CPU of the target system.

【0050】図9において、入力手段100により入力
された被デバッグプログラムDPがロードされてプログ
ラム実行処理シーケンスが開始されると、まず命令実行
前準備S901が行われる。この命令実行前準備S90
1では、ターゲットプログラムの命令コードをホストマ
シン上の仮想的な命令に置き換える。即ち、シミュレー
ションする1命令を複数の仮想命令によって置き換え
る。そして、置き換えられた複数の仮想命令の中から実
行すべき仮想命令を取り出す(S902)。このステッ
プS902から置換した仮想命令の処理ルーチンの実行
に入る。仮想命令には、バスアクセスを発生するもの
と、発生しないものとがある。そこで、取り出した仮想
命令がメモリあるいはI/Oレジスタへのバスアクセス
を生じるものであるか否かを判断する(S903)。バ
スアクセスが発生しない場合には仮想命令の実行処理S
904の処理を行い、バスアクセスが発生する場合には
バスオペレーションのための前処理S905を行うこと
になる。
In FIG. 9, when the program to be debugged DP inputted by the input means 100 is loaded and the program execution processing sequence is started, first, preparation before instruction execution S901 is performed. This instruction pre-execution preparation S90
In step 1, the instruction code of the target program is replaced with a virtual instruction on the host machine. That is, one instruction to be simulated is replaced with a plurality of virtual instructions. Then, a virtual instruction to be executed is extracted from the plurality of replaced virtual instructions (S902). From this step S902, execution of the processing routine of the replaced virtual instruction is started. Some virtual instructions generate a bus access and some do not. Therefore, it is determined whether or not the extracted virtual instruction causes a bus access to the memory or the I / O register (S903). If no bus access occurs, execution of virtual instruction S
If the processing of step 904 is performed and a bus access occurs, preprocessing S905 for bus operation is performed.

【0051】バスアクセスが発生しない場合にステップ
S904で行われる仮想命令の実行とは、各種演算や演
算結果の格納に伴うCPUシミュレーション部231内
にある仮想レジスタ101や各種フラグへのアクセスな
どを意味する。そして、実行が終了するとステップS9
06に進み、ステップS906では、仮想命令が存在し
ない場合にはシミュレーションする1命令の終了と判断
して命令の実行処理を終了し、仮想命令が存在する場合
にはステップS902に戻り、上記処理を繰り返す。
The execution of the virtual instruction performed in step S904 when no bus access occurs means access to the virtual register 101 and various flags in the CPU simulation unit 231 accompanying various operations and storage of the operation results. I do. When the execution is completed, step S9 is performed.
In step S906, if there is no virtual instruction, it is determined that one instruction to be simulated has been completed, and the execution of the instruction is terminated. If there is a virtual instruction, the flow returns to step S902, and the above processing is performed. repeat.

【0052】また、ステップS903においてバスアク
セスが発生する場合には、ステップS905でバスシミ
ュレーション部234に対してデータを渡す。渡すデー
タには2種類あり、一つのはアクセス先のアドレスであ
り、もう一つは、ライトオペレーションの場合には書き
込むデータであり、リードオペレーションの場合には読
み込むデータを格納するためのアドレスである。
If a bus access occurs in step S903, the data is passed to the bus simulation unit 234 in step S905. There are two types of data to be passed, one is the address of the access destination, the other is the data to be written in the case of a write operation, and the address for storing the data to be read in the case of a read operation. .

【0053】データが受け渡されるとステップS907
に進み、バスオペレーションが発生してCPUシミュレ
ーション部231からバスシミュレーション部234に
対してアクセス依頼を行う。ここで、実行がCPUシミ
ュレーション部231からバスシミュレーション部23
4へ移ることになる。
When the data is transferred, step S907
The bus operation occurs, and the CPU simulation unit 231 makes an access request to the bus simulation unit 234. Here, the execution is performed from the CPU simulation unit 231 to the bus simulation unit 23.
It will move to 4.

【0054】次に、図10のフローチャートに基づい
て、バスシミュレーション部234の処理について説明
する。
Next, the processing of the bus simulation unit 234 will be described with reference to the flowchart of FIG.

【0055】バスシミュレーション部234は、CPU
シミュレーション部231,I/Oシミュレーション部
232およびメモリシミュレーション部233の間の実
行制御やスケジューリング、アクセス制御を行うもので
ある。CPUシミュレーション部231からの任意のメ
モリやI/Oレジスタへのアクセスは、全てこのバスシ
ミュレーション部234においてアクセス情報106を
参照して行われる。
The bus simulation unit 234 has a CPU
It performs execution control, scheduling, and access control between the simulation unit 231, the I / O simulation unit 232, and the memory simulation unit 233. All accesses from the CPU simulation unit 231 to any memory or I / O register are performed in the bus simulation unit 234 with reference to the access information 106.

【0056】まず、図10においてバスオペレーション
が開始されると、CPUシミュレーション部231から
図9のステップS905で渡されたデータを受取る(S
1001)。この受け取ったデータの中からアクセス先
のアドレスを取り出して(S1002)、ステップS1
003のイベント処理部の取得の処理に進む。
First, when the bus operation is started in FIG. 10, the data passed in step S905 in FIG. 9 is received from the CPU simulation unit 231 (S
1001). The access destination address is extracted from the received data (S1002), and step S1 is executed.
The process proceeds to the acquisition process of the event processing unit of 003.

【0057】このイベント処理部の取得の処理を図11
のフローチャートに基づいて説明する。
FIG. 11 shows the process of obtaining the event processing unit.
A description will be given based on the flowchart of FIG.

【0058】まず、ステップS1002で取り出された
アクセス先のアドレスを受け取る(S1101)。この
アクセス先のアドレスとアクセス情報106とからイベ
ント処理部を特定する(S1102)。この特定したイ
ベント処理部を呼び出し元に返却して(S1103)図
10のバスオペレーションのフローチャートに戻り、ス
テップS1004に進む。
First, the address of the access destination extracted in step S1002 is received (S1101). The event processing unit is specified from the access destination address and the access information 106 (S1102). The specified event processing unit is returned to the caller (S1103), and the process returns to the bus operation flowchart of FIG. 10 and proceeds to step S1004.

【0059】ステップS1004では、ライトオペレー
ションの場合には書き込むデータを、リードオペレーシ
ョンの場合には読み込むデータの格納先アドレスをイベ
ント処理部の実行の処理に渡して、ステップS1005
のイベント処理部の実行へ進む。
In step S1004, the data to be written is passed to the execution of the event processing unit in the case of a write operation, and the storage address of the data to be read is passed in the case of a read operation.
To the execution of the event processing unit.

【0060】ここで、実行がバスシミュレーション部2
34からI/Oシミュレーション部232またはメモリ
シミュレーション部233へ移る。アクセス先がI/O
シミュレーション部232であるときにはI/Oシミュ
レーション部232へ移り、メモリシミュレーション部
233であるときにはメモリシミュレーション部233
へ実行が移る。ここでは、実行がI/Oシミュレーショ
ン部232へ移る場合について説明するが、メモリシミ
ュレーション部233へ移る場合にも同様の処理が行わ
れる。
The execution is performed by the bus simulation unit 2
From 34, the processing moves to the I / O simulation section 232 or the memory simulation section 233. Access destination is I / O
When it is the simulation unit 232, the process proceeds to the I / O simulation unit 232, and when it is the memory simulation unit 233, the memory simulation unit 233
Execution moves to Here, the case where the execution shifts to the I / O simulation unit 232 will be described, but the same processing is performed when the execution shifts to the memory simulation unit 233.

【0061】I/Oシミュレーション部232は、CP
U周辺の入出力装置をシミュレーションするためのもの
であり、ワンチップマイコン上の周辺入出力装置に限ら
ず、周辺入出力装置に接続された外部回路についてのシ
ミュレーションをも行うものである。I/Oシミュレー
ション部232は仮想I/Oレジスタ102とI/Oレ
ジスタ登録情報103とを含んでおり、この仮想I/O
レジスタ102の設定値に基づいて動作する。
The I / O simulation unit 232 has a CP
This is for simulating the input / output devices in the vicinity of the U, and not only for the peripheral input / output devices on the one-chip microcomputer but also for the simulation of the external circuit connected to the peripheral input / output devices. The I / O simulation unit 232 includes the virtual I / O register 102 and the I / O register registration information 103.
It operates based on the set value of the register 102.

【0062】この仮想I/Oレジスタ102は周辺入出
力装置のI/Oレジスタに相当し、I/Oシミュレーシ
ョン部232の動作モードやパラメータなどを保持して
おり、I/Oシミュレーション部232の動作を決定づ
けるものである。
The virtual I / O register 102 corresponds to an I / O register of a peripheral input / output device, holds an operation mode and parameters of the I / O simulation unit 232, and operates the I / O simulation unit 232. Is determined.

【0063】また、I/Oレジスタ登録情報103は各
仮想I/Oレジスタ102に対応した情報が登録されて
おり、システム初期化時などに登録が行われる。
In the I / O register registration information 103, information corresponding to each virtual I / O register 102 is registered, and is registered at the time of system initialization or the like.

【0064】仮想I/Oレジスタ102をメモリ上に正
しく割り付けるためにはマッピング情報MIのIDとI
/Oレジスタ登録情報102のIDとが一致しなければ
ならない。そして、I/Oレジスタ登録情報103はM
CUの周辺回路構成には依存しない。
In order to correctly allocate the virtual I / O register 102 on the memory, the ID of the mapping information MI and the I
The ID of the / O register registration information 102 must match. The I / O register registration information 103 is M
It does not depend on the peripheral circuit configuration of the CU.

【0065】また、メモリシミュレーション部233
は、メモリをシミュレーションするためのもので、被デ
バッグプログラムDPの保持などを行い、バスシミュレ
ーション部234へのメモリ登録情報105を含んでい
る。そして、システム初期化時などに登録が行なわれ
る。メモリ登録情報105の内容はI/Oレジスタ登録
情報103と同じである。
The memory simulation unit 233
Is for simulating a memory, holds a program to be debugged DP, and includes memory registration information 105 to the bus simulation unit 234. Then, registration is performed at the time of system initialization or the like. The contents of the memory registration information 105 are the same as the I / O register registration information 103.

【0066】ここで、イベント処理部の実行処理を図1
2のフローチャートに基づいて説明する。
Here, the execution process of the event processing unit is shown in FIG.
This will be described with reference to the flowchart of FIG.

【0067】まず、ステップS1004で渡された書き
込むデータまたは読み込むデータの格納先アドレスを呼
び出し元から受け取る(S1201)。そして、受け取
ったデータを仮想I/Oレジスタ102や仮想メモリ1
04に書き込むなどの入出力操作のシミュレーションを
行う(S1202)。
First, the storage destination address of the write data or read data passed in step S1004 is received from the caller (S1201). Then, the received data is transferred to the virtual I / O register 102 or the virtual memory 1.
A simulation of an input / output operation such as writing to the file 04 is performed (S1202).

【0068】次に、リードオペレーションの場合には受
け取ったデータの格納先アドレスに対してデータを格納
することで、呼び出し元のバスシミュレーション部23
4に対してデータを返却する(S1203)。格納する
データは主に仮想I/Oレジスタや各種フラグの値であ
る。また、ライトオペレーションの場合にはデータの返
却はない。
Next, in the case of a read operation, the data is stored in the storage destination address of the received data, so that the calling bus simulation unit 23
4 is returned to S4 (S1203). The data to be stored is mainly the values of the virtual I / O register and various flags. In the case of a write operation, no data is returned.

【0069】ここで、図10のバスオペレーションのフ
ローチャートに戻り、ステップS1006に進む。ステ
ップS1006ではリードオペレーションの場合に、呼
び出し元のCPUシミュレーション部231に対してデ
ータを返却する。返却されるデータはイベント処理部の
実行処理(S1005)時に返却されたデータである。
データの返却方法は、読み込むデータの格納先アドレス
に対してステップS1005の返却データを格納するこ
とによって行われる。
Here, returning to the bus operation flowchart of FIG. 10, the process proceeds to step S1006. In step S1006, in the case of a read operation, data is returned to the CPU simulation unit 231 of the calling source. The returned data is the data returned during the execution processing (S1005) of the event processing unit.
The method of returning data is performed by storing the return data in step S1005 for the storage address of the data to be read.

【0070】ここで、図9のフローチャートに戻り、ス
テップS906に進む。
Here, returning to the flowchart of FIG. 9, the process proceeds to step S906.

【0071】ステップS906では、仮想命令が存在す
る場合にはステップS902に戻って上記処理を繰り返
し、仮想命令が存在しない場合にはシミュレーションす
る1命令の終了と判断して命令の実行処理を終了する。
そして、全ての命令のシミュレーションが終了したら、
このシミュレーションの結果を出力手段300から出力
する。
In step S 906, if a virtual instruction exists, the process returns to step S 902 to repeat the above-described processing. If no virtual instruction exists, it is determined that one instruction to be simulated has ended, and the instruction execution processing ends. .
And when all the instructions have been simulated,
The result of this simulation is output from the output means 300.

【0072】以上のような命令実行処理シーケンスを時
系列で表現すると図13のようになる。図13は、シミ
ュレーション手段230において命令実行処理シーケン
スを実行する際の各シミュレーション部間のデータの受
け渡しの関係を時系列で示したものである。縦軸の下方
向に時間が経過していく。
FIG. 13 shows the above-described instruction execution processing sequence in a time series. FIG. 13 shows a time-series data transfer relationship between the simulation units when executing the instruction execution processing sequence in the simulation means 230. Time elapses below the vertical axis.

【0073】まず、CPUシミュレーション部231で
シミュレーションが開始され、ステップS903でバス
アクセスが発生すると、CPUシミュレーション部23
1からバスシミュレーション部234へ実行が移る。そ
して、アクセス先のアドレスの取出し(S1002)、
イベント処理部の取得(S1003)などの処理を行っ
た後にイベント処理部の実行処理(S1005)におい
て、バスシミュレーション部234からI/Oシミュレ
ーション部232へ実行が移る。I/Oシミュレーショ
ン部232では入出力操作(S1202)が行われた後
に、データをバスシミュレーション部234に返却して
(S1203)、I/Oシミュレーション部232から
バスシミュレーション部234へ実行が戻る。さらに、
データがCPUシミュレーション部231に返却され
(S1006)、バスシミュレーション部234からC
PUシミュレーション部231へ実行が戻ることにな
る。
First, the simulation is started by the CPU simulation unit 231 and when a bus access occurs in step S903, the CPU simulation unit 23
The execution moves from 1 to the bus simulation unit 234. Then, the address of the access destination is taken out (S1002),
After performing processing such as acquisition of the event processing unit (S1003), execution shifts from the bus simulation unit 234 to the I / O simulation unit 232 in the execution processing of the event processing unit (S1005). After the input / output operation (S1202) is performed in the I / O simulation unit 232, the data is returned to the bus simulation unit 234 (S1203), and the execution returns from the I / O simulation unit 232 to the bus simulation unit 234. further,
The data is returned to the CPU simulation unit 231 (S1006), and the bus simulation unit 234
Execution returns to the PU simulation unit 231.

【0074】このようにして、各シミュレーション部間
で、命令実行処理シーケンスを実行する際にはデータの
受け渡しが行われる。
As described above, data transfer is performed between the simulation units when executing the instruction execution processing sequence.

【0075】なお、上述したMCUのシミュレーション
方法を実現するためのプログラムは記録媒体に保存する
ことができ、この記録媒体をコンピュータシステムによ
って読み込ませることにより、前記プログラムを実行し
てコンピュータを制御しながら上述したMCUのシミュ
レーション方法を実現することができる。ここで、前記
記録媒体とは、メモリ装置、磁気ディスク装置、光ディ
スク装置等、プログラムを記録することができるような
装置が含まれる。
A program for realizing the above-described MCU simulation method can be stored in a recording medium. By reading this recording medium by a computer system, the program is executed while controlling the computer. The above-described MCU simulation method can be realized. Here, the recording medium includes a device capable of recording a program, such as a memory device, a magnetic disk device, and an optical disk device.

【0076】[0076]

【発明の効果】以上説明したように、本発明のMCUシ
ミュレーション装置は、ソースプログラムの記述のう
ち、特定のアドレスに依存した処理に関する記述につい
てはマッピング情報MIに記述し、特定のアドレスに依
存しない処理に関する記述についてはコンパイル/リン
ク手段で用意されるCPUソースプログラムやI/Oソ
ースプログラムに記述するようにしたことにより、さま
ざまな入出力装置を有する複数のMCUをシミュレーシ
ョンする場合でも、それぞれの入出力装置に対応したI
/Oシミュレーション部を動的にリンクするだけで、複
数のMCUのシミュレーションを行うことができる。
As described above, in the MCU simulation apparatus of the present invention, among the descriptions of the source program, the description relating to the processing depending on a specific address is described in the mapping information MI, and does not depend on the specific address. The description about the processing is described in the CPU source program and the I / O source program prepared by the compiling / linking means, so that even when simulating a plurality of MCUs having various input / output devices, each input / output device can be simulated. I corresponding to the output device
Simulating a plurality of MCUs can be performed only by dynamically linking the / O simulation units.

【0077】また、本発明のMCUシミュレーション装
置の別の効果として、新しいCPUが出てきたときで
も、周辺入出力装置が同じものであれば、CPUのみを
新たなCPUソースプログラムでコンパイル/リンクす
ることにより、新たなCPUを含むMCUのシミュレー
ションを行うことができるので、無駄な処理を行うこと
が大幅に少なくなった。
Another effect of the MCU simulation apparatus of the present invention is that even when a new CPU comes out, if the peripheral input / output devices are the same, only the CPU is compiled / linked with the new CPU source program. As a result, the simulation of the MCU including the new CPU can be performed, so that the useless processing is significantly reduced.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明によるMCUシミュレーション装置の一
実施形態の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of an MCU simulation apparatus according to the present invention.

【図2】図1のMCUシミュレーション装置のシミュレ
ーション手段の一実施形態の構成を示すブロック図であ
る。
FIG. 2 is a block diagram showing a configuration of an embodiment of a simulation unit of the MCU simulation apparatus of FIG. 1;

【図3】マッピング情報の内容の例を示す図である。FIG. 3 is a diagram illustrating an example of the content of mapping information.

【図4】本発明のMCUシミュレーション装置のプログ
ラムモジュール構成を示す図である。
FIG. 4 is a diagram showing a program module configuration of the MCU simulation device of the present invention.

【図5】本発明のMCUシミュレーション装置のイメー
ジを示す図である。
FIG. 5 is a diagram showing an image of an MCU simulation device of the present invention.

【図6】本発明によるMCUシミュレーション装置にお
けるマッピング処理シーケンスを示すフローチャートで
ある。
FIG. 6 is a flowchart showing a mapping processing sequence in the MCU simulation apparatus according to the present invention.

【図7】I/Oレジスタ登録情報、メモリ登録情報の内
容の例を示す図である。
FIG. 7 is a diagram illustrating an example of the contents of I / O register registration information and memory registration information.

【図8】アクセス情報の内容の例を示す図である。FIG. 8 is a diagram illustrating an example of the content of access information.

【図9】本発明によるMCUシミュレーション装置にお
ける命令実行処理シーケンスを示すフローチャートであ
る。
FIG. 9 is a flowchart showing an instruction execution processing sequence in the MCU simulation apparatus according to the present invention.

【図10】図9のフローチャートにおけるバスオペレー
ションを示すフローチャートである。
FIG. 10 is a flowchart showing a bus operation in the flowchart of FIG. 9;

【図11】図10のフローチャートにおけるイベント処
理部の取得処理を示すフローチャートである。
11 is a flowchart showing an acquisition process of the event processing unit in the flowchart of FIG.

【図12】図10のフローチャートにおけるイベント処
理部の実行処理を示すフローチャートである。
FIG. 12 is a flowchart showing an execution process of an event processing unit in the flowchart of FIG. 10;

【図13】本発明によるMCUシミュレーション装置に
おける命令実行処理シーケンスを時系列で示した図であ
る。
FIG. 13 is a diagram showing, in chronological order, an instruction execution processing sequence in the MCU simulation apparatus according to the present invention.

【図14】シミュレーションの対象となる現実の組込み
システムにおけるシステム構成例を示すブロック図であ
る。
FIG. 14 is a block diagram illustrating a system configuration example of a real embedded system to be simulated;

【図15】従来のMCUシミュレーション装置のプログ
ラムモジュール構成を示す図である。
FIG. 15 is a diagram showing a program module configuration of a conventional MCU simulation apparatus.

【符号の説明】 100 入力手段 101 仮想レジスタ 102 仮想I/Oレジスタ 103 I/Oレジスタ登録情報 104 仮想メモリ 105 メモリ登録情報 106 アクセス情報 200 処理手段 210 マッピング情報生成手段 220 コンパイル/リンク手段 230 シミュレーション手段 231 CPUシミュレーション部 232 I/Oシミュレーション部 233 メモリシミュレーション部 234 バスシミュレーション部 300 出力手段DESCRIPTION OF SYMBOLS 100 input means 101 virtual register 102 virtual I / O register 103 I / O register registration information 104 virtual memory 105 memory registration information 106 access information 200 processing means 210 mapping information generating means 220 compiling / linking means 230 simulation means 231 CPU simulation section 232 I / O simulation section 233 Memory simulation section 234 Bus simulation section 300 Output means

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUの動作をシミュレーションするC
PUシミュレーション部とI/O登録情報を有しCPU
の周辺入出力装置のシミュレーションを行うI/Oシミ
ュレーション部とメモリ登録情報を有しメモリのシミュ
レーションを行うメモリシミュレーション部と前記各シ
ミュレーション部間のアクセス制御を行うバスシミュレ
ーション部とによってMCUのシミュレーションを行う
MCUシミュレーション装置であって、 シミュレーションしようとする被デバックプログラムと
ソースプログラムとを入力する入力手段と、 この入力手段により入力された前記ソースプログラムか
ら特定のアドレスに依存した処理についての記述をマッ
ピング情報として生成するマッピング情報生成手段と、 前記入力手段により入力された前記ソースプログラムか
ら特定のアドレスに依存しない処理について、前記CP
Uシミュレーション部、前記I/Oシミュレーション
部、前記メモリシミュレーション部をそれぞれ別々にコ
ンパイルとリンクを行うコンパイル/リンク手段と、 このコンパイル/リンク手段によって、コンパイルとリ
ンクのされた前記CPUシミュレーション部と前記I/
Oシミュレーション部と前記メモリシミュレーション部
と、前記バスシミュレーション部とを具備し、前記マッ
ピング情報と前記I/O登録情報と前記メモリ登録情報
とから各シミュレーション部間のアクセスについて記述
するアクセス情報を生成し、このアクセス情報によりシ
ミュレーションを行うシミュレーション手段と、 このシミュレーション手段のシミュレーションの結果を
出力する出力手段とを含むことを特徴とするMCUシミ
ュレーション装置。
1. C for simulating the operation of a CPU
CPU having PU simulation unit and I / O registration information
MCU simulation is performed by an I / O simulation unit that simulates a peripheral input / output device, a memory simulation unit that has memory registration information and simulates a memory, and a bus simulation unit that performs access control between the simulation units. An MCU simulation apparatus, comprising: input means for inputting a debugged program to be simulated and a source program; and a description of processing depending on a specific address from the source program input by the input means as mapping information. A mapping information generating unit for generating, and a process which does not depend on a specific address from the source program input by the input unit.
Compile / link means for separately compiling and linking the U simulation section, the I / O simulation section, and the memory simulation section; and the CPU simulation section and the I / O section compiled and linked by the compile / link means. /
An O simulation unit, the memory simulation unit, and the bus simulation unit, and generate access information describing access between simulation units from the mapping information, the I / O registration information, and the memory registration information. A simulation means for performing a simulation based on the access information; and an output means for outputting a result of the simulation performed by the simulation means.
【請求項2】 CPUの動作をシミュレーションするC
PUシミュレーション部とI/O登録情報を有しCPU
の周辺入出力装置のシミュレーションを行うI/Oシミ
ュレーション部とメモリ登録情報を有しメモリのシミュ
レーションを行うメモリシミュレーション部と前記各シ
ミュレーション部間のアクセス制御を行うバスシミュレ
ーション部とを利用してMCUのシミュレーションを行
うMCUのシミュレーション方法であって、 ソースプログラムから特定のアドレスに依存した処理に
ついての記述をマッピング情報として生成するマッピン
グ情報生成ステップと、 前記ソースプログラムから特定のアドレスに依存しない
処理について、前記CPUシミュレーション部、前記I
/Oシミュレーション部、前記メモリシミュレーション
部をそれぞれ別々にコンパイルとリンクを行うコンパイ
ル/リンクステップと、 前記マッピング情報と前記I/O登録情報と前記メモリ
登録情報とから前記各シミュレーション部間のアクセス
について記述するアクセス情報を生成し、このアクセス
情報により前記各シミュレーション部を利用してシミュ
レーションを行うシミュレーションステップとを含むこ
とを特徴とするMCUのシミュレーション方法。
2. C for simulating the operation of the CPU
CPU having PU simulation unit and I / O registration information
An I / O simulation unit for simulating peripheral input / output devices, a memory simulation unit having memory registration information and simulating a memory, and a bus simulation unit for controlling access between the simulation units are used for the MCU. A method of simulating an MCU for performing a simulation, comprising: a mapping information generating step of generating a description of a process dependent on a specific address from a source program as mapping information; and a process independent of a specific address from the source program. CPU simulation unit, I
A compiling / linking step of separately compiling and linking the / O simulation unit and the memory simulation unit; and describing an access between the simulation units based on the mapping information, the I / O registration information, and the memory registration information. A simulation step of generating access information to be performed and performing a simulation using each of the simulation units based on the access information.
【請求項3】 CPUの動作をシミュレーションするC
PUシミュレーション部とI/O登録情報を有しCPU
の周辺入出力装置のシミュレーションを行うI/Oシミ
ュレーション部とメモリ登録情報を有しメモリのシミュ
レーションを行うメモリシミュレーション部と前記各シ
ミュレーション部間のアクセス制御を行うバスシミュレ
ーション部とを利用してMCUのシミュレーションを行
うMCUのシミュレーションプログラムを記録したコン
ピュータ読み取り可能な記録媒体であって、 ソースプログラムから特定のアドレスに依存した処理に
ついての記述をマッピング情報として生成するマッピン
グ情報生成処理と、 前記ソースプログラムから特定のアドレスに依存しない
処理について、前記CPUシミュレーション部、前記I
/Oシミュレーション部、前記メモリシミュレーション
部をそれぞれ別々にコンパイルとリンクを行うコンパイ
ル/リンク処理と、 前記マッピング情報と前記I/O登録情報と前記メモリ
登録情報とから前記各シミュレーション部間のアクセス
について記述するアクセス情報を生成し、このアクセス
情報により前記各シミュレーション部を利用してシミュ
レーションを行うシミュレーション処理とを含み、これ
ら処理をコンピュータに実行させることを特徴とするM
CUのシミュレーションプログラムを記録したコンピュ
ータ読み取り可能な記録媒体。
3. C for simulating the operation of the CPU
CPU having PU simulation unit and I / O registration information
An I / O simulation unit for simulating peripheral input / output devices, a memory simulation unit having memory registration information and simulating a memory, and a bus simulation unit for controlling access between the simulation units are used for the MCU. A computer-readable recording medium on which a simulation program of an MCU to be simulated is recorded, wherein: a mapping information generation process for generating a description of a process depending on a specific address from a source program as mapping information; The CPU simulation unit performs the processing independent of the address of
A compile / link process for separately compiling and linking the I / O simulation unit and the memory simulation unit; and describing access between the simulation units based on the mapping information, the I / O registration information, and the memory registration information. Generating access information to perform the simulation using the respective simulation units based on the access information, and causing the computer to execute these processes.
A computer-readable recording medium recording a CU simulation program.
JP10084612A 1998-03-30 1998-03-30 Mcu simulation device, its simulation method and computer redable recording medium recording simulation program Pending JPH11282693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10084612A JPH11282693A (en) 1998-03-30 1998-03-30 Mcu simulation device, its simulation method and computer redable recording medium recording simulation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10084612A JPH11282693A (en) 1998-03-30 1998-03-30 Mcu simulation device, its simulation method and computer redable recording medium recording simulation program

Publications (1)

Publication Number Publication Date
JPH11282693A true JPH11282693A (en) 1999-10-15

Family

ID=13835530

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10084612A Pending JPH11282693A (en) 1998-03-30 1998-03-30 Mcu simulation device, its simulation method and computer redable recording medium recording simulation program

Country Status (1)

Country Link
JP (1) JPH11282693A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007048019A (en) * 2005-08-10 2007-02-22 Sony Computer Entertainment Inc Emulation method, emulator, computer embedded device, and program for emulator
JP2010102496A (en) * 2008-10-23 2010-05-06 Mitsubishi Electric Corp System simulation device
JP2013210882A (en) * 2012-03-30 2013-10-10 Nec Soft Ltd Emulation device, emulation method, program, and development support system of built-in apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007048019A (en) * 2005-08-10 2007-02-22 Sony Computer Entertainment Inc Emulation method, emulator, computer embedded device, and program for emulator
JP2010102496A (en) * 2008-10-23 2010-05-06 Mitsubishi Electric Corp System simulation device
JP2013210882A (en) * 2012-03-30 2013-10-10 Nec Soft Ltd Emulation device, emulation method, program, and development support system of built-in apparatus

Similar Documents

Publication Publication Date Title
US20070261038A1 (en) Code Translation and Pipeline Optimization
JP6289751B2 (en) Program generating apparatus, program generating method, and program generating program
JPH11513512A (en) Method of manufacturing digital signal processor
JP2003140920A (en) Debug supporting device, compiler device, debug supporting program, compiler program, and computer readable recording medium
US6874148B1 (en) System and method for exporting a graphical program to a shared library
JP2016224558A (en) Program creation support device, control method, and program
CN115345101A (en) UVM-based chip register verification method
JP2007310449A (en) Model generation program and model generation method for software/hardware cooperation design
JP2007310565A (en) System lsi verification device and system lsi verification program
JPH11282693A (en) Mcu simulation device, its simulation method and computer redable recording medium recording simulation program
Lyu et al. A procedure-based dynamic software update
JPH08314760A (en) Program development supporting device
US20030070117A1 (en) Simulation apparatus and simulation method
JPH06309193A (en) Method and device for verifying operation of machine language program
JPH10320212A (en) Cache optimizing method
JP2007018313A (en) Circuit design program, circuit design device and circuit design method
US6937973B1 (en) Design of an application specific processor (ASP)
JP3137094B2 (en) Simulation method, simulation device, and recording medium therefor
CN116627496B (en) UVM-based register model construction and verification method, system and electronic equipment
JP3270729B2 (en) Extended instruction set simulator
JP2004118518A (en) Simulator, and recording medium recording the simulator readable in computer
KR100352500B1 (en) Method for automation of form controls generation
JP2005332110A (en) Simulation system
CN114357917A (en) Simulation method, device and simulation system for processor pipeline
Thomas A model for process representation and synthesis