JP2023032451A - Simulation device and simulation method - Google Patents

Simulation device and simulation method Download PDF

Info

Publication number
JP2023032451A
JP2023032451A JP2021138590A JP2021138590A JP2023032451A JP 2023032451 A JP2023032451 A JP 2023032451A JP 2021138590 A JP2021138590 A JP 2021138590A JP 2021138590 A JP2021138590 A JP 2021138590A JP 2023032451 A JP2023032451 A JP 2023032451A
Authority
JP
Japan
Prior art keywords
simulator
register
microcomputer
simulation
software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2021138590A
Other languages
Japanese (ja)
Inventor
裕二 深見
Yuji Fukami
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 Astemo Ltd
Original Assignee
Hitachi Astemo 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 Astemo Ltd filed Critical Hitachi Astemo Ltd
Priority to JP2021138590A priority Critical patent/JP2023032451A/en
Publication of JP2023032451A publication Critical patent/JP2023032451A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

To suppress reduction in a simulation speed.SOLUTION: A simulation device includes a first simulator that simulates operation of software executed by a microcomputer and a second simulator having a calculation period different from that of the first simulator. In the second simulator, a microcomputer peripheral model indicating operation of a peripheral device to be verified by the microcomputer is arranged. The first simulator has a first register capable of reading out a register value to be read from the microcomputer peripheral model during the calculation period of the first simulator. The first register can read out and rewrite a specific value of the first register during one period of calculation of the first simulator.SELECTED DRAWING: Figure 1

Description

本発明は、シミュレーション装置に関し、特に、計算機上でソフトウェアとハードウェアとメカニズムのシミュレータを用いた組み込みシステムの検証技術に関する。 TECHNICAL FIELD The present invention relates to a simulation apparatus, and more particularly to an embedded system verification technique using software, hardware, and mechanism simulators on a computer.

近年、車両制御の高機能化及び複雑化に伴い電子制御装置(ECU:Electric Control Unit)の数が増加し、更にECUが連動して車両システムを制御している。このように、システムが複雑化しているため、1箇所の修正が、設計者の意図していない範囲まで影響を及ぼすことがあり、変更の影響を広範囲にチェックする必要があり、回帰テストの重要性が増加している。 2. Description of the Related Art In recent years, the number of electronic control units (ECUs) has increased as vehicle control has become more sophisticated and complicated, and the ECUs are interlocked to control vehicle systems. In this way, because the system is becoming more complicated, a single modification may have an effect beyond the designer's intention. sex is increasing.

また、自動車開発においては、開発期間の短縮化、試作レス化が加速しており、増加するソフトウェアを如何に短期間に効率的に開発し、品質を確保するかが重要な課題となっている。 In addition, in automobile development, the shortening of the development period and the elimination of prototyping are accelerating, and how to efficiently develop the increasing software in a short period of time and ensure the quality is an important issue. .

この課題の解決策の一つに仮想検証環境を用いた検証環境がある。仮想環境であれば様々な条件でテストが可能であり、テストの自動実行も容易である。大量のテストを実行することが求められるので、高速なシミュレーション装置及びツールが必要である。 One solution to this problem is a verification environment using a virtual verification environment. In a virtual environment, tests can be performed under various conditions, and automatic execution of tests is easy. Due to the large number of tests required to run, high speed simulation equipment and tools are required.

仮想ECU活用のためのユーザ向け導入検討支援ガイド,仮想マイコン応用推進協議会,2015年9月29日,http://www.vecu-mbd.org/wp-content/uploads/downloads/2015/10/e981a9b1ad2267412627ee3c0f0e3f24.pdfIntroduction Study Support Guide for Users for Virtual ECU Utilization, Virtual Microcomputer Application Promotion Council, September 29, 2015, http://www.vecu-mbd.org/wp-content/uploads/downloads/2015/10 /e981a9b1ad2267412627ee3c0f0e3f24.pdf

マイコンのペリフェラル制御を含んだソフトウェアの検証を行う検証環境としてSimulated-processor-in-the-loop simulation(以下SPILS)がある。SPILSはマイコンペリフェラルを含むマイコン全体をモデル化し、その上でソフトウェアを実行するので、ソフトウェアの検証範囲が広い。 Simulated-processor-in-the-loop simulation (hereinafter referred to as SPILS) is a verification environment for verifying software including peripheral control of a microcomputer. SPILS models the entire microcomputer including microcomputer peripherals and executes software on it, so the scope of software verification is wide.

一方、マイコン全体をモデル化するので、モデルの規模が大きく計算負荷が高くなり、シミュレーション速度が遅い。 On the other hand, since the entire microcomputer is modeled, the scale of the model is large, the calculation load is high, and the simulation speed is slow.

SPILSによるシミュレーションの形態は、マイコンモデルを用いてソフトウェアをシミュレートするマイコンシミュレータと、回路モデル及びプラントモデルをシミュレーションするシミュレータとを用いる協調シミュレーションとなる。別な方法として、マイコンモデルと回路モデルとプラントモデルのそれぞれをモジュールにして、一つのシミュレータに取り込み、モジュールごとの計算周期で動作するシミュレータを用いる方法がある。 A form of simulation by SPILS is co-simulation using a microcomputer simulator that simulates software using a microcomputer model and a simulator that simulates a circuit model and a plant model. Another method is to make the microcomputer model, the circuit model, and the plant model into modules, load them into one simulator, and use a simulator that operates at the calculation cycle of each module.

SPILに対して、Software-In-the-Loop-Simulation(以下SILS)は、マイコンモデルを含まず、ソフトウェアを計算機(PC)に搭載するCPU(Central Processing Unit)向けコードに変換して実行するソフトウェアシミュレータを用いるため、計算負荷が低く、SPILSより高速なシミュレーションが可能である。 In contrast to SPIL, Software-In-the-Loop-Simulation (SILS) is software that does not include a microcomputer model, but converts software into code for the CPU (Central Processing Unit) installed in a computer (PC) and executes it. Since a simulator is used, the computational load is low and simulation can be performed at a higher speed than SPILS.

しかし、マイコンモデルを含んでいないため、マイコンのペリフェラルを制御するソフトウェア部は検証できず、検証範囲はSPILSより狭い。 However, since it does not include a microcomputer model, the software portion that controls the peripherals of the microcomputer cannot be verified, and the verification range is narrower than SPILS.

SILSによるシミュレーションの形態は、ソフトウェアシミュレータとプラントモデルをシミュレートするモデルシミュレータを用いる協調シミュレーションとなる。別方法として、SPILSと同じく、ソフトウェアとプラントをそれぞれのモジュールにして一つのシミュレータに取り込み、モジュールごとの計算周期でシミュレートする方法がある。 A form of simulation by SILS is co-simulation using a software simulator and a model simulator that simulates a plant model. As another method, similar to SPILS, there is a method in which the software and the plant are made into modules and loaded into one simulator, and the simulation is performed at the calculation cycle of each module.

SILSで、マイコンペリフェラルを制御するソフトウェアを含めて、高速なシミュレーション環境ができれば、SILSによる検証範囲は広がり、利用する機会を増加できる。そのためには、マイコンペリフェラルモデルを追加する必要がある。ただし、マイコンに搭載する全てのペリフェラルは必要なく、制御対象のマイコンペリフェラルモデルだけ搭載すればよい。 If SILS can create a high-speed simulation environment, including the software that controls microcomputer peripherals, the scope of verification by SILS will expand, and opportunities to use it will increase. For that purpose, it is necessary to add a microcomputer peripheral model. However, not all peripherals to be mounted on the microcomputer are required, and only the microcomputer peripheral model to be controlled should be mounted.

SILSにマイコンペリフェラルモデルを追加するために、まず、ソフトウェアからマイコンペリフェラルへのアクセス動作を見ると、ソフトウェアの一連の制御タスクの中で割り込みを契機に状態レジスタの読み出しや、割り込みステータス確認、割り込みクリア、特定処理を実行するためのレジスタ設定があり、ソフトウェアとマイコンペリフェラルは連携し、頻繁にアクセスする。 In order to add a microcomputer peripheral model to SILS, first of all, when looking at the access operation from software to the microcomputer peripheral, an interrupt triggers the reading of the status register, the confirmation of the interrupt status, and the clearing of the interrupt. , there are register settings for executing specific processing, and software and microcomputer peripherals are linked and accessed frequently.

マイコンペリフェラル自体の動作は、マイコン内部クロックに同期して動作し、タイミングを扱うのでマイコンペリフェラルモデルにしてもタイミングを扱う必要があり、マイコン内部クロック程ではないが、計算周期は短くなる。 Since the operation of the microcomputer peripheral itself operates in synchronization with the internal clock of the microcomputer and handles timing, the microcomputer peripheral model also needs to handle timing, and the calculation cycle becomes shorter, though not as much as the internal clock of the microcomputer.

次に、シミュレータでシミュレーションする時の計算周期とシミュレーション速度の関係を見ると、同じモデルでも計算周期が短いとシミュレータの停止処理と再開処理のオーバーヘッドが大きく、シミュレーション速度は低下する。反対に、計算周期が長いとオーバーヘッドは小さくシミュレーション速度は上がる。このようにシミュレーション速度を下げないためには、計算周期を短くしない必要がある。 Next, looking at the relationship between the calculation cycle and the simulation speed when simulating with a simulator, if the calculation cycle is short even for the same model, the overhead of the simulator stop processing and restart processing is large, and the simulation speed decreases. Conversely, if the calculation cycle is long, the overhead is small and the simulation speed is high. In order not to lower the simulation speed in this way, it is necessary not to shorten the calculation cycle.

SILSにマイコンペリフェラルモデルを組み込む方法として、ソフトウェアシミュレータにマイコンペリフェラルモデルを組み込む場合、ソフトウェアとマイコンペリフェラル間は頻繁にアクセスするため、ソフトウェアの計算周期はマイコンペリフェラルの計算周期の影響を受ける。ソフトウェアシミュレータの計算周期とマイコンペリフェラルモデルの計算周期では、マイコンプラントモデルの計算周期の方が短く、ソフトウェアシミュレータの計算周期を短くする必要がある。計算周期の変更はシミュレータのスケジューラのスケジュール条件の変更やスケジューラの差し替えが必要となる。 As a method of incorporating a microcomputer peripheral model into SILS, when a microcomputer peripheral model is incorporated into a software simulator, frequent accesses are made between the software and the microcomputer peripheral, so the calculation cycle of the software is affected by the calculation cycle of the microcomputer peripheral. Among the calculation cycle of the software simulator and the calculation cycle of the microcomputer peripheral model, the calculation cycle of the microcomputer plant model is shorter, and it is necessary to shorten the calculation cycle of the software simulator. Changing the calculation cycle requires changing the schedule conditions of the scheduler of the simulator or replacing the scheduler.

SILSにマイコンペリフェラルモデルを組み込む別方法として、ソフトウェアシミュレータとは別にマイコンペリフェラルモデルをシミュレートするシミュレータの協調シミュレーションにすれば、ソフトウェアシミュレータの計算負荷は変わらず、プラントモデルをシミュレートするシミュレータ分の計算負荷増加だけになる。結果、シミュレーションの速度低下を抑制できる。但し、この方法は、ソフトウェアからマイコンペリフェラルに頻繁にアクセス可能にしなければならない。すなわち、シミュレータ間のデータ転送が頻繁に発生する中でも速度低下を抑制するという課題を解決する必要がある。 Another method of incorporating the microcomputer peripheral model into SILS is co-simulation of a simulator that simulates the microcomputer peripheral model separately from the software simulator. It will only increase the load. As a result, a decrease in simulation speed can be suppressed. However, this method requires frequent access to microcomputer peripherals from software. In other words, it is necessary to solve the problem of suppressing speed reduction even when data transfer between simulators occurs frequently.

シミュレータ間のデータの転送を見ると、各シミュレータは協調シミュレーションのスケジューラの指示に従ってシミュレーションを進め、各シミュレータが停止したタイミングでシミュレータ間でデータを転送する。 Looking at the transfer of data between simulators, each simulator advances the simulation according to the instructions of the co-simulation scheduler, and transfers data between the simulators at the timing when each simulator stops.

前述の通り、協調シミュレーションでソフトウェアとマイコンペリフェラルとの間のデータ転送が、単純にレジスタリード、レジスタライトであれば協調シミュレーションのデー転送方法で問題ないが、ソフトウェアの計算周期で実行するソフトウェア処理の中でマイコンペリフェラルからの割り込みを契機にレジスタを読み出しや、レジスタをライトすることで書き換わった別のレジスタ値の読み出しが必要である。さらに、協調シミュレーションでは、同期タイミングにしかデータを転送できず、データ転送タイミングの遅れが生じる。これらの問題を解決する必要がある。 As mentioned above, if the data transfer between the software and the microcomputer peripheral in co-simulation is simply register read and register write, there is no problem with the co-simulation data transfer method. Inside, it is necessary to read a register with an interrupt from a microcomputer peripheral as a trigger, or to read another register value that has been rewritten by writing a register. Furthermore, in co-simulation, data can only be transferred at synchronous timing, resulting in a delay in data transfer timing. These issues need to be resolved.

本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、シミュレーション装置であって、マイコンで実行されるソフトウェアの動作を模擬する第1のシミュレータと、前記第1のシミュレータと計算周期が異なる第2のシミュレータとを備え、前記第2のシミュレータには、前記マイコンの検証対象となる周辺機器の動作を示すマイコンペリフェラルモデルが配置され、前記第1のシミュレータは、前記マイコンペリフェラルモデルからの読み取り対象となるレジスタ値を、前記第1のシミュレータの計算周期中に読み出し可能な第1のレジスタを有し、前記第1のレジスタは、前記第1のシミュレータの計算の1周期中に前記第1のレジスタの特定の値の読み出しと書き換えが可能であることを特徴とする。 A representative example of the invention disclosed in the present application is as follows. That is, the simulation apparatus includes a first simulator that simulates the operation of software executed by a microcomputer, and a second simulator that has a calculation cycle different from that of the first simulator, and the second simulator includes , a microcomputer peripheral model indicating the operation of a peripheral device to be verified by the microcomputer is arranged, and the first simulator reads a register value to be read from the microcomputer peripheral model in a calculation cycle of the first simulator. having a readable first register therein, the first register being capable of reading and rewriting a specific value of the first register during one cycle of calculation of the first simulator characterized by

本発明の一態様によれば、ソフトウェア検証領域を拡大し、シミュレーション速度低下を抑制できる。前述した以外の課題、構成及び効果は、以下の実施例の説明によって明らかにされる。 According to one aspect of the present invention, it is possible to expand the software verification area and suppress a decrease in simulation speed. Problems, configurations, and effects other than those described above will be clarified by the following description of the embodiments.

実施例1の協調シミュレーション環境を示す図である。1 is a diagram showing a co-simulation environment of Example 1; FIG. 実施例1のマイコンペリフェラルのレジスタマップとレジスタ実装位置を示す図である。FIG. 3 is a diagram showing a register map of a microcomputer peripheral and register mounting positions of Example 1; 実施例1のシミュレータ間のデータの転送を示すタイミング図である。4 is a timing chart showing transfer of data between simulators of Example 1. FIG. 実施例1のソフトウェアシミュレータの計算周期とソフトウェア処理の関係を示す図である。4 is a diagram showing the relationship between the calculation cycle of the software simulator of Example 1 and software processing; FIG. 実施例1のマイコンの構成を示すブロック図である。2 is a block diagram showing the configuration of a microcomputer of Example 1; FIG. 実施例1のマイコンの内部のタイムチャートである。4 is a time chart inside the microcomputer of Example 1; 実施例1の割り込み報告とレジスタ値の読み出しを示すタイムチャートである。5 is a time chart showing interrupt reporting and reading of register values in Example 1; 実施例1の高速応答レジスタの動作を示すタイムチャートである。4 is a time chart showing the operation of the high-speed response register of Example 1; 実施例2の協調シミュレーション環境を示す図である。FIG. 10 is a diagram showing a co-simulation environment of Example 2;

以下、図面を参照して、本発明の実施例の構成及び処理を説明する。以下の記述では、特に断わらない限り、複数の図面にわたって同一の要素は同一の符号で参照されるものとする。なお、本明細書で説明する構成と処理は一実施例として説明するものであり、本発明の技術的範囲をこの実施例に限定して解釈する意図はないことを理解されたい。 The configuration and processing of an embodiment of the present invention will be described below with reference to the drawings. In the following description, the same elements are referred to by the same reference numerals across multiple drawings unless otherwise specified. It should be noted that the configuration and processing described in this specification are described as an example, and it should be understood that there is no intention to limit the technical scope of the present invention to this example.

<実施例1>
図1は、二つのシミュレータを用いた協調シミュレーション環境を示す図である。
<Example 1>
FIG. 1 shows a co-simulation environment using two simulators.

本実施例のシミュレーション装置は、ソフトウェアシミュレータ100及びプラントシミュレータ120によって構成される。ソフトウェアシミュレータ100は、検証対象ソフトウェア101のシミュレーションを行う。ソフトウェアシミュレータ100には、マイコンペリフェラルの一部レジスタが高速応答レジスタ102として実装される。 The simulation apparatus of this embodiment is composed of a software simulator 100 and a plant simulator 120 . The software simulator 100 simulates the verification target software 101 . Some registers of microcomputer peripherals are implemented as high-speed response registers 102 in the software simulator 100 .

プラントシミュレータ120はソフトウェアの制御対象とするマイコンペリフェラルモデル111と、制御対象物の動きをシミュレートするプラントモデル121を含む。マイコンペリフェラルモデル111には、通常レジスタ114とキャプチャーレジスタ112とセレクタ113が実装される。 The plant simulator 120 includes a microcomputer peripheral model 111 to be controlled by software and a plant model 121 to simulate the movement of the controlled object. A normal register 114 , a capture register 112 and a selector 113 are implemented in the microcomputer peripheral model 111 .

通常レジスタ114は、マイコンペリフェラルの機能として本来実装されるレジスタである。 The normal register 114 is a register originally implemented as a function of the microcomputer peripheral.

キャプチャーレジスタ112は、ソフトウェアから参照され、かつ、割り込み処理で参照され、レジスタ値が変化するレジスタであり、割り込み要因発生時に通常レジスタ114の値がキャプチャーされる。そして、割り込み要因に対応するレジスタ読み出し時にキャプチャーレジスタ112の値が読み出される。特に、時間経過によって変化するレジスタ値は、割り込み要因発生のタイミングに、通常レジスタ114からキャプチャーレジスタ112にコピーされる。セレクタ113は、マイコンペリフェラルモデル111からの割り込み報告時はキャプチャーレジスタ112を参照し、それ以外は通常レジスタ114を参照する切替機能である。上記二つのシミュレータ間ではデータが転送される。 The capture register 112 is a register that is referenced by software and by interrupt processing, and whose register value changes. When an interrupt factor occurs, the value of the normal register 114 is captured. Then, the value of the capture register 112 is read at the time of reading the register corresponding to the interrupt factor. In particular, register values that change over time are copied from the normal register 114 to the capture register 112 at the timing of the occurrence of an interrupt factor. The selector 113 is a switching function that refers to the capture register 112 when an interrupt is reported from the microcomputer peripheral model 111 and refers to the normal register 114 otherwise. Data is transferred between the two simulators.

図2は、マイコンペリフェラルのレジスタマップとレジスタ実装位置を示す図である。 FIG. 2 is a diagram showing a register map of a microcomputer peripheral and a register mounting position.

ソフトウェアシミュレータ100のレジスタの一部に高速応答レジスタ102を実装する。高速応答レジスタ102以外のレジスタは、マイコンペリフェラルモデル111に通常レジスタ114として実装する。通常レジスタ114の一部は、レジスタ値をキャプチャーするキャプチャーレジスタ112として実装し、セレクタ113でキャプチャーレジスタ112から読み出すか通常レジスタ114から読み出すかが切り替えられる。 A fast response register 102 is implemented as part of the registers of the software simulator 100 . Registers other than the high-speed response register 102 are implemented as normal registers 114 in the microcomputer peripheral model 111 . A part of the normal register 114 is implemented as a capture register 112 that captures a register value, and a selector 113 switches between reading from the capture register 112 and reading from the normal register 114 .

図3は、シミュレータ間のデータの転送を示すタイミング図である。図3では、ソフトウェアシミュレータ100の計算周期100μs、プラントシミュレータ120の計算周期10μsとしている。 FIG. 3 is a timing diagram showing the transfer of data between simulators. In FIG. 3, the calculation period of the software simulator 100 is 100 μs, and the calculation period of the plant simulator 120 is 10 μs.

ソフトウェアシミュレータ100では、一回の計算周期(100μs)毎にソフトウェアシミュレート処理320が実行され、プラントシミュレータ120では、一回の計算周期(10μs)モデルシミュレート処理330が実行される。ソフトウェアシミュレート処理320からモデルシミュレート処理330へデータを転送する際、モデルシミュレート処理330の計算周期10μs遅れでデータを受け取ることができる。このデータ転送はソフトウェアシミュレータ100がプラントシミュレータ120のレジスタを書き込む際にも利用される。 The software simulator 100 executes software simulation processing 320 in each calculation cycle (100 μs), and the plant simulator 120 executes model simulation processing 330 in one calculation cycle (10 μs). When transferring data from the software simulation processing 320 to the model simulation processing 330, the data can be received with a delay of 10 μs in the calculation period of the model simulation processing 330. FIG. This data transfer is also used when the software simulator 100 writes the registers of the plant simulator 120 .

反対方向のモデルシミュレート処理330からソフトウェアシミュレート処理320へのデータの転送は、最大100μsの遅延が生じる。このデータ転送はソフトウェアシミュレータ100がプラントシミュレータ120のレジスタからデータを読み出す際にも利用され、ソフトウェアシミュレート処理320は、直前のモデルシミュレート処理330の出力値を受け取れる。 Transferring data from the model simulation process 330 to the software simulation process 320 in the opposite direction incurs a maximum delay of 100 μs. This data transfer is also used when the software simulator 100 reads data from the register of the plant simulator 120, and the software simulation processing 320 can receive the output value of the previous model simulation processing 330.

マイコンペリフェラルモデル111で割り込みイベント340が発生する場合、ソフトウェアシミュレータ100に通知できるのはソフトウェアシミュレート処理320の次の計算周期となり、最大100μsの遅れが生じる。 When the interrupt event 340 occurs in the microcomputer peripheral model 111, the software simulator 100 can be notified of the next calculation cycle of the software simulation process 320, resulting in a maximum delay of 100 μs.

図4は、ソフトウェアシミュレータ100の計算周期とソフトウェア処理の関係を示す図である。 FIG. 4 is a diagram showing the relationship between the calculation cycle of the software simulator 100 and software processing.

ソフトウェアは、所定の周期で一連のtaskを実行する周期処理と、割り込みなどのイベントが発生した際に一連のtaskを実行するイベント処理がある。これら処理をソフトウェアシミュレータ100はスケジューラで管理し、優先順位に従ってシミュレートする。 Software includes periodic processing for executing a series of tasks at a predetermined period and event processing for executing a series of tasks when an event such as an interrupt occurs. The software simulator 100 manages these processes with a scheduler and performs simulations according to priority.

図5は、マイコンの構成を示すブロック図である。 FIG. 5 is a block diagram showing the configuration of the microcomputer.

CPUコア510は、ソフトウェアを実行する。CPUコア510は、内部バス512を経由してタイマ、ADコンバータ、CANコントローラ、DMAコントローラ、I/O、割込コントローラ、RAM、ROMなどのマイコンペリフェラル511のレジスタにアクセスする。 CPU core 510 executes software. The CPU core 510 accesses registers of microcomputer peripherals 511 such as timers, AD converters, CAN controllers, DMA controllers, I/Os, interrupt controllers, RAMs, and ROMs via an internal bus 512 .

図6は、マイコンの内部のタイムチャートであり、CPUコア510が実行するソフトウェア600とマイコンペリフェラル610の間のレジスタアクセスで主な三つ処理を示す。 FIG. 6 is a time chart inside the microcomputer, showing three main processes of register access between the software 600 executed by the CPU core 510 and the microcomputer peripheral 610 .

一つ目の割り込み処理620は、マイコンペリフェラル610で割り込みが生じ、ソフトウェア600の割り込み処理ルーチンの中で、マイコンペリフェラル610のステータスレジスタなどにアクセスする。 The first interrupt process 620 accesses the status register of the microcomputer peripheral 610 in the interrupt process routine of the software 600 when an interrupt occurs in the microcomputer peripheral 610 .

二つ目のステータスクリア630は、レジスタアクセスが別のレジスタに影響にするケースである。例えば、割り込み処理において、まず、割り込みステータスレジスタをリードして、割り込み要因を読み出した後、割り込み要因クリアレジスタをライトして、割り込み要因レジスタの割り込みステータスビットをクリアし、さらに、割り込みステータスレジスタをリードして、割り込み要因のクリアを確認する。この処理では、割り込み要因レジスタの1回目のリードと、割り込み要因レジスタの2回目のリードの間にロジックがあり、あるレジスタ(割り込み要因レジスタ)へのアクセスによって、別のレジスタ(割り込みステータスレジスタ)の値を書き換わる。 A second clear status 630 is the case where a register access affects another register. For example, in interrupt processing, first read the interrupt status register to read the interrupt factor, then write the interrupt factor clear register to clear the interrupt status bit of the interrupt factor register, and then read the interrupt status register. to confirm that the interrupt factor has been cleared. In this processing, there is logic between the first read of the interrupt factor register and the second read of the interrupt factor register, and access to one register (interrupt factor register) causes another register (interrupt status register) to be read. rewrite the value.

三つ目の特定処理指示640は、特定処理の開始指示をするため、マイコンペリフェラル610のレジスタへの連続した書き込みによって、処理のオーダー内容の指示と、処理開始指示を行う。 The third specific process instruction 640 instructs the start of the specific process by successively writing to the register of the microcomputer peripheral 610 to instruct the contents of the order for the process and to start the process.

本実施例では、この三つの処理でキャプチャーレジスタ112、高速応答レジスタ102及び通常レジスタ114を使い分ける。すなわち、割り込み時のレジスタ値が必要な割り込み処理ではキャプチャーレジスタ112をアクセスし、1計算周期のソフトウェアシミュレート処理320の中で、アクセスされたレジスタ値を更新する場合は高速応答レジスタ102にアクセスし、通常のレジスタ値の読み書きでは通常レジスタ114にアクセスする。 In this embodiment, the capture register 112, the high-speed response register 102, and the normal register 114 are properly used for these three processes. That is, the capture register 112 is accessed in the interrupt process that requires the register value at the time of the interrupt, and the high-speed response register 102 is accessed in the case of updating the accessed register value in the software simulation process 320 of one calculation cycle. , the normal register 114 is accessed for reading and writing normal register values.

図7は、割り込み報告とレジスタ値の読み出しを示すタイムチャートである。 FIG. 7 is a time chart showing interrupt reporting and reading of register values.

マイコンペリフェラルモデル111は、割り込みを検出し、割り込みをソフトウェアに報告をする。ソフトウェアの割り込み処理は、計算周期の開始まで処理が開始せず、読み出し対象の通常レジスタ114のレジスタ値が更新される場合、割り込み発生時に通常レジスタ114の値をキャプチャーレジスタ112に保持し、セレクト信号の立ち上がりでセレクタ113によって切り替えられたキャプチャーレジスタ112の値をソフトウェアに渡す。割り込みが終了すると、セレクト信号が立ち下がり、セレクタ113は通常レジスタ114からの読み出しを選択する。割り込み報告でなければ、セレクタ113によって切り替えられた通常レジスタ114の値をソフトウェアに渡す。 The microcomputer peripheral model 111 detects an interrupt and reports the interrupt to software. The software interrupt processing does not start processing until the start of the calculation cycle, and if the register value of the normal register 114 to be read is updated, the value of the normal register 114 is held in the capture register 112 when an interrupt occurs, and the select signal The value of the capture register 112 switched by the selector 113 at the rising edge of is passed to the software. When the interrupt ends, the select signal falls and the selector 113 selects reading from the normal register 114 . If it is not an interrupt report, the value of the normal register 114 switched by the selector 113 is passed to the software.

図8は、高速応答レジスタ102の動作を示すタイムチャートである。 8 is a time chart showing the operation of the high-speed response register 102. FIG.

高速応答レジスタ102は、ソフトウェアシミュレータ100内に実装され、ソフトウェアシミュレータの処理中に動作する。1計算周期中に実行する検証対象ソフトウェア101が、あるレジスタをアクセスすることによって、別レジスタ値を更新し、かつ更新された別レジスタを参照する場合がある。実際のマイコンでは、別レジスタ値の更新をマイコンペリフェラルのロジックで処理するが、ソフトウェアシミュレータは1計算周期中に外部との通信ができないので、ソフトウェアシミュレータの中で処理しなければならない。高速応答レジスタ102は、1計算処理期間中にマイコンのペリフェラルのロジック処理を模擬するために設けられたものである。高速応答レジスタ102の動作を、割り込みステータスのチェック、割り込みクリア処理を例にして説明する。計算周期実行前に割り込み信号による割り込みを検出した場合、割り込みステータスの当該bitを高速応答レジスタ102にセットした後、計算周期実行処理の先頭でソフトウェア割り込みを実行する。割り込み処理中に高速応答レジスタ102の割り込みステータスを読み出し、その後、割り込み要因クリアレジスタに割り込みクリアのための値を書き込む。実際のマイコンのペリフェラルでは、この書き込みから割り込みステータスをクリアするが、代わりに、ソフトウェアシミュレータで検証対象ソフトウェア101の実行途中に挿入されたクリア関数によって、割り込みステータスレジスタの当該ビットをクリアする。また、外部のソフトウェアデバッガが割り込みステータスクリアへの書き込みを監視し、割り込みステータスクリアへの書き込みが検出されると、割り込みステータスをクリアしてもよい。その後、検証対象ソフトウェア101は、割り込みステータスレジスタを読み出すと、クリアされた値を取得できる。これにより、ソフトウェアシミュレータ100内でレジスタアクセスを完結できる。 The fast response register 102 is implemented within the software simulator 100 and operates during processing of the software simulator. The software to be verified 101 executed during one calculation cycle may access a certain register to update the value of another register and refer to the updated another register. In an actual microcomputer, the update of another register value is processed by microcomputer peripheral logic, but since the software simulator cannot communicate with the outside during one calculation cycle, it must be processed within the software simulator. The high-speed response register 102 is provided to simulate peripheral logic processing of the microcomputer during one calculation processing period. The operation of the high-speed response register 102 will be described by taking interrupt status check and interrupt clear processing as examples. When an interrupt due to an interrupt signal is detected before execution of a calculation cycle, the corresponding bit of the interrupt status is set in the high-speed response register 102, and then a software interrupt is executed at the beginning of the calculation cycle execution process. During interrupt processing, the interrupt status of the high-speed response register 102 is read, and then a value for interrupt clear is written in the interrupt factor clear register. In the actual microcomputer peripheral, the interrupt status is cleared by this writing, but instead, the relevant bit of the interrupt status register is cleared by a clear function inserted during execution of the verification target software 101 in the software simulator. Alternatively, an external software debugger may monitor a write to the interrupt status clear and clear the interrupt status when a write to the interrupt status clear is detected. After that, the verification target software 101 can obtain the cleared value by reading the interrupt status register. Thereby, register access can be completed within the software simulator 100 .

<実施例2>
次に、本発明の実施例2を説明する。実施例2では、図9に示すように、プラントシミュレータ120からマイコンペリフェラルモデル111を分離し、プラントシミュレータ120と別にマイコンペリフェラルシミュレータ110を設けた。実施例2では実施例1との相違点を主に説明し、実施例1と同じ構成及び処理の説明は省略する。
<Example 2>
Next, Example 2 of the present invention will be described. In Example 2, as shown in FIG. 9 , the microcomputer peripheral model 111 is separated from the plant simulator 120 and the microcomputer peripheral simulator 110 is provided separately from the plant simulator 120 . In the second embodiment, differences from the first embodiment will be mainly described, and descriptions of the same configurations and processes as in the first embodiment will be omitted.

実施例2では、プラントモデル121とマイコンペリフェラルモデル111を別のシミュレータとしたので、既存のモデルを活用したシミュレーション環境を構築でき、ソフトウェアシミュレータ100とプラントシミュレータ120の協調シミュレーションが可能となる。 In the second embodiment, since the plant model 121 and the microcomputer peripheral model 111 are separate simulators, a simulation environment utilizing existing models can be constructed, and co-simulation of the software simulator 100 and the plant simulator 120 becomes possible.

以上に説明したように、本発明の実施例のシミュレーション装置は、マイコンで実行されるソフトウェアの動作を模擬する第1のシミュレータ(ソフトウェアシミュレータ100)と、ソフトウェアシミュレータ100と計算周期が異なる第2のシミュレータ(マイコンペリフェラルシミュレータ110、プラントシミュレータ120)とを備え、マイコンペリフェラルシミュレータ110には、マイコンの検証対象となる周辺機器の動作を示すマイコンペリフェラルモデル111が配置され、ソフトウェアシミュレータ100は、マイコンペリフェラルモデル110からの読み取り対象となるレジスタ値を、ソフトウェアシミュレータ100の計算周期中に読み出し可能な第1のレジスタ(高速応答レジスタ102)を有し、高速応答レジスタ102は、ソフトウェアシミュレータ100の計算の1周期中に高速応答レジスタ102の特定の値(割り込みステータス)の読み出しと書き換えを可能としたので、SILS環境へのマイコンペリフェラルモデル111の追加によって、ソフトウェア検証領域が拡大するとともに、シミュレーション速度の低下を抑制できる。すなわち、計算周期を変えなくてもよいのでソフトウェアシミュレータ100の計算負荷が増大せず、計算負荷が大きいマイコンペリフェラルモデル111のシミュレートを局所化することで、計算負荷の上昇を抑制できる。 As described above, the simulation apparatus according to the embodiment of the present invention includes a first simulator (software simulator 100) that simulates the operation of software executed by a microcomputer, and a second simulator (software simulator 100) that has a calculation cycle different from that of the software simulator 100. simulators (a microcomputer peripheral simulator 110 and a plant simulator 120), in which a microcomputer peripheral model 111 representing the operation of a peripheral device to be verified by the microcomputer is arranged; 110 has a first register (high-speed response register 102) capable of reading a register value to be read from the software simulator 100 during one calculation cycle of the software simulator 100. Since it is possible to read and rewrite a specific value (interrupt status) of the high-speed response register 102 in the SILS environment, the addition of the microcomputer peripheral model 111 to the SILS environment expands the software verification area and suppresses the decrease in simulation speed. can. That is, since the calculation cycle does not have to be changed, the calculation load on the software simulator 100 does not increase, and by localizing the simulation of the microcomputer peripheral model 111 with a large calculation load, an increase in the calculation load can be suppressed.

また、キャプチャーレジスタ112に書き込むことによって、高速応答レジスタ102の値を書き換えられる高速応答レジスタ102を、ソフトウェアシミュレータ100側に設けたので、次の周期でレジス達を読み出して期待値が返ってこないことによるエラーの発生を防止できる。 In addition, since the high-speed response register 102 that can rewrite the value of the high-speed response register 102 by writing to the capture register 112 is provided on the software simulator 100 side, the expected value will not be returned when the registers are read in the next cycle. It is possible to prevent the occurrence of errors due to

また、マイコンペリフェラルモデル111は、割り込み処理の際、当該割り込み処理の指示時のレジスタ値を、キャプチャーレジスタ112からソフトウェアシミュレータ100に出力するので、同期周期の短縮による速度低下を抑制できる。 In addition, the microcomputer peripheral model 111 outputs the register value at the time of interrupt processing instruction from the capture register 112 to the software simulator 100 during interrupt processing, so that speed reduction due to shortening of the synchronization cycle can be suppressed.

また、マイコンペリフェラルモデル111は、ソフトウェアシミュレータ100への割り込み指示時のレジスタ値を保持するキャプチャーレジスタ112と、割り込み処理の際、キャプチャーレジスタ112に保持されたレジスタ値を選択してソフトウェアシミュレータ100に出力するセレクタ113とを有するので、ソフトウェアの動作タイミングとは別に細かいタイミングでの同期を不要にでき、同期タイミングを任意に設定できる。 In addition, the microcomputer peripheral model 111 selects a capture register 112 that holds a register value when an interrupt instruction is given to the software simulator 100, and selects a register value held in the capture register 112 during interrupt processing and outputs it to the software simulator 100. Since the selector 113 is provided, it is possible to eliminate the need for synchronization at fine timings separate from the operation timings of the software, and to arbitrarily set the synchronization timings.

なお、本発明は前述した実施例に限定されるものではなく、添付した特許請求の範囲の趣旨内における様々な変形例及び同等の構成が含まれる。例えば、前述した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに本発明は限定されない。また、ある実施例の構成の一部を他の実施例の構成に置き換えてもよい。また、ある実施例の構成に他の実施例の構成を加えてもよい。また、各実施例の構成の一部について、他の構成の追加・削除・置換をしてもよい。 It should be noted that the present invention is not limited to the embodiments described above, but includes various modifications and equivalent configurations within the scope of the appended claims. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and the present invention is not necessarily limited to those having all the described configurations. Also, part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Moreover, the configuration of another embodiment may be added to the configuration of one embodiment. Further, additions, deletions, and replacements of other configurations may be made for a part of the configuration of each embodiment.

また、前述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等により、ハードウェアで実現してもよく、プロセッサがそれぞれの機能を実現するプログラムを解釈し実行することにより、ソフトウェアで実現してもよい。 In addition, each configuration, function, processing unit, processing means, etc. described above may be realized by hardware, for example, by designing a part or all of them with an integrated circuit, and the processor realizes each function. It may be realized by software by interpreting and executing a program to execute.

各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリ、ハードディスク、SSD(Solid State Drive)等の記憶装置、又は、ICカード、SDカード、DVD等の記録媒体に格納することができる。 Information such as programs, tables, and files that implement each function can be stored in storage devices such as memories, hard disks, SSDs (Solid State Drives), or recording media such as IC cards, SD cards, and DVDs.

また、制御線や情報線は説明上必要と考えられるものを示しており、実装上必要な全ての制御線や情報線を示しているとは限らない。実際には、ほとんど全ての構成が相互に接続されていると考えてよい。 In addition, the control lines and information lines indicate those considered necessary for explanation, and do not necessarily indicate all the control lines and information lines necessary for mounting. In practice, it can be considered that almost all configurations are interconnected.

100:ソフトウェアシミュレータ
101:検証対象ソフトウェア
102:高速応答レジスタ
110:マイコンペリフェラルシミュレータ
111:マイコンペリフェラルモデル
112:キャプチャーレジスタ
113:セレクタ
114:通常レジスタ
120:プラントシミュレータ
121:プラントモデル
320:ソフトウェアシミュレート処理
330:モデルシミュレート処理
340:割り込みイベント
510:CPUコア
511:マイコンペリフェラル
512:内部バス
100: software simulator 101: verification target software 102: high-speed response register 110: microcomputer peripheral simulator 111: microcomputer peripheral model 112: capture register 113: selector 114: normal register 120: plant simulator 121: plant model 320: software simulation processing 330 : Model simulation processing 340: Interrupt event 510: CPU core 511: Microcomputer peripheral 512: Internal bus

Claims (6)

シミュレーション装置であって、
マイコンで実行されるソフトウェアの動作を模擬する第1のシミュレータと、前記第1のシミュレータと計算周期が異なる第2のシミュレータとを備え、
前記第2のシミュレータには、前記マイコンの検証対象となる周辺機器の動作を示すマイコンペリフェラルモデルが配置され、
前記第1のシミュレータは、前記マイコンペリフェラルモデルからの読み取り対象となるレジスタ値を、前記第1のシミュレータの計算周期中に読み出し可能な第1のレジスタを有し、
前記第1のレジスタは、前記第1のシミュレータの計算の1周期中に特定の値の読み出しと書き換えが可能であることを特徴とするシミュレーション装置。
A simulation device,
A first simulator that simulates the operation of software executed by a microcomputer, and a second simulator that has a calculation cycle different from that of the first simulator,
A microcomputer peripheral model indicating the operation of a peripheral device to be verified by the microcomputer is arranged in the second simulator,
The first simulator has a first register capable of reading a register value to be read from the microcomputer peripheral model during a calculation period of the first simulator,
The simulation apparatus, wherein the first register is capable of reading and rewriting a specific value during one cycle of calculation of the first simulator.
請求項1に記載のシミュレーション装置であって、
前記マイコンペリフェラルモデルは、割り込み処理の際、当該割り込み処理の指示時のレジスタ値を前記第1のシミュレータに出力することを特徴とするシミュレーション装置。
The simulation device according to claim 1,
The simulation apparatus, wherein the microcomputer peripheral model outputs a register value at the time of instructing the interrupt processing to the first simulator during interrupt processing.
請求項1に記載のシミュレーション装置であって、
前記マイコンペリフェラルモデルは、
前記第1のシミュレータへの割り込み指示時のレジスタ値を保持する第2のレジスタと、
割り込み処理の際、前記第2のレジスタに保持された前記レジスタ値を選択して前記第1のシミュレータに出力する選択部とを有することを特徴とするシミュレーション装置。
The simulation device according to claim 1,
The microcomputer peripheral model is
a second register holding a register value at the time of an interrupt instruction to the first simulator;
and a selection unit that selects the register value held in the second register and outputs the register value to the first simulator during interrupt processing.
請求項1から3のいずれか一つに記載のシミュレーション装置であって、
前記第2のシミュレータは、前記マイコンペリフェラルモデル、及びプラントモデルを有することを特徴とするシミュレーション装置。
The simulation device according to any one of claims 1 to 3,
The simulation device, wherein the second simulator has the microcomputer peripheral model and the plant model.
請求項1から3のいずれか一つに記載のシミュレーション装置であって、
前記第2のシミュレータは、プラントモデルが設けられるシミュレータと別に設けられることを特徴とするシミュレーション装置。
The simulation device according to any one of claims 1 to 3,
A simulation apparatus, wherein the second simulator is provided separately from a simulator in which the plant model is provided.
シミュレーション装置によるシミュレーション方法であって、
前記シミュレーション装置は、マイコンで実行されるソフトウェアの動作を模擬する第1のシミュレータと、前記第1のシミュレータと計算周期が異なる第2のシミュレータとを有し、
前記マイコンの検証対象となる周辺機器の動作を示すマイコンペリフェラルモデルを、前記第1のシミュレータとは別に配置し、
前記第1のシミュレータは、前記マイコンペリフェラルモデルからの読み取り対象となる第1のレジスタ値を、前記第1のシミュレータの計算周期中に読み出し可能な応答レジスタと、前記マイコンペリフェラルモデルからの書き込み対象となる第2のレジスタとを有し、
前記シミュレーション方法は、
前記第1のシミュレータが、前記マイコンペリフェラルモデルからの読み取り対象となる第1のレジスタの値を、前記第1のシミュレータの計算周期中に前記応答レジスタから読み出し、
前記第1のシミュレータが、前記第1のシミュレータの計算の1周期中に前記第1のレジスタの特定の値の読み出しと書き換えが可能であることを特徴とするシミュレーション方法。
A simulation method by a simulation device,
The simulation device has a first simulator that simulates the operation of software executed by a microcomputer, and a second simulator that has a calculation cycle different from that of the first simulator,
arranging a microcomputer peripheral model indicating the operation of a peripheral device to be verified by the microcomputer separately from the first simulator;
The first simulator stores a first register value to be read from the microcomputer peripheral model as a response register that can be read during a calculation cycle of the first simulator and a write target from the microcomputer peripheral model. and a second register of
The simulation method is
the first simulator reads a value of a first register to be read from the microcomputer peripheral model from the response register during a calculation period of the first simulator;
A simulation method, wherein the first simulator is capable of reading and rewriting a specific value of the first register during one cycle of calculation of the first simulator.
JP2021138590A 2021-08-27 2021-08-27 Simulation device and simulation method Pending JP2023032451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021138590A JP2023032451A (en) 2021-08-27 2021-08-27 Simulation device and simulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021138590A JP2023032451A (en) 2021-08-27 2021-08-27 Simulation device and simulation method

Publications (1)

Publication Number Publication Date
JP2023032451A true JP2023032451A (en) 2023-03-09

Family

ID=85415566

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021138590A Pending JP2023032451A (en) 2021-08-27 2021-08-27 Simulation device and simulation method

Country Status (1)

Country Link
JP (1) JP2023032451A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102586821B1 (en) * 2023-07-04 2023-10-11 주식회사 드림에이스 System and method for verifying operation according to autosar platfrorm i/o in virtual ecu environment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102586821B1 (en) * 2023-07-04 2023-10-11 주식회사 드림에이스 System and method for verifying operation according to autosar platfrorm i/o in virtual ecu environment

Similar Documents

Publication Publication Date Title
US7246052B2 (en) Bus master and bus slave simulation using function manager and thread manager
US7036114B2 (en) Method and apparatus for cycle-based computation
US8725485B2 (en) Simulation method and simulation apparatus
US9262322B2 (en) Method and apparatus for storing a processor architectural state in cache memory
EP1797512B1 (en) Accelerated hardware emulation environment for processor-based systems
JP4799444B2 (en) Simulation system
US8898051B2 (en) System and method for implementing a trace interface
US20100302882A1 (en) Random Access Memory for Use in an Emulation Environment
Zuolo et al. SSDExplorer: A virtual platform for performance/reliability-oriented fine-grained design space exploration of solid state drives
US6810373B1 (en) Method and apparatus for modeling using a hardware-software co-verification environment
US7895027B2 (en) HDL re-simulation from checkpoints
JP2023032451A (en) Simulation device and simulation method
JP2008282308A (en) Cooperation verification device, cooperation verification method, and cooperation verification program
US10430215B1 (en) Method and system to transfer data between hardware emulator and host workstation
JP2007310565A (en) System lsi verification device and system lsi verification program
US20140181491A1 (en) Field-programmable module for interface bridging and input/output expansion
US7228513B2 (en) Circuit operation verification device and method
US8886512B2 (en) Simulation apparatus, computer-readable recording medium, and method
US20110307239A1 (en) Hardware Emulation Proxy for Hardware Software Co-Emulation
US11537769B2 (en) Simulator and simulation method
JP2012155519A (en) Simulation device, simulation method and computer program thereof
US9898563B2 (en) Modeling memory in emulation based on cache
US8914274B1 (en) Method and system for instruction set simulation with concurrent attachment of multiple debuggers
JP2004310568A (en) Simulator device, simulation method and performance analysis method
JP2011081560A (en) System level simulation method and device