JP2014078087A - Simulation device for digital circuit and program therefor - Google Patents
Simulation device for digital circuit and program therefor Download PDFInfo
- Publication number
- JP2014078087A JP2014078087A JP2012224642A JP2012224642A JP2014078087A JP 2014078087 A JP2014078087 A JP 2014078087A JP 2012224642 A JP2012224642 A JP 2012224642A JP 2012224642 A JP2012224642 A JP 2012224642A JP 2014078087 A JP2014078087 A JP 2014078087A
- Authority
- JP
- Japan
- Prior art keywords
- character string
- assembler
- software
- instruction
- digital circuit
- 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.)
- Granted
Links
Images
Landscapes
- Semiconductor Integrated Circuits (AREA)
- Design And Manufacture Of Integrated Circuits (AREA)
Abstract
Description
本発明は、デジタル回路のハードウェア/ソフトウェアをシミュレーションする技術に関する。 The present invention relates to a technique for simulating hardware / software of a digital circuit.
デジタル回路の開発では、開発期間およびコスト低減の要求から試作品を作成する前に予測可能な問題点を検証し、解決するために論理シミュレーションベースのハードウェア/ソフトウェアの協調検証が行われている。この協調検証方法としては非特許文献1が公知文献となっている。 In digital circuit development, collaborative verification of logic simulation-based hardware / software is performed to verify and solve problems that can be predicted before creating prototypes based on development time and cost reduction requirements. . As this cooperative verification method, Non-Patent Document 1 is a publicly known document.
図4に基づき前記協調検証の概略を説明すれば、コンパイラの出力するオブジェクトコード、即ち実行ソフトウェア(SW)1により仮想ハードウェア(HW)2の動作をシミュレーションする。この仮想ハードウェア2は、被試験論理回路として機能するASIC3と、ソフトウェア動作用のメモリモデルとして機能するROMモデル4,RAMモデル5と、実機と等価なCPUモデル6とを有し、各部3〜6はバスモデル7を通じて接続されている。
The outline of the cooperative verification will be described with reference to FIG. 4. The operation of the virtual hardware (HW) 2 is simulated by the object code output from the compiler, that is, the execution software (SW) 1. The virtual hardware 2 includes an ASIC 3 that functions as a logic circuit under test, a
実行ソフトウェア1は、実行対象の命令セットが存在するアドレスが記述されたアドレス情報部8と、コンパイラが出力するオブジェクトコードのビットパターン、即ちCPU命令を独自のビットパターンによる16進数で表現した命令ビットパターン部9とを有している。
The execution software 1 includes an
CPUモデル6は、ハードウェア記述言語(HDL:hardware description language)で構築され、命令ビットパターン部9のビットパターンを解析する命令デコーダ部10と、命令デコード部10で解析された命令を実行する命令実行部11とを有している。このCPUモデル6によれば、実行ソフトウェア1を実行することで実機のソフトウェアをシミュレーションでき、CPUモデル6を使用した仮想ハードウェア2の環境はハードウェア全体を実機のソフトウェアでシミュレーションすることができる。
The
しかしながら、実行ソフトウェア1の作成には、すべてのファイルでのコンパイルエラーやリンクエラーが無いソフトウェア(SW)の完成度が要求されるため、かかるエラー修正等の手間が大きく、その作成が効率的ではない。 However, the creation of the execution software 1 requires a completeness of software (SW) free from compile errors and link errors in all files. Therefore, it takes a lot of trouble to correct such errors and the creation is not efficient. Absent.
また、実行ソフトウェア1は、CPU命令を独自のビットパターンによる16進で表現するため、その可読性が極めて低く、CPUモデル6のソフトウェア処理状況の把握が難しい。さらに命令デコード部10には実際のCPUと同等の命令デコード回路が必要になるので、CPUモデル6が大掛かりなものとなり、シミュレータの負担が増加し、シミュレーション速度が低下する原因にもなる。
Further, since the execution software 1 expresses the CPU instruction in hexadecimal with a unique bit pattern, its readability is extremely low, and it is difficult to grasp the software processing status of the
本発明は、上述のような従来技術の問題点を解決するためになされたものであり、シミュレーションの実行ソフトウェアの作成労力を軽減させるとともに、CPUモデルのソフトウェア処理把握の容易化およびシミュレーション速度の向上を解決課題としている。 The present invention has been made to solve the above-mentioned problems of the prior art, and reduces the labor for creating simulation execution software, facilitates understanding of software processing of the CPU model, and improves the simulation speed. Is a solution issue.
そこで、本発明は、実機と等価なCPUモデルとデジタル回路用の被試験論理回路とを備えた仮想ハードウェアを実行ソフトウェアによりシミュレーションするデジタル回路用シミュレーション装置であって、CPUモデルはアセンブラ命令語の文字列を解析する文字列解析機能部を備え、該解析機能部で解析されたアッセンブラ命令を実行することを特徴とする。 Therefore, the present invention is a digital circuit simulation apparatus for simulating virtual hardware including a CPU model equivalent to a real machine and a logic circuit under test for a digital circuit using execution software, and the CPU model is an assembler instruction word. A character string analysis function unit for analyzing a character string is provided, and an assembler instruction analyzed by the analysis function unit is executed.
この発明によれば、実行ソフトウェアをオブジェクトコードではなく、アセンブラプログラムとして作成することができる。したがって、すべてのファイルでのコンパイルエラーやリンクエラーなどを取り除く作業が不要となる。 According to the present invention, the execution software can be created not as an object code but as an assembler program. This eliminates the need to remove compile errors and link errors in all files.
また、アセンブラプログラムは従来のオブジェクトコードに比べて可読性が高く、CPUモデルのソフトウェア処理の把握が容易であり、さらに従来のビットパターン解析と比べCPUモデルの処理速度の向上が期待できる。 The assembler program is more readable than the conventional object code, can easily understand the software processing of the CPU model, and can be expected to improve the processing speed of the CPU model compared to the conventional bit pattern analysis.
前記文字列解析機能部の一態様は、実行ソフトウェアに記述されたアセンブラ命令語の文字列を解析する。したがって、人手で実行ソフトウェアが作成でき、コンパイル作業を省略できる。 One aspect of the character string analysis function unit analyzes a character string of an assembler instruction word described in execution software. Therefore, execution software can be created manually, and compilation work can be omitted.
前記文字列解析機能部の他の態様は、実行ソフトウェアに記述された命令ビットパターンを変換したアセンブラ命令語の文字列を解析する。この変換手段はCPUモデルの外部に設けられていることが好ましい。この態様によれば、アセンブラプログラムの命令のみならず、従来のコンパイラが出力するオブジェクトコードの命令も解析可能となる。なお、本発明は、前記CPUモデルとしてコンピュータを機能させることを特徴とするプログラムとして構成することもできる。 Another aspect of the character string analysis function unit analyzes a character string of an assembler instruction word obtained by converting an instruction bit pattern described in execution software. This conversion means is preferably provided outside the CPU model. According to this aspect, not only the instruction of the assembler program but also the instruction of the object code output by the conventional compiler can be analyzed. In addition, this invention can also be comprised as a program characterized by making a computer function as said CPU model.
本発明によれば、シミュレーションの実行ソフトウェアの作成労力が軽減でき、またCPUモデルのソフトウェア処理把握の容易化およびシミュレーション速度の向上にも貢献できる。 According to the present invention, it is possible to reduce labor for creating simulation execution software, and to contribute to facilitating grasping of software processing of a CPU model and improvement of simulation speed.
≪シミュレーションの概略≫
図1に基づき本発明の実施形態に係るシミュレーション装置(シミュレータ)を用いたシミュレーションを説明する。図1中、図4と同一構成は同一の符号を付して説明する。
≪Simulation outline≫
Based on FIG. 1, a simulation using a simulation apparatus (simulator) according to an embodiment of the present invention will be described. In FIG. 1, the same components as those in FIG.
ここでは実行ソフトウェア12は、コンパイラが出力するオブジェクトコード(実行ソフトウェア1)のビットパターンではなく、該ビットパターンなどの機械語の命令列をアセンブラ言語(Assembler Language:アセンブリ言語ともいう。)で記述したアセンブラプログラムからなる。
Here, the
具体的には実行ソフトウェア12は、実行対象の命令セットが存在するアドレスが記述されたアドレス情報部8と、機械語の命令列をアセンブラ言語で表したアセンブラ命令語の文字列が記述されたアセンブラ命令語部14とを有している。このアセンブラ命令語の文字列は、処理内容を指示するオペコードと処理の対象を指示するオペランドを有している。このオペコードはアセンブラ言語のコードではニーモニックと呼ばれる。
Specifically, the
前記シミュレーション装置は、コンピュータにソフトウェアが読み込まれて該ソフトウェアとハードウェア資源とが協働した具体的手段、即ちデジタル回路の被試験論理回路および制御系の処理モデルを主体とした仮想ハードウェア13を備えている。この仮想ハードウェア13は、ユーザが作成するカスタムLSIなどの被試験論理回路として機能するASIC3と、ソフトウェア動作用のメモリモデルとして機能するROMモデル4,RAMモデル5と、ソフトウェア実行部分として機能する実機と等価なCPUモデル16とを有し、それぞれがバスモデル7を通じて接続されている。
The simulation apparatus includes specific means in which software is read into a computer and the software and hardware resources cooperate, that is,
このCPUモデル16は、CPU命令のビットパターンを解析する命令デコーダ部10ではなく、アセンブラ命令語部14に記述されたアセンブラ命令語の文字列を解析する文字列解析部15と、文字列解析部15で解析されたアッセンブラ命令を実行する命令実行部11とを有している。したがって、CPUモデル16によれば、アセンブラプログラムの実行ソフトウェア12を直接実行することができる。
The
このアセンブラプログラムは、基本的に機械語と1対1で対応し、プログラマーがCPU動作を把握しながらプログラムを記述できるため、人手で実行ソフトウェア12が作成でき、コンパイル作業を省略することができる。これにより従来のオブジェクトコード(例えば実行ソフトウェア1など)生成のために必要だったすべてのファイルでのコンパイルエラーやエラーリンクを取り除く作業が不要となる。
This assembler program basically corresponds to the machine language on a one-to-one basis, and since the programmer can describe the program while grasping the CPU operation, the
その結果、シミュレーション動作させたい内容のみをアセンブラプログラムで実行ソフトウェア12を作成することができ、実行ソフトウェア12の作成労力を軽減することができる。また、実行ソフトウェア12はアセンブラプログラムなので、従来のオブジェクトコードに比べて可読性が高く、CPUモデル16のソフトウェア処理の把握が容易となる。
As a result, the
さらにCPUモデル16の命令解析には、従来の命令デコーダ部(命令デコード回路)10によるビットパターン解析ではなく、文字列解析機能部15によるアセンブラ命令語の文字列解析で実現される。このときアセンブラ命令語の文字列解析は、ビットパターン解析に比べて小規模に実現できるため、従来方式よりも前記シミュレーション装置の負荷が減少し、この点でシミュレーション速度の向上に貢献することができる。
Further, the instruction analysis of the
≪処理の比較≫
以下、従来のオブジェクトコードの命令デコードと、アセンブラプログラムの文字列解析とを比較説明する。まず、図2に基づきアセンブラプログラムの文字列解析を説明すれば、実行ソフトウェア12のアセンブラ命令語部14には64文字程度のアセンブラ命令語の文字列データが記述され、CPUモデル16の文字列解析機能部15が該文字列データのテキストを文字列処理する。
≪Comparison of processing≫
Hereinafter, conventional instruction decoding of an object code and character string analysis of an assembler program will be described in comparison. First, the character string analysis of the assembler program will be described with reference to FIG. 2. In the assembler
図2中の文字列データ「STS.L PR,@−R15」を一例に説明すれば、該文字列データはオペコード「STS.L」と、第1オペランド「PR,」と、第2オペランド「@−R15」とにより構成されている。そして、文字列解析機能部15の文字列処理では、オペコードと二つのオペランドの文字列を条件とする制御文(switch〜case文)とし、各分岐内に実行処理を記述する。この記述内容を命令実行部11が実行する。
The character string data “STS.L PR, @ -R15” in FIG. 2 will be described as an example. The character string data includes an operation code “STS.L”, a first operand “PR,” and a second operand “ @ -R15 ". In the character string processing of the character string
これに対してオブジェクトコードの命令デコードは、図3に示すように、前記文字列データ「STS.L PR,@−R15」に対応する16本のバイナリデータ(2進化されたデータ)の入力信号から命令実行部11のオペコードとオペランドの制御信号を生成しなければならない。したがって、命令デコーダ部10は、全オペコードおよび全オペランド分の制御信号(100本以上)を生成しなければならず、シミュレータの負担が大きくなる。
On the other hand, as shown in FIG. 3, the instruction decode of the object code is an input signal of 16 binary data (binary data) corresponding to the character string data “STS.L PR, @ -R15”. Therefore, the opcode of the
そうすると、CPUモデル16によるアセンブラプログラムの文字列解析によれば、64文字程度のアセンブラ命令語の文字列データを文字列処理すればよいので、前述のようにオブジェクトコードの命令デコードに比べて装置の負荷が小さく、シミュレーション速度の向上が十分に期待できる。
Then, according to the character string analysis of the assembler program by the
≪変形例等≫
本発明は、上記実施形態に限定されるものではなく、仮想ハードウェア13の構成などは各請求項に記載された範囲内で変更して実施することができる。例えば仮想ハードウェア13は、デュアルCPUをモデル化したCPUモデルであってもよく、各CPUモデルからアクセス可能な2ポートメモリとしてもよい。
≪Modifications etc.≫
The present invention is not limited to the above-described embodiment, and the configuration of the
また、従来同様にコンパイラが出力するオブジェクトコード(実行ソフトウェア1)を利用することも可能である。この場合には命令ビットパターン部9のビットパターンをアセンブラ命令語の文字列に変換してアセンブラプログラムを生成し、CPUモデル16の文字列解析機能部15で解析処理をすればよい。このアセンブラ命令語の文字列への変換には非特許文献1の命令セット変換機能を使用することができる。
It is also possible to use the object code (execution software 1) output by the compiler as in the prior art. In this case, the bit pattern of the instruction
この場合には命令セット変換機能を実現する手段をCPUモデル16の外部に設けて、バイナリデータを命令セットの変換ルールを使ってテキスト形式に変換すればよい。これにより前記シミュレーション装置は、アセンブリプログラムの実行ソフトウェア12のみならず、コンパイラが出力する実行ソフトウェア1を利用したシミュレーションも可能となる。
In this case, a means for realizing the instruction set conversion function may be provided outside the
さらに、本発明は、前記シミュレーション装置としてコンピュータを機能させるシミュレーション用のプログラムとして構成することもできる。このプログラムによれば、アセンブラプログラムの文字列解析が可能なCPUモデル16が実現される。
Furthermore, the present invention can also be configured as a simulation program for causing a computer to function as the simulation apparatus. According to this program, the
このプログラムは、Webサイトや電子メールなどネットワークを通じて提供することができ、またCD−ROM,DVD−ROMなどの記録媒体に記録して提供することができる。この記録媒体は、記録媒体駆動装置(光学ドライブ装置など)を利用して読み出され、そのプログラムコード自体が前記各実施形態の処理を実現するので、該記録媒体も本発明を構成する。 This program can be provided through a network such as a website or electronic mail, or can be provided by being recorded on a recording medium such as a CD-ROM or a DVD-ROM. This recording medium is read using a recording medium driving device (such as an optical drive device), and the program code itself realizes the processing of each of the above embodiments, so that the recording medium also constitutes the present invention.
3…ASIC(被試験論理回路)
4…ROMモデル
5…RAMモデル
7…バスモデル
8…アドレス情報部
11…命令実行部
12…実行ソフトウェア(アセンブラプログラム)
13…仮想ハードウェア
14…アセンブラ命令語部
15…文字列解析機能部
16…CPUモデル
3. ASIC (logic under test)
4 ...
13 ...
Claims (4)
CPUモデルはアセンブラ命令語の文字列を解析する文字列解析機能部を備え、該解析機能部で解析されたアセンブラ命令を実行する
ことを特徴とするデジタル回路用シミュレーション装置。 A simulation apparatus for digital circuit that simulates virtual hardware including a CPU model equivalent to a real machine and a logic circuit under test for a digital circuit by execution software,
The CPU model includes a character string analysis function unit that analyzes a character string of an assembler instruction word, and executes an assembler instruction analyzed by the analysis function unit.
ことを特徴とする請求項1記載のデジタル回路用シミュレーション装置。 The digital circuit simulation device according to claim 1, wherein the character string analysis function unit analyzes a character string of an assembler instruction word described in execution software.
文字列解析機能部が、前記変換されたアセンブラ命令語の文字列を解析可能なことを特徴とする請求項1記載のデジタル回路用のシミュレーション装置。 Outside the CPU model, there is means for converting an instruction bit pattern described in the execution software into a character string of an assembler instruction word,
2. The simulation apparatus for a digital circuit according to claim 1, wherein the character string analysis function unit can analyze the character string of the converted assembler instruction word.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012224642A JP6015327B2 (en) | 2012-10-10 | 2012-10-10 | Digital circuit simulation apparatus and program thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012224642A JP6015327B2 (en) | 2012-10-10 | 2012-10-10 | Digital circuit simulation apparatus and program thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014078087A true JP2014078087A (en) | 2014-05-01 |
JP6015327B2 JP6015327B2 (en) | 2016-10-26 |
Family
ID=50783355
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012224642A Expired - Fee Related JP6015327B2 (en) | 2012-10-10 | 2012-10-10 | Digital circuit simulation apparatus and program thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6015327B2 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001256079A (en) * | 2000-03-10 | 2001-09-21 | Matsushita Electric Ind Co Ltd | Debug method for software and debug method for logic circuit |
JP2002366602A (en) * | 2001-04-06 | 2002-12-20 | Seiko Epson Corp | Simulation method, system and program for software and hardware |
JP2003233634A (en) * | 2002-02-07 | 2003-08-22 | Sanyo Electric Co Ltd | Circuit function verification method and program |
-
2012
- 2012-10-10 JP JP2012224642A patent/JP6015327B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001256079A (en) * | 2000-03-10 | 2001-09-21 | Matsushita Electric Ind Co Ltd | Debug method for software and debug method for logic circuit |
JP2002366602A (en) * | 2001-04-06 | 2002-12-20 | Seiko Epson Corp | Simulation method, system and program for software and hardware |
JP2003233634A (en) * | 2002-02-07 | 2003-08-22 | Sanyo Electric Co Ltd | Circuit function verification method and program |
Also Published As
Publication number | Publication date |
---|---|
JP6015327B2 (en) | 2016-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10691419B2 (en) | Reconstructing a high level compilable program from an instruction trace | |
JP4427002B2 (en) | Program debugging device for semiconductor testing | |
US8930923B2 (en) | Generating debugging extension source code utilizing debugging information | |
Lowe-Power et al. | The Davis In-Order (DINO) CPU: A Teaching-Focused RISC-V CPU Design | |
JP2008276735A (en) | Program code converter and program code conversion method | |
Yıldız et al. | CPU design simplified | |
JP6015327B2 (en) | Digital circuit simulation apparatus and program thereof | |
Blagodarov et al. | Tool demo: Raincode assembler compiler | |
Cadenas et al. | Virtualization for cost-effective teaching of assembly language programming | |
Shi et al. | First steps towards the certification of an ARM simulator using Compcert | |
EP2770429B1 (en) | Method and device for generating simulator | |
JP7295469B2 (en) | Function generation program, function generation method, and information processing device | |
Gutierrez et al. | Virtualization and Validation of Emulated STM-32 Blue Pill Using the QEMU Open-Source Framework | |
JP2007018313A (en) | Circuit design program, circuit design device and circuit design method | |
KR20150041541A (en) | Method and apparatus for generating test bench for verification of a processor decoder | |
JP2004013190A (en) | Environment for software development, simulator, and recording medium | |
Meyer-Baese et al. | A balanced HW/SW teaching approach for embedded microprocessors | |
Křoustek et al. | Approaching Retargetable Static, Dynamic, and Hybrid Executable-Code Analysis | |
Kamat | IP testing for heterogeneous SOCs | |
JP2009515243A (en) | Method for generating a simulation program executable on a host computer | |
JP6763162B2 (en) | Simulation equipment for digital circuits and their programs | |
JP6019843B2 (en) | Extended language specification information providing method, extended language specification information providing program, and compiling device | |
JP2013257757A (en) | Semiconductor design support device and semiconductor design support method | |
Hossain et al. | Using LLM such as ChatGPT for Designing and Implementing a RISC Processor: Execution, Challenges and Limitations | |
US20070150873A1 (en) | Dynamic host code generation from architecture description for fast simulation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150915 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160804 |
|
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: 20160830 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160912 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6015327 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |