JP2013020425A - Hardware and software cooperative verification method using open source software - Google Patents

Hardware and software cooperative verification method using open source software Download PDF

Info

Publication number
JP2013020425A
JP2013020425A JP2011152879A JP2011152879A JP2013020425A JP 2013020425 A JP2013020425 A JP 2013020425A JP 2011152879 A JP2011152879 A JP 2011152879A JP 2011152879 A JP2011152879 A JP 2011152879A JP 2013020425 A JP2013020425 A JP 2013020425A
Authority
JP
Japan
Prior art keywords
hardware
software
qemu
pci
pci device
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.)
Withdrawn
Application number
JP2011152879A
Other languages
Japanese (ja)
Inventor
Takashi Kinjo
隆志 金城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Solutions Ltd
Original Assignee
Hitachi Solutions Ltd
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 Hitachi Solutions Ltd filed Critical Hitachi Solutions Ltd
Priority to JP2011152879A priority Critical patent/JP2013020425A/en
Publication of JP2013020425A publication Critical patent/JP2013020425A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a hardware emulator obtained by suppressing initial introduction cost at lost cost and to provide technology in which a hardware model and the hardware emulator are easily connected.SOLUTION: A hardware and software cooperative verification method using open source software achieves a PC emulator of open source software including means for performing data I/O of a hardware model through a TLM interface for connecting a Qemu and a hardware model by modifying the Qemu being open source software, means for showing the hardware model as a PCI device connected to a PCI bus emulated on the Qemu, and means for starting the Qemu from a System C simulator.

Description

本発明は、ハードウェア・ソフトウェア協調検証の技術に関し、特にハードウェア・ソフトウェア協調検証にて使用するハードウェアエミュレータに関するものである。   The present invention relates to a hardware / software co-verification technique, and more particularly to a hardware emulator used in hardware / software co-verification.

ハードウェア・ソフトウェア協調検証とは、組み込みシステム実機完成前の設計段階から組み込みシステムで稼動するソフトウェアとハードウェアであるLSIとを含むシステム全体の検証を行う技術である。現在、SoC(System on Chip)あるいはASIC(Application Specific Integrated Circuit)などのLSI設計では、ソフトウェア開発とハードウェア開発とを分離して実施し、LSI試作機の完成後、ソフトウェアをシステムへ統合した上で、LSIの動作を検証している。この場合、LSIの不良は、試作機完成後の統合試験を実施している際に発覚する場合が多く、開発工程終盤での工程の手戻り、特にLSIの作り直しが発生した場合、開発コストや開発期間が大幅に増大してしまう。ハードウェア・ソフトウェア協調検証の目的は、組み込みシステム実機完成前からソフトウェアとハードウェアであるLSIとを含むシステム全体の検証を行い、実機完成前の早い段階でシステムの不良を摘出し、開発工程の手戻り、特にLSIの作り直しを回避することにある(例えば、非特許文献1参照)。   Hardware / software co-verification is a technique for verifying the entire system including software running on the embedded system and LSI, which is hardware, from the design stage prior to completion of the embedded system actual machine. Currently, in LSI design such as SoC (System on Chip) or ASIC (Application Specific Integrated Circuit), software development and hardware development are performed separately, and after the LSI prototype is completed, the software is integrated into the system. Thus, the operation of the LSI is verified. In this case, defective LSIs are often detected when an integrated test is performed after the prototype is completed. If a rework at the end of the development process occurs, especially if an LSI is rebuilt, the development cost or The development period will increase significantly. The purpose of hardware / software co-verification is to verify the entire system including software and hardware LSIs before the embedded system is completed, identify system failures at an early stage before the completion of the actual machine, and The purpose is to avoid rework, in particular, LSI rework (see, for example, Non-Patent Document 1).

ハードウェア・ソフトウェア協調検証方法としては、一般的には、SystemCやSpecC等のシステムレベル設計言語で実装されたハードウェアモデルと組み込みソフトウェアとをハードウェアエミュレータ上で一緒に動作させ、システム全体の検証を行う方法が知られている。そのような検証を行うための商用の複数のハードウェアエミュレータが存在するが、その初期導入コストは、一般的に非常に高価なのが現状である。一方、オープンソースソフトウェアのPCエミュレータとしてQemuが知られているが、QemuはPCのエミュレータ機能を備えるだけのものであり、そのままではハードウェア・ソフトウェア協調検証に利用することはできない。   As a hardware / software co-verification method, generally, a hardware model implemented in a system level design language such as SystemC or SpecC and embedded software are operated together on a hardware emulator to verify the entire system. The method of doing is known. There are a plurality of commercial hardware emulators for performing such verification, but the initial introduction cost is generally very high. On the other hand, Qemu is known as a PC emulator of open source software, but Qemu has only a PC emulator function and cannot be used for hardware / software co-verification as it is.

SystemCとは、一般的に普及しているシステムレベル設計言語のひとつである。SystemCとは、厳密には言語ではなく、C++言語で定義されたクラスライブラリのことであり、ハードウェアモデルはSystemCクラスライブラリ(以下、SystemCライブラリと称する)を用いたC++言語で記述される。SystemCライブラリを用いて記述されたハードウェアモデルは、一般的に用いられているgcc等のコンパイラによりコンパイルすることができる。コンパイルした結果、生成されたオブジェクトファイルは、SystemCライブラリとリンクすることにより、ハードウェアのシミュレータ(以降、SystemCシミュレータと称する)として実行することができる。SystemCは、いわゆるオープンソースソフトウェアであり、無償で手に入れ利用することができる。   SystemC is one of system level design languages that are generally popular. SystemC is not strictly a language but a class library defined in the C ++ language, and a hardware model is described in a C ++ language using a SystemC class library (hereinafter referred to as a SystemC library). The hardware model described using the SystemC library can be compiled by a generally used compiler such as gcc. The object file generated as a result of compiling can be executed as a hardware simulator (hereinafter referred to as a SystemC simulator) by linking with the SystemC library. SystemC is so-called open source software and can be obtained and used free of charge.

SystemCによるハードウェアモデル記述の構造にて基本となるブロックをモジュールという。モジュール間の相互接続には、一般的にTLM(Transaction Level Modeling)インターフェースが広く用いられている。SystemCおよびTLMインターフェースを使用するためには、OSCI(Open SystemC Initiative)が提供するSystemCライブラリおよびTLMライブラリを使用する。これらライブラリは、ハードウェア・ソフトウェア協調検証の中核技術であり、ハードウェア・ソフトウェア協調設計やハードウェアの性能評価などに広く適用される。   A basic block in the structure of the hardware model description by SystemC is called a module. In general, a TLM (Transaction Level Modeling) interface is widely used for interconnection between modules. In order to use the SystemC and TLM interfaces, the SystemC library and the TLM library provided by OSCI (Open SystemC Initiative) are used. These libraries are the core technologies of hardware / software co-verification, and are widely applied to hardware / software co-design and hardware performance evaluation.

http://techon.nikkeibp.co.jp/article/WORD/20090107/163726/http://techon.nikkeibp.co.jp/article/WORD/20090107/163726/

上述したとおり、ハードウェア・ソフトウェア協調検証に使用するハードウェアエミュレータの初期導入コストは一般的に非常に高価であり、システムの開発規模と比較して、十分な数のハードウェア・ソフトウェア協調検証環境を揃えにくいという問題がある。また、ハードウェアエミュレータとハードウェアモデル(例えば、SystemCで記述したハードウェアモデル)を接続する方法はハードウェアエミュレータにより異なり、ハードウェア・ソフトウェア協調検証を行う際にハードウェアモデルの一部を書き換える必要がある。   As mentioned above, the initial installation cost of hardware emulators used for hardware / software co-verification is generally very high, and there are a sufficient number of hardware / software co-verification environments compared to the scale of system development. There is a problem that it is difficult to align. Also, the method of connecting a hardware emulator and a hardware model (for example, a hardware model described in SystemC) differs depending on the hardware emulator, and it is necessary to rewrite a part of the hardware model when performing hardware / software co-verification. There is.

本発明の目的は、初期導入コストを安く抑えたハードウェアエミュレータを提供し、ハードウェアモデルとハードウェアエミュレータとを容易に接続する技術を提供することにある。   An object of the present invention is to provide a hardware emulator that can reduce the initial introduction cost at a low cost, and to provide a technique for easily connecting a hardware model and a hardware emulator.

上記目的を達成するため、本発明では、一般に広く用いられているTLM(Transaction Level Modeling)インターフェースを備えたオープンソースソフトウェアをベースとしたハードウェアエミュレータを提供する。   In order to achieve the above object, the present invention provides a hardware emulator based on open source software having a generally used TLM (Transaction Level Modeling) interface.

すなわち、本発明は、オープンソースソフトウェアを利用したハードウェア・ソフトウェア協調検証方法であって、オープンソースソフトウェアであるQemuを改変することにより、Qemuとハードウェアモデルの接続するTLMインターフェースを介して、ハードウェアモデルに対してデータI/Oを行う手段と、ハードウェアモデルをQemu上でエミュレートしているPCIバスに接続されているPCIデバイスとして見せる手段と、SystemCシミュレータからQemuを起動する手段とを備えたオープンソースソフトウェアのPCエミュレータを実現することを特徴とする。   In other words, the present invention is a hardware / software co-verification method using open source software, and by modifying Qemu, which is open source software, via a TLM interface connecting Qemu and a hardware model. Means for performing data I / O on the wear model, means for showing the hardware model as a PCI device connected to the PCI bus emulating on Qmu, and means for starting Qmu from the SystemC simulator A PC emulator of open source software provided is realized.

本発明によれば、オープンソースソフトウェアのPCエミュレータを改造して使用するので、従来と比較して初期導入コストを低く抑えてハードウェア・ソフトウェア協調検証環境を構築することができる。TLMライブラリを使用したハードウェアモデルは、そのまま修正を加えること無く、ハードウェアエミュレータに接続可能となる。TLMライブラリを使用したハードウェアモデルは、そのままPCIデバイスとしてOSから認識できるようになる。それにより、組み込みソフトウェアからは、実機と同様に、LSI(ハードウェモデル)に対してMemory Mapped I/O, Port Mapped I/Oが可能となる。ハードウェアエミュレータとハードウェアモデルとの接続は、数〜十数ステップのコードを記述し、コンパイルを実行することにより容易に接続可能である。   According to the present invention, since a PC emulator of open source software is modified and used, it is possible to construct a hardware / software co-verification environment at a low initial introduction cost as compared with the conventional one. A hardware model using the TLM library can be connected to a hardware emulator without modification. The hardware model using the TLM library can be directly recognized from the OS as a PCI device. As a result, the embedded software can perform Memory Mapped I / O and Port Mapped I / O on the LSI (hardware model) in the same manner as the actual machine. The hardware emulator and the hardware model can be easily connected by writing code of several to several tens of steps and executing compilation.

本実施形態で実現するハードウェア・ソフトウェア協調検証環境の全体概要図Overview of hardware / software co-verification environment realized in this embodiment 中継モジュールのクラス定義実装例Relay module class definition implementation example ハードウェア・ソフトウェア協調検証環境の動作開始時の処理の流れを示すフローチャートFlow chart showing the flow of processing at the start of hardware / software co-verification environment operation Qemuメインループ処理の流れを示すフローチャートFlowchart showing the flow of Qemu main loop processing 仮想マシンのインスタンス化の流れを示すフローチャートFlow chart showing the flow of instantiating a virtual machine Qemuの初期化処理の流れを示すフローチャートThe flowchart which shows the flow of initialization processing of Qemu 各種テーブルの一部領域設定例Example of setting partial areas of various tables

以下、図面を用いて、本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

本実施形態では、オープンソースソフトウェアのPCエミュレータであるQemuを基として、そのQemuのソースコードの変更を行い、Qemuと検証対象であるハードウェアモデルとを接続するTLMインターフェースを介して、ハードウェアモデルに対してデータI/Oを行う手段を追加する。また、Qemuのソースコードの変更を行うことにより、ハードウェアモデルを、Qemu上でエミュレートしているPCIバスに接続されているPCIデバイスとして見せる手段を追加し、さらに、SystemCシミュレータからQemuを起動する手段を追加する。   In the present embodiment, based on Qem, which is a PC emulator of open source software, the source code of the Qemu is changed, and the hardware model is connected via the TLM interface that connects the Qemu and the hardware model to be verified. A means for performing data I / O is added. Also, by changing the Qemu source code, a means to show the hardware model as a PCI device connected to the PCI bus emulated on Qemu is added, and Qemu is started from the SystemC simulator. Add a means to do.

図1は、本実施形態で実現するハードウェア・ソフトウェア協調検証環境の全体概要図である。図1の各ブロックは、コンピュータ上でソフトウェアを実行することで実現される。すなわち、これらの各ブロックは、HDD等の記憶装置からメモリ等の主記憶装置に読み出され、CPU等の演算部により実行されることで実現される。   FIG. 1 is an overall schematic diagram of a hardware / software co-verification environment realized in this embodiment. Each block in FIG. 1 is realized by executing software on a computer. That is, each of these blocks is realized by being read from a storage device such as an HDD to a main storage device such as a memory and executed by a calculation unit such as a CPU.

本実施形態のハードウェア・ソフトウェア協調検証環境は、オープンソースソフトウェアのPCエミュレータであるQemu部分100と、Qemu上でエミュレートしているPCIバス部分101と、PCIバス部分101上に接続したPCIデバイス部分102と、Qemuとハードウェアモデルの中継ぎを行う中継モジュール部分103と、ハードウェア・ソフトウェア協調検証対象となるハードウェアモデル部分104と、ハードウェア・ソフトウェア協調検証対象となるソフトウェア部分105と、ソフトウェア部分105の動作プラットフォームとなるOS部分106とを備える。107はQemu上でエミュレートしているCPU部分であり、108はQemu上でエミュレートしているMCH(Memory Control Hub)部分であり、109はQemu上でエミュレートしているメモリ部分を示す。   The hardware / software co-verification environment of this embodiment includes a Qemu portion 100 which is a PC emulator of open source software, a PCI bus portion 101 emulated on Qemu, and a PCI device connected on the PCI bus portion 101. A part 102, a relay module part 103 that relays Qemu and a hardware model, a hardware model part 104 that is a hardware / software co-verification target, a software part 105 that is a hardware / software co-verification target, and software And an OS portion 106 that serves as an operation platform of the portion 105. Reference numeral 107 denotes a CPU portion emulating on Qemu, 108 denotes an MCH (Memory Control Hub) portion emulating on Qemu, and 109 denotes a memory portion emulating on Qemu.

107〜109は、Qemu100が従来より備えているCPUとMCHとメモリをエミュレートする機能を利用して実現する。PCIバスとPCIデバイスに関し、汎用のPCが持つ幾つかの基本的なPCIデバイスとそれらを接続するPCIバスについては従前よりQemu100が持つ機能で実現している。図1ではそのような基本的なPCIデバイスについては不図示とした。本実施形態では、検証対象のハードウェアモデル104を接続するためのPCIデバイス102に相当する部分をQemu100に追加する必要がある。また、このPCIデバイス102をPCIバスに接続するため、Qemu100のPCIバス101に相当する部分を改変する必要がある。これらPCIデバイス102とPCIバス101は、C言語で記載されているQemuを改変することで実現する。   107 to 109 are realized by using the function of emulating the CPU, MCH, and memory that the Qemu 100 has conventionally provided. Regarding PCI buses and PCI devices, some basic PCI devices of general-purpose PCs and PCI buses for connecting them are realized by the functions of Qumu100. In FIG. 1, such a basic PCI device is not shown. In this embodiment, a part corresponding to the PCI device 102 for connecting the hardware model 104 to be verified needs to be added to the Qemu 100. Further, in order to connect the PCI device 102 to the PCI bus, it is necessary to modify a part corresponding to the PCI bus 101 of the Qemu 100. The PCI device 102 and the PCI bus 101 are realized by modifying Qemu described in C language.

Qemu100とハードウェアモデル104とは、中継モジュール103を介して接続する。中継モジュール103は、SystemCで記述したSystemCモジュール(すなわちC++レイヤ)であり、ハードウェアモデル104に対してはTLMインターフェースにて接続する。また、中継モジュール103とPCIデバイス102との接続は、コールバック用の関数ポインタをPCIデバイス102に渡しておく方式により実現する。Qemu100で実現されるPCIデバイス102はC言語レイヤで、中継モジュール103はC++レイヤであるので、そのままではPCIデバイス102から中継モジュール103のメソッドを呼び出すことができず、PCIデバイス102から中継モジュール103経由でのハードウェアモデル104に対するデータの書き込みや読み出しを行うことができない。そこで、PCIデバイス102から中継モジュール103へデータ転送を行うときは、コールバック用の関数ポインタにて関数を発行し、データ渡しを行う。中継モジュール103からPCIデバイス102へのデータ転送も同様の方式である。これらの実装は、実際のハードウェア構成でいうと、PCIデバイス部分102はPCIカードに相当し、ハードウェアモデル104はそのPCIカード上に実装されたLSIに相当する。   The Qemu 100 and the hardware model 104 are connected via the relay module 103. The relay module 103 is a SystemC module (that is, a C ++ layer) described in SystemC, and is connected to the hardware model 104 through a TLM interface. Also, the connection between the relay module 103 and the PCI device 102 is realized by a method in which a callback function pointer is passed to the PCI device 102. Since the PCI device 102 implemented in the Qemu 100 is a C language layer and the relay module 103 is a C ++ layer, the PCI device 102 cannot call a method of the relay module 103 as it is, and the PCI device 102 passes through the relay module 103. Data cannot be written to or read from the hardware model 104. Therefore, when data is transferred from the PCI device 102 to the relay module 103, a function is issued by a function pointer for callback and data is transferred. Data transfer from the relay module 103 to the PCI device 102 is the same method. In terms of the actual hardware configuration, the PCI device portion 102 corresponds to a PCI card, and the hardware model 104 corresponds to an LSI mounted on the PCI card.

検証対象のハードウェアモデル104は、SystemCおよびTLMインターフェースを使用して記述したものを使用する。SystemCおよびTLMインターフェースは、従来より知られている数多くのハードウェアシミュレータで使用されている形式であるので、既にそのようなハードウェアモデルを作成済みであればそれをそのまま使い回すことができる。   The hardware model 104 to be verified uses what is described using the SystemC and TLM interfaces. Since the SystemC and TLM interfaces are used in a number of conventionally known hardware simulators, if such a hardware model has already been created, it can be used as it is.

図2は、中継モジュール103のクラス定義実装例である。中継モジュール103は、予めユーザが、SystemCで作成しておく。図2の201はハードウェアモデル104との接続ソケットであり、202はPCIデバイス102からコールバックされるデータ書き込みメソッドであり、203はPCIデバイス102からコールバックされるデータ読み込みメソッドであり、205は中継モジュール103のコンストラクタであり、図2の206はデータ書き込みメソッド202の実装から発行されるメソッドであり、207はデータ読み込みメソッド203の実装から発行されるメソッドである。   FIG. 2 is a class definition implementation example of the relay module 103. The relay module 103 is created in advance by the user using SystemC. 2 is a connection socket with the hardware model 104, 202 is a data write method called back from the PCI device 102, 203 is a data read method called back from the PCI device 102, 205 is The constructor of the relay module 103, 206 in FIG. 2 is a method issued from the implementation of the data write method 202, and 207 is a method issued from the implementation of the data read method 203.

図2の中継モジュール103のクラスからオブジェクトを作成する際にコンストラクタ205が実行され、これにより各種のテーブル領域の確保や初期設定が行われる。コンストラクタ205の実装例はここでは省略するが、後述する図5のステップ502以降の初期設定処理はコンストラクタ205の実装により実現されるものである。   When an object is created from the class of the relay module 103 in FIG. 2, a constructor 205 is executed, thereby securing various table areas and initial settings. Although an implementation example of the constructor 205 is omitted here, an initial setting process after step 502 in FIG. 5 described later is realized by the implementation of the constructor 205.

図3は、図1のハードウェア・ソフトウェア協調検証環境の動作開始時の処理の流れを示すフローチャートである。Qemuによるエミュレーションの処理は、後述する図4のQemuのメインループ処理により実行されるが、そのメインループ処理が開始される前に、図3の310と320の処理が実行される。   FIG. 3 is a flowchart showing the flow of processing at the start of the operation of the hardware / software co-verification environment of FIG. The emulation process by Qemu is executed by the main loop process of Qemu shown in FIG. 4 to be described later, but before the main loop process is started, processes 310 and 320 of FIG. 3 are executed.

前処理310は、ハードウェアモデル104をOS106からQemu上でエミュレートしているPCIバス101に接続されているPCIデバイス102として見せる手段を実現するための処理である。この処理は、GNU gcc拡張機能_attribute_((constructor))により、main()発行前に発行される処理である。   The pre-processing 310 is a process for realizing a means for showing the hardware model 104 as the PCI device 102 connected to the PCI bus 101 emulating on the Qmu from the OS 106. This processing is issued before main () is issued by the GNU gcc extension function_attribute _ ((constructor)).

ステップ311で、DeviceInfoテーブルの領域を確保し属性を設定する。DeviceInfoテーブルは、PCIデバイス102をエミュレートするために利用する構造体である。   In step 311, an area of the DeviceInfo table is secured and attributes are set. The DeviceInfo table is a structure used to emulate the PCI device 102.

図7(c)に、DeviceInfoテーブル(テーブル3)の構造体の一部領域の設定例を示す。「PCIデバイス識別名文字列」は、ハードウェアモデル104を接続するためのPCIデバイス102を特定する識別名の文字列である。「PCIデバイス説明文字列」は、PCIデバイス102を説明する文字列である。「PCIDeviceテーブルサイズ」は、本PCIデバイス102に対応するPCIDeviceテーブル(図7(d)で後述する)のサイズ(バイト数)である。「PCIデバイス初期化関数ポインタ」は、PCIデバイス102の初期化を実行する関数を指すポインタである。   FIG. 7C shows a setting example of a partial area of the structure of the DeviceInfo table (Table 3). The “PCI device identification name character string” is a character string of an identification name that identifies the PCI device 102 for connecting the hardware model 104. The “PCI device description character string” is a character string that describes the PCI device 102. “PCIID device table size” is the size (number of bytes) of the PCI device table (described later in FIG. 7D) corresponding to the PCI device 102. The “PCI device initialization function pointer” is a pointer indicating a function for executing initialization of the PCI device 102.

図7(c)に示すDeviceInfoテーブルはPCIデバイス102に対応するテーブルであるが、PCIデバイス102以外にも汎用のPCが基本的に備えているPCIデバイスが存在し、Qemuでエミュレートする全てのPCIデバイスのそれぞれにはそのPCIデバイスに対応するDeviceInfoテーブルが確保される。それら全てのDeviceInfoテーブルはチェインでつながれ、このチェインを辿ることで、各PCIデバイスに対応するDeviceInfoテーブルへのアクセスを実現できる。このチェインをDeviceInfoテーブルチェインと呼ぶ。「DeviceInfoテーブルチェインポインタ」は、そのDeviceInfoテーブルチェインで繋がれている次のDeviceInfoテーブルを指すポインタである。   The DeviceInfo table shown in FIG. 7 (c) is a table corresponding to the PCI device 102, but there are PCI devices that a general-purpose PC basically includes in addition to the PCI device 102, and all of the devices emulated by Qmu are included. A DeviceInfo table corresponding to the PCI device is secured for each PCI device. All these DeviceInfo tables are connected by a chain, and by accessing this chain, it is possible to realize access to the DeviceInfo table corresponding to each PCI device. This chain is referred to as a DeviceInfo table chain. The “DeviceInfo table chain pointer” is a pointer that points to the next DeviceInfo table connected in the DeviceInfo table chain.

図3に戻って、ステップ311の後、ステップ312〜315で、DeviceInfoテーブルに、PCIデバイス102のPCIデバイス識別名文字列とPCIデバイス説明文文字列とPCIDeviceテーブルサイズ(バイト数)とPCIデバイス初期化関数ポインタを設定する。次に、ステップ316で、当該DeviceInfoテーブルをDeviceInfoテーブルチェインに追加する。   Returning to FIG. 3, after step 311, in steps 312 to 315, in the DeviceInfo table, the PCI device identification name character string, the PCI device description character string, the PCI device table size (number of bytes), and the initial PCI device name of the PCI device 102. Set the function pointer. Next, in step 316, the DeviceInfo table is added to the DeviceInfo table chain.

次の前処理320は、SystemCシミュレータからQemu100を起動する手段を実現するための処理である。前述したとおり、ハードウェアモデル104のオブジェクトファイルとSystemCライブラリをリンクしたものはSystemCシミュレータとして動作する。そのため、SystemCライブラリには、予め、プログラムのエントリポイントであるmain関数が実装されている。一方、Qemuもエントリポイントであるmain関数を持つ。そこで、Qemuのソースを改造し、元々のQemuのエントリーポイントであるmain関数をコメントアウトし、図3の320に示すようにSystemCシミュレータからQemuを起動するように改変する。   The next pre-process 320 is a process for realizing a means for starting Qemu 100 from the SystemC simulator. As described above, the object file of the hardware model 104 linked with the SystemC library operates as a SystemC simulator. Therefore, a main function that is an entry point of the program is mounted in advance in the SystemC library. On the other hand, Qemu also has a main function that is an entry point. Therefore, the source of Qemu is remodeled, the main function that is the original entry point of Qmu is commented out, and the system is modified so that Qemu is started from the SystemC simulator as indicated by 320 in FIG.

この仕組みではSystemCライブラリには予めプログラムのエントリポイントであるmain関数が実装されているので、ステップ321で、このmain関数が起動される。ステップ322で、このmain関数から、同じくSystemCライブラリに実装されているsc_elab_and_sim関数が発行される。さらに、ステップ323で、このsc_elab_and_sim関数から、sc_mainという名前の関数が発行される。SystemCシミュレータのエントリポイントはSystemCの記述規則によりsc_main関数と定められており、sc_main関数の実装はSystemCシミュレータの利用者が行う。本実施形態においては、このsc_main関数からQemu100の起動を行う。   In this mechanism, since the main function which is the entry point of the program is mounted in advance in the SystemC library, this main function is started in step 321. In step 322, the sc_elab_and_sim function, which is also implemented in the SystemC library, is issued from the main function. In step 323, a function named sc_main is issued from the sc_elab_and_sim function. The entry point of the SystemC simulator is defined as the sc_main function according to the description rules of the SystemC, and the user of the SystemC simulator implements the sc_main function. In the present embodiment, the Qemu 100 is activated from this sc_main function.

Qemu100の起動のため、ステップ324で、仮想マシンのインスタンス化を行う。この処理については、図5で詳しく説明する。   In order to start the Qemu 100, in step 324, the virtual machine is instantiated. This process will be described in detail with reference to FIG.

次に、ステップ325で、ハードウェアモデル(LSIハードウェア設計記述)104のインスタンス化を行う。ステップ326で、Qemu100による仮想マシンとハードウェアモデル104との相互接続を行う。次に、ステップ327で、SystemCライブラリに実装されているSC_START関数を発行する。これにより、センシビティリスト(SC_THREAD)に登録した処理が開始される。センシビティリスト(SC_THREAD)は、ハードウェアモデルをエミュレートするための各プロセスの実行を制御するのに利用するリストである。後述するが、Qemuメインループ処理もセンシビティリスト(SC_THREAD)に登録されるので、ステップ327によりセンシビティリスト(SC_THREAD)に登録した処理が開始されることで、図1のハードウェア・ソフトウェア協調検証環境の動作が開始される。   Next, in step 325, the hardware model (LSI hardware design description) 104 is instantiated. In step 326, the virtual machine and the hardware model 104 are connected to each other by the Qemu 100. Next, in step 327, the SC_START function implemented in the SystemC library is issued. As a result, processing registered in the sensitivity list (SC_THREAD) is started. The sensitivity list (SC_THREAD) is a list used to control the execution of each process for emulating a hardware model. As will be described later, since the Qemu main loop processing is also registered in the sensitivity list (SC_THREAD), the processing registered in the sensitivity list (SC_THREAD) is started in step 327, so that the hardware / software co-verification in FIG. Environment operation begins.

図4は、ステップ327により開始されるQemuメインループ処理(ステップ401)を示す。ステップ402のQemuメインループの処理では、SC_THREADに登録した各処理が実行され、それがループ処理であれば繰り返し実行される。終了が指示されると、ステップ403でQemu終了処理を実行する。   FIG. 4 shows the Qemu main loop process (step 401) started at step 327. In the process of the Qemu main loop in step 402, each process registered in SC_THREAD is executed, and if it is a loop process, it is repeatedly executed. When termination is instructed, Qumu termination processing is executed in step 403.

図5は、図3のステップ324の仮想マシンのインスタンス化(ステップ501)の処理の流れを示す。ステップ502では、中継モジュール103のインスタンス化を行う。これは、図2で説明した中継モジュール103のクラスのインスタンス化であり、これにより中継モジュール103のエミュレートが実現される。   FIG. 5 shows a flow of processing of instantiating the virtual machine (step 501) in step 324 of FIG. In step 502, the relay module 103 is instantiated. This is an instantiation of the class of the relay module 103 described with reference to FIG. 2, and thus the emulation of the relay module 103 is realized.

処理503は、Qemu100とハードウェアモデル104とを接続するTLMインターフェースを介してハードウェアモデル104に対してデータI/Oを行う手段を実現するための処理である。ステップ511では、データI/Oハンドラテーブル領域を確保する。   A process 503 is a process for realizing a means for performing data I / O on the hardware model 104 via the TLM interface that connects the Qemu 100 and the hardware model 104. In step 511, a data I / O handler table area is secured.

図7(a)に、データI/Oハンドラテーブル(テーブル1)の構造体の一部領域の設定例を示す。データI/Oハンドラテーブルには、中継モジュール103のクラスのインスタンスアドレスが設定される。また、ハードウェアモデル104へのメモリ・マップド・ライト関数ポインタ、メモリ・マップド・リード関数ポインタ、ポート・マップド・ライト関数ポインタ、および、ポート・マップド・リード関数ポインタが設定される。これらの関数ポインタは、C++レイヤからC言語レイヤへのコールバック関数ポインタであり、I/Oハンドラに相当する。   FIG. 7A shows a setting example of a partial area of the structure of the data I / O handler table (table 1). In the data I / O handler table, the instance address of the class of the relay module 103 is set. In addition, a memory mapped write function pointer, a memory mapped read function pointer, a port mapped write function pointer, and a port mapped read function pointer to the hardware model 104 are set. These function pointers are callback function pointers from the C ++ layer to the C language layer and correspond to I / O handlers.

図5の処理に戻って、ステップ511でデータI/Oハンドラテーブル(テーブル1)の領域を確保したら、ステップ512で、メモリマップドI/OハンドラをデータI/Oハンドラテーブルへ設定し、ステップ513で、ポートマップドI/OハンドラをデータI/Oハンドラテーブルへ設定する。これにより図7(a)のデータI/Oハンドラテーブルの各I/Oハンドラ関数ポインタ等のデータが設定される。   Returning to the processing of FIG. 5, when the area of the data I / O handler table (table 1) is secured in step 511, in step 512, the memory mapped I / O handler is set in the data I / O handler table. In 513, the port mapped I / O handler is set in the data I / O handler table. As a result, data such as each I / O handler function pointer in the data I / O handler table of FIG. 7A is set.

ステップ504では、Qemu100の初期化処理として、Qemuメインループ直前までの処理を実行する。この処理については、図6で詳しく説明する。ステップ505では、Qemuメインループ処理を、センシビティリスト(SC_THREAD)へ登録する。   In step 504, processing up to immediately before the Qemu main loop is executed as initialization processing of the Qemu 100. This process will be described in detail with reference to FIG. In step 505, the Qemu main loop process is registered in the sensitivity list (SC_THREAD).

図6は、図5のステップ504のQemu100の初期化処理(ステップ601)の流れを示す。処理602は、ハードウェアモデル104をOS106からQemu100上でエミュレートしているPCIバス101に接続されているPCIデバイス102として見せる手段を実現するための処理である。   FIG. 6 shows the flow of the initialization process (step 601) of the Qemu 100 in step 504 of FIG. A process 602 is a process for realizing a means for showing the hardware model 104 as the PCI device 102 connected to the PCI bus 101 emulating the Qumu 100 from the OS 106.

まずステップ611で、PCIバスモデルを作成する。これは、Qemuのオリジナルな処理であり、PCIバステーブルを作成する処理である。   First, in step 611, a PCI bus model is created. This is Qemu's original process and is a process of creating a PCI bus table.

図7(b)に、PCIバステーブル(テーブル2)の一部領域の設定例を示す。PCIバステーブルには、PCIバス101に接続している全てのPCIデバイスに対応するPCIDeviceテーブルをチェインしたチェインリスト(PCIDeviceチェインリスト)の先頭アドレスを設定する。これにより、図7(b)のPCIバステーブルからPCIDeviceチェインリストを辿って各PCIデバイスに対応するPCIDeviceテーブルにアクセスできる。上述したように、DeviceInfoテーブルチェインを辿ることにより、各PCIデバイスに対応するDeviceInfoテーブルにアクセスできる。各PCIデバイスに対応するDeviceInfoテーブルとPCIDeviceテーブルを利用することによって、それら各PCIデバイスの動作のエミュレートが実現できる。   FIG. 7B shows a setting example of a partial area of the PCI bus table (table 2). In the PCI bus table, the head address of a chain list (PCIID chain list) obtained by chaining the PCI device tables corresponding to all the PCI devices connected to the PCI bus 101 is set. Accordingly, the PCI device table corresponding to each PCI device can be accessed by tracing the PCI device chain list from the PCI bus table of FIG. As described above, the DeviceInfo table chain corresponding to each PCI device can be accessed by following the DeviceInfo table chain. By using the DeviceInfo table and the PCI Device table corresponding to each PCI device, the operation of each PCI device can be emulated.

図7(d)に、PCIDeviceテーブル(テーブル4)の一部領域の設定例を示す。PCIDeviceテーブルには、各種PCIコンフィギュレーションレジスタ情報格納領域先頭アドレスと、ポートマップドI/Oハンドラ関数ポインタ(write)と、ポートマップドI/Oハンドラ関数ポインタ(read)と、メモリマップドI/Oハンドラ関数ポインタ(write)と、メモリマップドI/Oハンドラ関数ポインタ(read)とが設定される。   FIG. 7D shows a setting example of a partial area of the PCID device table (table 4). The PCI Device table includes various PCI configuration register information storage area start addresses, a port mapped I / O handler function pointer (write), a port mapped I / O handler function pointer (read), and a memory mapped I / O. An O handler function pointer (write) and a memory mapped I / O handler function pointer (read) are set.

図6に戻って、ステップ611で図7(b)のPCIバステーブルを作成した後、ステップ612では、PCIデバイス102に対応するPCIDeviceテーブルの領域を確保する。他のPCIデバイスについても同様である。これは、DeviceInfoテーブルチェインの先頭から順に辿って各PCIデバイスに対応するDeviceInfoテーブルにアクセスし、そのPCIデバイスに対応するPCIDeviceテーブルの領域を順に確保していく処理である。ステップ613では、PCIバスモデルの接続するPCIデバイスチェインリストへPCIDeviceテーブルアドレスを設定する。この処理は、ステップ612で確保した各PCIデバイスに対応するPCIDeviceテーブルのアドレスをPCIデバイスチェインリストに設定して、各PCIデバイスに対応するPCIDeviceテーブルをチェインで繋ぐ処理である。チェインで繋ぐ順番は、DeviceInfoテーブルチェインで繋がれたPCIデバイスの順と同じである。   Returning to FIG. 6, after creating the PCI bus table of FIG. 7B in step 611, in step 612, an area of the PCI device table corresponding to the PCI device 102 is secured. The same applies to other PCI devices. In this process, the DeviceInfo table corresponding to each PCI device is accessed in order from the top of the DeviceInfo table chain, and the area of the PCI Device table corresponding to the PCI device is secured in order. In step 613, the PCI device table address is set in the PCI device chain list to which the PCI bus model is connected. This process is a process of setting the PCI device table address corresponding to each PCI device secured in step 612 in the PCI device chain list and connecting the PCI device table corresponding to each PCI device in a chain. The order of connection in the chain is the same as the order of PCI devices connected in the DeviceInfo table chain.

次に、ステップ614で、DeviceInfoテーブルチェインの先頭から順に、各PCIデバイスに対応するDeviceInfoテーブル(図7(c))のPCIデバイス初期化関数ポインタを読み込み、各種PCIデバイスの初期化関数を発行する。これにより、PCIデバイス102についても初期化関数が発行される。ステップ615では、PCIデバイス102のベンダID、デバイスID、レビジョンID、クラスコードなどの各種PCIコンフィグレーションレジスタ情報を、所定のPCIコンフィグレーションレジスタ情報格納領域に格納し、その領域のアドレスをPCIDeviceテーブル(図7(d))の各種PCIコンフィギュレーションレジスタ情報格納領域先頭アドレスに設定する。ステップ616では、ポートマップドI/OハンドラをPCIDeviceテーブルのポートマップドI/Oハンドラ関数ポインタ(write)およびポートマップドI/Oハンドラ関数ポインタ(read)に設定する。ステップ617では、メモリマップドI/OハンドラをPCIDeviceテーブルのメモリマップドI/Oハンドラ関数ポインタ(write)およびメモリマップドI/Oハンドラ関数ポインタ(read)に設定する。   Next, in step 614, the PCI device initialization function pointer of the DeviceInfo table (FIG. 7C) corresponding to each PCI device is read in order from the top of the DeviceInfo table chain, and initialization functions for various PCI devices are issued. . As a result, an initialization function is also issued for the PCI device 102. In step 615, various PCI configuration register information such as the vendor ID, device ID, revision ID, and class code of the PCI device 102 is stored in a predetermined PCI configuration register information storage area, and the address of that area is stored in the PCI Device table ( The various PCI configuration register information storage area start addresses in FIG. In step 616, the port mapped I / O handler is set in the port mapped I / O handler function pointer (write) and the port mapped I / O handler function pointer (read) of the PCID device table. In step 617, the memory mapped I / O handler is set to the memory mapped I / O handler function pointer (write) and the memory mapped I / O handler function pointer (read) of the PCID device table.

以上のように初期設定が為された後、例えば、検証対象のソフトウェア105からハードウェアモデル104に対してメモリ書き込みを行う場合、Qemu100はその書き込み命令を受けて、図7(a)のコールバック関数ポインタ(ハードウェアモデル104へのメモリ・マップド・ライト関数ポインタ)を利用してデータ書き込みメソッドを発行する。そのデータ書き込みメソッドの実装例は省略するが、そのデータ書き込みメソッドの実装によりメモリ書き込みがエミュレートされる。ハードウェアモデル104に対するメモリ読み出し、ポート書き込み、および、ポート読み出しも同様の方式でエミュレートしている。これにより、Qemu100からハードウェアモデル104に対してデータ書き込みおよびデータ読み込みを行う手段が実現される。   After the initial setting as described above, for example, when performing memory writing from the verification target software 105 to the hardware model 104, the Qemu 100 receives the write command and receives the callback of FIG. A data write method is issued using a function pointer (memory mapped write function pointer to the hardware model 104). Although an implementation example of the data write method is omitted, memory write is emulated by the implementation of the data write method. Memory read, port write, and port read for the hardware model 104 are emulated in a similar manner. Thereby, a means for writing data to and reading data from the hardware model 104 from the Qemu 100 is realized.

また、図7(b)〜図7(d)で説明した構造体を用意し、図3の310および図6の602の初期化処理を行っており、これによりハードウェアモデル104をPCIバス101に接続されているPCIデバイス102として見せる手段が実現される。   Also, the structures described in FIGS. 7B to 7D are prepared, and the initialization process 310 in FIG. 3 and the initialization process 602 in FIG. 6 are performed, whereby the hardware model 104 is transferred to the PCI bus 101. A means for showing as the PCI device 102 connected to is realized.

100:Qemu部分、101:Qemu上でエミュレートしているPCIバス部分、102:PCIバス部分101上に接続したPCIデバイス部分、103:Qemuとハードウェアモデルの中継ぎを行う中継モジュール部分、104:ハードウェア・ソフトウェア協調検証対象となるハードウェアモデル部分、105:ハードウェア・ソフトウェア協調検証対象となるソフトウェア部分、106:ソフトウェア部分105の動作プラットフォームとなるOS部分、107:Qemu上でエミュレートしているCPU部分、108:Qemu上でエミュレートしているMCH(Memory Control Hub)部分、109:Qemu上でエミュレートしているメモリ部分。   100: Qemu part, 101: PCI bus part emulating on Qemu, 102: PCI device part connected on the PCI bus part 101, 103: Relay module part relaying hardware model with Qemu, 104: Hardware model part to be subjected to hardware / software co-verification, 105: Software part to be subjected to hardware / software co-verification, 106: OS part to be an operation platform of the software part 105, 107: Emulated on Qemu 108: MCH (Memory Control Hub) part emulating on Qemu, 109: Memory part emulating on Qemu.

Claims (1)

オープンソースソフトウェアを利用したハードウェア・ソフトウェア協調検証方法であって、
オープンソースソフトウェアであるQemuを改変することにより、
Qemuとハードウェアモデルの接続するTLMインターフェースを介して、ハードウェアモデルに対してデータI/Oを行う手段と、
ハードウェアモデルをQemu上でエミュレートしているPCIバスに接続されているPCIデバイスとして見せる手段と、
SystemCシミュレータからQemuを起動する手段と
を備えたオープンソースソフトウェアのPCエミュレータを実現することを特徴とするオープンソースソフトウェアを利用したハードウェア・ソフトウェア協調検証方法。
A hardware / software co-verification method using open source software,
By modifying Qumu, which is open source software,
Means for performing data I / O to the hardware model via a TLM interface connecting the Qemu and the hardware model;
Means to show the hardware model as a PCI device connected to a PCI bus emulating on Qumu;
A hardware / software co-verification method using open source software, characterized by realizing a PC emulator of open source software comprising means for starting Qemu from a SystemC simulator.
JP2011152879A 2011-07-11 2011-07-11 Hardware and software cooperative verification method using open source software Withdrawn JP2013020425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011152879A JP2013020425A (en) 2011-07-11 2011-07-11 Hardware and software cooperative verification method using open source software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011152879A JP2013020425A (en) 2011-07-11 2011-07-11 Hardware and software cooperative verification method using open source software

Publications (1)

Publication Number Publication Date
JP2013020425A true JP2013020425A (en) 2013-01-31

Family

ID=47691802

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011152879A Withdrawn JP2013020425A (en) 2011-07-11 2011-07-11 Hardware and software cooperative verification method using open source software

Country Status (1)

Country Link
JP (1) JP2013020425A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103312814A (en) * 2013-06-28 2013-09-18 武汉大学 Method for establishing VNC (virtual network computing) covert channel between cloud management platform and virtual machine terminal user
CN113360249A (en) * 2021-07-02 2021-09-07 深圳市瑞驰信息技术有限公司 Qemu virtual machine operation method based on ARM64
WO2023053356A1 (en) * 2021-09-30 2023-04-06 株式会社アイ・エル・シー Device including communication control object, communication control method, and communication control program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103312814A (en) * 2013-06-28 2013-09-18 武汉大学 Method for establishing VNC (virtual network computing) covert channel between cloud management platform and virtual machine terminal user
CN113360249A (en) * 2021-07-02 2021-09-07 深圳市瑞驰信息技术有限公司 Qemu virtual machine operation method based on ARM64
WO2023053356A1 (en) * 2021-09-30 2023-04-06 株式会社アイ・エル・シー Device including communication control object, communication control method, and communication control program

Similar Documents

Publication Publication Date Title
US8180620B2 (en) Apparatus and method for performing hardware and software co-verification testing
US20150355933A1 (en) System and methods for generating and managing a virtual device
US7584456B1 (en) Method and apparatus for debugging embedded systems having read only memory
CN102480467B (en) A kind of SOC software and hardware cooperating simulation verification method of communications protocol Network Based
CN102623069B (en) Random excitation flash model verification method
US20130024178A1 (en) Playback methodology for verification components
US7437282B2 (en) Method and apparatus to provide alternative stimulus to signals internal to a model actively running on a logic simulation hardware emulator
Goli et al. Automatic equivalence checking for SystemC-TLM 2.0 models against their formal specifications
US9690681B1 (en) Method and system for automatically generating executable system-level tests
US20100280817A1 (en) Direct pointer access and xip redirector for emulation of memory-mapped devices
JP2013020425A (en) Hardware and software cooperative verification method using open source software
US20100274550A1 (en) Integrated development structure having virtual inputs/outputs for embedded hardware/software
CN115858092A (en) Time sequence simulation method, device and system
CN115185638A (en) Method for acquiring call stack during simulation running of application program and computing equipment
CN115374017A (en) Method for capturing site during simulation running of executable file and computing equipment
Bombieri et al. Correct-by-construction generation of device drivers based on RTL testbenches
WO2024046362A1 (en) Verification system, verification method, electronic device, and storage medium
TWI837026B (en) Verification system, verification method, electronic device and storage medium
JP2011145880A (en) Generation method for test task used in logic verification of semiconductor integrated circuit
US20230267253A1 (en) Automated synthesis of virtual system-on-chip environments
US11151294B1 (en) Emulated register access in hybrid emulation
US20230289500A1 (en) Method and system for building hardware images from heterogeneous designs for eletronic systems
US20220066911A1 (en) Virtual machine for developing and testing target code for hardware designs
JP4893028B2 (en) Chipset emulation apparatus and method
Yeh et al. A novel technique for making qemu an instruction set simulator for co-simulation with systemc

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20141007