Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3753572B2 - Simulation system and instruction simulation method - Google Patents
[go: Go Back, main page]

JP3753572B2 - Simulation system and instruction simulation method - Google Patents

Simulation system and instruction simulation method Download PDF

Info

Publication number
JP3753572B2
JP3753572B2 JP28281799A JP28281799A JP3753572B2 JP 3753572 B2 JP3753572 B2 JP 3753572B2 JP 28281799 A JP28281799 A JP 28281799A JP 28281799 A JP28281799 A JP 28281799A JP 3753572 B2 JP3753572 B2 JP 3753572B2
Authority
JP
Japan
Prior art keywords
instruction
simulation
storage area
executed
information storage
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.)
Expired - Fee Related
Application number
JP28281799A
Other languages
Japanese (ja)
Other versions
JP2001101031A (en
Inventor
三喜雄 尾形
Original Assignee
Necマイクロシステム株式会社
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 Necマイクロシステム株式会社 filed Critical Necマイクロシステム株式会社
Priority to JP28281799A priority Critical patent/JP3753572B2/en
Publication of JP2001101031A publication Critical patent/JP2001101031A/en
Application granted granted Critical
Publication of JP3753572B2 publication Critical patent/JP3753572B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、プロセッサの命令シミュレーション技術に係り、特にシミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、マイクロコントローラのような制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムおよび命令シミュレーション方法に関する。
【0002】
【従来の技術】
図5は従来技術のプロセッサ命令シミュレーションの流れを説明するフロー図である。従来のプロセッサの命令シミュレーション方法としては、たとえば特開平10−177487号公報に記載のものがある。図5を参照すると、従来のプロセッサ命令シミュレーション方法は、シミュレーション対象プログラム1、プログラム分割手段3と、シミュレーションを実際に実行するコンピュータ(以下、ホストコンピュータと呼ぶ)の機械語に変換する手段4と、変換された機械語プログラムを実行する手段5と、機械語に変換できなかった部分を命令逐次実行するシミュレータ6とから構成されている。
【0003】
図8は従来技術を実現するための実際の計算機システム全体の構成図である。図8において、1はシミュレーション対象プログラム、23は擬似レジスタ・メモリ格納領域、25はネイティブ命令格納領域、90はシミュレータ、91は制御部、100はコンピュータシステム、101は補助記憶装置、102は入出力装置を示している。
【0004】
図8を参照すると、従来技術を実現するための実際の計算機システムでは、シミュレータ90の制御部91は、命令逐次実行シミュレーション機能と変換された機械語プログラムを直接実行する機能の2つを切り替えながら実行することができる機能を有している。
【0005】
図6は従来技術におけるシミュレーション対象プログラム1の実行のシミュレーションの流れを説明するフロー図である。図6を参照すると、上記構成を有する従来のプロセッサ命令シミュレーション方法では、次のように動作する。すなわち、シミュレーション対象プログラム1を高速にシミュレーションするために、プログラム分割手段3によってホストコンピュータの機械語に変換し、変換された機械語プログラムを実行することにより、シミュレーション対象プログラム1の実行のシミュレーションを実行する場合(図6中のa,b,c,e)とホストコンピュータによる命令逐次実行型シミュレータによってシミュレーションを実行する場合(図6中のd)とに分け、これに基づいて、シミュレーション対象プログラム1のシミュレーション結果を得る。
【0006】
また、ホストコンピュータによる命令逐次実行シミュレーションの動作は上記従来技術には具体的には説明されていないが、図7の処理の流れによって実行することができる。図7は従来の逐次命令シミュレーション方法の処理の流れを示すフローチャートである。図7の処理の流れは、実際のプロセッサのハードウェアで実行されることをソフトウェアの処理に置き換えたもので、特に目新しいものではない。ここで、周辺機能シミュレーションとは、シングルチップマイコンのI/Oポートやタイマ、A/D変換器をシミュレーションすることを示している。なお、上記従来技術では、周辺機能シミュレーションについては、触れられていないため、これらの機能を有しているか否かは、不明である。
【0007】
【発明が解決しようとする課題】
しかしながら、従来技術には以下に掲げる問題点があった。まず第1の問題点は、割り込みコントローラ、I/Oポート、タイマなど、周辺機器を内蔵したマイクロコントローラと呼ばれるプロセッサには適用できないことである。その理由は、マイクロコントローラの場合には、命令毎あるいは、1クロック毎に、周辺機器のシミュレーションを行わなければ、正確なシミュレーション結果を得ることができないからである。たとえば、外部割り込み処理が必要な場合、図6のcの部分を変換された機械語プログラムで実行している場合には、連続的にシミュレーション対象プログラム1のシミュレーションが実行されるため、cの部分では命令と命令の間の外部割り込み処理が受け付けられないためである。
【0008】
そして第2の問題点は、シミュレーション対象プログラム1をデバッグする場合には、1命令ずつステップ実行させたり、任意の場所で、シミュレーションの実行を停止させる必要があるため、変換された機械語プログラムに対して、実行停止をさせるための処理が必要になり、構造が複雑になることである。その理由は、変換されたプログラムの実行停止方法と命令逐次実行でのプログラム停止手段が異なるからである。
【0009】
本発明は斯かる問題点を鑑みてなされたものであり、その目的とするところは、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、マイクロコントローラのような制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムおよび命令シミュレーション方法を提供する点にある。
【0010】
【課題を解決するための手段】
請求項1に記載の発明の要旨は、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムであって、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段と、前記命令が実行済であるか否かの判定用の情報を格納する実行済命令情報格納領域と、前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する手段と、前記命令のシミュレーションを1回目に実行した際に変換した実行済命令にかかる変換結果を格納するネイティブ命令格納領域と、前記命令をネイティブ命令に変換できない場合に当該命令のデコード情報を保存するためのデコード情報格納領域とを有し、前記シミュレーション実行手段は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域および前記ネイティブ命令格納領域を参照して2回目以降のシミュレーションを実行するとともに、2回目以降のシミュレーションの実行の場合には同一命令のデコード処理を行わずに前記デコード情報格納領域を参照して得た1回目のデコード情報を利用してシミュレーションの処理時間の短縮を図るように構成されていることを特徴とするシミュレーションシステムに存する。
また、請求項2に記載の発明の要旨は、前記命令のシミュレーションを1回目に実行した際に、シミュレータが動作するコンピュータの機械語命令に変換可能であれば当該変換結果を前記ネイティブ命令格納領域に格納するように構成されていることを特徴とする請求項1に記載のシミュレーションシステムに存する。
また、請求項3に記載の発明の要旨は、同一命令のシミュレーションを2回目以降に実行する場合に前記実行済命令情報格納領域から情報を取り出すとともに、前記ネイティブ命令格納領域に既に格納されている機械語で実行可能であれば当該機械語を実行することにより、高速に同一命令の2回目以降のシミュレーションを実行するように構成されていることを特徴とする請求項1に記載のシミュレーションシステムに存する。
また、請求項4に記載の発明の要旨は、シミュレータ全体を制御し実際にシミュレーションを実行する制御部と、シミュレーション対象プログラムと、シミュレーションを実行するために擬似的にシミュレーション対象のプロセッサのハードウェアを持たせた擬似レジスタ・メモリ格納領域と、命令が実行済であるか否かの判定用の情報を格納する前記実行済命令情報格納領域と、前記シミュレーション対象プログラムの命令をコンピュータシステムの機械語の命令に変換して実行することによって命令のシミュレーションを行うことを可能とするための前記ネイティブ命令格納領域と、を有することを特徴とする請求項1乃至3のいずれか一項に記載のシミュレーションシステムに存する。
また、請求項5に記載の発明の要旨は、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムであって、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段と、前記命令が実行済であるか否かの判定用の情報を格納する実行済命令情報格納領域と、前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する手段と、前記命令のシミュレーションを1回目に実行した際に、当該命令をネイティブ命令に変換できない場合に当該命令のデコード情報を保存するためのデコード情報格納領域とを有し、前記シミュレーション実行手段は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域と前記デコード情報格納領域とを参照して得たデコード情報を利用してシミュレーションの処理時間の短縮を図るように構成されていることを特徴とするシミュレーションシステムに存する。
また、請求項6に記載の発明の要旨は、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段を有するシミュレーションシステムであって、前記命令のシミュレーションを実行した際に、当該命令が機械語命令に変換できない場合に当該命令のデコード情報を格納するためのデコード情報格納領域を備え、前記シミュレーション実行手段は、前記シミュレーション対象プログラムから取り出した命令が前記デコード情報格納領域に格納された前記デコード情報に関する命令と同一であるか否かを判定し、当該命令のデコード情報が存在する場合には、前記デコード情報格納領域を参照して当該命令のシミュレーションを実行することを特徴とするシミュレーションシステムに存する。
また、請求項7に記載の発明の要旨は、前記命令のシミュレーションを実行した際に変換した機械語命令変換結果を格納するネイティブ命令格納領域を備え、前記シミュレーション実行手段は、前記シミュレーション対象プログラムから取り出した命令が前記ネイティブ命令格納領域に格納された前記機械語命令変換結果に関する命令と同一であるか否かを判定し、当該命令の機械語命令変換結果が存在する場合には、前記ネイティブ命令格納領域を参照して当該命令のシミュレーションを実行することを特徴とする請求項6に記載のシミュレーションシステムに存する。
また、請求項8に記載の発明の要旨は、前記シミュレーション実行手段は、命令のシミュレーションを実行した際に、シミュレータが動作するコンピュータの前記機械語命令に変換可能であれば、前記デコード情報を前記デコード情報格納領域に格納せずに前記機械語命令変換結果を前記ネイティブ命令格納領域に格納するように構成されていることを特徴とする請求項7に記載のシミュレーションシステムに存する。
また、請求項9に記載の発明の要旨は、前記シミュレーション実行手段において、未実行の命令のシミュレーションを行なうときに、前記デコード情報を前記デコード情報格納領域に格納することを特徴とする請求項6に記載のシミュレーションシステムに存する。
また、請求項10に記載の発明の要旨は、前記デコード情報は、シミュレーション対象の命令の種類、レジスタ番号、もしくはメモリアドレスであることを特徴とする請求項1及至9のいずれかに記載のシミュレーションシステムに存する。
また、請求項11に記載の発明の要旨は、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できる命令シミュレーション方法であって、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行工程と、前記命令が実行済であるか否かの判定用の情報を実行済命令情報格納領域に格納する工程と、前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する工程と、前記命令のシミュレーションを1回目に実行した際に変換した実行済命令にかかる変換結果をネイティブ命令格納領域に格納する工程と、前記命令をネイティブ命令に変換できない場合に当該命令のデコード情報をデコード情報格納領に保存する工程とを有し、前記シミュレーション実行工程は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域および前記ネイティブ命令格納領域を参照して2回目以降のシミュレーションを実行するとともに、2回目以降のシミュレーションの実行の場合には同一命令のデコード処理を行わずに前記デコード情報格納領域を参照して得た1回目のデコード情報を利用してシミュレーションの処理時間の短縮を図る工程を含むことを特徴とする命令シミュレーション方法に存する。
また、請求項12に記載の発明の要旨は、前記命令のシミュレーションを1回目に実行した際に、シミュレータが動作するコンピュータの機械語命令に変換可能であれば当該変換結果を前記ネイティブ命令格納領域に格納する工程を有することを特徴とする請求項11に記載の命令シミュレーション方法に存する。
また、請求項13に記載の発明の要旨は、同一命令のシミュレーションを2回目以降に実行する場合に前記実行済命令情報格納領域から情報を取り出すとともに、前記ネイティブ命令格納領域に既に格納されている機械語で実行可能であれば当該機械語を実行することにより、高速に同一命令の2回目以降のシミュレーションを実行する工程を有することを特徴とする請求項11に記載の命令シミュレーション方法に存する。
また、請求項14に記載の発明の要旨は、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できる命令シミュレーション方法であって、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行工程と、前記命令が実行済であるか否かの判定用の情報を実行済命令情報格納領域に格納する工程と、前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する工程と、前記命令のシミュレーションを1回目に実行する際に、当該命令をネイティブ命令に変換できない場合に当該命令のデコード情報をデコード情報格納領域に保存する工程とを有し、前記シミュレーション実行工程は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域と前記デコード情報格納領域とを参照して得たデコード情報を利用してシミュレーションの処理時間の短縮を図る工程を含むことを特徴とする命令シミュレーション方法に存する。
また、請求項15に記載の発明の要旨は、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行する命令シミュレーション方法であって、前記命令のシミュレーションを実行した際に、当該命令が機械語命令に変換できない場合に当該命令のデコード情報をデコード情報格納領域に格納する工程と、前記シミュレーション対象プログラムから取り出した命令が前記デコード情報格納領域に格納された前記デコード情報に関する命令と同一であるか否かを判定し、当該命令のデコード情報が存在する場合には、前記デコード情報格納領域を参照して当該命令のシミュレーションを実行する工程とを含むことを特徴とする命令シミュレーション方法に存する。
また、請求項16に記載の発明の要旨は、前記デコード情報は、シミュレーション対象の命令の種類、レジスタ番号、もしくはメモリアドレスであることを特徴とする請求項11及至15のいずれかに記載の命令シミュレーション方法に存する。
【0011】
【発明の実施の形態】
本発明の特徴は、プロセッサの命令逐次実行シミュレータにおいて、シミュレーション対象プログラムから命令を取り出してシミュレーションを実行した場合に、対象プログラムにループ処理があり2回目に同一命令を実行する際に、1回目のシミュレーション処理よりも高速にシミュレーションを行い、より短時間にシミュレーション結果を取得できる構成を設けた点にある。これにより、第1に、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションできるようになる。また第2に、マイクロコントローラのような制御系のプロセッサに対して1命令毎に実行することで割り込み処理や周辺機能シミュレーションに対しても正確にシミュレーションを実行できるようになる。そして第3に、プログラムを開発する場合に、従来の命令逐次実行シミュレーションに対する改造点が少ないために開発期間が少なくて済むといった効果を奏する。以下、図面に基づき本発明の実施の形態を説明する。
【0012】
(第1の実施の形態)
初めに、図面に基づき本発明の第1の実施の形態を説明する。図1は本発明の第1の実施の形態のシステム構成図である。図1において、1はシミュレーション対象プログラム、20はシミュレータ、21は制御部、22は実行済命令情報格納領域、23は擬似レジスタ・メモリ格納領域、25はネイティブ命令格納領域、100はコンピュータシステム、101は補助記憶装置、102は入出力装置、200はシミュレーションシステムを示している。
【0013】
図1を参照すると、本実施の形態のシミュレーションシステム200は、オペレーティングシステム(たとえば、WindowsNTやWindows98,UNIXなど(いずれも商標))により動作するコンピュータシステム100と、シミュレーション対象プログラム1のソースプログラム、実行形式のプログラムを格納する補助記憶装置101と、コンピュータシステム100に接続された入出力装置102と、本発明のシミュレータ20から構成されている。
【0014】
また、本実施の形態におけるコンピュータシステム100は、オペレーティングシステム(Operating System)と、当該オペレーティングシステム上で動作するシミュレータ20を備えている。一方、シミュレータ20は、シミュレータ20全体を制御し実際にシミュレーションを実行する制御部21と、シミュレーション対象プログラム1と、シミュレーションを実行するために、擬似的にシミュレーション対象のプロセッサのハードウェアを持たせた擬似レジスタ・メモリ格納領域23と、実行済命令であるかの判定用の情報を格納する実行済命令情報格納領域22と、シミュレーション対象プログラム1の命令をコンピュータシステム100の機械語の命令に変換して実行することによって命令のシミュレーションを行うことを可能とするためのネイティブ命令格納領域25を備えている。
【0015】
すなわち、本実施の形態のシミュレータ20は、図1に示すように、前述の従来の命令逐次実行シミュレータ(図8参照)の構成に、実行済命令情報格納領域22を追加することで、1回目の命令シミュレーションを実行した際に、シミュレータ20が動作するコンピュータの機械語命令に変換可能であればその変換結果をネイティブ命令格納領域25に格納できる。さらに加えて、ループなどにより同一命令の命令シミュレーションを2回目に実行する場合に実行済命令情報格納領域22から情報を取り出すとともに、ネイティブ命令格納領域25の機械語で実行可能であれば当該機械語を実行することにより、高速に2回目の命令シミュレーションを実行できるようになるといった効果を奏する。
【0016】
次にシミュレーションシステム200の動作(命令シミュレーション方法)について説明する。図2は制御部21の処理の流れを示すフローチャートである。なお、本フローチャートに示す処理では実行済命令情報格納領域22の初期化処理などは省略している。
【0017】
図2において、ステップS201は、シミュレーション対象プログラム1からシミュレーションを行う1命令を取り出す処理である。
【0018】
ステップS202は、未実行の命令か否かを、実行済命令情報格納領域22を参照して判断する処理である。
【0019】
ステップS203は、ステップS201で取り出した命令をデコードし、命令の種類(転送、演算、分岐、比較などの命令)や、対象のレジスタ番号やメモリのアドレスの情報を取り出す処理である。
【0020】
ステップS204は、1命令シミュレーションを擬似レジスタ・メモリ格納領域23を参照しながら、命令の種類に従って動作を行い、シミュレーション結果を擬似レジスタ・メモリ格納領域23に格納する処理である。
【0021】
ステップS205は、シミュレーションした命令が、ネイティブ命令変換可能であるかを判断する処理である。
【0022】
ステップS206は、シミュレーション対象プログラム1の1命令を、コンピュータシステム100で直接実行可能な命令(ネイティブ命令)に変換して、ネイティブ命令格納領域25に格納する処理である。
【0023】
ステップS207は、同一命令を2回目に実行する場合に、ネイティブ命令で実行可能であることを示すために、実行済命令情報格納領域22に論理値(たとえば’1’)を格納する処理である。
【0024】
ステップS208は、実行済命令であった場合に、ネイティブ命令格納領域25の命令を実行して、シミュレーションを行う処理である。
【0025】
ステップS209は、周辺機能のシミュレーション、たとえば、プロセッサ内蔵のタイマがあり、かつ動作中であれば、タイマのカウントアップを行う処理である。
【0026】
ステップS210は、シミュレーション対象プロセッサに対する擬似割り込みがあった否かのチェック、シミュレーション処理に必要なクロック数の加算、およびシミュレーション対象プログラム1に対してシミュレーション停止の指示があったかのチェックをする処理である。
【0027】
ステップS211は、シミュレーション停止の指示があった場合にシミュレーションを停止し、シミュレーション停止の指示がなければシミュレーションを続行する処理である。
【0028】
次に図1および図2のフローチャートを参照して本実施の形態の全体の動作について詳細に説明する。本実施の形態では、まず、補助記憶装置101からコンピュータシステム100のシミュレータ20のシミュレーション対象プログラム1をロードする。
【0029】
続いて、制御部21の処理によって、シミュレーションを開始する。シミュレーション対象プログラム1の中から擬似レジスタ・メモリ格納領域23に格納されているプログラムカウンタが示しているアドレスの命令をステップS201で取り出す。
【0030】
続いて、ステップS202によって、取り出した命令が、未実行の命令であるか否かを判断する。もし、実行した命令であれば、ステップS208のステップ処理へ進む。未実行の命令であれば、次のステップの処理を行うステップS203によって、命令をデコードし、シミュレーションに必要な情報を取り出す。
【0031】
続いて、ステップS203で取り出した情報に従ってステップS204を実行し擬似レジスタ・メモリ格納領域23の情報を命令の種類によって操作し、その結果を擬似レジスタ・メモリ格納領域23に書き戻す。たとえば、ADDI R1,#10(すなわち、第1のレジスタに数値10を加え、当該演算結果を第1のレジスタに保持する)といった命令であった場合には擬似レジスタ・メモリ格納領域23の第1のレジスタに相当するメモリの内容を読み出して数値10を加算し、該演算結果を擬似レジスタ・メモリ格納領域23の第1のレジスタに相当するメモリに書き戻すことにより、1命令のシミュレーションを行ったことになる。
【0032】
続いて、ステップS205を実行し、シミュレーションした命令がネイティブ命令に変換可能であるかを判定する。このとき、変換可能な命令は事前に制御部21の管理するテーブルなどに登録しておくことによって判断可能である。変換不可能であれば、ステップS209へジャンプする。たとえばステップS204の具体的な命令の例である前述のADDI R1,#10であれば、変換可能である。すなわち、ネイティブ加算命令が、擬似レジスタ・メモリ格納領域23のメモリのアドレスの内容と数値10を加算し、結果を擬似レジスタ・メモリ格納領域23のメモリに格納できる命令であれば、ステップS204と同一の動作となる。
【0033】
続いて、ステップS206を実行し、シミュレーション対象プログラム1の命令をネイティブ命令に変換して、ネイティブ命令格納領域25に格納する。
【0034】
続いて、ステップS208を実行する際、ネイティブ命令実行可能とするために、ステップS207で、実行済命令情報格納領域22に値を書き込んで実行済命令とする。
【0035】
続いて、ステップS209にジャンプする。このとき、シミュレーション対象プログラム1と実行済命令情報格納領域22には、簡単な演算で1対1に対応できるようにマッピングする。たとえば、実行済命令情報格納領域22を1ビットで表現した場合、シミュレーション対象プログラムがバイト(8ビット単位)で命令が配置されていれば、1/8のメモリの容量で表現することができる。具体的には、シミュレーション対象プログラム1のアドレス(バイト単位)が0番地に対しては、実行済命令情報格納領域22のアドレス(バイト単位)およびビット位置は0番地およびビット0となる。同様に、シミュレーション対象プログラム1のアドレス(バイト単位)が1番地に対しては、実行済命令情報格納領域22のアドレス(バイト単位)およびビット位置は0番地およびビット1となる。同様に、シミュレーション対象プログラム1のアドレス(バイト単位)が2番地に対しては、実行済命令情報格納領域22のアドレス(バイト単位)およびビット位置は0番地およびビット2となる。同様に、シミュレーション対象プログラム1のアドレス(バイト単位)が8番地に対しては、実行済命令情報格納領域22のアドレス(バイト単位)およびビット位置は1番地およびビット0となる。
【0036】
続いて、ステップS208を実行し、ネイティブ命令格納領域25に格納されたネイティブ命令を実行する。
【0037】
続いて、ステップS209を実行し、1命令のシミュレーションでは直接操作できない周辺機能、たとえば、シミュレーション対象プロセッサに内蔵されたタイマーのカウントアップの処理などを行う。
【0038】
続いて、ステップS210を実行し、シミュレーション対象プロセッサに対する割り込み(たとえば外部割り込み、タイマーの一致による内部割り込みなど)のチェック、シミュレーションに必要であったクロック数の更新(この値によって、実際のプロセッサでは、どのくらいの時間で、処理ができるかの算出ができる)、シミュレーション停止か否かのチェックを行う。このような外部割り込みのシミュレーションは、入出力装置102とシミュレータ20の制御部21との会話処理(インタラクティブ処理)によって割り込みを発生させるように登録しておくこと、あるいは事前にシミュレーション開始から何クロック経過したら割り込みを発生させるかを登録しておくことにより実現できる。
【0039】
続いて、ステップS211を実行し、シミュレーション停止か否かの判断し、もしシミュレーション続行と判断した場合はステップS201へジャンプし、シミュレーション停止と判断した場合はシミュレーションを停止させる。
【0040】
以上説明したように第1の実施の形態によれば以下に掲げる効果を奏する。まず第1の効果は、シミュレーション対象プログラム1を従来の命令逐次実行シミュレーションに比べて、高速にシミュレーションできることである。その理由は、シミュレーション対象プログラム1のループ処理(たとえば、C言語でのfor文)で、同一の命令を実行する場合に、命令のデコードが不要であり、さらに、ネイティブ命令実行によって、擬似レジスタ・メモリ格納領域23の情報を直接扱うことができるからである。
【0041】
また第2の効果は、マイクロコントローラのような制御系のプロセッサに対して1命令毎に実行することで割り込み処理や周辺機能シミュレーションに対しても、正確にシミュレーションを行うことができることである。その理由は、従来のように、シミュレーション対象プログラム1をネイティブ命令に変換する場合、ある命令群の固まりを変換するのではなく、1命令毎に変換するため、ネイティブ命令実行によって、割り込み処理や周辺機能シミュレーションの動作に、影響を与えないからである。
【0042】
そして第3の効果は、本実施の形態のプログラムを開発する場合に、従来の命令逐次実行シミュレーションに対する改造点が少ないために、開発期間が少なくて済ませることができることである。その理由は、基本的な処理の流れは、従来の命令逐次実行シミュレーションと同じであるからである。
【0043】
(第2の実施の形態)
次に図面に基づき本発明の第2の実施の形態を説明する。なお、上記第1の実施の形態において既に記述したものと同一の部分については、同一符号を付し、重複した説明は省略する。図3は本発明の第2の実施の形態のシステム構成図である。図3において、1はシミュレーション対象プログラム、30はシミュレータ、31は制御部、22は実行済命令情報格納領域、23は擬似レジスタ・メモリ格納領域、25はネイティブ命令格納領域、32はデコード情報格納領域、100はコンピュータシステム、101は補助記憶装置、102は入出力装置、200はシミュレーションシステムを示している。
【0044】
図3を参照すると、第2の実施の形態は、図1の前述の第1の実施の形態のシステム構成図に対して、デコード情報格納領域32が追加され、ネイティブ命令に変換できない場合に当該命令のデコード情報を保存する構成とすることによって、2回目の実行の場合に同一命令のデコード処理を行わずに1回目のデコード情報を利用してシミュレーションの処理時間の短縮を図る点に特徴を有している。
【0045】
上記デコード処理では、通常、シミュレーション対象プログラム1から取り出した命令のコードに対して、フィールド(命令フィールド、レジスタフィールド、アドレスフィールド、その他に分けられているフィールド)毎にマスクを掛け、さらに値を取り出すためにシフト動作を行う。さらに、命令の種類を判別するために命令テーブルを参照するなどの処理が必要であり、数10ステップから数100ステップの処理を必要とする。
【0046】
第2の実施の形態ではこれらをデコード情報格納領域32へのデコード情報の書き込みと読み出しによって、処理ステップを少なくしてシミュレーションの性能を上げている。
【0047】
次にシミュレーションシステム200の動作(命令シミュレーション方法)について説明する。図4は第2の実施の形態の制御部31の処理の流れを示すフローチャートである。本実施の形態の制御部31の処理のフローチャートは、前述の制御部21の処理のフローチャートに、ステップP301〜ステップP304の処理が追加されている点に特徴を有している。
【0048】
これらのステップP301〜ステップP304は、それぞれ概ね次のように動作する。まず、ステップP301は、命令デコードの情報を、デコード情報格納領域32に格納する処理である。
【0049】
ステップP302は、デコード済命令であること示すために、実行済命令情報格納領域22に値を設定する処理である。前述の第1の実施の形態では、実行済命令情報格納領域22のデータは、1ビットで実行済(ネイティブ命令実行可能)か未実行かの判断が可能であったが、第2の実施の形態の場合には、未実行/ネイティブ命令は実行不可であるが、デコード情報格納/ネイティブ命令実行可能のいずれかを示す必要があるため、2ビットを使用することにより表現できる。たとえば、「00:初期値、未実行命令、01:ネイティブ命令実行可能命令、10:ネイティブ命令実行不可であるが、デコード情報を格納、11:この場合はありえないため、不定とする。」となる。
【0050】
ステップP303は、ステップP302で設定した2ビットのデータを読み込んで、デコード済命令である(たとえば上記の例の場合10)かを判定する処理である。
【0051】
ステップP304は、ステップP301で、デコード情報格納領域32に書き込んだ情報を読み出す処理を行う処理である。
【0052】
次に図3のシステム構成図および図4のフローチャートを参照して本実施の形態の全体の動作について詳細に説明する。本実施の形態では、まず、補助記憶装置101からコンピュータシステム100のシミュレータ30のシミュレーション対象プログラム1をロードし、制御部31の処理によってシミュレーションを開始する。
【0053】
続いて、ステップP201を実行し、擬似レジスタ・メモリ格納領域23に格納されているプログラムカウンタが示しているアドレスの命令を、シミュレーション対象プログラム1の中から取り出す。
【0054】
続いて、ステップP202を実行し、取り出した命令が未実行の命令であるかを判断する。もし、取り出した命令が既に実行した命令であれば後述するステップP303へジャンプする。一方、取り出した命令が未実行の命令であれば、ステップP203を実行する。ステップP203では当該命令をデコードしてシミュレーションに必要な情報を取り出す。
【0055】
続いて、ステップP204を実行し、ステップP203を実行して取り出した情報に従って、擬似レジスタ・メモリ格納領域23の情報を命令の種類によって操作し、当該実行結果を擬似レジスタ・メモリ格納領域23に書き戻す。
【0056】
続いて、ステップP205を実行し、ステップP204でシミュレーションした命令がネイティブ命令に変換可能であるかを判定する。当該変換可能な命令は、事前に制御部31の管理するテーブルなどに登録しておくことによって判断可能であり、ステップP206の処理へジャンプする。一方、ステップP204でシミュレーションした命令がネイティブ命令に変換不可能であった場合には次の処理を行う。
【0057】
すなわち、ステップP301を実行してデコード情報(命令の種類、レジスタ番号、メモリアドレスなどの情報)をデコード情報格納領域32に書き込む。
【0058】
続いて、ステップP302を実行し、値(たとえば’10’)の2ビットのデータをデコード済命令として実行済命令情報格納領域22に書き込み、ステップP304の処理へジャンプする。
【0059】
ステップP204でシミュレーションした命令がネイティブ命令に変換可能な場合は、続いてステップP206を実行し、シミュレーション対象プログラム1の命令をネイティブ命令に変換して、ネイティブ命令格納領域25に格納する。
【0060】
続いて、ステップP207を実行し、ネイティブ命令実行可能とするために、実行済命令(ネイティブ命令実行可能)の値(たとえば、’01’)の2ビットのデータを実行済命令情報格納領域22に書き込んでネイティブ命令実行可能命令とし、ステップP209の処理へジャンプする。
【0061】
一方、未実行命令でない場合(ステップP202のNO)は、ステップP303を実行して実行済命令情報格納領域22からデータを取り出し、ステップP201で取り出した命令がデコード済みの命令であるかを判断する。
【0062】
もし、実行済命令情報格納領域22から取り出したデータの論理値が’01’であれば、ネイティブ命令実行可能な命令であると判断してステップP208の処理へジャンプする。一方、実行済命令情報格納領域22から取り出したデータの論理値が’10’であれば、ネイティブ命令実行不可能な命令であるがデコード情報を格納した命令であると判断して次のステップを実行する。
【0063】
続いて、ステップP304を実行し、デコード情報格納領域32から命令シミュレーションに必要なデコードした情報を読み出す。
【0064】
続いて、ステップP204を実行して1命令のシミュレーションを実行し、ステップP209の処理へジャンプする。
【0065】
デコード済命令でない場合(ステップP303のNO)は、ステップP208を実行し、ネイティブ命令格納領域25に格納されたネイティブ命令を実行する。
【0066】
続いて、ステップP209を実行し、1命令のシミュレーションでは直接操作できない周辺機能、たとえば、シミュレーション対象プロセッサに内蔵されたタイマーのカウントアップの処理などを行う。
【0067】
続いて、ステップP210を実行し、シミュレーション対象プロセッサに対する割り込み(外部割り込み、タイマーの一致による内部割り込みなど)のチェック、シミュレーションに必要であったクロック数の更新(この値によって、実際のプロセッサでは、どのくらいの時間で、処理ができるかの算出ができる)、シミュレーション停止か否かのチェックなどを行う。
【0068】
続いて、ステップP211を実行し、シミュレーション停止か否かの判断し、もし、シミュレーションを続行すると判断したならばステップP201の処理へジャンプする。一方、シミュレーション停止と判断したならばシミュレーションを停止させる。
【0069】
ここで、図1を参照すると、本実施の形態は、シミュレータ30のプログラムを補助記憶装置101からコンピュータシステム100に読み込んでシミュレーションを実行するため、補助記憶装置101へシミュレータ30を記述したプログラムコードを記録した記録媒体(不図示)を備えている。当該記録媒体は磁気ディスク、光ディスク、半導体メモリカードなどの情報記憶媒体であってよい。
【0070】
以上説明したように第2の実施の形態によれば以下に掲げる効果を奏する。まず第1の効果は、シミュレーション対象プログラム1を従来の命令逐次実行シミュレーションに比べて、高速にシミュレーションできることである。その理由は、シミュレーション対象プログラム1のループ処理(たとえば、C言語でのfor文)で、同一の命令を実行する場合に、命令のデコードが不要であり、さらに、ネイティブ命令実行によって、擬似レジスタ・メモリ格納領域23の情報を直接扱うことができるからである。
【0071】
また第2の効果は、マイクロコントローラのような制御系のプロセッサに対して1命令毎に実行することで割り込み処理や周辺機能シミュレーションに対しても、正確にシミュレーションを行うことができることである。その理由は、従来のように、シミュレーション対象プログラム1をネイティブ命令に変換する場合、ある命令群の固まりを変換するのではなく、1命令毎に変換するため、ネイティブ命令実行によって、割り込み処理や周辺機能シミュレーションの動作に、影響を与えないからである。
【0072】
そして第3の効果は、本実施の形態のプログラムを開発する場合に、従来の命令逐次実行シミュレーションに対する改造点が少ないために、開発期間が少なくて済ませることができることである。その理由は、基本的な処理の流れは、従来の命令逐次実行シミュレーションと同じであるからである。
【0073】
なお、本発明が上記各実施の形態に限定されず、本発明の技術思想の範囲内において、各実施の形態は適宜変更され得ることは明らかである。また上記構成部材の数、位置、形状などは上記実施の形態に限定されず、本発明を実施する上で好適な数、位置、形状などにすることができる。また、各図において、同一構成要素には同一符号を付している。
【0074】
【発明の効果】
本発明は以上のように構成されているので、以下に掲げる効果を奏する。まず第1の効果は、シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて、高速にシミュレーションできることである。その理由は、シミュレーション対象プログラムのループ処理(たとえば、C言語での for文)で、同一の命令を実行する場合に、命令のデコードが不要であり、さらに、ネイティブ命令実行によって、擬似レジスタ・メモリ格納領域の情報を直接扱うことができるからである。
【0075】
また第2の効果は、マイクロコントローラのような制御系のプロセッサに対して1命令毎に実行することで割り込み処理や周辺機能シミュレーションに対しても、正確にシミュレーションを行うことができることである。その理由は、従来のように、シミュレーション対象プログラムをネイティブ命令に変換する場合、ある命令群の固まりを変換するのではなく、1命令毎に変換するため、ネイティブ命令実行によって、割り込み処理や周辺機能シミュレーションの動作に、影響を与えないからである。
【0076】
そして第3の効果は、本発明のプログラムを開発する場合に、従来の命令逐次実行シミュレーションに対する改造点が少ないために、開発期間が少なくて済ませることができることである。その理由は、基本的な処理の流れは、従来の命令逐次実行シミュレーションと同じであるからである。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態のシステム構成図である。
【図2】第1の実施の形態の制御部の処理の流れを示すフローチャートである。
【図3】本発明の第2の実施の形態のシステム構成図である。
【図4】第2の実施の形態の制御部の処理の流れを示すフローチャートである。
【図5】従来技術のプロセッサ命令シミュレーションの流れを説明するフロー図である。
【図6】従来技術におけるターゲットプログラムの実行のシミュレーションの流れを説明するフロー図である。
【図7】従来の逐次命令シミュレーション方法の処理の流れを示すフローチャートである。
【図8】従来技術を実現するためのシステム構成図である。
【符号の説明】
1…シミュレーション対象プログラム
20,30,90…シミュレータ
21,31,91…制御部
22…実行済命令情報格納領域
23…擬似レジスタ・メモリ格納領域
25…ネイティブ命令格納領域
32…デコード情報格納領域
100…コンピュータシステム
101…補助記憶装置
102…入出力装置
200…シミュレーションシステム
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a processor instruction simulation technique, and in particular, can simulate a program to be simulated at a higher speed than a conventional instruction sequential execution simulation, and can perform simulation for each instruction even for a control processor such as a microcontroller. The present invention relates to an executable simulation system and an instruction simulation method.
[0002]
[Prior art]
FIG. 5 is a flowchart for explaining the flow of the prior art processor instruction simulation. As a conventional instruction simulation method for a processor, for example, there is one disclosed in Japanese Patent Laid-Open No. 10-177487. Referring to FIG. 5, a conventional processor instruction simulation method includes a simulation target program 1, program dividing means 3, and means 4 for converting into a machine language of a computer (hereinafter referred to as a host computer) that actually executes the simulation, It comprises means 5 for executing the converted machine language program and a simulator 6 for sequentially executing the instructions that could not be converted into machine language.
[0003]
FIG. 8 is a block diagram of the entire actual computer system for realizing the prior art. In FIG. 8, 1 is a simulation target program, 23 is a pseudo register / memory storage area, 25 is a native instruction storage area, 90 is a simulator, 91 is a control unit, 100 is a computer system, 101 is an auxiliary storage device, and 102 is an input / output The device is shown.
[0004]
Referring to FIG. 8, in an actual computer system for realizing the prior art, the control unit 91 of the simulator 90 switches between an instruction sequential execution simulation function and a function for directly executing the converted machine language program. It has functions that can be executed.
[0005]
FIG. 6 is a flowchart for explaining a simulation flow of execution of the simulation target program 1 in the prior art. Referring to FIG. 6, the conventional processor instruction simulation method having the above configuration operates as follows. That is, in order to simulate the simulation target program 1 at high speed, the program dividing unit 3 converts the program into the machine language of the host computer and executes the converted machine language program, thereby executing the simulation of the execution of the simulation target program 1 The simulation target program 1 is divided into a case (a, b, c, e in FIG. 6) and a case where a simulation is executed by an instruction sequential execution type simulator by the host computer (d in FIG. 6). The simulation result is obtained.
[0006]
The operation of the sequential instruction execution simulation by the host computer is not specifically described in the above prior art, but can be executed by the processing flow of FIG. FIG. 7 is a flowchart showing the flow of processing of the conventional sequential instruction simulation method. The processing flow of FIG. 7 is not particularly new, but is replaced by software processing instead of being executed by actual processor hardware. Here, the peripheral function simulation refers to simulating an I / O port, a timer, and an A / D converter of a single chip microcomputer. In addition, in the said prior art, since it is not touched about the peripheral function simulation, it is unknown whether it has these functions.
[0007]
[Problems to be solved by the invention]
However, the prior art has the following problems. The first problem is that it cannot be applied to a processor called a microcontroller incorporating peripheral devices such as an interrupt controller, an I / O port, and a timer. The reason is that in the case of a microcontroller, accurate simulation results cannot be obtained unless simulation of peripheral devices is performed for each instruction or for each clock. For example, when external interrupt processing is required, when the part c in FIG. 6 is executed by the converted machine language program, the simulation of the simulation target program 1 is continuously executed. This is because external interrupt processing between instructions cannot be accepted.
[0008]
The second problem is that when the simulation target program 1 is debugged, it is necessary to step by step one instruction or stop the execution of the simulation at an arbitrary location. On the other hand, a process for stopping execution is required, and the structure is complicated. This is because the execution stop method of the converted program is different from the program stop means in the sequential instruction execution.
[0009]
The present invention has been made in view of such problems, and an object of the present invention is to simulate a program to be simulated at a higher speed than a conventional instruction sequential execution simulation, and to control a processor such as a microcontroller. For this reason, a simulation system and an instruction simulation method capable of executing simulation for each instruction are provided.
[0010]
[Means for Solving the Problems]
  The gist of the invention described in claim 1 is a simulation system capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation, and capable of executing a simulation for each instruction of a control processor. A simulation execution means for extracting an instruction from the simulation target program and executing a simulation; an executed instruction information storage area for storing information for determining whether or not the instruction has been executed;Means for determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;A native instruction storage area for storing a conversion result of an executed instruction converted when the instruction simulation is executed for the first time, and a decoding information of the instruction when the instruction cannot be converted into a native instruction A decoding information storage area, and the simulation execution means includes a plurality of the same instructions in the simulation target program and executes the simulation of the same instruction for the second time or later, and the executed instruction information storage area and the The second and subsequent simulations are executed with reference to the native instruction storage area, and in the case of the second and subsequent simulation executions, 1 obtained by referring to the decode information storage area without decoding the same instruction Shorten the simulation processing time by using the first decoding information It consists in a simulation system characterized by being configured to achieve.
  Further, the gist of the invention described in claim 2 is that, when the simulation of the instruction is executed for the first time, the conversion result can be converted into a machine language instruction of a computer on which the simulator operates. The simulation system according to claim 1, wherein the simulation system is configured to store in the simulation system.
  The gist of the invention described in claim 3 is that information is extracted from the executed instruction information storage area and is already stored in the native instruction storage area when the simulation of the same instruction is executed for the second time or later. The simulation system according to claim 1, wherein the simulation system is configured to execute the second and subsequent simulations of the same instruction at high speed by executing the machine language if it can be executed in the machine language. Exist.
  According to a fourth aspect of the present invention, there is provided a control unit that controls the entire simulator and actually executes a simulation, a simulation target program, and a simulation target processor hardware for executing the simulation. A pseudo register / memory storage area provided, the executed instruction information storage area for storing information for determining whether or not the instruction has been executed, and instructions of the simulation target program in the machine language of the computer system. The simulation system according to claim 1, further comprising: a native instruction storage area for enabling simulation of an instruction by converting the instruction into an instruction and executing the instruction. Exist.
  Further, the gist of the invention described in claim 5 is a simulation system capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation and capable of executing a simulation for each instruction of a control processor. A simulation executing means for taking out an instruction from the simulation target program and executing the simulation; an executed instruction information storage area for storing information for determining whether or not the instruction has been executed;Means for determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;When the simulation of the instruction is executed for the first time, If the instruction cannot be converted to a native instructionA decoding information storage area for storing the decoding information of the instruction, and the simulation execution means includes a plurality of the same instructions in the simulation target program and executes the simulation of the same instructions for the second and subsequent times. And a simulation system configured to shorten a simulation processing time by using decode information obtained by referring to the executed instruction information storage area and the decode information storage area. .
  The gist of the invention described in claim 6 is a simulation system having a simulation execution means for taking out an instruction from a simulation target program and executing the simulation, and executing the simulation of the instruction., If the instruction cannot be converted into machine language instructionsA decoding information storage area for storing decoding information of the instruction, wherein the simulation execution means is the same as the instruction relating to the decoding information stored in the decoding information storage area; If the decoding information of the instruction exists, the simulation of the instruction is executed with reference to the decoding information storage area.
  Further, the gist of the invention described in claim 7 is provided with a native instruction storage area for storing a machine language instruction conversion result converted when the instruction simulation is executed, and the simulation execution means includes the simulation target program. It is determined whether or not the fetched instruction is the same as the instruction related to the machine language instruction conversion result stored in the native instruction storage area, and if the machine language instruction conversion result of the instruction exists, the native instruction The simulation system according to claim 6, wherein the simulation of the instruction is executed with reference to the storage area.
  Further, the gist of the invention described in claim 8 is that the simulation executing means is a computer that operates the simulator when executing simulation of instructions.SaidIf it is convertible to a machine language instruction, the machine language instruction conversion result is stored in the native instruction storage area without storing the decode information in the decode information storage area. It exists in the simulation system of Claim 7.
  The gist of the invention described in claim 9 is that the simulation information is stored in the decode information storage area when the unexecuted instruction is simulated in the simulation execution means. Exists in the simulation system described in 1.
  The gist of the invention of claim 10 is as follows:10. The simulation system according to claim 1, wherein the decode information is a type of instruction to be simulated, a register number, or a memory address.Exist.
  Claims11The gist of the invention described in is an instruction simulation method capable of simulating a simulation target program at a higher speed than the conventional instruction sequential execution simulation, and capable of executing simulation for each instruction to a control processor. A simulation execution step of extracting an instruction from the target program and executing a simulation; a step of storing information for determining whether or not the instruction has been executed in an executed instruction information storage area;Determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;A step of storing a conversion result of an executed instruction converted when the instruction simulation is executed for the first time in a native instruction storage area; and decoding information of the instruction when the instruction cannot be converted into a native instruction The simulation execution step includes the executed instruction information storage area when the simulation target program includes a plurality of the same instructions and executes the simulation of the same instructions for the second time or later. The second and subsequent simulations are executed by referring to the native instruction storage area, and the second and subsequent simulations are obtained by referring to the decode information storage area without decoding the same instruction. Simulation time using the first decoding information Resides in instruction simulation method characterized by comprising the step of shortening.
  Claims12In the gist of the invention described in (2), when the simulation of the instruction is executed for the first time, the conversion result can be stored in the native instruction storage area if the instruction can be converted into a machine language instruction of a computer on which the simulator operates. Claims having11The instruction simulation method described in the above.
  Claims13The gist of the invention described in the above is that when the simulation of the same instruction is executed for the second time or later, information is extracted from the executed instruction information storage area and can be executed in a machine language already stored in the native instruction storage area If so, it has a step of executing the second and subsequent simulations of the same instruction at high speed by executing the machine language.11The instruction simulation method described in the above.
  Claims14The gist of the invention described in is an instruction simulation method capable of simulating a simulation target program at a higher speed than the conventional instruction sequential execution simulation, and capable of executing simulation for each instruction to a control processor. A simulation execution step of extracting an instruction from the target program and executing a simulation; a step of storing information for determining whether or not the instruction has been executed in an executed instruction information storage area;Determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;When executing the simulation of the instruction for the first time, If the instruction cannot be converted to a native instructionStoring the decode information of the instruction in a decode information storage area, wherein the simulation execution step includes a case where a plurality of the same instructions are included in the simulation target program and the simulation of the same instruction is executed for the second time or later. The instruction simulation method includes a step of shortening a simulation processing time by using decode information obtained by referring to the executed instruction information storage area and the decode information storage area.
  The subject matter of claim 15 is as follows:An instruction simulation method for extracting an instruction from a simulation target program and executing a simulation, when the instruction simulation is executed, If the instruction cannot be converted into machine language instructionsDetermining whether or not the instruction fetched from the simulation target program is the same as the instruction related to the decode information stored in the decode information storage area, and storing the decode information of the instruction in the decode information storage area; A step of performing simulation of the instruction with reference to the decode information storage area when the decode information of the instruction exists.Exist.
  The gist of the invention described in claim 16 is that the decode information is a type of instruction to be simulated, a register number, or a memory address, and the instruction according to any one of claims 11 to 15 It exists in the simulation method.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
The feature of the present invention is that, in the instruction sequential execution simulator of a processor, when an instruction is extracted from a simulation target program and a simulation is executed, the target program has a loop process and the same instruction is executed for the second time when the target program is executed. The configuration is such that a simulation can be performed at a higher speed than the simulation process and the simulation result can be obtained in a shorter time. As a result, first, the simulation target program can be simulated at a higher speed than the conventional instruction sequential execution simulation. Second, by executing each instruction for a control processor such as a microcontroller, simulation can be executed accurately for interrupt processing and peripheral function simulation. Third, when developing a program, there is an effect that a development period can be shortened because there are few modifications to the conventional instruction sequential execution simulation. Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0012]
(First embodiment)
First, a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a system configuration diagram of a first embodiment of the present invention. In FIG. 1, 1 is a simulation target program, 20 is a simulator, 21 is a control unit, 22 is an executed instruction information storage area, 23 is a pseudo register / memory storage area, 25 is a native instruction storage area, 100 is a computer system, 101 Denotes an auxiliary storage device, 102 denotes an input / output device, and 200 denotes a simulation system.
[0013]
Referring to FIG. 1, a simulation system 200 according to the present embodiment includes a computer system 100 that is operated by an operating system (for example, Windows NT, Windows 98, UNIX (all are trademarks)), a source program of the simulation target program 1, and an execution It comprises an auxiliary storage device 101 for storing a program of a format, an input / output device 102 connected to the computer system 100, and the simulator 20 of the present invention.
[0014]
In addition, the computer system 100 according to the present embodiment includes an operating system (Operating System) and a simulator 20 that operates on the operating system. On the other hand, the simulator 20 includes a control unit 21 that controls the entire simulator 20 and actually executes the simulation, the simulation target program 1, and the simulation target processor hardware in order to execute the simulation. A pseudo register / memory storage area 23, an executed instruction information storage area 22 for storing information for determining whether the instruction is an executed instruction, and instructions of the simulation target program 1 are converted into machine language instructions of the computer system 100. A native instruction storage area 25 for enabling instruction simulation by executing the instruction.
[0015]
That is, as shown in FIG. 1, the simulator 20 of the present embodiment adds the executed instruction information storage area 22 to the configuration of the above-described conventional instruction sequential execution simulator (see FIG. 8). When the instruction simulation is executed, the conversion result can be stored in the native instruction storage area 25 if it can be converted into a machine language instruction of the computer on which the simulator 20 operates. In addition, when the instruction simulation of the same instruction is executed for the second time by a loop or the like, information is extracted from the executed instruction information storage area 22, and if the machine instruction in the native instruction storage area 25 can be executed, the machine language As a result, the second instruction simulation can be executed at high speed.
[0016]
Next, the operation (command simulation method) of the simulation system 200 will be described. FIG. 2 is a flowchart showing a processing flow of the control unit 21. In the process shown in this flowchart, the initialization process of the executed instruction information storage area 22 is omitted.
[0017]
In FIG. 2, step S <b> 201 is processing for extracting one instruction for performing simulation from the simulation target program 1.
[0018]
Step S202 is processing to determine whether or not the instruction is an unexecuted instruction with reference to the executed instruction information storage area 22.
[0019]
In step S203, the instruction fetched in step S201 is decoded, and the instruction type (transfer, operation, branch, comparison, etc.), target register number, and memory address information are fetched.
[0020]
Step S204 is a process of performing one instruction simulation according to the type of instruction while referring to the pseudo register / memory storage area 23 and storing the simulation result in the pseudo register / memory storage area 23.
[0021]
Step S205 is processing for determining whether or not the simulated instruction can be converted into a native instruction.
[0022]
Step S206 is a process of converting one instruction of the simulation target program 1 into an instruction (native instruction) that can be directly executed by the computer system 100 and storing it in the native instruction storage area 25.
[0023]
Step S207 is a process of storing a logical value (for example, “1”) in the executed instruction information storage area 22 to indicate that it can be executed with a native instruction when the same instruction is executed for the second time. .
[0024]
Step S208 is a process of executing a simulation by executing an instruction in the native instruction storage area 25 when the instruction is an executed instruction.
[0025]
Step S209 is a process of performing a peripheral function simulation, for example, if the processor has a built-in timer and the timer is counting up if it is in operation.
[0026]
Step S210 is a process of checking whether or not there is a pseudo interrupt for the simulation target processor, adding the number of clocks necessary for the simulation process, and checking whether or not the simulation target program 1 is instructed to stop the simulation.
[0027]
Step S211 is a process of stopping the simulation when there is an instruction to stop the simulation and continuing the simulation if there is no instruction to stop the simulation.
[0028]
Next, the overall operation of the present embodiment will be described in detail with reference to the flowcharts of FIGS. In the present embodiment, first, the simulation target program 1 of the simulator 20 of the computer system 100 is loaded from the auxiliary storage device 101.
[0029]
Subsequently, simulation is started by processing of the control unit 21. The instruction at the address indicated by the program counter stored in the pseudo register / memory storage area 23 is extracted from the simulation target program 1 in step S201.
[0030]
Subsequently, in step S202, it is determined whether or not the fetched instruction is an unexecuted instruction. If it is an executed instruction, the process proceeds to step S208. If the instruction is an unexecuted instruction, the instruction is decoded and information necessary for the simulation is extracted in step S203 in which processing of the next step is performed.
[0031]
Subsequently, step S204 is executed according to the information extracted in step S203, the information in the pseudo register / memory storage area 23 is manipulated according to the type of instruction, and the result is written back to the pseudo register / memory storage area 23. For example, if the instruction is ADDI R1, # 10 (that is, the numerical value 10 is added to the first register and the operation result is held in the first register), the first register in the pseudo register memory storage area 23 is stored. 1 instruction was simulated by reading the contents of the memory corresponding to this register, adding the numerical value 10, and writing the operation result back to the memory corresponding to the first register in the pseudo-register / memory storage area 23. It will be.
[0032]
Subsequently, step S205 is executed to determine whether the simulated instruction can be converted into a native instruction. At this time, convertible instructions can be determined by registering in advance in a table or the like managed by the control unit 21. If conversion is impossible, the process jumps to step S209. For example, the above-mentioned ADDI R1, # 10, which is an example of a specific instruction in step S204, can be converted. In other words, if the native addition instruction is an instruction that adds the contents of the memory address of the pseudo register / memory storage area 23 and the numerical value 10 and can store the result in the memory of the pseudo register / memory storage area 23, the same as step S204. It becomes the operation.
[0033]
Subsequently, step S206 is executed, and the instruction of the simulation target program 1 is converted into a native instruction and stored in the native instruction storage area 25.
[0034]
Subsequently, when executing step S208, in order to enable execution of the native instruction, in step S207, a value is written in the executed instruction information storage area 22 to obtain an executed instruction.
[0035]
Subsequently, the process jumps to step S209. At this time, the simulation target program 1 and the executed instruction information storage area 22 are mapped so as to correspond one-to-one with a simple calculation. For example, when the executed instruction information storage area 22 is expressed by 1 bit, if the simulation target program has instructions arranged in bytes (8-bit units), it can be expressed by 1/8 memory capacity. Specifically, when the address (byte unit) of the simulation target program 1 is address 0, the address (byte unit) and bit position of the executed instruction information storage area 22 are address 0 and bit 0. Similarly, when the address (byte unit) of the simulation target program 1 is 1, the address (byte unit) and bit position of the executed instruction information storage area 22 are 0 address and bit 1. Similarly, when the address (byte unit) of the simulation target program 1 is 2, the address (byte unit) and bit position of the executed instruction information storage area 22 are 0 address and bit 2. Similarly, when the address (byte unit) of the simulation target program 1 is 8, the address (byte unit) and bit position of the executed instruction information storage area 22 are 1 address and bit 0.
[0036]
Subsequently, step S208 is executed, and the native instruction stored in the native instruction storage area 25 is executed.
[0037]
Subsequently, step S209 is executed to perform a peripheral function that cannot be directly operated by one-instruction simulation, for example, a process for counting up a timer built in the simulation target processor.
[0038]
Subsequently, step S210 is executed to check an interrupt to the simulation target processor (for example, an external interrupt, an internal interrupt due to a timer match, etc.), and update the number of clocks required for the simulation. It is possible to calculate how much time can be processed), and check whether the simulation is stopped. Such an external interrupt simulation is registered such that an interrupt is generated by conversation processing (interactive processing) between the input / output device 102 and the control unit 21 of the simulator 20, or how many clocks have elapsed since the simulation started. Then, it can be realized by registering whether to generate an interrupt.
[0039]
Subsequently, step S211 is executed to determine whether or not to stop the simulation. If it is determined that the simulation is to be continued, the process jumps to step S201, and if it is determined to stop the simulation, the simulation is stopped.
[0040]
As described above, according to the first embodiment, the following effects can be obtained. First, the first effect is that the simulation target program 1 can be simulated at a higher speed than the conventional instruction sequential execution simulation. The reason is that when the same instruction is executed in the loop processing of the simulation target program 1 (for example, a for statement in C language), it is not necessary to decode the instruction. This is because the information in the memory storage area 23 can be directly handled.
[0041]
The second effect is that simulation can be accurately performed for interrupt processing and peripheral function simulation by executing each instruction for a control processor such as a microcontroller. The reason for this is that when the simulation target program 1 is converted into native instructions as in the prior art, a group of instructions is not converted, but instead is converted for each instruction. This is because the function simulation operation is not affected.
[0042]
The third effect is that, when developing the program according to the present embodiment, since there are few modifications to the conventional instruction sequential execution simulation, the development period can be shortened. The reason is that the basic processing flow is the same as in the conventional instruction sequential execution simulation.
[0043]
(Second Embodiment)
Next, a second embodiment of the present invention will be described with reference to the drawings. Note that the same parts as those already described in the first embodiment are denoted by the same reference numerals, and redundant description is omitted. FIG. 3 is a system configuration diagram of the second embodiment of the present invention. In FIG. 3, 1 is a simulation target program, 30 is a simulator, 31 is a control unit, 22 is an executed instruction information storage area, 23 is a pseudo register / memory storage area, 25 is a native instruction storage area, and 32 is a decode information storage area. , 100 is a computer system, 101 is an auxiliary storage device, 102 is an input / output device, and 200 is a simulation system.
[0044]
Referring to FIG. 3, in the second embodiment, the decoding information storage area 32 is added to the system configuration diagram of the first embodiment shown in FIG. The feature is that the decoding time of the simulation is shortened by using the first decoding information without performing the decoding processing of the same instruction in the case of the second execution by adopting a configuration to store the decoding information of the instruction. Have.
[0045]
In the decoding process, normally, the code of the instruction fetched from the simulation target program 1 is masked for each field (instruction field, register field, address field, and other fields divided), and further values are taken out. Therefore, a shift operation is performed. Furthermore, processing such as referring to an instruction table is necessary to determine the type of instruction, and processing from several tens of steps to several hundred steps is required.
[0046]
In the second embodiment, the performance of the simulation is improved by reducing the number of processing steps by writing and reading the decoding information to and from the decoding information storage area 32.
[0047]
Next, the operation (command simulation method) of the simulation system 200 will be described. FIG. 4 is a flowchart illustrating a flow of processing of the control unit 31 according to the second embodiment. The flowchart of the process of the control unit 31 of the present embodiment is characterized in that the processes of Step P301 to Step P304 are added to the flowchart of the process of the control unit 21 described above.
[0048]
These steps P301 to P304 generally operate as follows. Step P301 is a process of storing instruction decode information in the decode information storage area 32.
[0049]
Step P302 is a process of setting a value in the executed instruction information storage area 22 to indicate that it is a decoded instruction. In the first embodiment described above, it is possible to determine whether the data in the executed instruction information storage area 22 has been executed with one bit (native instruction can be executed) or not yet executed. In the case of the form, an unexecuted / native instruction cannot be executed, but it is necessary to indicate one of decoding information storage / native instruction execution, and can be expressed by using 2 bits. For example, “00: initial value, unexecuted instruction, 01: native instruction executable instruction, 10: native instruction inexecutable, but decode information is stored, 11: in this case, it is not possible, and is undefined”. .
[0050]
Step P303 is processing for reading the 2-bit data set in step P302 and determining whether the instruction is a decoded instruction (for example, 10 in the above example).
[0051]
Step P304 is a process for reading the information written in the decode information storage area 32 in step P301.
[0052]
Next, the overall operation of the present embodiment will be described in detail with reference to the system configuration diagram of FIG. 3 and the flowchart of FIG. In the present embodiment, first, the simulation target program 1 of the simulator 30 of the computer system 100 is loaded from the auxiliary storage device 101, and the simulation is started by the processing of the control unit 31.
[0053]
Subsequently, step P201 is executed, and the instruction at the address indicated by the program counter stored in the pseudo register / memory storage area 23 is extracted from the simulation target program 1.
[0054]
Subsequently, Step P202 is executed to determine whether the fetched instruction is an unexecuted instruction. If the fetched instruction is already executed, the process jumps to Step P303 described later. On the other hand, if the fetched instruction is an unexecuted instruction, Step P203 is executed. In step P203, the instruction is decoded to extract information necessary for the simulation.
[0055]
Subsequently, Step P204 is executed, and the information in the pseudo register / memory storage area 23 is manipulated according to the type of instruction according to the information extracted by executing Step P203, and the execution result is written in the pseudo register / memory storage area 23. return.
[0056]
Subsequently, Step P205 is executed to determine whether the instruction simulated in Step P204 can be converted into a native instruction. The convertible instruction can be determined by registering in advance in a table or the like managed by the control unit 31 and jumps to the process of step P206. On the other hand, if the instruction simulated in step P204 cannot be converted into a native instruction, the following processing is performed.
[0057]
That is, step P301 is executed to write decode information (information such as instruction type, register number, and memory address) in the decode information storage area 32.
[0058]
Subsequently, Step P302 is executed, and 2-bit data of a value (for example, “10”) is written in the executed instruction information storage area 22 as a decoded instruction, and the process jumps to Step P304.
[0059]
If the instruction simulated in step P204 can be converted into a native instruction, then step P206 is executed, and the instruction of the simulation target program 1 is converted into a native instruction and stored in the native instruction storage area 25.
[0060]
Subsequently, step P207 is executed, and in order to enable execution of the native instruction, 2-bit data of the executed instruction (native instruction executable) value (for example, “01”) is stored in the executed instruction information storage area 22. Write to the native instruction executable instruction and jump to the process of step P209.
[0061]
On the other hand, if it is not an unexecuted instruction (NO in step P202), step P303 is executed to extract data from the executed instruction information storage area 22, and it is determined whether the instruction extracted in step P201 is a decoded instruction. .
[0062]
If the logical value of the data retrieved from the executed instruction information storage area 22 is “01”, it is determined that the instruction is a native instruction executable, and the process jumps to the process of step P208. On the other hand, if the logical value of the data fetched from the executed instruction information storage area 22 is “10”, it is determined that the instruction is a native instruction inexecutable instruction but stored with decode information. Execute.
[0063]
Subsequently, step P304 is executed, and decoded information necessary for instruction simulation is read from the decode information storage area 32.
[0064]
Subsequently, Step P204 is executed to execute a one-instruction simulation, and the process jumps to Step P209.
[0065]
If it is not a decoded instruction (NO in step P303), step P208 is executed, and the native instruction stored in the native instruction storage area 25 is executed.
[0066]
Subsequently, Step P209 is executed to perform peripheral functions that cannot be directly operated by one-instruction simulation, for example, processing for counting up a timer built in the simulation target processor.
[0067]
Subsequently, Step P210 is executed to check the interrupt to the simulation target processor (external interrupt, internal interrupt due to timer match, etc.), update the number of clocks necessary for the simulation (how much in the actual processor by this value) It is possible to calculate whether or not the process can be performed in the period of time).
[0068]
Subsequently, step P211 is executed to determine whether or not the simulation is stopped. If it is determined to continue the simulation, the process jumps to step P201. On the other hand, if it is determined that the simulation is stopped, the simulation is stopped.
[0069]
Here, referring to FIG. 1, in this embodiment, in order to read the program of the simulator 30 from the auxiliary storage device 101 to the computer system 100 and execute the simulation, the program code describing the simulator 30 is stored in the auxiliary storage device 101. A recorded recording medium (not shown) is provided. The recording medium may be an information storage medium such as a magnetic disk, an optical disk, or a semiconductor memory card.
[0070]
As described above, according to the second embodiment, the following effects can be obtained. First, the first effect is that the simulation target program 1 can be simulated at a higher speed than the conventional instruction sequential execution simulation. The reason is that when the same instruction is executed in the loop processing of the simulation target program 1 (for example, a for statement in C language), it is not necessary to decode the instruction. This is because the information in the memory storage area 23 can be directly handled.
[0071]
The second effect is that simulation can be accurately performed for interrupt processing and peripheral function simulation by executing each instruction for a control processor such as a microcontroller. The reason for this is that when the simulation target program 1 is converted into native instructions as in the prior art, a group of instructions is not converted, but instead is converted for each instruction. This is because the function simulation operation is not affected.
[0072]
The third effect is that, when developing the program according to the present embodiment, since there are few modifications to the conventional instruction sequential execution simulation, the development period can be shortened. The reason is that the basic processing flow is the same as in the conventional instruction sequential execution simulation.
[0073]
Note that the present invention is not limited to the above-described embodiments, and it is obvious that the embodiments can be appropriately changed within the scope of the technical idea of the present invention. In addition, the number, position, shape, and the like of the above-described constituent members are not limited to the above-described embodiment, and can be set to a suitable number, position, shape, and the like for carrying out the present invention. Moreover, in each figure, the same code | symbol is attached | subjected to the same component.
[0074]
【The invention's effect】
Since this invention is comprised as mentioned above, there exists an effect hung up below. First, the first effect is that the simulation target program can be simulated faster than the conventional instruction sequential execution simulation. The reason is that when the same instruction is executed in the loop processing of the simulation target program (for example, a for statement in C language), it is not necessary to decode the instruction. This is because the storage area information can be directly handled.
[0075]
The second effect is that simulation can be accurately performed for interrupt processing and peripheral function simulation by executing each instruction for a control processor such as a microcontroller. The reason for this is that when a simulation target program is converted into native instructions as in the past, a group of instructions is not converted, but is converted for each instruction. This is because the simulation operation is not affected.
[0076]
The third effect is that, when the program of the present invention is developed, since there are few modifications to the conventional instruction sequential execution simulation, the development period can be shortened. The reason is that the basic processing flow is the same as in the conventional instruction sequential execution simulation.
[Brief description of the drawings]
FIG. 1 is a system configuration diagram of a first embodiment of this invention.
FIG. 2 is a flowchart illustrating a processing flow of a control unit according to the first embodiment.
FIG. 3 is a system configuration diagram of a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a processing flow of a control unit according to the second embodiment.
FIG. 5 is a flowchart illustrating a flow of a processor instruction simulation according to the prior art.
FIG. 6 is a flowchart for explaining a simulation flow of execution of a target program in the prior art.
FIG. 7 is a flowchart showing a processing flow of a conventional sequential instruction simulation method.
FIG. 8 is a system configuration diagram for realizing the prior art.
[Explanation of symbols]
1 ... Simulation target program
20, 30, 90 ... simulator
21, 31, 91 ... control unit
22 ... Executed instruction information storage area
23... Pseudo register / memory storage area
25 ... Native instruction storage area
32 ... Decoding information storage area
100: Computer system
101 ... Auxiliary storage device
102 ... Input / output device
200 ... simulation system

Claims (16)

シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムであって、
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段と、
前記命令が実行済であるか否かの判定用の情報を格納する実行済命令情報格納領域と、
前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する手段と、
前記命令のシミュレーションを1回目に実行した際に変換した実行済命令にかかる変換結果を格納するネイティブ命令格納領域と、
前記命令をネイティブ命令に変換できない場合に当該命令のデコード情報を保存するためのデコード情報格納領域とを有し、
前記シミュレーション実行手段は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域および前記ネイティブ命令格納領域を参照して2回目以降のシミュレーションを実行するとともに、2回目以降のシミュレーションの実行の場合には同一命令のデコード処理を行わずに前記デコード情報格納領域を参照して得た1回目のデコード情報を利用してシミュレーションの処理時間の短縮を図るように構成されている
ことを特徴とするシミュレーションシステム。
A simulation system capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation and capable of executing a simulation for each instruction on a control processor,
A simulation execution means for fetching instructions from the simulation target program and executing the simulation;
An executed instruction information storage area for storing information for determining whether or not the instruction has been executed;
Means for determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;
A native instruction storage area for storing a conversion result of an executed instruction converted when the instruction simulation is executed for the first time;
A decode information storage area for storing the decode information of the instruction when the instruction cannot be converted into a native instruction;
The simulation execution means refers to the executed instruction information storage area and the native instruction storage area when the simulation target program includes a plurality of the same instructions and executes the simulation of the same instructions for the second time and thereafter. In the case of executing the second and subsequent simulations, the simulation is performed using the first decoding information obtained by referring to the decoding information storage area without performing the decoding process of the same instruction in the second and subsequent simulations. A simulation system characterized in that it is configured to shorten the processing time.
前記命令のシミュレーションを1回目に実行した際に、シミュレータが動作するコンピュータの機械語命令に変換可能であれば当該変換結果を前記ネイティブ命令格納領域に格納するように構成されていることを特徴とする請求項1に記載のシミュレーションシステム。  When the simulation of the instruction is executed for the first time, the conversion result is stored in the native instruction storage area if it can be converted into a machine language instruction of a computer on which the simulator operates. The simulation system according to claim 1. 同一命令のシミュレーションを2回目以降に実行する場合に前記実行済命令情報格納領域から情報を取り出すとともに、前記ネイティブ命令格納領域に既に格納されている機械語で実行可能であれば当該機械語を実行することにより、高速に同一命令の2回目以降のシミュレーションを実行するように構成されていることを特徴とする請求項1に記載のシミュレーションシステム。  When executing the simulation of the same instruction for the second time or later, information is extracted from the executed instruction information storage area, and if it can be executed in the machine language already stored in the native instruction storage area, the machine language is executed. The simulation system according to claim 1, wherein the simulation system is configured to execute the second and subsequent simulations of the same instruction at high speed. シミュレータ全体を制御し実際にシミュレーションを実行する制御部と、
シミュレーション対象プログラムと、
シミュレーションを実行するために擬似的にシミュレーション対象のプロセッサのハードウェアを持たせた擬似レジスタ・メモリ格納領域と、
命令が実行済であるか否かの判定用の情報を格納する前記実行済命令情報格納領域と、
前記シミュレーション対象プログラムの命令をコンピュータシステムの機械語の命令に変換して実行することによって命令のシミュレーションを行うことを可能とするための前記ネイティブ命令格納領域と、
を有することを特徴とする請求項1乃至3のいずれか一項に記載のシミュレーションシステム。
A control unit that controls the entire simulator and actually executes the simulation;
Simulation target program,
A pseudo register / memory storage area in which the hardware of the processor to be simulated is included in order to execute simulation;
The executed instruction information storage area for storing information for determining whether or not an instruction has been executed;
The native instruction storage area for enabling the simulation of the instruction by converting the instruction of the simulation target program into a machine language instruction of a computer system and executing the instruction;
The simulation system according to claim 1, further comprising:
シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できるシミュレーションシステムであって、
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段と、
前記命令が実行済であるか否かの判定用の情報を格納する実行済命令情報格納領域と、
前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する手段と、
前記命令のシミュレーションを1回目に実行した際に、当該命令をネイティブ命令に変換できない場合に当該命令のデコード情報を保存するためのデコード情報格納領域とを有し、
前記シミュレーション実行手段は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域と前記デコード情報格納領域とを参照して得たデコード情報を利用してシミュレーションの処理時間の短縮を図るように構成されていることを特徴とするシミュレーションシステム
A simulation system capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation and capable of executing a simulation for each instruction on a control processor,
A simulation execution means for fetching instructions from the simulation target program and executing the simulation;
An executed instruction information storage area for storing information for determining whether or not the instruction has been executed;
Means for determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;
A decoding information storage area for storing the decoding information of the instruction when the instruction cannot be converted into a native instruction when the instruction is simulated for the first time;
The simulation execution means refers to the executed instruction information storage area and the decode information storage area when the simulation target program includes a plurality of the same instructions and executes the simulation of the same instructions for the second time or later. A simulation system configured to shorten the simulation processing time by using the obtained decoding information .
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行手段を有するシミュレーションシステムであって、
前記命令のシミュレーションを実行した際に、当該命令が機械語命令に変換できない場合に当該命令のデコード情報を格納するためのデコード情報格納領域を備え、
前記シミュレーション実行手段は、前記シミュレーション対象プログラムから取り出した命令が前記デコード情報格納領域に格納された前記デコード情報に関する命令と同一であるか否かを判定し、当該命令のデコード情報が存在する場合には、前記デコード情報格納領域を参照して当該命令のシミュレーションを実行することを特徴とするシミュレーションシステム。
A simulation system having a simulation execution means for extracting a command from a simulation target program and executing a simulation,
A decoding information storage area for storing decoding information of the instruction when the instruction cannot be converted into a machine language instruction when the instruction is simulated;
The simulation execution means determines whether or not the instruction extracted from the simulation target program is the same as the instruction related to the decode information stored in the decode information storage area, and when the decode information of the instruction exists Is a simulation system characterized in that the instruction is simulated with reference to the decode information storage area.
前記命令のシミュレーションを実行した際に変換した機械語命令変換結果を格納するネイティブ命令格納領域を備え、
前記シミュレーション実行手段は、前記シミュレーション対象プログラムから取り出した命令が前記ネイティブ命令格納領域に格納された前記機械語命令変換結果に関する命令と同一であるか否かを判定し、当該命令の機械語命令変換結果が存在する場合には、前記ネイティブ命令格納領域を参照して当該命令のシミュレーションを実行することを特徴とする請求項6に記載のシミュレーションシステム。
A native instruction storage area for storing a machine language instruction conversion result converted when the instruction simulation is executed,
The simulation execution means determines whether or not an instruction extracted from the simulation target program is the same as an instruction related to the machine language instruction conversion result stored in the native instruction storage area, and converts the machine language instruction of the instruction The simulation system according to claim 6, wherein when a result exists, the simulation of the instruction is executed with reference to the native instruction storage area.
前記シミュレーション実行手段は、命令のシミュレーションを実行した際に、シミュレータが動作するコンピュータの前記機械語命令に変換可能であれば、前記デコード情報を前記デコード情報格納領域に格納せずに前記機械語命令変換結果を前記ネイティブ命令格納領域に格納するように構成されていることを特徴とする請求項7に記載のシミュレーションシステム。The simulation execution unit, when executing the simulation of the instruction, the machine language instruction simulator converted into the machine language instructions of a computer which operates if possible, the decode information without storing the decoding information storage area The simulation system according to claim 7, wherein the conversion result is stored in the native instruction storage area. 前記シミュレーション実行手段において、未実行の命令のシミュレーションを行なうときに、前記デコード情報を前記デコード情報格納領域に格納することを特徴とする請求項6に記載のシミュレーションシステム。  The simulation system according to claim 6, wherein the simulation execution unit stores the decode information in the decode information storage area when simulating an unexecuted instruction. 前記デコード情報は、シミュレーション対象の命令の種類、レジスタ番号、もしくはメモリアドレスであることを特徴とする請求項1及至9のいずれかに記載のシミュレーションシステム。The simulation system according to claim 1, wherein the decode information is a type of instruction to be simulated, a register number, or a memory address. シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できる命令シミュレーション方法であって、
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行工程と、
前記命令が実行済であるか否かの判定用の情報を実行済命令情報格納領域に格納する工程と、
前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する工程と、
前記命令のシミュレーションを1回目に実行した際に変換した実行済命令にかかる変換結果をネイティブ命令格納領域に格納する工程と、
前記命令をネイティブ命令に変換できない場合に当該命令のデコード情報をデコード情報格納領に保存する工程とを有し、
前記シミュレーション実行工程は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域および前記ネイティブ命令格納領域を参照して2回目以降のシミュレーションを実行するとともに、2回目以降のシミュレーションの実行の場合には同一命令のデコード処理を行わずに前記デコード情報格納領域を参照して得た1回目のデコード情報を利用してシミュレーションの処理時間の短縮を図る工程を含むことを特徴とする命令シミュレーション方法。
An instruction simulation method capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation, and capable of executing a simulation for each instruction of a control processor,
A simulation execution step for extracting a command from the simulation target program and executing the simulation;
Storing information for determining whether or not the instruction has been executed in an executed instruction information storage area;
Determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;
Storing the conversion result of the executed instruction converted when the instruction simulation is executed for the first time in a native instruction storage area;
Storing the decode information of the instruction in the decode information storage area when the instruction cannot be converted into a native instruction,
The simulation execution step includes a step of referring to the executed instruction information storage area and the native instruction storage area when a plurality of the same instructions are included in the simulation target program and the simulation of the same instruction is executed for the second time or later. In the case of executing the second and subsequent simulations, the simulation is performed using the first decoding information obtained by referring to the decoding information storage area without performing the decoding process of the same instruction in the second and subsequent simulations. An instruction simulation method comprising a step of shortening the processing time.
前記命令のシミュレーションを1回目に実行した際に、シミュレータが動作するコンピュータの機械語命令に変換可能であれば当該変換結果を前記ネイティブ命令格納領域に格納する工程を有することを特徴とする請求項11に記載の命令シミュレーション方法。The method further comprises a step of storing the conversion result in the native instruction storage area if the instruction can be converted into a machine language instruction of a computer on which the simulator operates when the instruction is simulated for the first time. The instruction simulation method according to 11 . 同一命令のシミュレーションを2回目以降に実行する場合に前記実行済命令情報格納領域から情報を取り出すとともに、前記ネイティブ命令格納領域に既に格納されている機械語で実行可能であれば当該機械語を実行することにより、高速に同一命令の2回目以降のシミュレーションを実行する工程を有することを特徴とする請求項11に記載の命令シミュレーション方法。When the simulation of the same instruction is executed for the second time or later, information is extracted from the executed instruction information storage area, and if it can be executed in the machine language already stored in the native instruction storage area, the machine language is executed. The instruction simulation method according to claim 11 , further comprising a step of executing a second and subsequent simulations of the same instruction at high speed. シミュレーション対象プログラムを従来の命令逐次実行シミュレーションに比べて高速にシミュレーションでき、制御系のプロセッサに対してもシミュレーションを1命令毎に実行できる命令シミュレーション方法であって、
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行するシミュレーション実行工程と、
前記命令が実行済であるか否かの判定用の情報を実行済命令情報格納領域に格納する工程と、
前記シミュレーション対象プログラムから取り出した命令が実行済であるか否かを前記実行済命令情報格納領域に格納されている前記判定用の情報を基に判断する工程と、
前記命令のシミュレーションを1回目に実行する際に、当該命令をネイティブ命令に変換できない場合に当該命令のデコード情報をデコード情報格納領域に保存する工程とを有し、
前記シミュレーション実行工程は、前記シミュレーション対象プログラムに同一命令が複数含まれ当該同一命令のシミュレーションを2回目以降に実行する際に、前記実行済命令情報格納領域と前記デコード情報格納領域とを参照して得たデコード情報を利用してシミュレーションの処理時間の短縮を図る工程を含むことを特徴とする命令シミュレーション方法。
An instruction simulation method capable of simulating a simulation target program at a higher speed than a conventional instruction sequential execution simulation, and capable of executing a simulation for each instruction of a control processor,
A simulation execution step for extracting a command from the simulation target program and executing the simulation;
Storing information for determining whether or not the instruction has been executed in an executed instruction information storage area;
Determining whether or not an instruction fetched from the simulation target program has been executed based on the information for determination stored in the executed instruction information storage area;
Storing the decode information of the instruction in a decode information storage area when the instruction cannot be converted into a native instruction when the instruction is simulated for the first time,
The simulation execution step refers to the executed instruction information storage area and the decode information storage area when a plurality of the same instructions are included in the simulation target program and the simulation of the same instruction is executed for the second time or later. An instruction simulation method comprising a step of shortening a simulation processing time using the obtained decode information.
シミュレーション対象プログラムから命令を取り出してシミュレーションを実行する命令シミュレーション方法であって、
前記命令のシミュレーションを実行した際に、当該命令が機械語命令に変換できない場合に当該命令のデコード情報をデコード情報格納領域に格納する工程と、
前記シミュレーション対象プログラムから取り出した命令が前記デコード情報格納領域に格納された前記デコード情報に関する命令と同一であるか否かを判定し、当該命令のデコード情報が存在する場合には、前記デコード情報格納領域を参照して当該命令のシミュレーションを実行する工程とを含むことを特徴とする命令シミュレーション方法。
An instruction simulation method for extracting an instruction from a simulation target program and executing a simulation,
Storing the decode information of the instruction in the decode information storage area when the instruction cannot be converted into a machine language instruction when the instruction is simulated;
It is determined whether or not the instruction fetched from the simulation target program is the same as the instruction related to the decoding information stored in the decoding information storage area, and when the decoding information of the instruction exists, the decoding information storage And a step of executing a simulation of the instruction with reference to a region.
前記デコード情報は、シミュレーション対象の命令の種類、レジスタ番号、もしくはメモリアドレスであることを特徴とする請求項11及至15のいずれかに記載の命令シミュレーション方法。16. The instruction simulation method according to claim 11, wherein the decode information is a type of an instruction to be simulated, a register number, or a memory address.
JP28281799A 1999-10-04 1999-10-04 Simulation system and instruction simulation method Expired - Fee Related JP3753572B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28281799A JP3753572B2 (en) 1999-10-04 1999-10-04 Simulation system and instruction simulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28281799A JP3753572B2 (en) 1999-10-04 1999-10-04 Simulation system and instruction simulation method

Publications (2)

Publication Number Publication Date
JP2001101031A JP2001101031A (en) 2001-04-13
JP3753572B2 true JP3753572B2 (en) 2006-03-08

Family

ID=17657480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28281799A Expired - Fee Related JP3753572B2 (en) 1999-10-04 1999-10-04 Simulation system and instruction simulation method

Country Status (1)

Country Link
JP (1) JP3753572B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2851815A1 (en) * 2013-09-18 2015-03-25 dSPACE digital signal processing and control engineering GmbH Test device for testing a virtual control device in real time

Also Published As

Publication number Publication date
JP2001101031A (en) 2001-04-13

Similar Documents

Publication Publication Date Title
EP0241946A2 (en) Information processing system
JP2006510126A (en) Processing action masking in data processing system
JPS6029126B2 (en) data processing equipment
JP3938580B2 (en) Information processing apparatus, information processing method, semiconductor device, and computer program
JPH04233040A (en) Simulation system for executing computer program
JPH01310441A (en) Data processor
CN118426839A (en) Processor instruction verification method and device
JP2817786B2 (en) Simulation apparatus and simulation method
JP3753572B2 (en) Simulation system and instruction simulation method
KR19990071604A (en) Processing system and method for reading and restoring information in RAM configuration
US20040098708A1 (en) Simulator for software development and recording medium having simulation program recorded therein
JP2000284964A (en) Efficient sub-instruction emulation in a VLIW processor
JP2001306334A (en) Emulation device
JPH0588884A (en) State mode setting method
US9389865B1 (en) Accelerated execution of target of execute instruction
US12008372B2 (en) Techniques for reducing CPU privilege boundary crossings
JP3324542B2 (en) Virtual machine
JPH1173301A (en) Information processing device
JP2002007140A (en) Recording medium, system development device, and microcomputer
CN121579012A (en) An integrated compilation method and system for PSCAD simulation and device operation
CN119938430A (en) A prototype verification method, device, equipment and medium for pipeline-level instructions
CN116755781A (en) Instruction exception handling method and device
JPH05250156A (en) RISC processor
Navabi Computer Architecture
JP2000267901A (en) Software execution system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050418

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050426

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050627

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050816

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051017

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20051115

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051213

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091222

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091222

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101222

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101222

Year of fee payment: 5

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101222

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111222

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111222

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121222

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121222

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131222

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees