[go: up one dir, main page]

JP2006023852A - Method for creating software validation model - Google Patents

Method for creating software validation model Download PDF

Info

Publication number
JP2006023852A
JP2006023852A JP2004199716A JP2004199716A JP2006023852A JP 2006023852 A JP2006023852 A JP 2006023852A JP 2004199716 A JP2004199716 A JP 2004199716A JP 2004199716 A JP2004199716 A JP 2004199716A JP 2006023852 A JP2006023852 A JP 2006023852A
Authority
JP
Japan
Prior art keywords
instruction
data
cache memory
address conversion
cache
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
Application number
JP2004199716A
Other languages
Japanese (ja)
Other versions
JP4342392B2 (en
Inventor
Noriyoshi Ito
徳義 伊藤
Takao Niiya
隆夫 新舎
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.)
Semiconductor Technology Academic Research Center
Original Assignee
Semiconductor Technology Academic Research Center
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 Semiconductor Technology Academic Research Center filed Critical Semiconductor Technology Academic Research Center
Priority to JP2004199716A priority Critical patent/JP4342392B2/en
Publication of JP2006023852A publication Critical patent/JP2006023852A/en
Application granted granted Critical
Publication of JP4342392B2 publication Critical patent/JP4342392B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To increase simulation accuracy by taking cache errors with a cache memory or the like into account, relating to a method for creating the software validation model required to perform the co-validation of hardware and software installed in a semiconductor device. <P>SOLUTION: A runtime insert statement whose parameter is a runtime calculated between control points of a Basic Block is added. A call for a procedure to determine whether or not an instruction cache memory has been hit is inserted and an instruction tag memory part in the instruction cache memory determines whether or not the instruction cache memory has been hit. Upon the detection of a cache error, a procedure with the function of identifying an instruction cache hit by adding the time of a cache line fill is provided. Upon the execution of a procedure for invalidating an instruction cache, an entry in the instruction tag memory part is invalidated. A software component described in a C-based language and obtained through the series of processes mentioned above is outputted as a validation model. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、キャッシュメモリを有するホストCPU(中央処理装置:Central Processing Unit )を使用して、キャッシュメモリの動作を考慮しながら、半導体装置に搭載されるハードウェア及びソフトウェアの協調検証(Co-verification )を実行する際に必要となるソフトウェアの検証モデルを生成するためのソフトウェア検証モデル生成方法に関する。
ここで、キャッシュメモリとは、ホストCPUと主記憶装置(メインメモリ)との間で、ホストCPUが頻繁に読み書きするデータの転送を高速にて行う目的で当該データをため込むためのメモリを指している。
The present invention uses a host CPU (Central Processing Unit) having a cache memory, and considers the operation of the cache memory while cooperating with hardware and software installed in a semiconductor device (Co-verification). The present invention relates to a software verification model generation method for generating a software verification model necessary for executing (1).
Here, the cache memory refers to a memory for storing data for the purpose of performing high-speed transfer of data frequently read and written by the host CPU between the host CPU and the main storage device (main memory). Yes.

近年、SoCを搭載した機器が広く普及してきている。SoCとは、System on a Chipの略で、コンピュータの主要機能を一つのチップ(半導体装置)に詰め込む技術、あるいは、当該技術によりコンピュータの主要機能を搭載したチップを指している。   In recent years, devices equipped with SoC have become widespread. SoC is an abbreviation for System on a Chip, and refers to a technology that packs the main functions of a computer into a single chip (semiconductor device), or a chip in which the main functions of a computer are mounted using the technology.

図1は、かかるSoCの上流設計フローを示す図である。同図に示されるように、システム・レベルの設計が完了した後、アーキテクチャ・レベルの設計に移行する。アーキテクチャ・レベルの設計では、CPU、RTOS(Real-Time Operating System)に代表されるOS(Operating System)、バス(Bus )等の基本部品の選択、アプリケーションのハードウェア及びソフトウェアへの機能分割、並びにハードウェア設計及びソフトウェア設計が行われる。そして、アーキテクチャ・レベルの設計により得られた基本部品、ハードウェア部品及びソフトウェア部品に対し、それらの検証モデルに基づくハードウェア/ソフトウェア協調検証が実行される。   FIG. 1 is a diagram showing an upstream design flow of such SoC. As shown in the figure, after the system level design is completed, the process moves to the architecture level design. In the architecture level design, the selection of basic components such as CPU, OS (Operating System) represented by RTOS (Real-Time Operating System), bus (Bus), etc., division of functions into application hardware and software, and Hardware design and software design are performed. Then, hardware / software co-verification based on the verification model is executed on the basic components, hardware components, and software components obtained by the architecture level design.

ここで、RTOSとは、各種の処理をリアルタイムにて実行することを重視し、このための機能を実装したOSを指している。携帯電話、ディジタル・テレビ等のディジタル機器を制御するコンピュータ等では、応答時間が一定の範囲内にあることが要求されるため、上記のRTOSに対してもリアルタイム性を実現するための様々な機能が必要とされる。   Here, the RTOS refers to an OS that implements various functions in real time and has a function for this purpose. Computers that control digital devices such as mobile phones and digital televisions require response time to be within a certain range, so various functions for realizing real-time performance for the above RTOS Is needed.

図2は、従来のハードウェア/ソフトウェア協調検証方法を説明するためのデータ流れ図であり、図3は、従来のハードウェア/ソフトウェア協調検証方法によるタイミングバジェット処理追加の様子を説明するための模式図である。
一般に、半導体装置に搭載されるハードウェア及びソフトウェアで高性能の協調シミュレーションを実現するためには、基本部品、ハードウェア部品及びソフトウェア部品をモデル化することによって検証モデルを作成することが必要である。
FIG. 2 is a data flow diagram for explaining a conventional hardware / software co-verification method, and FIG. 3 is a schematic diagram for explaining a state of adding timing budget processing by the conventional hardware / software co-verification method. It is.
In general, in order to realize high-performance co-simulation with hardware and software mounted on a semiconductor device, it is necessary to create a verification model by modeling basic components, hardware components, and software components. .

図2に示すように、ソフトウェア部品のRTOSは通常、ANSI−C及びアセンブリ言語で記述されている。このANSI−C及びアセンブリ言語で記述されたRTOSのソースコードに基づいて、タスク制御及びデータアクセス制御を実行するためのモデル化やタスク切替えを実行するためのモデル化が、人手により行われ、実行時間追加前のCベース言語で記述された検証モデル(すなわち、Cベース・モデル)が作成される。その後、この実行時間追加前の検証モデルにタイミングバジェット(Timing Budget)が追加され、実行時間追加後のCベース言語で記述された検証モデル(すなわち、Cベース・モデル)が生成される。なお、本明細書において、「Cベース言語」とは、ANSI−C/C++の各種拡張言語、SpecC、SystemCのいずれかの言語を意味する。   As shown in FIG. 2, the software component RTOS is usually written in ANSI-C and assembly language. Based on the RTOS source code described in ANSI-C and assembly language, modeling for executing task control and data access control and modeling for executing task switching are performed manually and executed. A verification model (that is, a C base model) described in the C base language before the time is added is created. Thereafter, a timing budget is added to the verification model before the execution time is added, and a verification model (that is, a C base model) described in the C base language after the execution time is added is generated. In this specification, the “C base language” means any one of ANSI-C / C ++ extended languages, SpecC, and SystemC.

又一方で、ソフトウェア部品のアプリケーション・ソフトウェアは通常、ANSI−Cで記述されている。ただし、アプリケーション・ソフトウェアの中の割込みハンドラ及びデバイス・ドライバ等においては、それらの設計論理にANSI−Cによる記述に加えてアセンブリ言語による記述が含まれることもある。このANSI−Cのみ、又は、ANSI−C及びアセンブリ言語で記述されたアプリケーション・ソフトウェアのソースコードに基づいて、タスク制御及びデータアクセス制御を実行するためのモデル化やタスク切替えを実行するためのモデル化が、人手により行われ、実行時間追加前のCベース言語で記述された検証モデル(すなわち、Cベース・モデル)が作成される。その後、この実行時間追加前の検証モデルにタイミングバジェット(Timing Budget)が追加され、実行時間追加後のCベース言語で記述された検証モデル(すなわち、Cベース・モデル)が生成される。   On the other hand, software / application software is usually written in ANSI-C. However, in the interrupt handler and device driver in the application software, their design logic may include a description in assembly language in addition to the description in ANSI-C. Model for executing task control and data access control and task switching based on the ANSI-C alone or the source code of application software written in ANSI-C and assembly language The verification model (ie, the C base model) described in the C base language before the execution time is added is created. Thereafter, a timing budget is added to the verification model before the execution time is added, and a verification model (that is, a C base model) described in the C base language after the execution time is added is generated.

又一方で、ハードウェア部品に関しては、Cベース言語で記述された検証モデル(すなわち、Cベース・モデル)が作成される。このCベース・モデルは、ビヘイビア(Behavior)記述又はRTL(Register Transfer Level )記述による検証モデルである。なお、ビヘイビア記述とは、回路のふるまいを記述したものであり、一方、RTL記述とは、レジスタの値が遷移していく様子を記述したものである。   On the other hand, for hardware parts, a verification model (ie, a C base model) written in a C base language is created. This C-based model is a verification model based on a behavior description or an RTL (Register Transfer Level) description. The behavioral description describes the behavior of the circuit, while the RTL description describes how the register values transition.

さらに、ハードウェア部品の検証モデルの作成方法について説明する。基本部品に関しては、CPU及びCPU専用の検証モデルは作成されず、ISS(Instruction Set Simulator)における割込み処理部を独立させたIRS(Interrupt Routine Scheduler)が、RTOSの検証モデルの一部として新たに導入される。このIRSはCベース言語で記述される。又、バスの検証モデルは、Cベース言語で新規に作成される。   Furthermore, a method for creating a hardware component verification model will be described. For basic components, the CPU and CPU-specific verification model are not created, and the IRS (Interrupt Routine Scheduler), which makes the interrupt processing unit independent in the ISS (Instruction Set Simulator), newly introduced as part of the RTOS verification model Is done. This IRS is written in a C-based language. A bus verification model is newly created in a C-based language.

又、Cベース言語を用いて論理設計されたビヘイビア(Behavior)記述のハードウェア部品は、動作合成ツールの拡張機能を利用して、Cベース言語記述から Fixed I/O Behavior モデルへと自動的に変換されることにより、その検証モデル(Cベース・モデル)が生成される。このFixed I/O Behavior モデル は、Basic Block を利用したハードウェア・モデルと同等のものである。   Also, behavior description hardware components logically designed using C-based language are automatically converted from C-based language description to Fixed I / O Behavior model by using the extension function of behavioral synthesis tool. The verification model (C base model) is generated by the conversion. This Fixed I / O Behavior model is equivalent to the hardware model using Basic Block.

又、Verilog/VHDL を用いて論理設計されたRTL((Register Transfer Level)記述のハードウェア部品は、HDL Import(CoWare社製ツール)等を利用して、RTL記述からRTL−Cベース言語モデルへと自動的に変換されることにより、その検証モデル(Cベース・モデル)が生成される。このRTL−Cベース言語モデルは、FSM(有限状態機械:Finite State Machine)の1ステートが1クロックの動作を表現するものである。   Also, RTL (Register Transfer Level) description hardware parts logically designed using Verilog / VHDL are converted from RTL description to RTL-C base language model using HDL Import (CoWare tool). The verification model (C-based model) is generated by automatically converting the RTL-C-based language model in which one state of FSM (Finite State Machine) is one clock. It represents an action.

以上のようなCベース・モデルからなる検証モデル(基本部品、ハードウェア部品及びソフトウェア部品)にシミュレーション全体の動作を制御するCベース・シミュレータを加えることで、図2に示すような従来のハードウェア/ソフトウェア協調検証方法を実行するための協調検証システム(ソフトウェア構成)が構成される。   The conventional hardware as shown in FIG. 2 is added to the verification model (basic parts, hardware parts, and software parts) composed of the C base model as described above by adding a C base simulator that controls the operation of the entire simulation. / A collaborative verification system (software configuration) for executing the software collaborative verification method is configured.

図2のバジェット追加部(バジェット追加ツールとも呼ばれる)では、ソフトウェア部品の検証モデルを生成する場合、実行時間追加前のCベース・モデルの中からANSI−C記述のみによるソースコードの部分(Cコードの部分と呼ばれる)を取り出し、図3に示すようなタイミングバジェット(Timing Budget)追加処理を行っている。このタイミングバジェット(Timing Budget)追加処理は、以下のような順序で行われる(例えば、先行技術文献(後述の特許文献1)の特願平2003−024706号(平成15年1月31日出願)参照)。   In the budget addition unit (also referred to as a budget addition tool) in FIG. 2, when generating a verification model of a software component, a source code part (C code) only from the ANSI-C description from the C base model before the execution time is added. The timing budget (Timing Budget) addition process as shown in FIG. 3 is performed. This timing budget addition processing is performed in the following order (for example, Japanese Patent Application No. 2003-024706 (filed on January 31, 2003) in the prior art document (Patent Document 1 described later)). reference).

まず第1に、実行時間追加前のCベース・モデルの中から取り出したCコードの部分に対して、Basic Block (基本ブロック)を認識し、制御点を挿入することにより、制御点が挿入されたCコードを出力する。このBasic Blockは、RTOS及びアプリケーション・ソフトウェアのプログラムが分岐することなしに逐次的に走行する部分を指すものである。そして、その認識された Basic Block の前後に制御点が挿入される。   First, the control point is inserted by recognizing the basic block and inserting the control point for the part of the C code extracted from the C base model before the execution time is added. Output C code. This Basic Block indicates a portion where RTOS and application software programs run sequentially without branching. Then, control points are inserted before and after the recognized basic block.

より詳しく説明すると、図3の(A)に示されるCコードの部分に対しては、ノードa及びノードbが一つの Basic Block と認識され、ノードc、ノードd及びノードeが一つの Basic Block と認識され、ノードc及びノードfが一つの Basic Block と認識され、ノードgが一つの Basic Block と認識される。このため、図3の(B)に示されるように、ノードbとノードcとの間、ノードeとノードgとの間、ノードfとノードgとの間、及びノードgの後に、それぞれ制御点が挿入される。   More specifically, for the C code portion shown in FIG. 3A, node a and node b are recognized as one basic block, and node c, node d and node e are one basic block. Node c and node f are recognized as one basic block, and node g is recognized as one basic block. Therefore, as shown in FIG. 3B, control is performed between the node b and the node c, between the node e and the node g, between the node f and the node g, and after the node g, respectively. A point is inserted.

第2に、上記の制御点が挿入されたCコードの部分をコンパイルすることにより、ターゲットCPU用バイナリ・コードを生成する。なお、本明細書において、「ターゲットCPU」とは、検証対象のSoC等の半導体装置に搭載されているCPU(例えば、ARMプロセッサ又はSHプロセッサ)を意味する。   Secondly, the target CPU binary code is generated by compiling the C code portion in which the control points are inserted. In this specification, the “target CPU” means a CPU (for example, an ARM processor or an SH processor) mounted on a semiconductor device such as an SoC to be verified.

第3に、前述のようなコンパイルを行った結果、生成されたターゲットCPU用バイナリ・コード(命令コード)に基づいて、各々の制御点間の実行時間を算出する。その算出は、
kΣ[各命令のサイクル数]
なる演算式に基づいて行われる。ここで、係数kは、キャッシュメモリのミスヒット(キャッシュミスとも呼ばれる:キャッシュメモリ内に所望のデータが存在しないこと)に起因するオーバヘッド係数である。ここでは、キャッシュメモリに関するモデルを設けていないので、統計的処理による実行時間の補正を可能とするために、上記のようなオーバヘッド係数が導入されている。
Third, as a result of the above-described compilation, the execution time between the control points is calculated based on the generated target CPU binary code (instruction code). The calculation is
kΣ [number of cycles for each instruction]
It is performed based on the following arithmetic expression. Here, the coefficient k is an overhead coefficient caused by a cache memory miss (also called a cache miss: that there is no desired data in the cache memory). Here, since a model relating to the cache memory is not provided, the overhead coefficient as described above is introduced in order to enable correction of execution time by statistical processing.

第4に、制御点が挿入されたCコードの部分の各々の制御点へ、算出された実行時間であるタイミングバジェットをパラメータとする実行時間挿入文(SpecCの場合は、waitfor 文である)を追加し、Cベース言語記述の検証モデル(実行時間追加後のCベース・モデル)として出力する。なお、前述の先行技術文献では、実行時間追加前のCベース・モデルを「Untimedソフトウェア部品」と称し、上記のバジェット処理追加による実行時間追加後のCベース・モデルを「Timedソフトウェア部品」と称している。   Fourthly, an execution time insertion statement (in the case of SpecC, a waitfor statement) having a timing budget as a parameter to each control point of the C code portion in which the control point is inserted is used as a parameter. It is added and output as a verification model of the C base language description (C base model after execution time is added). In the above-mentioned prior art documents, the C base model before the execution time is added is referred to as “Untimed software component”, and the C base model after the execution time is added by adding the budget process is referred to as “Timed software component”. ing.

例えば、図3の(B)に示されるノードa及びノードbの実行時間がt1と算出され、ノードc、ノードd及びノードeの実行時間がt2と算出され、ノードc及びノードfの実行時間がt3と算出され、ノードgの実行時間がt4と算出されたとする。この場合には、図3の(C)に示されるように、ノードbとノードcとの間の制御点には、実行時間挿入文として waitfor(t1) が追加される。同様に、ノードeとノードgとの間の制御点には実行時間挿入文として waitfor(t2) が追加され、ノードfとノードgとの間の制御点には実行時間挿入文として waitfor(t3) が追加され、ノードgの後の制御点には実行時間挿入文として waitfor(t4) が追加されることとなる。   For example, the execution times of the nodes a and b shown in FIG. 3B are calculated as t1, the execution times of the nodes c, d and e are calculated as t2, and the execution times of the nodes c and f are calculated. Is calculated as t3, and the execution time of the node g is calculated as t4. In this case, as shown in FIG. 3C, waitfor (t1) is added as an execution time insertion statement to the control point between the nodes b and c. Similarly, waitfor (t2) is added as an execution time insertion statement to the control point between node e and node g, and waitfor (t3) is added as an execution time insertion statement to the control point between node f and node g. ) Is added, and waitfor (t4) is added as an execution time insertion statement to the control point after node g.

図4は、このようにして作成されたCベース言語記述の検証モデルに基づくCベース・シミュレーションについて説明するための模式図である。Cベース言語記述の検証モデルをコンパイルしてホストCPU用バイナリ・コードを生成することにより、ホストCPUにおいてCベース・シミュレータを使用したCベース・シミュレーションが可能となる。ここで、「ホストCPU」とは、協調検証を実行するパーソナル・コンピュータ(PC)又はワーク・ステーション(WS)に搭載されているCPU(例えば、Pentium(登録商標)プロセッサ)を意味する。   FIG. 4 is a schematic diagram for explaining the C-based simulation based on the verification model of the C-based language description created in this way. By compiling the verification model of the C base language description and generating the binary code for the host CPU, it becomes possible to perform C base simulation using the C base simulator in the host CPU. Here, the “host CPU” means a CPU (for example, a Pentium (registered trademark) processor) mounted on a personal computer (PC) or a work station (WS) that executes cooperative verification.

換言すれば、図3及び図4に示したようなバジェット処理追加によりソフトウェア部品の検証モデルを生成する場合、Cコードの部分のBasic Block を認識して制御点を挿入し、各々の制御点間の実行時間をパラメータとする実行時間挿入文を追加して得られるCベース言語記述の検証モデルをコンパイルして生成されたホストCPU用バイナリ・コードをホストCPUで実行させるようにしている。このようなソフトウェア検証モデル生成方法では、命令コードの一命令ごとにその命令内容を解釈してシミュレーションを実行する従来のISS(Instruction Set Simulator)を利用したシミュレーションの場合に比較して、シミュレーション性能(命令数/秒)が100〜1000倍程度向上し、ハードウェア/ソフトウェア協調検証におけるシミュレーションの高速化を図ることができる。   In other words, when a software component verification model is generated by adding a budget process as shown in FIGS. 3 and 4, the control block is inserted by recognizing the basic block of the C code portion, and between each control point. The host CPU binary code generated by compiling the verification model of the C-based language description obtained by adding the execution time insertion statement with the execution time of the above as a parameter is executed on the host CPU. In such a software verification model generation method, compared with a simulation using a conventional ISS (Instruction Set Simulator) that executes a simulation by interpreting the content of each instruction code, the simulation performance ( The number of instructions / second) is improved by about 100 to 1000 times, and the simulation speed in hardware / software co-verification can be increased.

又一方で、シミュレーションの過程において、waitfor 文が出現したところで、シミュレータがその内容を解釈することにより、命令実行時間の管理が可能となるため、タイミングについてのシミュレーション精度もある程度維持することができる。すなわち、ノードbに相当する命令コードの実行後には、waitfor(t1) の命令コードを解釈することで累積処理時間T1=t1が求められる。同様に、ノードeに相当する命令コードの実行後には累積処理時間T2=t1+t2が求められる一方、ノードfに相当する命令コードの実行後には累積処理時間T2=t1+t3が求められる。   On the other hand, when a waitfor statement appears in the simulation process, the simulator interprets the content of the waitfor statement so that the instruction execution time can be managed, so that the simulation accuracy of timing can be maintained to some extent. That is, after execution of the instruction code corresponding to the node b, the accumulated processing time T1 = t1 is obtained by interpreting the instruction code of waitfor (t1). Similarly, the accumulated processing time T2 = t1 + t2 is obtained after execution of the instruction code corresponding to the node e, while the accumulated processing time T2 = t1 + t3 is obtained after execution of the instruction code corresponding to the node f.

そして、ノードgに相当する命令コードの実行後には、プログラムがノードc、ノードd及びノードe のルートを走行した場合には累積処理時間T3=t1+t2+t4が求められる一方、プログラムがノードc及びノードfのルートを走行した場合には累積処理時間T3=t1+t3+t4が求められることとなる。   Then, after execution of the instruction code corresponding to the node g, if the program runs along the route of the node c, the node d and the node e, the accumulated processing time T3 = t1 + t2 + t4 is obtained, while the program is obtained by the node c and the node f. In the case of traveling on the route, the accumulated processing time T3 = t1 + t3 + t4 is obtained.

さらに、他の先行技術文献(特許文献2)の特願平2004−107207号(平成16年3月31日出願)では、Cコードの部分のBasic Block に挿入された各々の制御点間の実行時間を算出すると共に、当該実行時間を積算して得られる積算値が指定値以上であると判定された場合にのみ、当該積算値をパラメータとするwaitfor 文をソフトウェア部品に追加するようにしている。このような方法によって、前述の特許文献1の場合に比べてwaitfor 文の追加頻度が節減され、特許文献1の場合よりもシミュレーションの実行速度が速くなってシミュレーション性能が向上する。この場合、当該積算値が指定値以上であると判定された場合に当該積算値をパラメータとするwaitfor 文を追加し、Cベース・シミュレータが当該waitfor 文を解釈して命令実行時間の管理を行うことができるので、特許文献1の場合に比べてシミュレーション精度がそれほど低下することはない。   Furthermore, in Japanese Patent Application No. 2004-107207 (filed on March 31, 2004) of another prior art document (Patent Document 2), execution between each control point inserted in the Basic Block of the C code portion A timefor is calculated and a waitfor statement with the integrated value as a parameter is added to the software component only when the integrated value obtained by integrating the execution time is determined to be greater than or equal to the specified value. . By such a method, the frequency of adding a waitfor statement is reduced as compared with the case of Patent Document 1, and the simulation execution speed is faster than that of Patent Document 1, and the simulation performance is improved. In this case, when it is determined that the integrated value is greater than or equal to the specified value, a waitfor statement using the integrated value as a parameter is added, and the C-based simulator interprets the waitfor statement and manages the instruction execution time. Therefore, compared with the case of patent document 1, simulation accuracy does not fall so much.

ここで、参考のため、図2〜図4に関連した特許文献1や、特許文献1のソフトウェア検証モデル生成方法を一部変更した方法が記載された特許文献2以外に、従来のハードウェア/ソフトウェア協調検証方法に関連した幾つかの先行技術文献を挙げておく。
ISSを使用した協調検証に関する先行技術文献としては、下記特許文献3〜5の他に、下記の非特許文献1及び2が存在する。なお、下記の非特許文献3は、前述の“Basic Block”に関するものであり、非特許文献4〜6は、前述の“Fixed I/O Behaviorモデル”に関するものであり、非特許文献7〜9は、Cベース言語の設計及び検証の技術動向に関するものである。
Here, for reference, in addition to Patent Document 1 related to FIGS. 2 to 4 and Patent Document 2 in which a method of partially modifying the software verification model generation method of Patent Document 1 is described, conventional hardware / Some prior art documents related to software co-verification methods are listed.
In addition to the following Patent Documents 3 to 5, the following Non-Patent Documents 1 and 2 exist as prior art documents related to cooperative verification using ISS. The following Non-Patent Document 3 relates to the above-mentioned “Basic Block”, and Non-Patent Documents 4 to 6 relate to the “Fixed I / O Behavior Model” described above, and Non-Patent Documents 7 to 9. Relates to technical trends in the design and verification of C-based languages.

特願2003−024706号(平成15年1月31日出願)Japanese Patent Application No. 2003-024706 (filed on January 31, 2003) 特願2004-107207号(平成16年3月31日出願)Japanese Patent Application No. 2004-107207 (filed on March 31, 2004) 特開2000−259445号公報Japanese Unexamined Patent Publication No. 2000-259445 特開2001−256072号公報Japanese Patent Laid-Open No. 2001-256072 特開2002−175344号公報JP 2002-175344 JP 若林一敏:C言語によるLSI設計−動作合成とHW/SW協調検証の実際、NE Embedded Symposium 2002.Kazutoshi Wakabayashi: LSI design using C language-behavioral synthesis and HW / SW collaborative verification, NE Embedded Symposium 2002. 黒川、池上、大坪、浅尾、桐ヶ谷、三栖、高橋、川津、新田、笠、若林、友部、高橋、向山、竹中:C言語ベースの動作合成を利用したシステムLSI設計手法の効果分析と考察、電子情報通信学会第15回軽井沢ワークショップ、pp. 131-142、Apr. 2002.Kurokawa, Ikegami, Otsubo, Asao, Kirigaya, Mitsumata, Takahashi, Kawazu, Nitta, Kasa, Wakabayashi, Tomobe, Takahashi, Mukaiyama, Takenaka: Effects analysis and discussion of system LSI design methods using C-based behavioral synthesis, IEICE 15th Karuizawa Workshop, pp. 131-142, Apr. 2002. Alfred Aho, Ravi Sethi and Jeffrey Ullman, “Compilers: Principals, Techniques and Tools”, Addison-Wesley, 1986.Alfred Aho, Ravi Sethi and Jeffrey Ullman, “Compilers: Principals, Techniques and Tools”, Addison-Wesley, 1986. D. W. Knapp, T. Ly, D. MacMillen and R. Miller, “Behavioral Synthesis Methodology for HDL-Based Specification and Validation”, Proc. Design Automation Conf., June 1995.D. W. Knapp, T. Ly, D. MacMillen and R. Miller, “Behavioral Synthesis Methodology for HDL-Based Specification and Validation”, Proc. Design Automation Conf., June 1995. T. Ly, D. W. Knapp, R. Miller and D. MacMillen, “Scheduling using Behavioral Templates”, Proc. Design Automation Conf., June 1995.T. Ly, D. W. Knapp, R. Miller and D. MacMillen, “Scheduling using Behavioral Templates”, Proc. Design Automation Conf., June 1995. D. W. Knapp, “Behavioral Synthesis: Digital System Design using the Synopsys Behavioral Compiler”, Prentice Hall PTR.D. W. Knapp, “Behavioral Synthesis: Digital System Design using the Synopsys Behavioral Compiler”, Prentice Hall PTR. L. Gauthier, S. Yoo and A. A. Jerraya, “Automatic Generation and Targeting of Application Specific Operating Systems and Embedded Systems Software”, Proc. Design Automation and Test in Europe, Mar. 2001.L. Gauthier, S. Yoo and A. A. Jerraya, “Automatic Generation and Targeting of Application Specific Operating Systems and Embedded Systems Software”, Proc. Design Automation and Test in Europe, Mar. 2001. D. Lyonnard, S. Yoo, A. Baghdadi and A. A. Jerraya, “Automatic Generation of Application-Specific Architectures for Heterogeneous Multiprocessor System-on-Chip”, Proc. Design Automation Conf., June 2001.D. Lyonnard, S. Yoo, A. Baghdadi and A. A. Jerraya, “Automatic Generation of Application-Specific Architectures for Heterogeneous Multiprocessor System-on-Chip”, Proc. Design Automation Conf., June 2001. S. Yoo, G. Nicolescu, L. Gauthier and A. A. Jerraya, “Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC”, Proc. Design Automation and Test in Europe, Mar. 2002.S. Yoo, G. Nicolescu, L. Gauthier and A. A. Jerraya, “Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC”, Proc. Design Automation and Test in Europe, Mar. 2002.

一般に、ARMプロセッサ又はSHプロセッサ等のターゲットCPUを用いた組み込みシステムにおいては、主記憶装置(メインメモリ)との命令コードやデータのアクセスを高速化するために、キャッシュメモリをホストCPU側に設けることが多い。このキャッシュメモリは、通常、ターゲットCPUに内蔵されて使用される。   In general, in an embedded system using a target CPU such as an ARM processor or an SH processor, a cache memory is provided on the host CPU side in order to speed up access to instruction codes and data with a main storage device (main memory). There are many. This cache memory is normally used by being built in the target CPU.

しかしながら、前述の特許文献1又は特許文献2等に記載されているような従来のハードウェア/ソフトウェア協調検証方法においては、ターゲットCPUにより生成された検証モデルに基づき、ホストCPUを使用してCベース・シミュレーションを実行した場合の実行時間を算出する際に、キャッシュメモリの動作の統計的処理を行うのみでキャッシュメモリのキャッシュミス等に起因する詳細な動作は考慮していなかった。このため、キャッシュメモリを内蔵したターゲットCPUの実行時間の見積りを行った場合、特にキャッシュメモリのキャッシュミス等が頻繁に発生したときは、実行時間の見積りの精度が低くなってシミュレーション精度が低下するという問題が生じてきた。   However, in the conventional hardware / software co-verification method as described in the above-mentioned Patent Document 1 or Patent Document 2, etc., based on the verification model generated by the target CPU, the C-base is used using the host CPU. When calculating the execution time when the simulation is executed, only the statistical processing of the cache memory operation is performed, and detailed operations due to cache misses of the cache memory are not considered. For this reason, when the execution time of the target CPU with the built-in cache memory is estimated, particularly when cache misses of the cache memory frequently occur, the accuracy of the estimation of the execution time is lowered and the simulation accuracy is lowered. The problem has arisen.

本発明は、上記問題点に鑑みてなされたものであり、ターゲットCPUにより生成された検証モデルに基づいてCベース・シミュレーションを実行した場合の実行時間を算出する際に、キャッシュメモリのキャッシュミス等を考慮することによって従来方法よりもシミュレーション精度を向上させることを可能にするようなソフトウェア検証モデル生成方法を提供することを目的とするものである。   The present invention has been made in view of the above-described problems. When calculating an execution time when a C-based simulation is executed based on a verification model generated by a target CPU, a cache miss of a cache memory, etc. It is an object of the present invention to provide a software verification model generation method that makes it possible to improve simulation accuracy over conventional methods by considering the above.

上記目的を達成するために、本発明の第1の態様によれば、命令キャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成する場合に、Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、当該制御点が挿入された上記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、上記Basic Block の各々について、当該Basic Block の制御点間の実行時間を算出するステップと、上記実行時間をパラメータとする実行時間挿入文を当該Basic Block の後の制御点に追加するステップと、当該Basic Block の単位で命令キャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを当該Basic Block の後の制御点に挿入するステップと、命令キャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップと、上記命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行い、当該命令キャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算する命令キャッシュヒット判定機能を有する手続きを提供するステップと、上記命令キャッシュ無効化手続きが実行されたときに、上記命令タグメモリ部のエントリを無効化するステップと、上記の一連のステップで得られたCベース言語記述のソフトウェア部品を上記検証モデルとして出力するステップとを有するソフトウェア検証モデル生成方法が提供される。ここで、キャッシュラインとは、キャッシュメモリの内容を置換する単位を示しており、通常は、32バイトや64バイト程度の固定長に設定される。キャッシュラインフィルとは、命令キャッシュライン(又はデータキャッシュライン)へのデータのロード操作を指している。   In order to achieve the above object, according to the first aspect of the present invention, hardware of a semiconductor device on which at least one target CPU and one OS are mounted using a host CPU having an instruction cache memory, and When generating a software verification model to perform software collaborative verification, input software parts of C-base language description, extract source code part by ANSI-C description, recognize Basic Block, and control A step of inserting a point, a step of generating a source CPU binary code by compiling a portion of the source code according to the ANSI-C description in which the control point is inserted, and the Basic Block A step of calculating an execution time between the control points and the execution time as a parameter A step for adding a line time insertion statement to the control point after the Basic Block and a procedure call for determining whether or not the instruction cache memory is hit in the Basic Block unit are called after the Basic Block. Inserted into the control point of the instruction, the assembler code for invalidating the instruction cache memory is converted into the source code in the ANSI-C description for calling the instruction cache invalidation procedure, and held in the instruction cache memory To determine whether or not the instruction cache memory is hit by using the instruction tag memory portion that has been executed, and to execute a cache line fill when it is detected that the instruction cache memory is not hit Providing a procedure having an instruction cache hit determination function for adding the execution time of When the instruction cache invalidation procedure is executed, the step of invalidating the entry in the instruction tag memory unit and the C-based language description software component obtained in the series of steps are output as the verification model. A method for generating a software verification model is provided. Here, the cache line indicates a unit for replacing the contents of the cache memory, and is normally set to a fixed length of about 32 bytes or 64 bytes. A cache line fill refers to an operation for loading data into an instruction cache line (or data cache line).

好ましくは、本発明の第1の態様に係るソフトウェア検証モデル生成方法は、命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファが上記ターゲットCPU内に設けられている場合に、上記Basic Block の単位で上記命令アドレスが上記命令アドレス変換用バッファ内に存在するか否かの判定を行い、上記命令アドレスが上記命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを上記命令アドレス変換用バッファにロードする時間を加算するステップをさらに有する。   Preferably, in the software verification model generation method according to the first aspect of the present invention, when an instruction address conversion buffer for converting an instruction address from a virtual address to a physical address is provided in the target CPU, It is determined whether or not the instruction address exists in the instruction address conversion buffer in units of the Basic Block, and when it is detected that the instruction address does not exist in the instruction address conversion buffer, The method further includes the step of adding a time for loading the instruction address conversion entry into the instruction address conversion buffer.

さらに、好ましくは、本発明の第1の態様に係るソフトウェア検証モデル生成方法は、上記命令アドレスの保護機能の有無をチェックし、上記命令アドレス変換用バッファにおけるアクセス保護に対する違反が検出された場合に、上記命令キャッシュメモリのアクセス保護の例外が発生したことを知らせるステップをさらに有する。   Further preferably, the software verification model generation method according to the first aspect of the present invention checks the presence / absence of a protection function of the instruction address, and detects a violation of access protection in the instruction address conversion buffer. And a step of notifying that an exception of the instruction cache memory access protection has occurred.

又一方で、本発明の第2の態様によれば、データキャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成する場合に、Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、当該制御点が挿入された上記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、上記Basic Block の各々について、当該Basic Block の制御点間の実行時間を算出するステップと、上記実行時間をパラメータとする実行時間挿入文を当該Basic Block の後の制御点に追加するステップと、上記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、データキャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを挿入するステップと、データキャッシュメモリの無効化を行うアセンブラコードを、データキャッシュ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップと、上記データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行い、当該データキャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算するデータキャッシュヒット判定機能を有する手続きを提供するステップと、上記データキャッシュ無効化手続きが実行されたときに、上記データタグメモリ部のエントリを無効化するステップと、上記の一連のステップで得られたCベース言語記述のソフトウェア部品を上記検証モデルとして出力するステップとを有するソフトウェア検証モデル生成方法が提供される。   On the other hand, according to the second aspect of the present invention, hardware verification and software verification of a semiconductor device on which at least one target CPU and one OS are mounted are performed using a host CPU having a data cache memory. When generating a software verification model, the software part of the C base language description is input, the source code part by ANSI-C description is extracted, the Basic Block is recognized, and the control point is inserted. A step of generating a binary code for a target CPU by compiling a source code portion according to the ANSI-C description in which the control point is inserted, and between each control point of the Basic Block A step of calculating the execution time of the execution time, and an execution time insertion statement using the execution time as a parameter A step for adding to the control point after the Basic Block and a procedure for determining whether or not the data cache memory is hit in a portion where data access is required in the source code according to the ANSI-C description. Stored in the data cache memory, a step of inserting an assembler code for invalidating the data cache memory, a step of converting the assembler code for invalidating the data cache memory into an ANSI-C description source code for calling the data cache invalidation procedure, To determine whether or not the data cache memory is hit by using the data tag memory unit, and when it is detected that the data cache memory is not hit, the cache line fill is executed. Data cache hit judgment function that adds execution time Providing a procedure to perform, invalidating an entry in the data tag memory unit when the data cache invalidation procedure is executed, and C-based language description software obtained in the series of steps A method for generating a software verification model is provided that includes outputting a part as the verification model.

好ましくは、本発明の第2の態様に係るソフトウェア検証モデル生成方法は、データアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファが上記ターゲットCPU内に設けられている場合に、上記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、上記データアドレスが上記データアドレス変換用バッファ内に存在するか否かの判定を行い、上記データアドレスが上記データアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリを上記データアドレス変換用バッファにロードする時間を加算するステップをさらに有する。   Preferably, in the software verification model generation method according to the second aspect of the present invention, when a data address conversion buffer for converting a data address from a virtual address to a physical address is provided in the target CPU, It is determined whether or not the data address exists in the data address conversion buffer at a portion where data access is required in the source code according to the ANSI-C description, and the data address is used for the data address conversion. The method further includes a step of adding a time for loading the data address conversion entry into the data address conversion buffer when it is detected that the buffer does not exist in the buffer.

さらに、好ましくは、本発明の第2の態様に係るソフトウェア検証モデル生成方法は、上記データアドレスの保護機能の有無をチェックし、上記データアドレス変換用バッファにおけるアクセス保護に対する違反が検出された場合に、上記データキャッシュメモリのアクセス保護の例外が発生したことを知らせるステップをさらに有する。   Further preferably, the software verification model generation method according to the second aspect of the present invention checks whether or not the data address protection function is present, and if a violation of access protection in the data address conversion buffer is detected. And a step of notifying that an access protection exception of the data cache memory has occurred.

又一方で、本発明の第3の態様によれば、命令キャッシュメモリ及びデータキャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成する場合に、Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、当該制御点が挿入された上記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、上記Basic Block の各々について、当該Basic Block の制御点間の実行時間を算出するステップと、上記実行時間をパラメータとする実行時間挿入文を当該Basic Block の後の制御点に追加するステップと、当該Basic Block の単位で命令キャッシュメモリがヒットしているか否かの判定を行うための手続き呼び出しを当該Basic Block の後の制御点に挿入するステップと、上記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、データキャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを挿入するステップと、命令キャッシュメモリ及びデータキャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュ無効化手続き及びデータキャッシュメモリ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップとを有するソフトウェア検証モデル生成方法が提供される。   On the other hand, according to the third aspect of the present invention, using a host CPU having an instruction cache memory and a data cache memory, hardware of a semiconductor device on which at least one target CPU and one OS are mounted, and When generating a software verification model to perform software collaborative verification, input software parts of C-base language description, extract source code part by ANSI-C description, recognize Basic Block, and control A step of inserting a point, a step of generating a source CPU binary code by compiling a portion of the source code according to the ANSI-C description in which the control point is inserted, and the Basic Block Calculating the execution time between the control points of the Add the execution time insertion statement for the basic block to the control point after the basic block, and call the procedure to determine whether the instruction cache memory is hit in the unit of the basic block. And a call to a procedure for determining whether or not the data cache memory is hit at a portion where data access is required in the source code according to the ANSI-C description. Inserting the assembler code for invalidating the instruction cache memory and the data cache memory into a source code according to ANSI-C description for calling the instruction cache invalidation procedure and the data cache memory invalidation procedure. A software verification model generation method is provided.

さらに、上記のソフトウェア検証モデル生成方法は、上記命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行い、当該命令キャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算する命令キャッシュヒット判定機能を有する手続きを提供するステップと、上記データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行い、当該データキャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を追加するデータキャッシュヒット判定機能を有する手続きを提供するステップと、上記命令キャッシュ無効化手続き及び上記データキャッシュメモリ無効化手続きが実行されたときに、上記命令タグメモリ部及び上記データタグメモリ部のエントリを無効化するステップと、上記の一連のステップで得られたCベース言語記述のソフトウェア部品を上記検証モデルとして出力するステップとを有する。   Further, the software verification model generation method determines whether the instruction cache memory is hit by using the instruction tag memory unit held in the instruction cache memory, and hits the instruction cache memory. Providing a procedure having an instruction cache hit determination function for adding an execution time for executing a cache line fill when it is detected that there is not, and a data tag held in the data cache memory Uses the memory unit to determine whether the data cache memory is hit, and adds execution time to execute cache line fill when it is detected that the data cache memory is not hit Provides a procedure with a data cache hit judgment function A step of invalidating entries of the instruction tag memory unit and the data tag memory unit when the instruction cache invalidation procedure and the data cache memory invalidation procedure are executed, and the series of steps described above. And outputting the C-based language description software component obtained in step 1 as the verification model.

好ましくは、本発明の第3の態様に係るソフトウェア検証モデル生成方法は、命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファが上記ターゲットCPU内に設けられている場合に、上記Basic Block の単位で上記命令アドレスが上記命令アドレス変換用バッファ内に存在するか否かの判定を行い、上記命令アドレスが上記命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを上記命令アドレス変換用バッファにロードする時間を加算するステップと、データアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファが上記ターゲットCPU内に設けられている場合に、上記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、上記データアドレスが上記データアドレス変換用バッファ内に存在するか否かの判定を行い、上記データアドレスが上記データアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリを上記データアドレス変換用バッファにロードする時間を加算するステップとをさらに有する。   Preferably, in the software verification model generation method according to the third aspect of the present invention, an instruction address conversion buffer for converting an instruction address from a virtual address to a physical address is provided in the target CPU. It is determined whether or not the instruction address exists in the instruction address conversion buffer in units of the Basic Block, and when it is detected that the instruction address does not exist in the instruction address conversion buffer, A step for adding time for loading an instruction address conversion entry into the instruction address conversion buffer and a data address conversion buffer for converting a data address from a virtual address to a physical address are provided in the target CPU. The source code according to the ANSI-C description above. When it is determined that the data address does not exist in the data address conversion buffer, it is determined whether or not the data address exists in the data address conversion buffer. And a step of adding a time for loading the data address conversion entry into the data address conversion buffer.

さらに、好ましくは、本発明の第3の態様に係るソフトウェア検証モデル生成方法は、上記命令アドレスの保護機能の有無をチェックし、上記命令アドレス変換用バッファのアクセス保護に対する違反が検出された場合に、上記命令アドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップと、上記データアドレスの保護機能の有無をチェックし、上記データアドレス変換用バッファのアクセス保護に対する違反が検出された場合に、上記データアドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップとをさらに有する。   Further preferably, the software verification model generation method according to the third aspect of the present invention checks whether or not the instruction address protection function is present, and if a violation of access protection of the instruction address conversion buffer is detected. The step of notifying that the instruction address conversion buffer access protection exception has occurred and the presence / absence of the data address protection function are checked, and when a violation of the data address conversion buffer access protection is detected. And a step of notifying that an exception of the access protection of the data address conversion buffer has occurred.

要約すれば、本発明では、第1に、Cベース言語記述のソフトウェア部品のBasic Block に挿入された各々の制御点間の実行時間を算出すると共に、Basic Block の単位で、ターゲットCPUに内蔵の命令キャッシュメモリがヒットしているか否かを判定し、キャッシュミス(命令キャッシュメモリがヒットしていないこと)が検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、上記のような命令キャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、ハードウェア及びソフトウェアの協調検証におけるシミュレーションを実行するようにしている。このように、命令キャッシュメモリがターゲットCPUに内蔵されている場合に、命令キャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間を加算することによって、従来方法よりも実行時間の見積りの精度が高くなり、シミュレーションの精度が向上する。   In summary, in the present invention, firstly, the execution time between each control point inserted in the Basic Block of the software component of the C base language description is calculated, and at the same time, it is incorporated in the target CPU in units of Basic Block. Judge whether the instruction cache memory is hit or not, and if a cache miss (no instruction cache memory hit) is detected, source the procedure call that adds the execution time for executing the cache line fill A procedure for determining the instruction cache hit as described above is prepared by being inserted into the code and compiled together with the source code so as to execute a simulation in hardware and software collaborative verification. In this way, when the instruction cache memory is built in the target CPU, the execution time for executing the cache line fill in the case of a cache miss in the instruction cache memory is added, so that the execution time is longer than the conventional method. The accuracy of estimation is increased and the accuracy of simulation is improved.

この場合、命令キャッシュメモリがヒットしているか否かの判定を命令単位ではなく、Basic Block の単位で行うので、シミュレーション全体の動作を制御するCベース・シミュレータ等における処理負荷を軽減することが可能になる。   In this case, whether or not the instruction cache memory is hit is determined not in units of instructions but in units of Basic Blocks, so it is possible to reduce the processing load in a C-based simulator or the like that controls the operation of the entire simulation. become.

さらに、本発明では、第2に、命令アドレス変換用バッファ(例えば、TLB(トランスレーション・ルックアサイド・バッファ:Translation Look-aside Buffer ))がターゲットCPU内に設けられている場合に、命令アドレス変換用バッファのミス(命令アドレスが当該命令アドレス変換用バッファ内に存在しないこと)が検出されたときに、命令アドレス変換のエントリを命令アドレス変換用バッファにロードする時間を加算するようにしている。それゆえに、命令アドレス変換用バッファのミスの際に命令アドレス変換のエントリをロードする時間を含めた高精度のシミュレーションを実行することが可能になる。   Further, according to the present invention, secondly, when an instruction address conversion buffer (for example, TLB (Translation Look-aside Buffer)) is provided in the target CPU, the instruction address conversion is performed. When a buffer buffer error (instruction address does not exist in the instruction address conversion buffer) is detected, the time for loading the instruction address conversion entry into the instruction address conversion buffer is added. Therefore, it is possible to execute a high-precision simulation including a time for loading an instruction address conversion entry when an instruction address conversion buffer is missed.

さらに、本発明では、第3に、命令アドレス変換用バッファのアクセス保護に対する違反が検出された場合に、命令アドレス変換用バッファのアクセス保護の例外が発生したことをCベース・シミュレータ等に知らせることによって、シミュレーションの実行時に命令アドレス変換用バッファのアクセス保護に対する違反を確実に検出することが可能になる。   Further, according to the present invention, thirdly, when a violation of the access protection of the instruction address conversion buffer is detected, the C base simulator or the like is notified that an access protection exception of the instruction address conversion buffer has occurred. This makes it possible to reliably detect violations of access protection of the instruction address conversion buffer during simulation.

さらに、本発明では、第4に、Cベース言語記述のソフトウェア部品のBasic Block に挿入された任意の制御点間の実行時間を算出すると共に、データのアクセスが必要な部分で、ターゲットCPUに内蔵のデータキャッシュメモリがヒットしているか否かを判定し、キャッシュミス(データキャッシュメモリがヒットしていないこと)が検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、上記のようなデータキャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、ハードウェア及びソフトウェアの協調検証におけるシミュレーションを実行するようにしている。このように、データキャッシュメモリがターゲットCPUに内蔵されている場合にも、データキャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間を加算することによって、従来方法よりも実行時間の見積りの精度が高くなり、シミュレーションの精度が向上する。   Furthermore, in the present invention, fourthly, the execution time between arbitrary control points inserted in the basic block of the software component of the C base language description is calculated, and at the part where data access is necessary, it is built in the target CPU. It is determined whether or not the data cache memory is hit, and if a cache miss (data cache memory is not hit) is detected, a procedure call is added that adds the execution time for executing the cache line fill. A procedure for inserting data cache hits as described above is prepared by being inserted into the source code, compiled together with the source code, and a simulation for hardware and software collaborative verification is executed. As described above, even when the data cache memory is built in the target CPU, the execution time for executing the cache line fill in the case of a cache miss of the data cache memory is added, so that the execution time is longer than the conventional method. The accuracy of the estimation is increased, and the accuracy of the simulation is improved.

さらに、本発明では、第5に、データアドレス変換用バッファ(例えば、TLB)がターゲットCPU内に設けられている場合に、データアドレス変換用バッファのミス(データアドレスが当該データアドレス変換用バッファ内に存在しないこと)が検出されたときに、データアドレス変換のエントリをデータアドレス変換用バッファにロードする時間を加算するようにしている。それゆえに、データアドレス変換用バッファのミスの際にデータアドレス変換のエントリをロードする時間を含めた高精度のシミュレーションを実行することが可能になる。   Furthermore, in the present invention, fifthly, when a data address conversion buffer (for example, TLB) is provided in the target CPU, a data address conversion buffer miss (data address is in the data address conversion buffer). The time for loading the data address conversion entry into the data address conversion buffer is added. Therefore, it is possible to execute a high-precision simulation including the time for loading the data address conversion entry when the data address conversion buffer is missed.

さらに、本発明では、第6に、データアドレス変換用バッファのアクセス保護に対する違反が検出された場合に、データアドレス変換用バッファのアクセス保護の例外が発生したことをCベース・シミュレータ等に知らせることによって、シミュレーションの実行時にデータアドレス変換用バッファのアクセス保護に対する違反を確実に検出することが可能になる。   Further, according to the present invention, sixthly, when a violation of access protection of the data address conversion buffer is detected, the C base simulator or the like is notified that an access protection exception of the data address conversion buffer has occurred. This makes it possible to reliably detect violations of the access protection of the data address conversion buffer during simulation.

さらに、本発明では、第7に、Cベース言語記述のソフトウェア部品のBasic Block に挿入された各々の制御点間の実行時間を算出すると共に、Basic Block の単位で、ターゲットCPUに内蔵の命令キャッシュメモリがヒットしているか否かを判定し、キャッシュミスが検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、上記のような命令キャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、又一方で、データのアクセスが必要な部分で、ターゲットCPUに内蔵のデータキャッシュメモリがヒットしているか否かを判定し、キャッシュミスが検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、上記のようなデータキャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、シミュレーションを実行するようにしている。   Further, according to the present invention, seventhly, the execution time between the control points inserted in the Basic Block of the software component of the C base language description is calculated, and the instruction cache built in the target CPU is calculated in Basic Block units. Determine whether the memory is hit, insert a procedure call that adds the execution time for executing the cache line fill when a cache miss is detected, and determine the instruction cache hit as described above Prepare the procedure to compile with the source code, and on the other hand, determine whether the data cache memory built in the target CPU is hit at the part that requires data access, and cache miss A procedure call that adds the execution time to execute the cache line fill when Insert the Sukodo, so that by providing a procedure for performing data cache hit determination as described above to compile with the source code to perform the simulation.

上記のように、命令キャッシュメモリ及びデータキャッシュメモリの両方がターゲットCPUに内蔵されている場合にも、命令キャッシュメモリのキャッシュミス、及び、データキャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間を加算することによって、従来方法よりも実行時間の見積りの精度がさらに高くなり、シミュレーションの精度が顕著に向上する。   As described above, even when both the instruction cache memory and the data cache memory are built in the target CPU, the cache line fill is executed in the case of a cache miss of the instruction cache memory and a cache miss of the data cache memory. By adding the execution time for this, the accuracy of the estimation of the execution time becomes higher than that of the conventional method, and the accuracy of the simulation is significantly improved.

さらに、本発明では、第8に、命令アドレス変換用バッファ及びデータアドレス変換用バッファがターゲットCPU内に設けられている場合に、命令アドレス変換用バッファのミスが検出されたときに、命令アドレス変換のエントリを命令アドレス変換用バッファにロードする時間を加算すると共に、データアドレス変換用バッファのミスが検出されたときに、データアドレス変換のエントリをデータアドレス変換用バッファにロードする時間を加算するようにしている。それゆえに、命令アドレス変換用バッファ及びデータアドレス変換用バッファのミスの際に命令アドレス変換のエントリ及びデータアドレス変換のエントリをロードする時間を含めたより高精度のシミュレーションを実行することが可能になる。   Further, according to the present invention, eighthly, when an instruction address conversion buffer and a data address conversion buffer are provided in the target CPU, an instruction address conversion is performed when a mistake in the instruction address conversion buffer is detected. The time to load the data address conversion buffer is added to the instruction address conversion buffer, and the time to load the data address conversion entry to the data address conversion buffer is added when a miss in the data address conversion buffer is detected. I have to. Therefore, it is possible to execute a more accurate simulation including the time to load the instruction address conversion entry and the data address conversion entry when the instruction address conversion buffer and the data address conversion buffer are missed.

さらに、本発明では、第9に、命令アドレス変換用バッファ及びデータアドレス変換用バッファのアクセス保護に対する違反が検出された場合に、命令アドレス変換用バッファ及びデータアドレス変換用バッファのアクセス保護の例外が発生したことをCベース・シミュレータ等に知らせることによって、シミュレーションの実行時に命令アドレス変換用バッファ及びデータアドレス変換用バッファのアクセス保護に対する違反をより確実に検出することが可能になる。   Furthermore, in the present invention, ninthly, when a violation of access protection of the instruction address conversion buffer and the data address conversion buffer is detected, an exception of access protection of the instruction address conversion buffer and the data address conversion buffer is detected. By notifying the C-base simulator or the like of the occurrence, it is possible to more reliably detect violations of the access protection of the instruction address conversion buffer and the data address conversion buffer when executing the simulation.

以下、添付図面を参照して本発明の実施形態について説明する。
図5は、本発明に係るソフトウェア検証モデル生成方法を実施するためのハードウェア環境を例示するブロック図である。なお、これ以降、前述した構成要素と同様のものについては、同一の参照番号を付して表すこととする。
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
FIG. 5 is a block diagram illustrating a hardware environment for implementing the software verification model generation method according to the present invention. Hereinafter, the same components as those described above are denoted by the same reference numerals.

図5に例示されるように、本発明に係るソフトウェア検証モデル生成方法(又はハードウェア/ソフトウェア協調検証方法)は、中央処理装置(図5ではホストCPUと記載)912、キャッシュメモリ916及び主記憶装置(MS)914(図5では、主記憶と略記する)を有するコンピュータ本体910、ディスプレイ920、キーボード922、マウス924、ハードディスク装置等からなる外部記憶装置(HD)930を備える通常のパーソナル・コンピュータ(PC)又はワーク・ステーション(WS)上で実行可能である。   As illustrated in FIG. 5, a software verification model generation method (or hardware / software co-verification method) according to the present invention includes a central processing unit (described as a host CPU in FIG. 5) 912, a cache memory 916, and a main memory. A normal personal computer comprising a computer main body 910 having a device (MS) 914 (abbreviated as main memory in FIG. 5), an external storage device (HD) 930 comprising a display 920, a keyboard 922, a mouse 924, a hard disk device, etc. (PC) or work station (WS).

ここでは、本発明に係るソフトウェア検証モデル生成方法を高速にて実行させるために、高性能のホストCPU912が要求される。この要求に応えるために、ホストCPU912と主記憶装置914との間にキャッシュメモリ916が設けられている。このキャッシュメモリ916は、ホストCPU912が主記憶装置914に対して頻繁に読み書きするデータを高速にて転送させるために、当該データをホストCPU912からストアして(書き込んで)一時的にため込むか、又は当該データを主記憶装置914からロードして(ダウンロードとも呼ばれる)一時的にため込む機能を有している。キャッシュメモリ916と主記憶装置914とは、バス918を介して相互に接続されている。キャッシュメモリ916は、図6にて後述するように、命令キャッシュメモリ及びデータキャッシュメモリの少なくとも一方、又は両方を含んでおり、コンピュータ本体910に内蔵されている。   Here, a high-performance host CPU 912 is required to execute the software verification model generation method according to the present invention at high speed. In order to respond to this request, a cache memory 916 is provided between the host CPU 912 and the main storage device 914. The cache memory 916 stores (writes) the data from the host CPU 912 and temporarily stores the data that the host CPU 912 frequently reads / writes to / from the main storage device 914 at a high speed, or It has a function of loading the data from the main storage device 914 and temporarily storing it (also called downloading). The cache memory 916 and the main storage device 914 are connected to each other via a bus 918. As will be described later with reference to FIG. 6, the cache memory 916 includes at least one of an instruction cache memory and a data cache memory, or both, and is built in the computer main body 910.

ホストCPU912は、ソフトウェア検証モデル生成(又はハードウェア/ソフトウェア協調検証)を実行するホストCPUとして動作するものであり、例えば、Pentiumプロセッサである。以下に説明されるソフトウェア検証モデル生成(又はハードウェア/ソフトウェア協調検証)のためのプログラムは、ホストCPU912によって実行される。又、各種のデータ、ファイル等は、外部記憶装置930から主記憶装置(MS)914にロードされて処理される。   The host CPU 912 operates as a host CPU that executes software verification model generation (or hardware / software co-verification), and is, for example, a Pentium processor. A program for generating a software verification model (or hardware / software co-verification) described below is executed by the host CPU 912. Various data, files, and the like are loaded from the external storage device 930 to the main storage device (MS) 914 and processed.

図6は、ターゲットCPUを用いた組み込みシステムにおける命令キャッシュメモリ及びデータキャッシュメモリの接続例を示すブロック図である。ここでは、命令キャッシュメモリとデータキャッシュメモリを備えた組み込みシステムの展開的な接続例が図示されている。   FIG. 6 is a block diagram illustrating an example of connection between an instruction cache memory and a data cache memory in an embedded system using a target CPU. Here, an example of an expanded connection of an embedded system having an instruction cache memory and a data cache memory is shown.

図6において、キャッシュメモリ16は、命令(広い意味で「データ」とも呼ばれる)の内容を一時的に格納する命令キャッシュメモリ16−1、もしくはデータの内容を一時的に格納するデータキャッシュメモリ16−2、又はその両方を含んでいる。この命令キャッシュメモリ16−1及びデータキャッシュメモリ16−2は、好ましくは、ターゲットCPU12に内蔵されて使用される。なお、図6に示すような構成では、キャッシュメモリを単に「キャッシュ」と略記したり、命令キャッシュメモリを単に「命令キャッシュ」と略記したり、データキャッシュメモリを単に「データキャッシュ」と略記したりすることもある。   In FIG. 6, a cache memory 16 is an instruction cache memory 16-1 that temporarily stores the contents of instructions (also called "data" in a broad sense), or a data cache memory 16- that temporarily stores the contents of data. 2 or both. The instruction cache memory 16-1 and the data cache memory 16-2 are preferably used by being incorporated in the target CPU 12. In the configuration shown in FIG. 6, the cache memory is simply abbreviated as “cache”, the instruction cache memory is simply abbreviated as “instruction cache”, or the data cache memory is simply abbreviated as “data cache”. Sometimes.

図6のターゲットCPU12を用いたハードウェア/ソフトウェア協調検証システムにおいては、バジェット追加ツールによりソフトウェア部品のBasic Block に挿入された各々の制御点間の実行時間を算出する機能が備わっており、かつ、キャッシュメモリ16(命令キャッシュメモリ16−1及びデータキャッシュメモリ16−2)によるエミュレーション機能が追加される。ここで、ターゲットCPU12は、キャッシュメモリに対する命令実行において、命令キャッシュメモリ16−1から命令の内容をフェッチする操作(命令フェッチ操作)を実行したり、データキャッシュメモリ16−2に対してデータをロードしたりストアしたりするための命令(ロード命令/ストア命令)を実行したりする。   The hardware / software co-verification system using the target CPU 12 of FIG. 6 has a function of calculating the execution time between the control points inserted in the basic block of the software component by the budget addition tool, and An emulation function by the cache memory 16 (the instruction cache memory 16-1 and the data cache memory 16-2) is added. Here, the target CPU 12 executes an operation to fetch the contents of the instruction from the instruction cache memory 16-1 (instruction fetch operation) or loads data to the data cache memory 16-2 in executing the instruction to the cache memory. Instructions for loading and storing (load instructions / store instructions).

より詳しく説明すると、ターゲットCPU12は、命令キャッシュメモリ16−1がヒットしているか否か(命令キャッシュメモリ内に所望のデータ(命令の内容)が存在するか否か)を判定し、キャッシュミス(命令キャッシュメモリ内に所望のデータが存在しないこと)を検出したときに、主記憶装置14からデータを読み出し、命令キャッシュメモリ16−1の命令キャッシュラインへロードする。ここで、命令キャッシュラインは、命令キャッシュメモリ16−1へのデータのロード単位を表している。既述したように、この命令キャッシュラインへデータをロードする操作をキャッシュラインフィルと称している。この場合、一つの命令キャッシュライン分のデータのキャッシュラインフィルが終了するまで、ターゲットCPU12は待ち状態になる。このターゲットCPU12の待ち状態に起因する待ち時間は、「キャッシュミスペナルティ」と呼ばれる。   More specifically, the target CPU 12 determines whether or not the instruction cache memory 16-1 is hit (whether or not desired data (instruction contents) exists in the instruction cache memory), and a cache miss ( When it is detected that there is no desired data in the instruction cache memory), the data is read from the main memory 14 and loaded into the instruction cache line of the instruction cache memory 16-1. Here, the instruction cache line represents a data load unit to the instruction cache memory 16-1. As described above, the operation of loading data into the instruction cache line is called a cache line fill. In this case, the target CPU 12 waits until the cache line fill of data for one instruction cache line is completed. The waiting time resulting from the waiting state of the target CPU 12 is referred to as “cache miss penalty”.

又一方で、ターゲットCPU12は、データキャッシュメモリ16−2がヒットしているか否か(データキャッシュメモリ内に所望のデータが存在するか否か)を判定し、キャッシュミス(データキャッシュメモリ内に所望のデータが存在しないこと)を検出したときに、主記憶装置14からデータを読み出し、データキャッシュメモリ16−2のデータキャッシュラインへロードする。ここで、データキャッシュラインは、データキャッシュメモリ16−2へのデータのロード単位を表している。既述したように、このデータキャッシュラインへデータをロードする操作をキャッシュラインフィルと称している。この場合、一つのデータキャッシュライン分のデータのキャッシュラインフィルが終了するまで、ターゲットCPU12は待ち状態になる。このターゲットCPU12の待ち状態に起因する待ち時間は、前述の命令キャッシュメモリの場合と同様に、「キャッシュミスペナルティ」と呼ばれる。   On the other hand, the target CPU 12 determines whether or not the data cache memory 16-2 is hit (whether or not desired data exists in the data cache memory), and cache miss (desired in the data cache memory). Is detected), the data is read from the main memory 14 and loaded into the data cache line of the data cache memory 16-2. Here, the data cache line represents a data load unit to the data cache memory 16-2. As described above, an operation for loading data into the data cache line is referred to as a cache line fill. In this case, the target CPU 12 waits until the cache line fill of the data for one data cache line is completed. The waiting time resulting from the waiting state of the target CPU 12 is called “cache miss penalty” as in the case of the instruction cache memory described above.

図7は、図6の命令キャッシュメモリ16−1、又は、データキャッシュメモリ16−2の具体的な構成例を示すブロック図であり、図8は、図7の命令キャッシュメモリ16−1、又は、データキャッシュメモリ16−2のキャッシュミスによりキャッシュミスペナルティが発生する様子を説明するためのタイムチャートである。   7 is a block diagram showing a specific configuration example of the instruction cache memory 16-1 or the data cache memory 16-2 in FIG. 6, and FIG. 8 shows an instruction cache memory 16-1 in FIG. FIG. 10 is a time chart for explaining how a cache miss penalty occurs due to a cache miss in the data cache memory 16-2. FIG.

図7において、命令キャッシュメモリ16−1、又は、データキャッシュメモリ16−2は、複数の行の命令キャッシュライン、又は、データキャッシュライン(以下、単にキャッシュラインと呼ぶ)からなるウェイの集合体により構成される。一つの行のキャッシュラインは、当該キャッシュラインの内容が有効であるか否かを示す有効ビット(Valid Bit )と、最初に主記憶装置から当該キャッシュラインにロードされたデータがCPUにより書き替えられているか否か(ダーティの状態になっているか否か)を示すダーティビット(Dirty Bit )と、当該キャッシュライン内のデータがどのアドレスに属するデータであるかを示すタグ部(図7では、タグ(Tag )と略記する)とを有する。通常、上記の有効ビット、ダーティビット、及びタグ部は図示するように複数のウェイからなるタグメモリ16−3に格納される。ただし、命令キャッシュメモリ16−1では、一度ロードされたデータがCPUにより書き替えられることはないので、実際にはダーティビットは不要である。又一方で、各々のキャッシュラインに対応させてアドレス(命令キャッシュメモリ16−1、又は、データキャッシュメモリ16−2に対応して、それぞれ、命令アドレス、又は、データアドレス)31が設けられている。このアドレス31には、対応するキャッシュラインがどのアドレスに属するかを示すタグ(Tag )と、当該キャッシュラインのインデックス値を示すインデックス(Index )と、キャッシュラインの先頭アドレスの位置からのオフセット値を示すライン内オフセット(Line内Offset)とが含まれる。   In FIG. 7, the instruction cache memory 16-1 or the data cache memory 16-2 is constituted by a set of ways including a plurality of instruction cache lines or data cache lines (hereinafter simply referred to as cache lines). Composed. In a cache line of one line, a valid bit (Valid Bit) indicating whether or not the contents of the cache line are valid and data loaded into the cache line from the main storage device first are rewritten by the CPU. A dirty bit (Dirty Bit) indicating whether or not the data in the cache line belongs to and a tag portion (in FIG. (Abbreviated as (Tag)). Normally, the valid bit, dirty bit, and tag portion are stored in a tag memory 16-3 composed of a plurality of ways as shown in the figure. However, in the instruction cache memory 16-1, once loaded data is not rewritten by the CPU, the dirty bit is actually unnecessary. On the other hand, addresses (instruction addresses or data addresses corresponding to the instruction cache memory 16-1 or the data cache memory 16-2, respectively) 31 are provided corresponding to the respective cache lines. . The address 31 includes a tag (Tag) indicating which address the corresponding cache line belongs to, an index (Index) indicating the index value of the cache line, and an offset value from the position of the start address of the cache line. Inline offset (Inline Offset) is included.

図7に示すキャッシュラインメモリ16−4は、主記憶からロードしたキャッシュラインの内容を格納するメモリであり、各キャッシュラインはタグメモリ16−3の有効ビットやタグ部と1対1に対応している。この協調検証環境では、シミュレーション中にキャッシュミスが検出された場合に、キャッシュラインフィルに要する実行時間を求めるだけでよいので、実際には、このキャッシュラインメモリ16−4のシミュレーションモデルは不要である。   The cache line memory 16-4 shown in FIG. 7 is a memory for storing the contents of the cache line loaded from the main memory, and each cache line has a one-to-one correspondence with the valid bit and tag portion of the tag memory 16-3. ing. In this collaborative verification environment, when a cache miss is detected during the simulation, it is only necessary to obtain the execution time required for the cache line fill, so in practice, the simulation model of the cache line memory 16-4 is unnecessary. .

図7のタグメモリ16−3においては、タグメモリ16−3の各々のウェイに対してコンパレータ32が設けられている。このコンパレータ32は、アドレス内に含まれるタグ31とタグメモリ16−3から読み出したタグとを比較し、この特定のアドレスに一致するアドレスがあるか否かを判定する機能を有している。   In the tag memory 16-3 of FIG. 7, a comparator 32 is provided for each way of the tag memory 16-3. The comparator 32 has a function of comparing the tag 31 included in the address with the tag read from the tag memory 16-3 and determining whether or not there is an address that matches the specific address.

さらに、図7では、キャッシュライン毎にキャッシュメモリがヒットしているか否かを判定するキャッシュヒット検出部34が設けられている。このキャッシュヒット検出部34は、コンパレータ32による判定結果に基づき、キャッシュラインのアドレスをパラメータとしてキャッシュライン毎にキャッシュメモリ内に所望のデータが存在するか否かを判定する機能を有している。   Further, in FIG. 7, a cache hit detection unit 34 for determining whether or not the cache memory is hit for each cache line is provided. The cache hit detection unit 34 has a function of determining whether or not desired data exists in the cache memory for each cache line based on the determination result by the comparator 32 using the address of the cache line as a parameter.

キャッシュヒット検出部34において、命令キャッシュメモリ16−1、又は、データキャッシュメモリ16−2のキャッシュミス(キャッシュメモリ内に所望のデータが存在しないこと)が検出された場合、キャッシュラインのキャッシュラインフィルを実行するための実行時間(キャッシュミスペナルティの発生によるCPUの待ち時間)を追加するようにしている。なお、図7に示されるように、キャッシュラインのキャッシュラインフィルを実行するための実行時間を「ラインフィル時間」と称する場合もある。   If the cache hit detection unit 34 detects a cache miss in the instruction cache memory 16-1 or the data cache memory 16-2 (the desired data does not exist in the cache memory), the cache line fill of the cache line is detected. Execution time (CPU waiting time due to occurrence of cache miss penalty) is added. As shown in FIG. 7, the execution time for executing the cache line fill of the cache line may be referred to as “line fill time”.

このようなキャッシュミスペナルティが発生したときにキャッシュラインフィルが実行される様子(時間(t)に対するキャッシュラインへのデータの転送の様子)を図8に示す。ARMプロセッサ等のターゲットCPUにより生成されたソフトウェア検証モデルでは、命令キャッシュメモリ16−1、または、データキャッシュメモリ16−3のキャッシュミスが検出された場合に、システム動作の基本となるクロックCLKに同期して実行されるキャッシュラインフィルは、キャッシュラインの先頭アドレスから開始される。命令キャッシュメモリ16−1のインプリメントによっては、途中でキャッシュミスが検出されたアドレスに対応する命令の内容がロードされる際に、キャッシュラインへのロードとCPUによる命令実行とが平行して行われるものもある。この場合は、見かけ上のキャッシュラインフィルの実行時間は、小さくなる。   FIG. 8 shows how the cache line fill is executed when such a cache miss penalty occurs (data transfer to the cache line with respect to time (t)). In a software verification model generated by a target CPU such as an ARM processor, when a cache miss in the instruction cache memory 16-1 or the data cache memory 16-3 is detected, the software verification model is synchronized with the clock CLK that is the basis of the system operation. The cache line fill executed in this way is started from the start address of the cache line. Depending on the implementation of the instruction cache memory 16-1, when the contents of the instruction corresponding to the address where a cache miss is detected are loaded, the loading to the cache line and the instruction execution by the CPU are performed in parallel. There are also things. In this case, the apparent cache line fill execution time is reduced.

したがって、命令キャッシュメモリのキャッシュミスペナルティは、次式のように表される。
Tinit + Tword *Line Size − Texe
ここで、Tinitは、キャッシュミスが検出されてから最初の先頭ワードのロードを開始するまでの時間、Twordはワード毎のロード時間、Line Size(ラインサイズ)は一つのキャッシュラインのワード数、Texeは、キャッシュミスが検出された命令キャッシュラインのうち、キャッシュラインフィルの動作中にCPUにより実行された命令時間を示す。例えば、ラインサイズが8ワード(=32バイト)であり、1回あたりにロードするワード幅が4バイトである場合、ワード単位の命令(先頭ワード、次ワード……)が次々にキャッシュラインメモリ16−4にロードされ、合わせて8回ロードされることになる。
Therefore, the cache miss penalty of the instruction cache memory is expressed by the following equation.
Tinit + Tword * Line Size-Texe
Here, Tinit is the time from when a cache miss is detected until the start of loading of the first head word, Tword is the load time for each word, Line Size is the number of words in one cache line, Texe Indicates an instruction time executed by the CPU during the cache line fill operation among instruction cache lines in which a cache miss is detected. For example, when the line size is 8 words (= 32 bytes) and the word width to be loaded at one time is 4 bytes, instructions in units of words (first word, next word,...) Are successively cache line memory 16. Will be loaded 8 times.

換言すれば、本発明の実施形態では、図7に示したように、命令キャッシュメモリの命令タグメモリのエミュレーション機能を用意し、命令アドレスをパラメータとして命令キャッシュメモリがヒットしているか否かの判定を行い、命令キャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間をキャッシュミスペナルティとして追加するようになっている。   In other words, in the embodiment of the present invention, as shown in FIG. 7, an instruction tag memory emulation function of the instruction cache memory is prepared, and it is determined whether or not the instruction cache memory is hit with the instruction address as a parameter. The execution time for executing the cache line fill in the case of a cache miss in the instruction cache memory is added as a cache miss penalty.

また一方で、本発明の実施形態では、データキャッシュメモリのエミュレーション機能を用意し、データアドレスをパラメータとしてデータキャッシュメモリがヒットしているか否かの判定を行い、データキャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間をキャッシュミスペナルティとして追加するようになっている。   On the other hand, in the embodiment of the present invention, a data cache memory emulation function is prepared, and it is determined whether or not the data cache memory is hit by using the data address as a parameter. The execution time for executing the cache line fill is added as a cache miss penalty.

ここで、データキャッシュメモリのキャッシュミスが発生した場合のキャッシュラインフィルの動作は、ストア・スルー(Store Through )モード又はストア・バック(Store Back)のいずれかのモードで実行される点に注意すべきである。
ここで、「ストア・スルーモード」とは、データキャッシュメモリ16−2に対するストア(書き込み)動作を行った際に、データキャッシュメモリ16−2の内容を更新すると同時に主記憶装置の内容も更新するモードを指している。このストア・スルーモードでは、データキャッシュメモリ16−2及び主記憶装置14の内容を更新する度にバス18を使用するので、主記憶装置14に対するストア動作が終了するまでターゲットCPU12は待ち状態になる。したがって、ストア・スルーモードでは、ストア動作を行う度に主記憶装置14への書き込みのための実行時間だけターゲットCPUの実行を待たせる必要がある。なお、データキャッシュメモリ16−2のインプリメントによっては、このようなストア動作の要求を一時的に格納しておくストアバッファを用意しているものもある。このような場合には、ストア動作を行う場合に、まだ、ストアバッファにストア要求が残っているときのみターゲットCPU12の実行を待たせる必要がある。この場合、キャッシュラインフィルが実行された場合、主記憶装置14の更新は既に行われているので、アドレス31のインデックスで示されるウェイから適当なキャッシュラインを選択し、このキャッシュラインに主記憶装置14からロードしたラインの内容をロードするだけでよいので、データキャッシュメモリのキャッシュミスペナルティは前述の式のように表される。
Note that the cache line fill operation when a cache miss in the data cache memory occurs is executed in either the store-through mode or the store-back mode. Should.
Here, the “store-through mode” is to update the contents of the data cache memory 16-2 and the contents of the main storage device at the same time when the store (write) operation to the data cache memory 16-2 is performed. Refers to the mode. In this store-through mode, the bus 18 is used every time the contents of the data cache memory 16-2 and the main storage device 14 are updated, so that the target CPU 12 waits until the store operation for the main storage device 14 is completed. . Therefore, in the store-through mode, it is necessary to wait for the execution of the target CPU for the execution time for writing to the main storage device 14 every time the store operation is performed. Depending on the implementation of the data cache memory 16-2, a store buffer for temporarily storing a request for such a store operation may be prepared. In such a case, when performing a store operation, it is necessary to wait for execution of the target CPU 12 only when a store request still remains in the store buffer. In this case, when the cache line fill is executed, the main storage device 14 has already been updated. Therefore, an appropriate cache line is selected from the way indicated by the index of the address 31, and the main storage device is assigned to this cache line. Since it is only necessary to load the contents of the line loaded from 14, the cache miss penalty of the data cache memory is expressed by the above formula.

これに対し、「ストア・バックモード」とは、データキャッシュメモリ16−2に対するストア動作を行った際に、データキャッシュメモリ16−2の内容のみを更新し、主記憶装置の内容は元のままにしておくモードを指している。このストア・バックモードでは、データキャッシュラインに対するストア動作が行われた際にダーティビットを“1”にセットしておく。次いで、データキャッシュミスの発生によって、ダーティビットが“1”になっているデータキャッシュラインが置換される場合、まず、更新されたデータキャッシュラインの内容を主記憶装置に追い出す必要がある。この後、キャッシュミスしたデータキャッシュラインの更新後の内容をロードすることによって、データキャッシュラインの置換を行う(ストア・バックの動作)。このように、データキャッシュラインの置換が必要なストア・バックモードにおいては、ストア・スルーモードでキャッシュラインフィルを実行する場合の実行時間以外に、上記のようなストア・バックの動作を実行するための実行時間が追加される。なお、データキャッシュラインのストア・バック要求を保持するストアバッファをインプリメントしている場合には、追い出すデータキャッシュラインの内容をストアバッファに格納した後、直ちに、キャッシュミスしたデータキャッシュラインの内容を主記憶装置14からロードすることができる。このような場合は、キャッシュラインフィルを実行する場合の実行時間の追加だけでよい。この場合も、既に、ストアバッファに以前のストア・バック要求が残っている場合は、ストアバッファが空になるまで待たされる。   On the other hand, “store / back mode” means that when the store operation is performed on the data cache memory 16-2, only the contents of the data cache memory 16-2 are updated and the contents of the main storage device remain unchanged. It points to the mode to keep. In this store-back mode, the dirty bit is set to “1” when a store operation is performed on the data cache line. Next, when a data cache line in which the dirty bit is “1” is replaced due to the occurrence of a data cache miss, it is necessary to first purge the contents of the updated data cache line to the main storage device. Thereafter, the data cache line is replaced by loading the updated contents of the data cache line that has missed the cache (store-back operation). As described above, in the store-back mode that requires data cache line replacement, the store-back operation as described above is executed in addition to the execution time when the cache line fill is executed in the store-through mode. Execution time is added. If a store buffer that holds a store / back request for the data cache line is implemented, the contents of the data cache line to be evicted are stored in the store buffer, and then the contents of the data cache line that has been cache missed are immediately stored. It can be loaded from the storage device 14. In such a case, it is only necessary to add an execution time when the cache line fill is executed. Also in this case, when the previous store back request still remains in the store buffer, the process waits until the store buffer becomes empty.

図9は、本発明に係る命令キャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャートのその1、図10は、本発明に係る命令キャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャートのその2、そして、図11は、本発明に係る命令キャッシュヒット判定機能を有する手続きの追加によるソフトウェア検証モデル生成方法を説明するための模式図である。   FIG. 9 is a first part of a flowchart for explaining a processing procedure of a program for executing a procedure having an instruction cache hit determination function according to the present invention, and FIG. 10 shows a procedure having an instruction cache hit determination function according to the present invention. Part 2 of the flowchart for explaining the processing procedure of the program to be executed, and FIG. 11 are schematic diagrams for explaining the software verification model generation method by adding a procedure having an instruction cache hit determination function according to the present invention. is there.

以下、図9〜図11を参照しながら、命令キャッシュメモリ16−1がターゲットCPU12に内蔵されている場合に、Cベース言語記述のソフトウェア部品50に基づいて本発明に係る命令キャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明する。   Hereinafter, referring to FIGS. 9 to 11, when the instruction cache memory 16-1 is built in the target CPU 12, the instruction cache hit determination function according to the present invention is performed based on the software component 50 of the C base language description. A processing procedure of a program that executes a procedure having the above will be described.

まず、図9のステップ105では、実行時間追加前のCベース言語で記述されたソフトウェア部品50を入力して、このソフトウェア部品の中からANSI−C記述のみによるソースコードの部分(Cコードの部分と呼ばれる)を取り出す。次いで、ステップ110では、このCコードの部分に対して、Basic Block (基本ブロック)を認識し、制御点を挿入することにより、制御点が挿入されたCコードの部分(ANSI−C記述)52を出力する。このBasic Block は、プログラムが分岐することなしに逐次的に走行する部分を指すものである。そして、その認識された Basic Block の前後に制御点が挿入される。   First, in step 105 of FIG. 9, the software component 50 described in the C base language before the execution time is added is input, and the source code portion (the C code portion) only by the ANSI-C description is input from this software component. Take out). Next, in step 110, the C code portion (ANSI-C description) 52 in which the control point is inserted by recognizing the Basic Block (basic block) for this C code portion and inserting the control point. Is output. This Basic Block refers to the part where the program runs sequentially without branching. Then, control points are inserted before and after the recognized basic block.

より詳しく説明すると、図11の(A)に示されるCコードの部分に対しては、ノードa及びノードbが一つの Basic Block と認識され、ノードc、ノードd及びノードeが一つの Basic Block と認識され、ノードc及びノードfが一つの Basic Block と認識され、ノードgが一つの Basic Block と認識される。このため、図11の(B)に示されるように、ノードbとノードcとの間、ノードeとノードgとの間、ノードfとノードgとの間、及びノードgの後に、それぞれ制御点(図11の(B)の●印の部分)が挿入される。   More specifically, for the C code portion shown in FIG. 11A, node a and node b are recognized as one Basic Block, and node c, node d and node e are one Basic Block. Node c and node f are recognized as one basic block, and node g is recognized as one basic block. Therefore, as shown in FIG. 11B, control is performed between the node b and the node c, between the node e and the node g, between the node f and the node g, and after the node g, respectively. A point (a portion marked with ● in FIG. 11B) is inserted.

さらに、ステップ120では、かかる制御点が挿入されたCコードの部分をコンパイルすることにより、ターゲットCPU用バイナリ・コード54を生成する。   Further, in step 120, the target CPU binary code 54 is generated by compiling the portion of the C code in which such control points are inserted.

さらに、ステップ130では、Cコードの部分52からBasic Block を順次取り出す。さらに、ステップ135では、取り出すBasic Block があるか否かを判定する。取り出すBasic Block があると判定された場合は、ステップ140において、前述のコンパイルの結果として生成されたターゲットCPU用バイナリ・コード(命令コード)54に基づいて、ステップ130で取り出したBasic Block の制御点間の実行時間を算出する。又一方で、取り出すBasic Block がないと判定された場合は、前述のステップ105〜135で得られたCベース言語記述のソフトウェア部品を検証モデル56として出力し、本プログラムの処理を終了する。   In step 130, Basic Blocks are sequentially extracted from the C code portion 52. In step 135, it is determined whether there is a basic block to be extracted. If it is determined that there is a Basic Block to be extracted, the control point of the Basic Block extracted in Step 130 based on the target CPU binary code (instruction code) 54 generated as a result of the above-described compilation in Step 140. Calculate the execution time between. On the other hand, if it is determined that there is no Basic Block to be extracted, the software component of the C base language description obtained in steps 105 to 135 described above is output as the verification model 56, and the processing of this program is terminated.

前述のステップ140におけるBasic Block の制御点間の実行時間の算出は、
Σ[各命令のサイクル数]
なる演算式に基づいて行われる。
The calculation of the execution time between the control points of the Basic Block in the above step 140 is as follows:
Σ [number of cycles for each instruction]
It is performed based on the following arithmetic expression.

さらに、ステップ145では、制御点が挿入されたCコードの部分の各々の制御点(すなわち、各々のBasic Block の後の制御点)へ、算出された実行時間をパラメータとする実行時間挿入文(SpecCの場合は、waitfor 文である)を追加し、Cベース言語記述の検証モデル(実行時間挿入文追加後のCベース・モデル)56として出力する。   Further, in step 145, an execution time insertion statement (with the calculated execution time as a parameter) is sent to each control point of the portion of the C code where the control point is inserted (that is, the control point after each Basic Block). In the case of SpecC, it is a waitfor statement), and is output as a C-based language description verification model (C-based model after the execution time insertion statement is added) 56.

例えば、図11の(B)のBasic Block の認識と制御点の挿入との関係に基づいて、図11の(B)に示されるノードa及びノードbの実行時間がt1と算出され、ノードc、ノードd及びノードe の実行時間がt2と算出され、ノードc及びノードf の実行時間がt3と算出され、ノードgの実行時間がt4と算出されたとする。この場合には、図11の(C)のCベース言語記述の検証モデルに示されるように、ノードbとノードcとの間の制御点には、実行時間挿入文として waitfor(t1) が追加される。同様に、ノードeとノードgとの間の制御点には実行時間挿入文として waitfor(t2) が追加され、ノードfとノードgとの間の制御点には実行時間挿入文として waitfor(t3) が追加され、ノードgの後の制御点には実行時間挿入文として waitfor(t4) が追加されることとなる。   For example, based on the relationship between basic block recognition and control point insertion in FIG. 11B, the execution times of the nodes a and b shown in FIG. 11B are calculated as t1, and the node c , The execution time of node d and node e is calculated as t2, the execution time of node c and node f is calculated as t3, and the execution time of node g is calculated as t4. In this case, as shown in the verification model of the C base language description in FIG. 11C, waitfor (t1) is added as an execution time insertion statement to the control point between the nodes b and c. Is done. Similarly, waitfor (t2) is added as an execution time insertion statement to the control point between node e and node g, and waitfor (t3) is added as an execution time insertion statement to the control point between node f and node g. ) Is added, and waitfor (t4) is added as an execution time insertion statement to the control point after node g.

さらに、図10のステップ150では、図9のステップ130で取り出したBasic Block の単位で命令キャッシュメモリがヒットしているか否かの判定(命令キャッシュヒット判定:命令キャッシュメモリのミス判定)を行うための手続きの呼び出しを挿入する。さらに、図10のステップ155では、命令キャッシュメモリのキャッシュミスが検出されたときに命令キャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュメモリの無効化を行うための命令キャッシュ無効化手続きの呼び出しを行うANSI−C記述のみによるソースコード(すなわち、Cコード)に変換する。   Further, in step 150 of FIG. 10, in order to determine whether or not the instruction cache memory is hit in units of Basic Block extracted in step 130 of FIG. 9 (instruction cache hit determination: instruction cache memory miss determination). Insert a call to the procedure. Further, in step 155 of FIG. 10, an assembler code for invalidating the instruction cache memory when a cache miss in the instruction cache memory is detected is called an instruction cache invalidation procedure for invalidating the instruction cache memory. Is converted into source code (that is, C code) based only on the ANSI-C description.

さらに、図10のステップ160では、前述のステップ150で挿入された手続きに従って命令キャッシュメモリがヒットしているか否かの判定を行い、命令キャッシュヒット判定機能を有する手続きを付与する。この命令キャッシュヒット判定機能においては、命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行った場合、当該命令キャッシュメモリのキャッシュミスが検出されたときに、キャッシュラインフィルを実行するための実行時間をキャッシュミスペナルティとして追加するようになっている。   Further, in step 160 of FIG. 10, it is determined whether or not the instruction cache memory is hit according to the procedure inserted in step 150 described above, and a procedure having an instruction cache hit determination function is given. In this instruction cache hit determination function, when it is determined whether or not the instruction cache memory is hit using the instruction tag memory portion held in the instruction cache memory, a cache miss of the instruction cache memory is determined. Is detected, the execution time for executing the cache line fill is added as a cache miss penalty.

さらに、図10のステップ165では、前述のステップ155で呼び出された命令キャッシュ無効化手続きが実行されたときに、命令キャッシュメモリ内に保持されている命令タグメモリ部のエントリを無効化するのに要する実行時間だけCPUを待ち状態にして、当該命令キャッシュメモリの有効ビットの内容をクリアする。   Further, in step 165 of FIG. 10, when the instruction cache invalidation procedure called in step 155 described above is executed, the entry in the instruction tag memory portion held in the instruction cache memory is invalidated. The CPU is kept waiting for the required execution time, and the contents of the valid bit of the instruction cache memory are cleared.

前述の一連のステップ105〜165によって、Cベース言語記述のソフトウェア部品に対して各々のBasic Block の後の制御点に実行時間挿入文が追加されると共に、Basic Block の単位で命令キャッシュヒット判定を行ってキャッシュミスが検出されたときにキャッシュミスペナルティが追加されることになる。最終的に、上記の一連のステップで得られたCベース言語記述のソフトウェア部品が、前述のCベース言語記述の検証モデル56として出力される。   Through the series of steps 105 to 165 described above, an execution time insertion statement is added to the control point after each Basic Block for the software component in the C base language description, and instruction cache hit determination is performed in units of Basic Block. When a cache miss is detected, a cache miss penalty is added. Finally, the software component of the C base language description obtained in the series of steps is output as the verification model 56 of the C base language description.

例えば、図11の(C)のCベース言語記述の検証モデルに示されるように、Cコードの部分をターゲットCPUの命令にコンパイルし、Basic Block の先頭アドレスAi(iは任意の正の整数:ここでは、i=1〜4)と基本ブロック長Liとを算出し、各々のBasic Block の後の制御点に既に挿入されている実行時間挿入文(waitfor(t1)〜waitfor(t4))の直後に、命令フェッチに対する命令キャッシュヒット判定を行うための命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) :ここでは、i=1〜4)を挿入する。ここでは、命令キャッシュヒット判定を行った結果としてキャッシュミス(命令アドレスに対応する命令の内容が命令キャッシュメモリ内に存在しないこと)を検出した場合には、キャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   For example, as shown in the verification model of the C base language description in FIG. 11C, the C code portion is compiled into the instruction of the target CPU, and the basic block start address Ai (i is an arbitrary positive integer: Here, i = 1 to 4) and the basic block length Li are calculated, and the execution time insertion statements (waitfor (t1) to waitfor (t4)) already inserted at the control point after each Basic Block are calculated. Immediately after that, an instruction cache hit determination call statement (fetch_icache (Ai, Li): i = 1 to 4 in this case) for determining an instruction cache hit for instruction fetch is inserted. In this case, if a cache miss (the instruction content corresponding to the instruction address does not exist in the instruction cache memory) is detected as a result of the instruction cache hit determination, the cache line fill execution time (line fill time) ) Is called as an execution time insertion statement (waitfor statement).

図12は、図11にて生成されたCベース言語記述の検証モデルに基づくCベース・シミュレーションについて説明するための模式図である。
Cベース言語記述の検証モデルをコンパイルしてホストCPU用バイナリ・コードを生成することにより、ホストCPUにおいてCベース・シミュレータを使用したCベース・シミュレーションが可能となる。ここで、「ホストCPU」とは、既述したように、協調検証を実行するパーソナル・コンピュータ(PC)又はワーク・ステーション(WS)に搭載されているCPUを意味する。
FIG. 12 is a schematic diagram for explaining C-based simulation based on the verification model of the C-based language description generated in FIG.
By compiling the verification model of the C base language description and generating the binary code for the host CPU, it becomes possible to perform C base simulation using the C base simulator in the host CPU. Here, as described above, the “host CPU” means a CPU mounted on a personal computer (PC) or a work station (WS) that executes cooperative verification.

図12の左側の部分においては、Cベース言語記述のソフトウェア部品のBasic Block の制御点に実行時間挿入文(waitfor(t1)〜waitfor(t4))を挿入すると共に命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) :ここでは、i=1〜4)を挿入することによってCベース言語記述の検証モデルを作成するようにしている。   In the left part of FIG. 12, an execution time insertion statement (waitfor (t1) to waitfor (t4)) is inserted at the control point of the Basic Block of the software component of the C base language description and the instruction cache hit determination call statement (fetch_icache) (Ai, Li): Here, a verification model of a C-based language description is created by inserting i = 1 to 4).

又一方で、図12の右側の部分においては、Basic Block の制御点に挿入された実行時間挿入文に基づいて、各々の制御点間の実行時間を算出すると共に、Basic Block の単位で挿入された命令キャッシュヒット判定呼び出し文に基づいて、命令キャッシュメモリのキャッシュミスを検出したときにキャッシュラインフィルを実行するための実行時間(ラインフィル時間)を加算するようにしている。   On the other hand, in the right part of FIG. 12, the execution time between each control point is calculated based on the execution time insertion statement inserted at the control point of the Basic Block, and inserted in the unit of Basic Block. Based on the instruction cache hit determination call statement, an execution time (line fill time) for executing the cache line fill is added when a cache miss in the instruction cache memory is detected.

換言すれば、命令キャッシュメモリがターゲットCPUに内蔵されている場合、図11及び図12に示したような実行時間挿入文(waitfor(t1)〜waitfor(t4))及び命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) )に基づいてソフトウェア部品の検証モデルを生成する際に、Cコードの部分におけるBasic Block の各々の制御点間の実行時間をパラメータとする実行時間挿入文を追加すると共に、Basic Block の単位で命令キャッシュヒット判定呼び出し文を追加して得られるCベース言語記述の検証モデルをコンパイルする。このコンパイルにより生成されたホストCPU用バイナリ・コードをホストCPUで実行させることによって、Cベース・シミュレータを使用したCベース・シミュレーションを実行することが可能になる。   In other words, when the instruction cache memory is built in the target CPU, an execution time insertion statement (waitfor (t1) to waitfor (t4)) and an instruction cache hit determination call statement (shown in FIG. 11 and FIG. 12) When generating a software component verification model based on fetch_icache (Ai, Li)), an execution time insertion statement with the execution time between each control point of the Basic Block in the C code part as a parameter is added. Compile a verification model of C base language description obtained by adding an instruction cache hit judgment call statement in Basic Block units. By executing the host CPU binary code generated by this compilation on the host CPU, it is possible to execute a C-based simulation using a C-based simulator.

図12のCベース・シミュレータを使用し、Basic Block の制御点に挿入された実行時間挿入文及び命令キャッシュヒット判定呼び出し文に基づいてシミュレーションを実行した場合、シミュレーションによる命令実行時間の見積りの精度が従来方法よりも高くなり、命令実行時間の時間管理をより正確に行うことができる。   When the simulation is executed based on the execution time insertion statement inserted at the control point of the Basic Block and the instruction cache hit determination call statement using the C-based simulator of FIG. 12, the accuracy of the estimation of the instruction execution time by the simulation is It becomes higher than the conventional method, and the time management of the instruction execution time can be performed more accurately.

より詳しく説明すると、図12の命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) :ここでは、i=1〜4)においては、アドレスAi〜Ai+Li−1までの範囲の命令アドレスに対応する命令の内容が命令キャッシュメモリ内に存在するか否かの判定を行い、キャッシュミス(当該命令アドレスに対応する命令の内容が命令キャッシュメモリ内に存在しないこと)を検出した場合には、キャッシュミスが発生した回数だけキャッシュラインフィルの実行時間(ラインフィル時間)のサイクル数を挿入するようになっている。ここでは、ラインフィル時間をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   More specifically, in the instruction cache hit determination call statement (fetch_icache (Ai, Li): i = 1 to 4 in FIG. 12), instructions corresponding to instruction addresses in the range of addresses Ai to Ai + Li−1. Is determined in the instruction cache memory, and a cache miss is detected if a cache miss (the instruction corresponding to the instruction address does not exist in the instruction cache memory) is detected. The number of cycles of the cache line fill execution time (line fill time) is inserted as many times as the number of occurrences. Here, an execution time insertion statement (waitfor statement) with the line fill time as a parameter is called.

又一方で、シミュレーションの過程において、ノードa及びノードbに相当する命令コードの実行後に、waitfor(t1) の命令コードを解釈することで実行時間t1が求められ、シミュレーションの時刻を時間t1だけ進めることができる。さらに、fetch_icache (A1, L1) を解釈することで、アドレスA1〜A1+L1−1までの範囲で命令キャッシュメモリのキャッシュミスを検出した場合に、キャッシュミスが発生した回数だけキャッシュラインフィルの実行時間(ラインフィル時間)を挿入することができる。   On the other hand, in the simulation process, after executing the instruction codes corresponding to the nodes a and b, the execution time t1 is obtained by interpreting the instruction code of waitfor (t1), and the simulation time is advanced by the time t1. be able to. Further, by interpreting fetch_icache (A1, L1), when an instruction cache memory cache miss is detected in the range of addresses A1 to A1 + L1-1, the cache line fill execution time (the number of cache miss occurrences) Line fill time) can be inserted.

同様に、ノードcからノードeに相当する命令コードの実行後に、waitfor(t2) の命令コードを解釈することで実行時間t2が求められ、シミュレーションの時刻を時間t2だけ進めることができる。さらに、fetch_icache (A2, L2) を解釈することで、アドレスA2〜A2+L2−1までの範囲で命令キャッシュメモリのキャッシュミスを検出した場合に、キャッシュミスが発生した回数だけラインフィル時間を挿入することができる。   Similarly, after executing the instruction code corresponding to node e from node c, the execution time t2 is obtained by interpreting the instruction code of waitfor (t2), and the simulation time can be advanced by time t2. Further, by interpreting fetch_icache (A2, L2), when an instruction cache memory cache miss is detected in the range of addresses A2 to A2 + L2-1, the line fill time is inserted as many times as the cache miss occurs. Can do.

同様に、ノードcとノードfに相当する命令コードの実行後に、waitfor(t3) の命令コードを解釈することで実行時間t3が求められ、シミュレーションの時刻を時間t3だけ進めることができる。さらに、fetch_icache (A3, L3) を解釈することで、アドレスA3〜A3+L3−1までの範囲で命令キャッシュメモリのキャッシュミスを検出した場合に、キャッシュミスが発生した回数だけラインフィル時間を挿入することができる。   Similarly, after executing the instruction codes corresponding to the nodes c and f, the execution time t3 is obtained by interpreting the instruction code of waitfor (t3), and the simulation time can be advanced by the time t3. Further, by interpreting fetch_icache (A3, L3), when an instruction cache memory cache miss is detected in the range of addresses A3 to A3 + L3-1, the line fill time is inserted as many times as the cache miss occurs. Can do.

同様に、ノードgに相当する命令コードの実行後に、waitfor(t4) の命令コードを解釈することで実行時間t4が求められ、シミュレーションの時刻を時間t4だけ進めることができる。さらに、fetch_icache (A4, L4) を解釈することで、アドレスA4〜A4+L4−1までの範囲で命令キャッシュメモリのキャッシュミスを検出した場合に、キャッシュミスが発生した回数だけラインフィル時間を挿入することができる。   Similarly, after executing the instruction code corresponding to the node g, the execution time t4 is obtained by interpreting the instruction code of waitfor (t4), and the simulation time can be advanced by the time t4. Further, by interpreting fetch_icache (A4, L4), when an instruction cache memory cache miss is detected in the range of addresses A4 to A4 + L4-1, the line fill time is inserted as many times as the cache miss occurs. Can do.

一般的にいって、命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) )により命令キャッシュヒット判定を行った際に命令キャッシュメモリのキャッシュミスが検出される確率は、数%にすぎない。この命令キャッシュメモリのキャッシュミスが検出された場合のみ、キャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。それゆえに、Basic Block の単位で命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li) )を追加挿入した場合でも、従来方法とほぼ同等のシミュレーションの実行速度を維持することが可能になる。   Generally speaking, the probability that an instruction cache memory cache miss is detected when an instruction cache hit determination is performed by an instruction cache hit determination call statement (fetch_icache (Ai, Li)) is only a few percent. Only when a cache miss in the instruction cache memory is detected, an execution time insertion statement (waitfor statement) using the cache line fill execution time (line fill time) as a parameter is called. Therefore, even when an instruction cache hit determination call statement (fetch_icache (Ai, Li)) is additionally inserted in the unit of Basic Block, it is possible to maintain a simulation execution speed almost equal to that of the conventional method.

好ましくは、命令キャッシュメモリの命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファ(例えば、TLB(トランスレーション・ルックアサイド・バッファ))がターゲットCPU内に設けられている場合に、命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li))において、メモリ管理ユニット機能が追加される。   Preferably, an instruction address conversion buffer (for example, a TLB (translation lookaside buffer)) for converting an instruction address of the instruction cache memory from a virtual address to a physical address is provided in the target CPU. In the instruction cache hit determination call statement (fetch_icache (Ai, Li)), a memory management unit function is added.

このメモリ管理ユニット機能においては、Basic Block の単位で命令アドレスが命令アドレス変換用バッファ内に存在するか否かの判定を行い、当該命令アドレスが命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを命令アドレス変換用バッファにロードする時間を加算するようにしている。このようなメモリ管理ユニット機能によって、命令アドレス変換用バッファのミスの際に命令アドレス変換のエントリをロードする時間を含めた高精度のシミュレーションを実行することが可能になる。   In this memory management unit function, it is determined whether or not an instruction address exists in the instruction address conversion buffer in units of Basic Block, and it is detected that the instruction address does not exist in the instruction address conversion buffer. At this time, the time for loading the instruction address conversion entry into the instruction address conversion buffer is added. Such a memory management unit function makes it possible to execute a high-precision simulation including the time to load an instruction address conversion entry when a command address conversion buffer is missed.

さらに詳しく説明すると、上記のメモリ管理ユニット機能の追加を可能にするために、命令アドレス変換用バッファの内容を保持したTLBを予め用意すると共に、仮想メモリのマッピング情報の内容を保持したページテーブルを主記憶装置内に予め用意しておく。   More specifically, in order to enable the addition of the memory management unit function described above, a TLB holding the contents of the instruction address conversion buffer is prepared in advance, and a page table holding the contents of the virtual memory mapping information is prepared. Prepare in advance in the main memory.

上記の命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li))に基づいて、アドレスAi〜Ai+Li−1までの範囲の命令アドレスに対応する命令の内容が命令アドレス変換用バッファ内に存在するか否かの判定を行う。この判定結果として、命令アドレス変換用バッファのキャッシュミス(当該命令アドレスに対応する命令の内容が命令アドレス変換用バッファ内に存在しないこと)を検出した場合には、命令アドレス変換用バッファのエントリの内容を主記憶装置内のページテーブルからロードした値に更新し、命令アドレス変換用バッファのロードのためのサイクル数を挿入するようになっている。ここでは、命令アドレス変換用バッファにロードする時間をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   Based on the instruction cache hit determination call statement (fetch_icache (Ai, Li)), whether or not the content of the instruction corresponding to the instruction address in the range from the address Ai to Ai + Li−1 exists in the instruction address conversion buffer. Judgment is made. As a result of this determination, if a cache miss in the instruction address conversion buffer is detected (the instruction content corresponding to the instruction address does not exist in the instruction address conversion buffer), the instruction address conversion buffer entry The contents are updated to the values loaded from the page table in the main memory, and the number of cycles for loading the instruction address conversion buffer is inserted. Here, an execution time insertion statement (waitfor statement) is called with the time to load into the instruction address conversion buffer as a parameter.

さらに、好ましくは、上記のメモリ管理ユニット機能を実行する際に、命令アドレスの保護機能の有無のチェックが行われる。ここで、命令アドレス変換用バッファにおいてアクセス保護に対する違反が検出された場合には、アクセス保護の例外が発生したことを知らせるようにしている。これによって、シミュレーションの実行時に命令アドレス変換用バッファにおけるアクセス保護に対する違反を確実に検出することが可能になる。   Further, preferably, when executing the memory management unit function, the presence / absence of the instruction address protection function is checked. Here, when a violation of access protection is detected in the instruction address conversion buffer, it is informed that an access protection exception has occurred. This makes it possible to reliably detect violations of access protection in the instruction address conversion buffer during simulation.

図13は、本発明に係る命令キャッシュヒット判定に関する手続き呼び出しをCソースコードに挿入した例を示す図である。ただし、図13の例は、図11及び図12にて説明したようなCコードの部分の例とは異なっている。   FIG. 13 is a diagram showing an example in which a procedure call related to instruction cache hit determination according to the present invention is inserted into C source code. However, the example of FIG. 13 is different from the example of the C code portion described with reference to FIGS. 11 and 12.

図13の左上の部分においては、ANSI−C記述によるCソースコードの部分が例示されている。このCソースコードの部分を解析して、特許文献1又は特許文献2に示すように、バジェット追加ツールによって、各々のBasic Block の後の制御点に実行時間挿入文(例えば、図13の左下の部分に示されるようなwaitfor(2)、 waitfor(4)、及びwaitfor(5) 等のwaitfor 文)を挿入する。つまり、図13の左上のCソースコード部分を、同図の右側に示されるようなターゲットCPUのアセンブリ言語記述によるアセンブラ出力に展開するように、クロスコンパイルしている。このアセンブラ出力における分岐先や分岐命令の出現個所を解析することによって、Basic Block(例えば、図13の右側で複数のブロック(各々のブロックが8バイト〜20バイトの容量を有する)により囲まれている部分)を認識することができる。このアセンブラ出力の基本ブロックとCのソースコードの照合を行い、Cのソースコードの各Basic Blockの終わりである制御点に実行時間挿入文(waitfor文)を挿入して、Cのソースコードを生成する。   In the upper left part of FIG. 13, the C source code part by ANSI-C description is illustrated. By analyzing this C source code portion, as shown in Patent Document 1 or Patent Document 2, an execution time insertion statement (for example, the lower left in FIG. 13) is added to the control point after each Basic Block by a budget addition tool. Insert a waitfor statement such as waitfor (2), waitfor (4), and waitfor (5) as shown in the section. That is, the C source code portion at the upper left of FIG. 13 is cross-compiled so as to be expanded into an assembler output by the assembly language description of the target CPU as shown on the right side of FIG. By analyzing the branch destination and branch instruction occurrence location in the assembler output, it is surrounded by a basic block (for example, a plurality of blocks (each block has a capacity of 8 bytes to 20 bytes) on the right side of FIG. 13). Can be recognized. The basic block of this assembler output is collated with the C source code, and the C source code is generated by inserting an execution time insertion statement (waitfor statement) at the control point at the end of each Basic Block of the C source code. To do.

本特許では、この制御点に、実行時間挿入文(waitfor文)と共に、命令キャッシュヒット判定手続きの呼び出し文(fetch_icache呼び出し文)を追加挿入するものである。   In this patent, an instruction cache hit determination procedure call statement (fetch_icache call statement) is additionally inserted into this control point together with an execution time insertion statement (waitfor statement).

つまり、図13の右側のアセンブラ出力を解析してCソースコードとの間の照合を行い、Cソースコードの各々のBasic Block の後の制御点に、実行時間挿入文(waitfor文)と命令キャッシュヒット判定手続きの呼び出し文(fetch_icache呼び出し文)を追加挿入した後に、図13の左下の部分に示されるような更新後のC言語記述によるCソースコードの部分(すなわち、Cコードの部分)に変換する。この更新後のCコードの部分は、バジェット追加ツールによって、各々のBasic Block の後の制御点にて命令キャッシュヒット判定呼び出し文(fetch_icache呼び出し文)が追加挿入された形式になっている。より正確にいえば、図13の左下の部分では、更新後のCコードの部分をコンパイルすることによって最終的に出力されるCベース言語記述の検証モデルが図示されている。   That is, the assembler output on the right side of FIG. 13 is analyzed and collated with the C source code, and at the control point after each Basic Block of the C source code, the execution time insertion statement (waitfor statement) and the instruction cache After additionally inserting the call statement (fetch_icache call statement) of the hit determination procedure, it is converted into the C source code portion (that is, the C code portion) by the updated C language description as shown in the lower left portion of FIG. To do. The updated C code portion has a format in which an instruction cache hit determination call statement (fetch_icache call statement) is additionally inserted at a control point after each Basic Block by a budget addition tool. More precisely, the lower left part of FIG. 13 shows a verification model of a C-based language description that is finally output by compiling the updated C code part.

より詳しく説明すると、図13のCベース言語記述の検証モデルにおいては、各々のBasic Block の後の制御点に挿入されている実行時間挿入文(waitfor(2)、 waitfor(4)、及びwaitfor(5))の直後に、命令フェッチに対する命令キャッシュヒット判定を行うための命令キャッシュヒット判定呼び出し文(fetch_icache (stringcpy, 8) 、fetch_icache (stringcpy+8, 20)、 fetch_icache (stringcpy+28, 16) 、fetch_icache (stringcpy+44, 8)、 及びfetch_icache (stringcpy+52, 8))を挿入する。ここで、fetch_icache呼び出しの2つのパラメタは、Basic Bclockの先頭アドレスとその長さ(バイト数)である。各々のBasic Block に対し命令キャッシュヒット判定手続き呼び出しを行った結果としてキャッシュミスを検出した場合には、当該Basic Block においてキャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文の呼び出しが行われる。   More specifically, in the verification model of the C-based language description in FIG. 13, the execution time insertion statements (waitfor (2), waitfor (4), and waitfor () inserted at the control point after each Basic Block. Immediately after 5)), an instruction cache hit determination call statement (fetch_icache (stringcpy + 8, 20), fetch_icache (stringcpy + 28, 16), fetch_icache (stringcpy + 28, 16), Insert fetch_icache (stringcpy + 44, 8) and fetch_icache (stringcpy + 52, 8)). Here, the two parameters of the fetch_icache call are the start address of Basic Bclock and its length (number of bytes). When a cache miss is detected as a result of calling the instruction cache hit determination procedure for each Basic Block, an execution time insertion statement with the cache line fill execution time (line fill time) as a parameter in the Basic Block A call is made.

図14は、本発明に係るデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャートその1、図15は、本発明に係るデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャートのその2、図16は、本発明に係るデータキャッシュヒット判定機能を有する手続きの追加によるソフトウェア検証モデル生成方法を説明するための模式図である。   FIG. 14 is a flowchart for explaining a processing procedure of a program for executing a procedure having a data cache hit determination function according to the present invention, and FIG. 15 shows a procedure having a data cache hit determination function according to the present invention. FIG. 16 of the flowchart for explaining the processing procedure of the program to be executed, FIG. 16 is a schematic diagram for explaining a software verification model generation method by adding a procedure having a data cache hit determination function according to the present invention.

以下、図14〜図16を参照しながら、データキャッシュメモリがターゲットCPUに内蔵されている場合に、Cベース言語記述のソフトウェア部品60に基づいて本発明に係るデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明する。ここで、図14のステップ205〜245の処理手順は、前述の図9のステップ105〜145の処理手順と実質的に同じである点に注意すべきである。   Hereinafter, referring to FIGS. 14 to 16, when the data cache memory is built in the target CPU, the procedure having the data cache hit determination function according to the present invention based on the software component 60 of the C base language description will be described. A processing procedure of the program to be executed will be described. Here, it should be noted that the processing procedure of steps 205 to 245 in FIG. 14 is substantially the same as the processing procedure of steps 105 to 145 in FIG. 9 described above.

まず、図14のステップ205では、実行時間追加前のCベース言語で記述されたソフトウェア部品60を入力して、このソフトウェア部品の中からANSI−C記述のみによるソースコードの部分(Cコードの部分と呼ばれる)を取り出す。次いで、ステップ210では、このCコードの部分に対して、Basic Block (基本ブロック)を認識し、制御点を挿入することにより、制御点が挿入されたCコードの部分(ANSI−C記述)62を出力する。このBasic Blockは、プログラムが分岐することなしに逐次的に走行する部分を指すものである。そして、その認識された Basic Block の前後に制御点が挿入される。   First, in step 205 in FIG. 14, the software component 60 described in the C base language before the execution time is added is input, and the source code portion (the C code portion) based only on the ANSI-C description is input from the software components. Take out). Next, at step 210, the C code portion (ANSI-C description) 62 in which the control point is inserted is recognized by recognizing the Basic Block (basic block) for this C code portion and inserting the control point. Is output. This Basic Block refers to a portion where the program runs sequentially without branching. Then, control points are inserted before and after the recognized basic block.

より詳しく説明すると、図16の(A)に示されるCコードの部分に対しては、ノードa及びノードbが一つの Basic Block と認識され、ノードc、ノードd及びノードeが一つの Basic Block と認識され、ノードc及びノードfが一つの Basic Block と認識され、ノードgが一つの Basic Block と認識される。このため、図14の(B)に示されるように、ノードbとノードcとの間、ノードeとノードgとの間、ノードfとノードgとの間、及びノードgの後に、それぞれ制御点(図16の(B)の●印の部分)が挿入される。   More specifically, for the C code portion shown in FIG. 16A, node a and node b are recognized as one Basic Block, and node c, node d and node e are one Basic Block. Node c and node f are recognized as one basic block, and node g is recognized as one basic block. Therefore, as shown in FIG. 14B, control is performed between the node b and the node c, between the node e and the node g, between the node f and the node g, and after the node g, respectively. A point (a portion marked with ● in FIG. 16B) is inserted.

さらに、ステップ220では、かかる制御点が挿入されたCコードの部分をコンパイルすることにより、ターゲットCPU用バイナリ・コード64を生成する。   Further, in step 220, the target CPU binary code 64 is generated by compiling the portion of the C code in which such control points are inserted.

さらに、ステップ230では、Cコードの部分62からBasic Block を順次取り出す。さらに、ステップ235では、取り出すBasic Block があるか否かを判定する。取り出すBasic Block があると判定された場合は、ステップ240において、前述のコンパイルの結果として生成されたターゲットCPU用バイナリ・コード(データコード)64に基づいて、ステップ230で取り出したBasic Block の制御点間の実行時間を算出する。又一方で、取り出すBasic Block がないと判定された場合は、前述のステップ205〜235で得られたCベース言語記述のソフトウェア部品を検証モデル66として出力し、本プログラムの処理を終了する。   Further, in Step 230, Basic Blocks are sequentially extracted from the C code portion 62. In step 235, it is determined whether there is a basic block to be extracted. If it is determined that there is a Basic Block to be extracted, the control point of the Basic Block extracted in Step 230 based on the target CPU binary code (data code) 64 generated as a result of the above-described compilation in Step 240. Calculate the execution time between. On the other hand, if it is determined that there is no Basic Block to be extracted, the software component of the C base language description obtained in steps 205 to 235 described above is output as the verification model 66, and the processing of this program is terminated.

前述のステップ240におけるBasic Block の制御点間の実行時間の算出は、
Σ[各命令のサイクル数]
なる演算式に基づいて行われる。
The calculation of the execution time between the control points of the Basic Block in the above step 240 is as follows:
Σ [number of cycles for each instruction]
It is performed based on the following arithmetic expression.

さらに、ステップ245では、制御点が挿入されたCコードの部分の任意の制御点(すなわち、Basic Block の後の任意の制御点)へ、算出された実行時間をパラメータとする実行時間挿入文(SpecCの場合は、waitfor 文である)を追加し、Cベース言語記述の検証モデル(実行時間挿入文追加後のCベース・モデル)66として出力する。   Further, in step 245, an execution time insertion statement (in which the calculated execution time is used as a parameter) is set to an arbitrary control point in the portion of the C code where the control point is inserted (that is, an arbitrary control point after the Basic Block). In the case of SpecC, it is a waitfor statement) and is output as a verification model (C base model after execution time insertion statement addition) 66 of the C base language description.

この際、図15のステップ250では、前述のコンパイルの結果として生成されたターゲットCPU用アセンブリコードを解析してデータアクセス命令(ロード命令及びストア命令)を検出し、このロード命令及びストア命令を生成する部分に対応するCソースコードを認識し、生成されたロード命令及びストア命令に対応するCコードの部位(すなわち、Cコードのデータアクセスが必要な部分)で、データキャッシュメモリがヒットしているか否かの判定(データキャッシュヒット判定:データキャッシュメモリのミス判定)を行うための手続きの呼び出しを挿入する。この際、図16の(B)に示すように、ロード命令が生成されるCソースコード部分には、同図(B)に示すように、load_dcacheのデータキャッシュヒット判定手続きが挿入され、ストア命令が生成されるCソースコード部分には、store_dcacheのデータキャッシュヒット判定手続きが挿入される。さらに、図15のステップ255では、データキャッシュメモリのキャッシュミスが検出されたときにデータキャッシュメモリの無効化を行うアセンブラコードを、データキャッシュメモリの無効化を行うためのデータキャッシュ無効化手続きの呼び出しを行うANSI−C記述のみによるソースコード(すなわち、Cコード)に変換する。   At this time, in step 250 of FIG. 15, the target CPU assembly code generated as a result of the above-described compilation is analyzed to detect a data access instruction (load instruction and store instruction), and the load instruction and store instruction are generated. Whether the data cache memory is hit at the part of the C code corresponding to the generated load instruction and store instruction (that is, the part that requires data access of the C code). Insert a procedure call for determining whether or not (data cache hit determination: data cache memory miss determination). At this time, as shown in FIG. 16B, a load_dcache data cache hit determination procedure is inserted in the C source code portion where the load instruction is generated, as shown in FIG. The data cache hit determination procedure of store_dcache is inserted into the C source code portion where is generated. Further, in step 255 in FIG. 15, an assembler code for invalidating the data cache memory when a cache miss in the data cache memory is detected is called a data cache invalidation procedure for invalidating the data cache memory. Is converted into source code (that is, C code) based only on the ANSI-C description.

さらに、図15のステップ260では、前述のステップ250で挿入された手続きに従ってデータキャッシュメモリがヒットしているか否かの判定を行い、ロード命令及びストア命令に対するデータキャッシュヒット判定機能を有する手続きを付与する。このデータキャッシュヒット判定機能においては、データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行った場合、当該データキャッシュメモリのキャッシュミスが検出されたときに、キャッシュラインフィルを実行するための実行時間をキャッシュミスペナルティとして追加するようになっている。   Further, in step 260 of FIG. 15, it is determined whether or not the data cache memory is hit according to the procedure inserted in step 250 described above, and a procedure having a data cache hit determination function for the load instruction and the store instruction is given. To do. In this data cache hit determination function, when it is determined whether or not the data cache memory is hit using the data tag memory portion held in the data cache memory, a cache miss of the data cache memory is determined. Is detected, the execution time for executing the cache line fill is added as a cache miss penalty.

さらに、図14のステップ265では、前述のステップ250で呼び出されたデータキャッシュ無効化手続きが実行されたときに、データキャッシュメモリ内に保持されているデータタグメモリ部のエントリを無効化するのに要する実行時間だけCPUを待ち状態にして、当該データキャッシュメモリの有効ビットの内容をクリアする。   Further, in step 265 of FIG. 14, when the data cache invalidation procedure called in the above-described step 250 is executed, the entry of the data tag memory portion held in the data cache memory is invalidated. The CPU is kept waiting for the required execution time, and the contents of the valid bit of the data cache memory are cleared.

前述の一連のステップ205〜265によって、Cベース言語記述のソフトウェア部品に対して、クロスコンパイルによって生成されたロード命令及びストア命令に対応するCコードの部位でデータキャッシュヒット判定を行ってキャッシュミスが検出されたときにキャッシュミスペナルティが追加されることになる。最終的に、上記の一連のステップで得られたCベース言語記述のソフトウェア部品が、前述のCベース言語記述の検証モデル66として出力される。   Through the series of steps 205 to 265 described above, a data miss hit is determined at the portion of the C code corresponding to the load instruction and the store instruction generated by the cross-compilation for the software component of the C base language description, and the cache miss is detected. A cache miss penalty will be added when detected. Finally, the software component of the C base language description obtained in the series of steps is output as the verification model 66 of the C base language description.

例えば、図16の(C)のCベース言語記述の検証モデルに示されるように、Cコードの部分をクロスコンパイルし、ロード命令又はストア命令のデータアドレスオペランドAi(iは任意の正の整数)とデータ長(バイト数)Liとを求める。データアドレスオペランドAiは、ロード命令やストア命令でロード、又はストアされるCソースコード内のデータの変数名やスタックのアドレスである。データ長Liは、ロード命令又はストア命令を行う際のオペランド長である。例えば、ARM CPUアセンブリコードの場合、オペランド長は、ロード命令のニモニックがLDRBであれば1バイト長であり、LDRHであれば2バイト長であり、LDRWであれば4バイト長であり、ストア命令のニモニックがSTRBであれば1バイト長であり、STRHであれば2バイト長であり、STRWであれば4バイト長である。図16(A)で示す例の場合、ロード命令でロードされる変数名は“p”であり、ストア命令命令でストアされるデータの変数名は“q”である。また、この場合、これらの変数の指すデータ長は4バイトであると仮定している(つまり、図示していないが、ARM CPUのアセンブラ命令の場合はLDRWやSTRW命令が生成されるものとする)。これによって、ロード命令に対するデータキャッシュヒット判定を行うためのデータキャッシュヒット判定呼び出し文(load_dcache (p, 4))と、ストア命令に対するデータキャッシュヒット判定を行うためのデータキャッシュヒット判定呼び出し文(store_dcache (q, 4))とが挿入される。ここで、ロード命令及びストア命令に対するデータキャッシュヒット判定を行った結果としてキャッシュミス(データアドレスに対応するデータの内容がデータキャッシュメモリ内に存在しないこと)を検出した場合には、キャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   For example, as shown in the verification model of the C-based language description in FIG. 16C, the C code portion is cross-compiled, and the data address operand Ai of the load instruction or the store instruction (i is an arbitrary positive integer) And the data length (number of bytes) Li are obtained. The data address operand Ai is a variable name or stack address of data in C source code loaded or stored by a load instruction or a store instruction. The data length Li is an operand length when performing a load instruction or a store instruction. For example, in the case of ARM CPU assembly code, the operand length is 1 byte if the load instruction mnemonic is LDRB, 2 bytes if LDRH, 4 bytes if LDRW, and the store instruction If the mnemonic is STRB, it is 1 byte long, if it is STRH it is 2 bytes long, and if it is STRW it is 4 bytes long. In the example shown in FIG. 16A, the variable name loaded by the load instruction is “p”, and the variable name of the data stored by the store instruction instruction is “q”. In this case, it is assumed that the data length pointed to by these variables is 4 bytes (that is, although not shown, an LDRW or STRW instruction is generated in the case of an ARM CPU assembler instruction. ). As a result, a data cache hit determination call statement (load_dcache (p, 4)) for performing a data cache hit determination for a load instruction and a data cache hit determination call statement (store_dcache ( q, 4)) and are inserted. Here, if a cache miss is detected as a result of the data cache hit determination for the load instruction and the store instruction (the data content corresponding to the data address does not exist in the data cache memory), the cache line fill The execution time insertion statement (waitfor statement) is called with the execution time (line fill time) as a parameter.

より詳しく説明すると、図16のロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))においては、アドレスAi〜Ai+Li−1までの範囲のデータアドレスに対応するデータの内容がデータキャッシュメモリ内に存在するか否かの判定を行い、キャッシュミス(当該データアドレスに対応するデータの内容がデータキャッシュメモリ内に存在しないこと)を検出した場合には、キャッシュミスが発生した回数だけキャッシュラインフィルの実行時間(ラインフィル時間)のサイクル数を挿入するようになっている。ここで、データキャッシュラインの置換が必要なストア・バックモードにおいては、ストア・バックの動作を実行するための実行時間のサイクル数も挿入するようになっている。   More specifically, in the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction of FIG. 16, the data contents corresponding to the data addresses in the range of addresses Ai to Ai + Li−1 are the data cache memory. If there is a cache miss (the content of the data corresponding to the data address does not exist in the data cache memory) is detected, the cache line is returned as many times as the cache miss has occurred. The number of cycles of fill execution time (line fill time) is inserted. Here, in the store-back mode that requires replacement of the data cache line, the number of execution time cycles for executing the store-back operation is also inserted.

又一方で、図16のストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li))においても、前述のロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))の場合と同様に、アドレスAi〜Ai+Li−1までの範囲のデータアドレスに対応するデータの内容がデータキャッシュメモリ内に存在するか否かの判定を行い、キャッシュミスを検出した場合には、キャッシュミスが発生した回数だけキャッシュラインフィルの実行時間のサイクル数を挿入するようになっている。   On the other hand, the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction in FIG. 16 is the same as the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction. In addition, it is determined whether or not the data corresponding to the data address in the range from address Ai to Ai + Li−1 exists in the data cache memory, and if a cache miss is detected, a cache miss has occurred. The number of cache line fill execution times is inserted as many times as the number of times.

ただし、上記のストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li))は、ストア・スルーモードにも対応可能なように、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))と区別している。   However, the data cache hit determination call statement (store_dcache (Ai, Li)) for the above store instruction is compatible with the store-through mode. )).

ストア・スルーモードの場合は、データキャッシュラインの置換は行わないが、ストア命令を実行する度にストアバッファフル(ストアバッファ内のメモリがフル(full)になっている状態)になっているか否かのチェックを行うようになっている。このストアバッファフルになっているか否かのチェックは、ストアバッファに所望のデータの値をセットした時刻と現在の時刻との比較を行うことによって実行される。又一方で、ストア・バックモードの場合は、必要に応じてキャッシュラインフィルの動作を実行し、データキャッシュラインのダーティビットをセットする(例えば、ダーティビットを“1”にする)。ARMプロセッサ等のターゲットCPUにより生成されたCベース言語記述の検証モデルでは、キャッシュミスが検出された場合に、キャッシュラインフィルが完了するまでは、CPUは待ち状態になる。   In store-through mode, the data cache line is not replaced, but the store buffer is full (the memory in the store buffer is full) each time a store instruction is executed. The check is done. This check of whether or not the store buffer is full is executed by comparing the time when the value of the desired data is set in the store buffer with the current time. On the other hand, in the store-back mode, the cache line fill operation is executed as necessary, and the dirty bit of the data cache line is set (for example, the dirty bit is set to “1”). In a verification model for a C-based language description generated by a target CPU such as an ARM processor, when a cache miss is detected, the CPU waits until the cache line fill is completed.

換言すれば、データキャッシュメモリがターゲットCPUに内蔵されている場合、図14〜図16にて説明したようなロード命令及びストア命令に対するデータキャッシュヒット判定呼び出し文に基づいてソフトウェア部品の検証モデルを生成する際に、ロード命令に対応するCコードの部位にデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li) )を挿入し、かつ、ストア命令に対応するCコードの部位にデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を挿入して得られるCベース言語記述の検証モデルをコンパイルする。このコンパイルにより生成されたホストCPU用バイナリ・コードをホストCPUで実行させることによって、Cベース・シミュレータを使用したCベース・シミュレーションを実行することが可能になる。   In other words, when the data cache memory is built in the target CPU, the software component verification model is generated based on the data cache hit determination call statement for the load instruction and the store instruction as described in FIGS. When inserting, a data cache hit determination call statement (load_dcache (Ai, Li)) is inserted into the C code portion corresponding to the load instruction, and a data cache hit determination call statement is inserted into the C code portion corresponding to the store instruction. Compile a verification model of C-based language description obtained by inserting (store_dcache (Ai, Li)). By executing the host CPU binary code generated by this compilation on the host CPU, it is possible to execute a C-based simulation using a C-based simulator.

このCベース・シミュレータを使用し、ロード命令及びストア命令に対応するCコードの部位にそれぞれ挿入されたデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))及びデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )に基づいてシミュレーションを実行した場合、データキャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間を加算しているので、シミュレーションによる実行時間の見積りの精度が従来方法よりも高くなり、実行時間の時間管理をより正確に行うことができる。   Using this C-based simulator, a data cache hit determination call statement (load_dcache (Ai, Li)) and a data cache hit determination call statement (store_dcache (store_dcache ()) inserted in the portions of the C code corresponding to the load instruction and the store instruction, respectively. Ai, Li))), the execution time for executing the cache line fill in the case of a cache miss in the data cache memory is added. It becomes higher than the method, and the time management of the execution time can be performed more accurately.

好ましくは、データキャッシュメモリのデータアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファ(例えば、TLB(トランスレーション・ルックアサイド・バッファ))がターゲットCPU内に設けられている場合に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li) )、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )において、メモリ管理ユニット機能が追加される。   Preferably, when a data address conversion buffer (for example, TLB (translation lookaside buffer)) for converting a data address of the data cache memory from a virtual address to a physical address is provided in the target CPU. The memory management unit function is added to the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction and the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction.

このメモリ管理ユニット機能においては、生成されたロード命令及びストア命令に対応するCコードの部位で、データアドレスがデータアドレス変換用バッファ内に存在するか否かの判定を行い、データアドレスがデータアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリをデータアドレス変換用バッファにロードする時間を加算するようにしている。それゆえに、データアドレス変換用バッファのミスの際にデータアドレス変換のエントリをロードする時間を含めた高精度のシミュレーションを実行することが可能になる。   In this memory management unit function, it is determined whether or not the data address exists in the data address conversion buffer at the portion of the C code corresponding to the generated load instruction and store instruction. When it is detected that it does not exist in the conversion buffer, the time for loading the data address conversion entry into the data address conversion buffer is added. Therefore, it is possible to execute a high-precision simulation including the time for loading the data address conversion entry when the data address conversion buffer is missed.

さらに詳しく説明すると、上記のメモリ管理ユニット機能の追加を可能にするために、データアドレス変換用バッファの内容を保持したキャッシュメモリを予め用意すると共に、仮想メモリのマッピング情報の内容を保持したページテーブルを主記憶装置内に予め用意しておく。   More specifically, in order to make it possible to add the memory management unit function described above, a page memory which prepares a cache memory holding the contents of the data address conversion buffer in advance and holds the contents of the virtual memory mapping information Are prepared in advance in the main memory.

上記のロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))に基づいて、アドレスAi〜Ai+Li−1までの範囲のデータアドレスがデータアドレス変換用バッファ内に存在するか否かの判定を行う。この判定結果として、データアドレス変換用バッファのキャッシュミス(当該データアドレスに対応するデータの内容がデータアドレス変換用バッファ内に存在しないこと)を検出した場合には、データアドレス変換用バッファのエントリの内容を主記憶装置内のページテーブルからロードした値に更新し、データアドレス変換用バッファのロードのためのサイクル数を挿入するようになっている。ここでは、データアドレス変換用バッファにロードする時間をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   Based on the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction, it is determined whether or not a data address in the range from address Ai to Ai + Li-1 exists in the data address conversion buffer. I do. As a result of this determination, if a cache miss in the data address conversion buffer (the content of the data corresponding to the data address does not exist in the data address conversion buffer) is detected, the entry of the data address conversion buffer entry The contents are updated to the values loaded from the page table in the main storage device, and the number of cycles for loading the data address conversion buffer is inserted. Here, an execution time insertion statement (waitfor statement) is called with the time to load into the data address conversion buffer as a parameter.

同様にして、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )に基づいて、アドレスAi〜Ai+Li−1までの範囲のデータアドレスがデータアドレス変換用バッファ内に存在するか否かの判定を行う。この判定結果として、データアドレス変換用バッファのキャッシュミスを検出した場合には、データアドレス変換用バッファのエントリの内容を主記憶装置内のページテーブルからロードした値に更新し、データアドレス変換用バッファのロードのためのサイクル数を挿入するようになっている。この場合も、データアドレス変換用バッファにロードする時間をパラメータとする実行時間挿入文(waitfor 文)の呼び出しが行われる。   Similarly, based on the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction, whether or not a data address in the range of addresses Ai to Ai + Li−1 exists in the data address conversion buffer. Judgment is made. As a result of this determination, when a cache miss in the data address conversion buffer is detected, the contents of the data address conversion buffer entry are updated to the values loaded from the page table in the main memory, and the data address conversion buffer is updated. Insert the number of cycles for loading. In this case as well, an execution time insertion statement (waitfor statement) is called with the time to load into the data address conversion buffer as a parameter.

さらに、好ましくは、上記のメモリ管理ユニット機能を実行する際に、データアドレスの保護機能の有無のチェックが行われる。ここで、データアドレス変換のアクセス保護に対する違反が検出された場合には、アクセス保護の例外が発生したことを知らせるようにしている。これによって、シミュレーションの実行時にデータアドレス変換のアクセス保護に対する違反を確実に検出することが可能になる。   Further, preferably, when the above-mentioned memory management unit function is executed, the presence / absence of a data address protection function is checked. Here, when a violation of the access protection of the data address conversion is detected, it is notified that an access protection exception has occurred. This makes it possible to reliably detect violations of data address translation access protection during simulation.

図17は、本発明に係るデータキャッシュヒット判定に関するプログラムをCソースコードに挿入した例を示す図である。ただし、図17の例は、図16にて説明したようなCコードの部分の例とは異なっている。   FIG. 17 is a diagram showing an example in which a program relating to data cache hit determination according to the present invention is inserted into C source code. However, the example of FIG. 17 is different from the example of the C code portion described with reference to FIG.

図17の左上の部分においては、ANSI−C記述によるCソースコードの部分が例示されている。ロード命令やストア命令の生成は、一般に、クロスコンパイラの最適化オプションに依存する。例えば、最適化オプションなしでクロスコンパイルすると、Cソースコードに現れる局所変数も、スタック領域に割り当てられ、局所変数にアクセスする度にロード命令やストア命令が生成される。従って、このCソースコードの部分を見た限りでは、ロード命令及びストア命令を生成する部分に対応するCソースコードの部分(例えば、図13の左上で複数のブロックにより囲まれている部分)を認識することは困難であり、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を挿入すべき箇所を特定することは困難である。   In the upper left part of FIG. 17, a C source code part by ANSI-C description is illustrated. The generation of load instructions and store instructions generally depends on cross compiler optimization options. For example, when cross-compiling without an optimization option, local variables appearing in C source code are also allocated to the stack area, and a load instruction and a store instruction are generated each time the local variable is accessed. Therefore, as far as the C source code portion is seen, the portion of the C source code corresponding to the portion that generates the load instruction and the store instruction (for example, the portion surrounded by a plurality of blocks in the upper left of FIG. 13). It is difficult to recognize, and the location where the data cache hit judgment call statement (load_dcache (Ai, Li)) for the load instruction and the data cache hit judgment call statement (store_dcache (Ai, Li)) for the store instruction should be inserted It is difficult to specify.

それゆえに、図17の左上のCソースコードの部分をクロスコンパイルして、同図の右側に示されるようなアセンブリ言語記述によるアセンブラ出力に展開するようにしている。このアセンブラ出力を解析することによって、生成されたロード命令及びストア命令に対応する箇所(例えば、図17の右側で複数のブロックにより囲まれている部分)を認識することができる。このようにして、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を挿入すべき箇所を特定することが容易に可能になる。   Therefore, the C source code portion at the upper left of FIG. 17 is cross-compiled and expanded into an assembler output by an assembly language description as shown on the right side of FIG. By analyzing the assembler output, it is possible to recognize a portion (for example, a portion surrounded by a plurality of blocks on the right side in FIG. 17) corresponding to the generated load instruction and store instruction. In this way, the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction and the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction are specified. It becomes possible easily.

さらに、図17の右側のアセンブラ出力において、生成されたロード命令に対応する箇所に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))を挿入し、かつ、生成されたストア命令に対応する箇所に、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を挿入する。その後、図17の左下の部分に示されるような更新後のC言語記述によるCソースコードの部分(すなわち、Cコードの部分)に変換する。この更新後のCコードの部分は、バジェット追加ツールによって、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )が挿入された形式になっている。より正確にいえば、図17の左下の部分では、更新後のCコードの部分をコンパイルすることによって最終的に出力されるCベース言語記述の検証モデルが図示されている。   Further, in the assembler output on the right side of FIG. 17, a data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction is inserted at a position corresponding to the generated load instruction, and the generated store instruction Insert a data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction at the location corresponding to. Thereafter, the data is converted into a C source code portion (that is, a C code portion) based on the updated C language description as shown in the lower left portion of FIG. The updated C code part is loaded into the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction and the data cache hit determination call statement (store_dcache (Ai, Li) for the store instruction by the budget addition tool. )) Is inserted. More precisely, the lower left part of FIG. 17 shows a verification model of a C-based language description that is finally output by compiling the updated C code part.

より詳しく説明すると、図17のCベース言語記述の検証モデルにおいては、生成されたロード命令(*q++)に対応するCコードの部位に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (q, 1))を挿入すると共に、生成されたストア命令(*p++、*p)に対応するCコードの部位に、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (q, 1) )を挿入する。ここでは、各々のロード命令及びストア命令に対するキャッシュヒット判定を行った結果としてキャッシュミスを検出した場合には、このキャッシュミスが検出された部分に対応するCコードの部位に、キャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文の呼び出しが行われる。   More specifically, in the verification model of the C-based language description in FIG. 17, the data cache hit determination call statement (load_dcache (q, q,) for the load instruction is added to the portion of the C code corresponding to the generated load instruction (* q ++). 1)) is inserted, and a data cache hit determination call statement (store_dcache (q, 1)) for the store instruction is inserted into the portion of the C code corresponding to the generated store instruction (* p ++, * p). Here, when a cache miss is detected as a result of the cache hit determination for each load instruction and store instruction, execution of the cache line fill is performed at the portion of the C code corresponding to the portion where the cache miss is detected. An execution time insertion statement with time (line fill time) as a parameter is called.

次いで、命令キャッシュメモリ及びデータキャッシュメモリの両方がターゲットCPUに内蔵されている場合に、本発明に係る命令キャッシュヒット判定機能及びデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明する。   Next, a processing procedure of a program that executes a procedure having an instruction cache hit determination function and a data cache hit determination function according to the present invention when both the instruction cache memory and the data cache memory are built in the target CPU will be described. .

この場合には、前述の図9及び図10のフローチャートと図14及び図15のフローチャートとを組み合わせたフローチャートに従って、本発明に係る命令キャッシュヒット判定機能及びデータキャッシュヒット判定機能を有するCベース言語記述の検証モデルが生成される。   In this case, the C-based language description having the instruction cache hit determination function and the data cache hit determination function according to the present invention is performed in accordance with the flowcharts of FIG. 9 and FIG. 10 and the flowcharts of FIG. 14 and FIG. The verification model is generated.

より詳しく説明すると、本発明に係る命令キャッシュヒット判定機能及びデータキャッシュヒット判定機能を有するCベース言語記述の検証モデルは、下記のようなステップ(1)〜ステップ(11)により生成される。
(1)Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップ
(2)当該制御点が挿入されたANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップ
(3)Basic Block の各々について、当該Basic Block の制御点間の実行時間を算出するステップ
(4)上記実行時間をパラメータとする実行時間挿入文を当該Basic Block の後の制御点に追加するステップ
(5)当該Basic Block の単位で命令キャッシュメモリがヒットしているか否かの判定を行うための手続き呼び出しを挿入するステップ
(6)ANSI−C記述によるソースコードにてロード命令及びストア命令に対応する部分(データのアクセスが必要な部分)で、データキャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを挿入するステップ
More specifically, a verification model for a C-based language description having an instruction cache hit determination function and a data cache hit determination function according to the present invention is generated by the following steps (1) to (11).
(1) A step of inputting a software component of C base language description, extracting a source code portion by ANSI-C description, recognizing a Basic Block, and inserting a control point (2) ANSI- in which the control point is inserted Step of compiling a source code portion by C description to generate binary code for target CPU (3) Step of calculating execution time between control points of Basic Block for each Basic Block (4) Execution time Step of adding an execution time insertion statement with the parameter as a parameter to the control point after the Basic Block (5) Insert a procedure call to determine whether or not the instruction cache memory is hit in units of the Basic Block (6) A portion (data) corresponding to a load instruction and a store instruction in the source code according to ANSI-C description Access is required part), inserting a call procedure for a determination of whether the data cache memory is hit

(7)命令キャッシュメモリ及びデータキャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュ無効化手続き及びデータキャッシュメモリ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップ
(8)上記命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行い、当該命令キャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算する命令キャッシュヒット判定機能を有する手続きを提供するステップ
(9)上記データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行い、当該データキャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を追加するデータキャッシュヒット判定機能を有する手続きを提供するステップ
(10)上記命令キャッシュ無効化手続き及び上記データキャッシュメモリ無効化手続きが実行されたときに、上記命令タグメモリ部及び上記データタグメモリ部のエントリを無効化するステップ
(11)上記の一連のステップで得られたCベース言語記述のソフトウェア部品を上記検証モデルとして出力するステップ
(7) A step of converting the assembler code for invalidating the instruction cache memory and the data cache memory into source code according to ANSI-C description for calling the instruction cache invalidation procedure and the data cache memory invalidation procedure. The instruction tag memory part held in the instruction cache memory is used to determine whether or not the instruction cache memory is hit, and when it is detected that the instruction cache memory is not hit, the cache A step of providing a procedure having an instruction cache hit determination function for adding execution time for executing line fill. (9) The data cache memory is hit using the data tag memory unit held in the data cache memory. Whether or not A step of providing a procedure having a data cache hit determination function for adding an execution time for executing a cache line fill when it is detected that the data cache memory is not hit (10) The instruction cache A step of invalidating an entry in the instruction tag memory unit and the data tag memory unit when the invalidation procedure and the data cache memory invalidation procedure are executed. (11) C base obtained in the series of steps Step of outputting the language description software component as the verification model

上記のような命令キャッシュヒット判定機能及びデータキャッシュヒット判定機能を有するCベース言語記述の検証モデルでは、Basic Block に挿入された各々の制御点間の実行時間を算出すると共に、Basic Block の単位で、ターゲットCPUに内蔵の命令キャッシュメモリがヒットしているか否かを判定し、キャッシュミスが検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、命令キャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、又一方で、データのアクセスが必要な部分で、ターゲットCPUに内蔵のデータキャッシュメモリがヒットしているか否かを判定し、キャッシュミスが検出された場合にキャッシュラインフィルを実行するための実行時間を加算する手続き呼び出しをソースコードに挿入し、データキャッシュヒット判定を行う手続きを用意して当該ソースコードと一緒にコンパイルし、シミュレーションを実行するようにしている。   In the verification model of the C-based language description having the instruction cache hit determination function and the data cache hit determination function as described above, the execution time between each control point inserted in the Basic Block is calculated, and the basic block unit is used. , Determine whether the instruction cache memory built into the target CPU is hit, insert a procedure call in the source code to add the execution time for executing the cache line fill when a cache miss is detected, Prepare a procedure for determining the instruction cache hit and compile it with the source code. On the other hand, determine whether or not the data cache memory built into the target CPU is hit where data access is required. Cache line fill when a cache miss is detected The procedure calls for adding the execution time of the order is inserted into the source code, to prepare a procedure for performing data cache hit determination compiled together with the source code, so that to perform the simulation.

上記のように、命令キャッシュメモリ及びデータキャッシュメモリの両方がターゲットCPUに内蔵されている場合にも、命令キャッシュメモリのキャッシュミス、及び、データキャッシュメモリのキャッシュミスの際にキャッシュラインフィルを実行するための実行時間を加算することによって、従来方法よりも実行時間の見積りの精度がさらに高くなり、シミュレーションの精度が顕著に向上する。   As described above, even when both the instruction cache memory and the data cache memory are built in the target CPU, the cache line fill is executed in the case of a cache miss of the instruction cache memory and a cache miss of the data cache memory. By adding the execution time for this, the accuracy of the estimation of the execution time becomes higher than that of the conventional method, and the accuracy of the simulation is significantly improved.

なお、当然のことではあるが、命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファ(例えば、TLB)がターゲットCPU内に設けられ、かつ、データアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファ(例えば、TLB)がターゲットCPU内に設けられている場合にも、命令キャッシュヒット判定呼び出し文(fetch_icache (Ai, Li))、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li) )、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li))において、前述のようなメモリ管理ユニット機能が追加される。   Of course, an instruction address conversion buffer (for example, TLB) for converting the instruction address from the virtual address to the physical address is provided in the target CPU, and the data address is changed from the virtual address to the physical address. Even when a data address conversion buffer (for example, TLB) is provided in the target CPU, an instruction cache hit determination call statement (fetch_icache (Ai, Li)) and a data cache hit determination for a load instruction The memory management unit function as described above is added to the call statement (load_dcache (Ai, Li)) and the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction.

このメモリ管理ユニット機能においては、Basic Block の単位で命令アドレスが命令アドレス変換用バッファ内に存在するか否かの判定を行い、当該命令アドレスが命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを命令アドレス変換用バッファにロードする時間を加算し、又一方で、生成されたロード命令及びストア命令に対応するCコードの部位で、データアドレスがデータアドレス変換用バッファ内に存在するか否かの判定を行い、データアドレスがデータアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリをデータアドレス変換用バッファにロードする時間を加算するようにしている。それゆえに、命令アドレス変換用バッファ及びデータアドレス変換用バッファのミスの際に命令アドレス変換のエントリ及びデータアドレス変換のエントリをロードする時間を含めたより高精度のシミュレーションを実行することが可能になる。   In this memory management unit function, it is determined whether or not an instruction address exists in the instruction address conversion buffer in units of Basic Block, and it is detected that the instruction address does not exist in the instruction address conversion buffer. When the instruction address conversion entry is loaded into the instruction address conversion buffer, the data address is converted to the data address at the portion of the C code corresponding to the generated load instruction and store instruction. The time to load the data address conversion entry into the data address conversion buffer when it is detected that the data address does not exist in the data address conversion buffer is determined. I try to add. Therefore, it is possible to execute a more accurate simulation including the time to load the instruction address conversion entry and the data address conversion entry when the instruction address conversion buffer and the data address conversion buffer are missed.

好ましくは、上記のメモリ管理ユニット機能を実行する際に、命令アドレス及びデータアドレスの保護機能の有無のチェックが行われる。ここで、命令キャッシュメモリ及びデータキャッシュメモリの少なくとも一方のアクセス保護に対する違反が検出された場合には、命令キャッシュメモリ及びデータキャッシュメモリの少なくとも一方のアクセス保護の例外が発生したことを知らせるようにしている。これによって、シミュレーションの実行時に命令キャッシュメモリ及びデータキャッシュメモリのアクセス保護に対する違反をより確実に検出することが可能になる。   Preferably, when executing the memory management unit function, the presence / absence of the protection function of the instruction address and the data address is checked. Here, when a violation of access protection of at least one of the instruction cache memory and the data cache memory is detected, it is notified that an access protection exception of at least one of the instruction cache memory and the data cache memory has occurred. Yes. This makes it possible to more reliably detect violations of the access protection of the instruction cache memory and the data cache memory when the simulation is executed.

図18は、命令キャッシュメモリ及びデータキャッシュメモリの両方がターゲットCPUに内蔵されている場合に、本発明に係る命令キャッシュヒット判定及びデータキャッシュヒット判定に関するプログラムをCソースコードに挿入した例を示す図である。   FIG. 18 is a diagram showing an example in which a program relating to instruction cache hit determination and data cache hit determination according to the present invention is inserted into C source code when both the instruction cache memory and the data cache memory are built in the target CPU. It is.

図18の左上の部分においては、ANSI−C記述によるCソースコードの部分が例示されている。このCソースコードの部分では、前述の図13の場合と同様に、バジェット追加ツールによって、各々のBasic Block の後の制御点を認識するために、同図の右側に示されるようなアセンブリ言語記述によるアセンブラ出力に展開するようにしている。   In the upper left part of FIG. 18, the part of the C source code by ANSI-C description is illustrated. In this C source code portion, as in the case of FIG. 13 described above, the assembly language description as shown on the right side of the same block is shown in order to recognize the control point after each Basic Block by the budget addition tool. Is expanded to assembler output.

このアセンブラ出力を解析することによって、CソースコードをBasic Block に分割し、Basic Blockの最後の制御点を認識して、実行時間挿入文(例えば、図18の左下の部分に示されるようなwaitfor(2)、 waitfor(4)、及びwaitfor(5) 等のwaitfor 文)と命令キャッシュヒット判定呼び出し文(fetch_icache文)を追加挿入する。   By analyzing this assembler output, the C source code is divided into Basic Blocks, the last control point of the Basic Block is recognized, and an execution time insertion statement (for example, waitfor as shown in the lower left part of FIG. 18). (2), waitfor statements such as waitfor (4) and waitfor (5)) and an instruction cache hit determination call statement (fetch_icache statement) are additionally inserted.

この更新後のCコードの部分は、バジェット追加ツールによって、各々のBasic Block の後の制御点にて命令キャッシュヒット判定呼び出し文(fetch_icache文)が追加挿入された形式になっている。   The updated C code portion is in a format in which an instruction cache hit determination call statement (fetch_icache statement) is additionally inserted at a control point after each Basic Block by a budget addition tool.

又一方で、図18の右側に示されるようなアセンブリ言語記述によるアセンブラ出力を解析することによって、生成されたロード命令及びストア命令に対応する箇所を認識することができる。このようにして、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を挿入すべき箇所を特定することが可能になる。   On the other hand, by analyzing the assembler output based on the assembly language description as shown on the right side of FIG. 18, the locations corresponding to the generated load instruction and store instruction can be recognized. In this way, the data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction and the data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction are specified. It becomes possible.

さらに、図18の右側のアセンブラ出力において、前述の図17の場合と同様に、生成されたロード命令に対応する箇所に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))を追加挿入し、かつ、生成されたストア命令に対応する箇所に、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )を追加挿入する。その後、図18の左下の部分に示されるような更新後のC言語記述によるCソースコードの部分(すなわち、Cコードの部分)に変換する。この更新後のCコードの部分は、バジェット追加ツールによって、Basic Block の単位で命令キャッシュヒット判定呼び出し文(fetch_icache文)が挿入されると共に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (Ai, Li))、及び、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (Ai, Li) )が挿入された形式になっている。より正確にいえば、図18の左下の部分では、更新後のCコードの部分をコンパイルすることによって最終的に出力されるCベース言語記述の検証モデルが図示されている。   Further, in the assembler output on the right side of FIG. 18, a data cache hit determination call statement (load_dcache (Ai, Li)) for the load instruction is placed at a position corresponding to the generated load instruction, as in the case of FIG. A data cache hit determination call statement (store_dcache (Ai, Li)) for the store instruction is additionally inserted at a location corresponding to the generated store instruction. Thereafter, the data is converted into a C source code portion (that is, a C code portion) based on an updated C language description as shown in the lower left portion of FIG. The updated C code portion is inserted with an instruction cache hit determination call statement (fetch_icache statement) in units of Basic Block by a budget addition tool and a data cache hit determination call statement (load_dcache (Ai, Li)), and a data cache hit judgment call statement (store_dcache (Ai, Li)) for the store instruction is inserted. More precisely, the lower left part of FIG. 18 shows a verification model of a C-based language description that is finally output by compiling the updated C code part.

より詳しく説明すると、図18のCベース言語記述の検証モデルにおいては、前述の図13の場合と同様に、各々のBasic Block の後の制御点に挿入されている実行時間挿入文(waitfor(2)、 waitfor(4)、及びwaitfor(5))の直後に、命令キャッシュヒット判定呼び出し文(fetch_icache (stringcpy, 8) 、fetch_icache (stringcpy+8, 20)、 fetch_icache (stringcpy+28, 16) 、fetch_icache (stringcpy+44, 8)、 及びfetch_icache (stringcpy+52, 8))を挿入する。なお、この例では、for文の終了条件の判定式( i<len の部分)は、ひとつのBasic Blcokと認識されるので、この部分に実行時間制御文(waitfor(2)文)と命令キャッシュヒット判定呼び出し文(fetch_icache (stringcpy+44, 8)文)が、この終了条件判定式の直前に挿入されて、waitfor(2), fetch_icache (stringcpy+44, 8), i<len の終了条件判定式に変換される。ここで、各々のBasic Block に対し命令キャッシュヒット判定を行った結果としてキャッシュミスを検出した場合には、当該Basic Block においてキャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文の呼び出しが行われる。   More specifically, in the verification model of the C-based language description in FIG. 18, the execution time insertion statement (waitfor (2) inserted in the control point after each Basic Block, as in the case of FIG. 13 described above. ), Waitfor (4), and waitfor (5)) immediately after the instruction cache hit determination call statement (fetch_icache (stringcpy, 8), fetch_icache (stringcpy + 8, 20), fetch_icache (stringcpy + 28, 16), fetch_icache (stringcpy + 44, 8), and fetch_icache (stringcpy + 52, 8)) are inserted. In this example, the judgment condition for the end condition of the for statement (i <len part) is recognized as one Basic Blcok, so the execution time control statement (waitfor (2) statement) and instruction cache are included in this part. A hit judgment call statement (fetch_icache (stringcpy + 44, 8) statement) is inserted immediately before this end condition judgment expression to determine the end condition of waitfor (2), fetch_icache (stringcpy + 44, 8), i <len Converted to an expression. Here, when a cache miss is detected as a result of the instruction cache hit determination for each Basic Block, an execution time insertion statement with the cache line fill execution time (line fill time) as a parameter in the Basic Block. Is called.

さらに、図18のCベース言語記述の検証モデルにおいては、前述の図17の場合と同様に、生成されたロード命令(*q++)に対応するCコードの部位に、ロード命令に対するデータキャッシュヒット判定呼び出し文(load_dcache (q, 1))を挿入すると共に、生成されたストア命令(*p++、*p)に対応するCコードの部位に、ストア命令に対するデータキャッシュヒット判定呼び出し文(store_dcache (p, 1) )を挿入する。ここでも、各々のロード命令及びストア命令に対するキャッシュヒット判定を行った結果としてキャッシュミスを検出した場合には、このキャッシュミスが検出された部分に対応するCコードの部位に、キャッシュラインフィルの実行時間(ラインフィル時間)をパラメータとする実行時間挿入文の呼び出しが行われる。   Further, in the verification model of the C-based language description in FIG. 18, as in the case of FIG. 17, the data cache hit determination for the load instruction is performed at the portion of the C code corresponding to the generated load instruction (* q ++). A call statement (load_dcache (q, 1)) is inserted, and a data cache hit determination call statement (store_dcache (p, 1) for the store instruction is inserted in the portion of the C code corresponding to the generated store instruction (* p ++, * p). 1) Insert). Again, when a cache miss is detected as a result of the cache hit determination for each load instruction and store instruction, execution of the cache line fill is performed at the portion of the C code corresponding to the portion where the cache miss is detected. An execution time insertion statement with time (line fill time) as a parameter is called.

本発明は、携帯電話、ディジタル・テレビ等のディジタル機器を制御するコンピュータの主要機能を搭載した半導体装置(チップ)の設計が完了した後に、検証モデルに基づいて高精度のハードウェア/ソフトウェア協調検証を実行するためのハードウェア/ソフトウェア協調検証システムに適用することが可能である。   The present invention provides high-precision hardware / software co-verification based on a verification model after the design of a semiconductor device (chip) equipped with the main functions of a computer that controls a digital device such as a mobile phone or a digital television is completed. It is possible to apply to a hardware / software co-verification system for executing

SoCの上流設計フローを示すフローチャートである。It is a flowchart which shows the upstream design flow of SoC. 従来のハードウェア/ソフトウェア協調検証方法を説明するためのデータ流れ図である。It is a data flowchart for demonstrating the conventional hardware / software co-verification method. 従来のハードウェア/ソフトウェア協調検証方法によるタイミングバジェット処理追加の様子を説明するための模式図である。It is a schematic diagram for demonstrating the state of the timing budget process addition by the conventional hardware / software co-verification method. 図3にて生成されたCベース言語記述の検証モデルに基づくCベース・シミュレーションについて説明するための模式図である。It is a schematic diagram for demonstrating C base simulation based on the verification model of the C base language description produced | generated in FIG. 本発明に係るソフトウェア検証モデル生成方法を実施するためのハードウェア環境を例示するブロック図である。It is a block diagram which illustrates the hardware environment for enforcing the software verification model generation method concerning this invention. ターゲットCPUを用いた組み込みシステムにおける命令キャッシュメモリ及びデータキャッシュメモリの接続例を示すブロック図である。It is a block diagram which shows the example of a connection of the instruction cache memory and data cache memory in the embedded system using target CPU. 図6の命令キャッシュメモリ、又は、データキャッシュメモリの具体的な構成例を示すブロック図である。FIG. 7 is a block diagram illustrating a specific configuration example of an instruction cache memory or a data cache memory in FIG. 6. 図7の命令キャッシュメモリ、又は、データキャッシュメモリのキャッシュミスによりキャッシュミスペナルティが発生する様子を説明するためのタイムチャートである。8 is a time chart for explaining how a cache miss penalty occurs due to a cache miss in the instruction cache memory or the data cache memory in FIG. 7. 本発明に係る命令キャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャート(その1)である。It is a flowchart (the 1) for demonstrating the process sequence of the program which performs the procedure which has the instruction cache hit determination function based on this invention. 本発明に係る命令キャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャート(その2)である。It is a flowchart (the 2) for demonstrating the process sequence of the program which performs the procedure which has the instruction cache hit determination function based on this invention. 本発明に係る命令キャッシュヒット判定機能を有する手続きの追加によるソフトウェア検証モデル生成方法を説明するための模式図である。It is a schematic diagram for demonstrating the software verification model production | generation method by addition of the procedure which has the instruction cache hit determination function concerning this invention. 図11にて生成されたCベース言語記述の検証モデルに基づくCベース・シミュレーションについて説明するための模式図である。It is a schematic diagram for demonstrating C base simulation based on the verification model of the C base language description produced | generated in FIG. 本発明に係る命令キャッシュヒット判定に関する手続呼び出しをCソースコードに挿入した例を示す図である。It is a figure which shows the example which inserted the procedure call regarding the instruction | command cache hit determination which concerns on this invention in C source code. 本発明に係るデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャート(その1)である。It is a flowchart (the 1) for demonstrating the process sequence of the program which performs the procedure which has a data cache hit determination function based on this invention. 本発明に係るデータキャッシュヒット判定機能を有する手続きを実行するプログラムの処理手順を説明するためのフローチャート(その2)である。It is a flowchart (the 2) for demonstrating the process sequence of the program which performs the procedure which has a data cache hit determination function based on this invention. 本発明に係るデータキャッシュヒット判定機能を有する手続きの追加によるソフトウェア検証モデル生成方法を説明するための模式図である。It is a schematic diagram for demonstrating the software verification model production | generation method by addition of the procedure which has a data cache hit determination function based on this invention. 本発明に係るデータキャッシュヒット判定に関するプログラムをCソースコードに挿入した例を示す図である。It is a figure which shows the example which inserted the program regarding the data cache hit determination which concerns on this invention in C source code. 本発明に係る命令キャッシュヒット判定及びデータキャッシュヒット判定に関するプログラムをCソースコードに挿入した例を示す図である。It is a figure which shows the example which inserted the program regarding instruction cache hit determination and data cache hit determination which concerns on this invention in C source code.

符号の説明Explanation of symbols

12 ターゲットCPU
14 主記憶装置
16 キャッシュメモリ
16−1 命令キャッシュメモリ
16−2 データキャッシュメモリ
18 バス
31 アドレス
32 コンパレータ
34 キャッシュヒット検出部
910 コンピュータ(PC又はWS)本体
912 ホストCPU(中央処理装置)
914 主記憶装置(MS)
916 キャッシュメモリ
918 バス
920 ディスプレイ
922 キーボード
924 マウス
930 外部記憶装置(ハードディスク装置)
12 Target CPU
DESCRIPTION OF SYMBOLS 14 Main memory 16 Cache memory 16-1 Instruction cache memory 16-2 Data cache memory 18 Bus 31 Address 32 Comparator 34 Cache hit detection part 910 Computer (PC or WS) main body 912 Host CPU (central processing unit)
914 Main memory (MS)
916 Cache memory 918 Bus 920 Display 922 Keyboard 924 Mouse 930 External storage device (hard disk device)

Claims (9)

命令キャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成するソフトウェア検証モデル生成方法であって、
Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、
該制御点が挿入された前記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、
前記Basic Block の各々について、該Basic Block の制御点間の実行時間を算出するステップと、
前記実行時間をパラメータとする実行時間挿入文を該Basic Block の後の制御点に追加するステップと、
該Basic Block の単位で命令キャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを該Basic Block の後の制御点に挿入するステップと、
命令キャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップと、
前記命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行い、当該命令キャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算する命令キャッシュヒット判定機能を有する手続きを提供するステップと、
前記命令キャッシュ無効化手続きが実行されたときに、前記命令タグメモリ部のエントリを無効化するステップと、
前記の一連のステップで得られたCベース言語記述のソフトウェア部品を前記検証モデルとして出力するステップとを有することを特徴とするソフトウェア検証モデル生成方法。
Software verification that uses a host CPU having an instruction cache memory to generate a software verification model to perform hardware and software collaborative verification of a semiconductor device on which at least one target CPU and one OS are mounted A model generation method,
Inputting a software component of C-base language description, extracting a source code part by ANSI-C description, recognizing Basic Block, and inserting a control point;
Compiling a portion of the source code according to the ANSI-C description in which the control points are inserted to generate binary code for the target CPU;
For each of the Basic Blocks, calculating an execution time between control points of the Basic Block;
Adding an execution time insertion statement with the execution time as a parameter to a control point after the Basic Block;
Inserting a procedure call for determining whether or not the instruction cache memory is hit in the unit of the Basic Block into a control point after the Basic Block;
Converting assembler code for invalidating the instruction cache memory into source code in ANSI-C description for calling an instruction cache invalidation procedure;
It is determined whether or not the instruction cache memory is hit using the instruction tag memory portion held in the instruction cache memory, and when it is detected that the instruction cache memory is not hit, Providing a procedure having an instruction cache hit determination function for adding an execution time for executing a cache line fill;
Invalidating an entry in the instruction tag memory unit when the instruction cache invalidation procedure is executed;
A method of generating a software verification model, comprising: outputting a software component of the C-based language description obtained in the series of steps as the verification model.
命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファが前記ターゲットCPU内に設けられている場合に、前記Basic Block の単位で前記命令アドレスが前記命令アドレス変換用バッファ内に存在するか否かの判定を行い、前記命令アドレスが前記命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを前記命令アドレス変換用バッファにロードする時間を加算するステップをさらに有することを特徴とする請求項1記載のソフトウェア検証モデル生成方法。   When an instruction address conversion buffer for converting an instruction address from a virtual address to a physical address is provided in the target CPU, the instruction address exists in the instruction address conversion buffer in units of the Basic Block. When it is detected that the instruction address does not exist in the instruction address conversion buffer, a time for loading an instruction address conversion entry into the instruction address conversion buffer is added. The method according to claim 1, further comprising a step. 前記命令アドレスの保護機能の有無をチェックし、前記命令アドレス変換用バッファのアクセス保護に対する違反が検出された場合に、前記命令アドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップをさらに有することを特徴とする請求項2記載のソフトウェア検証モデル生成方法。   Checking the presence / absence of a protection function of the instruction address, and notifying that an exception of the access protection of the instruction address conversion buffer has occurred when a violation of access protection of the instruction address conversion buffer is detected. 3. The software verification model generation method according to claim 2, further comprising: データキャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成するソフトウェア検証モデル生成方法であって、
Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、
該制御点が挿入された前記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、
前記Basic Block の制御点間の実行時間を算出するステップと、
前記実行時間をパラメータとする実行時間挿入文を該Basic Block の後の制御点に追加するステップと、
前記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、データキャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを挿入するステップと、
データキャッシュメモリの無効化を行うアセンブラコードを、データキャッシュ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップと、
前記データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行い、当該データキャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算するデータキャッシュヒット判定機能を有する手続きを提供するステップと、
前記データキャッシュ無効化手続きが実行されたときに、前記データタグメモリ部のエントリを無効化するステップと、
前記の一連のステップで得られたCベース言語記述のソフトウェア部品を前記検証モデルとして出力するステップとを有することを特徴とするソフトウェア検証モデル生成方法。
Software verification that uses a host CPU having a data cache memory to generate a software verification model to perform collaborative verification of hardware and software of a semiconductor device on which at least one target CPU and one OS are mounted A model generation method,
Inputting a software component of C-base language description, extracting a source code part by ANSI-C description, recognizing Basic Block, and inserting a control point;
Compiling a portion of the source code according to the ANSI-C description in which the control points are inserted to generate binary code for the target CPU;
Calculating an execution time between control points of the Basic Block;
Adding an execution time insertion statement with the execution time as a parameter to a control point after the Basic Block;
Inserting a procedure call for determining whether or not the data cache memory is hit in a portion where data access is required in the source code according to the ANSI-C description;
Converting assembler code for invalidating the data cache memory into source code in ANSI-C description for calling a data cache invalidation procedure;
It is determined whether or not the data cache memory is hit using the data tag memory portion held in the data cache memory, and when it is detected that the data cache memory is not hit, Providing a procedure having a data cache hit determination function for adding an execution time for executing a cache line fill;
Invalidating an entry in the data tag memory unit when the data cache invalidation procedure is executed;
A method of generating a software verification model, comprising: outputting a software component of the C-based language description obtained in the series of steps as the verification model.
データアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファが前記ターゲットCPU内に設けられている場合に、前記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、前記データアドレスが前記データアドレス変換用バッファ内に存在するか否かの判定を行い、前記データアドレスが前記データアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリを前記データアドレス変換用バッファにロードする時間を加算するステップをさらに有することを特徴とする請求項4記載のソフトウェア検証モデル生成方法。   In the case where a data address conversion buffer for converting a data address from a virtual address to a physical address is provided in the target CPU, data access is required in the source code according to the ANSI-C description. It is determined whether or not the data address exists in the data address conversion buffer, and when it is detected that the data address does not exist in the data address conversion buffer, an entry for data address conversion is displayed. 5. The software verification model generation method according to claim 4, further comprising a step of adding a time for loading to the data address conversion buffer. 前記データアドレスの保護機能の有無をチェックし、前記データアドレス変換用バッファのアクセス保護に対する違反が検出された場合に、前記データアドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップをさらに有することを特徴とする請求項5記載のソフトウェア検証モデル生成方法。   Checking the presence / absence of the data address protection function and, if a violation of access protection of the data address conversion buffer is detected, notifying that an access protection exception of the data address conversion buffer has occurred 6. The software verification model generation method according to claim 5, further comprising: 命令キャッシュメモリ及びデータキャッシュメモリを有するホストCPUを使用して、一つのターゲットCPU及び一つのOSが少なくとも搭載される半導体装置のハードウェア及びソフトウェアの協調検証を実行するために、ソフトウェアの検証モデルを生成するソフトウェア検証モデル生成方法であって、
Cベース言語記述のソフトウェア部品を入力してANSI−C記述によるソースコードの部分を取り出し、Basic Block を認識し、制御点を挿入するステップと、
該制御点が挿入された前記ANSI−C記述によるソースコードの部分をコンパイルしてターゲットCPU用バイナリ・コードを生成するステップと、
前記Basic Block の各々について、該Basic Block の制御点間の実行時間を算出するステップと、
前記実行時間をパラメータとする実行時間挿入文を該Basic Block の後の制御点に追加するステップと、
該Basic Block の単位で命令キャッシュメモリがヒットしているか否かの判定を行うための手続き呼び出しを該Basic Block の後の制御点に挿入するステップと、
前記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、データキャッシュメモリがヒットしているか否かの判定を行うための手続きの呼び出しを挿入するステップと、
命令キャッシュメモリ及びデータキャッシュメモリの無効化を行うアセンブラコードを、命令キャッシュ無効化手続き及びデータキャッシュメモリ無効化手続きの呼び出しを行うANSI−C記述によるソースコードに変換するステップと、
前記命令キャッシュメモリ内に保持されている命令タグメモリ部を用いて当該命令キャッシュメモリがヒットしているか否かの判定を行い、当該命令キャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を加算する命令キャッシュヒット判定機能を有する手続きを提供するステップと、
前記データキャッシュメモリ内に保持されているデータタグメモリ部を用いて当該データキャッシュメモリがヒットしているか否かの判定を行い、当該データキャッシュメモリがヒットしていないことが検出されたときに、キャッシュラインフィルを実行するための実行時間を追加するデータキャッシュヒット判定機能を有する手続きを提供するステップと、
前記命令キャッシュ無効化手続きおよび前記データキャッシュメモリ無効化手続きが実行されたときに、前記命令タグメモリ部および前記データタグメモリ部のエントリを無効化するステップと、
前記の一連のステップで得られたCベース言語記述のソフトウェア部品を前記検証モデルとして出力するステップとを有することを特徴とするソフトウェア検証モデル生成方法。
Using a host CPU having an instruction cache memory and a data cache memory, a software verification model is used to perform cooperative verification of hardware and software of a semiconductor device on which at least one target CPU and one OS are mounted. A software verification model generation method for generating,
Inputting a software component of C-base language description, extracting a source code part by ANSI-C description, recognizing Basic Block, and inserting a control point;
Compiling a portion of the source code according to the ANSI-C description in which the control points are inserted to generate binary code for the target CPU;
For each of the Basic Blocks, calculating an execution time between control points of the Basic Block;
Adding an execution time insertion statement with the execution time as a parameter to a control point after the Basic Block;
Inserting a procedure call for determining whether or not the instruction cache memory is hit in the unit of the Basic Block into a control point after the Basic Block;
Inserting a procedure call for determining whether or not the data cache memory is hit in a portion where data access is required in the source code according to the ANSI-C description;
Converting the assembler code for invalidating the instruction cache memory and the data cache memory into source code according to ANSI-C description for calling the instruction cache invalidation procedure and the data cache memory invalidation procedure;
It is determined whether or not the instruction cache memory is hit using the instruction tag memory portion held in the instruction cache memory, and when it is detected that the instruction cache memory is not hit, Providing a procedure having an instruction cache hit determination function for adding an execution time for executing a cache line fill;
It is determined whether or not the data cache memory is hit using the data tag memory portion held in the data cache memory, and when it is detected that the data cache memory is not hit, Providing a procedure having a data cache hit determination function for adding execution time for executing a cache line fill;
Invalidating entries in the instruction tag memory unit and the data tag memory unit when the instruction cache invalidation procedure and the data cache memory invalidation procedure are executed;
A method of generating a software verification model, comprising: outputting a software component of the C-based language description obtained in the series of steps as the verification model.
命令アドレスを仮想アドレスから物理アドレスに変換するための命令アドレス変換用バッファが前記ターゲットCPU内に設けられている場合に、前記Basic Block の単位で前記命令アドレスが前記命令アドレス変換用バッファ内に存在するか否かの判定を行い、前記命令アドレスが前記命令アドレス変換用バッファ内に存在しないことが検出されたときに、命令アドレス変換のエントリを前記命令アドレス変換用バッファにロードする時間を加算するステップと、
データアドレスを仮想アドレスから物理アドレスに変換するためのデータアドレス変換用バッファが前記ターゲットCPU内に設けられている場合に、前記ANSI−C記述によるソースコードにてデータのアクセスが必要な部分で、前記データアドレスが前記データアドレス変換用バッファ内に存在するか否かの判定を行い、前記データアドレスが前記データアドレス変換用バッファ内に存在しないことが検出されたときに、データアドレス変換のエントリを前記データアドレス変換用バッファにロードする時間を加算するステップとをさらに有することを特徴とする請求項7記載のソフトウェア検証モデル生成方法。
When an instruction address conversion buffer for converting an instruction address from a virtual address to a physical address is provided in the target CPU, the instruction address exists in the instruction address conversion buffer in units of the Basic Block. When it is detected that the instruction address does not exist in the instruction address conversion buffer, a time for loading an instruction address conversion entry into the instruction address conversion buffer is added. Steps,
In the case where a data address conversion buffer for converting a data address from a virtual address to a physical address is provided in the target CPU, data access is required in the source code according to the ANSI-C description. It is determined whether or not the data address exists in the data address conversion buffer, and when it is detected that the data address does not exist in the data address conversion buffer, an entry for data address conversion is displayed. 8. The software verification model generation method according to claim 7, further comprising a step of adding time for loading to the data address conversion buffer.
前記命令アドレスの保護機能の有無をチェックし、前記命令アドレス変換用バッファのアクセス保護に対する違反が検出された場合に、前記命令アドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップと、
前記データアドレスの保護機能の有無をチェックし、前記データアドレス変換用バッファのアクセス保護に対する違反が検出された場合に、前記データアドレス変換用バッファのアクセス保護の例外が発生したことを知らせるステップとをさらに有することを特徴とする請求項8記載のソフトウェア検証モデル生成方法。
Checking whether the instruction address protection function is present, and in the case where a violation of the access protection of the instruction address conversion buffer is detected, notifying that an access protection exception of the instruction address conversion buffer has occurred,
Checking whether the data address protection function is present, and notifying that an access protection exception of the data address conversion buffer has occurred when a violation of access protection of the data address conversion buffer is detected; 9. The software verification model generation method according to claim 8, further comprising:
JP2004199716A 2004-07-06 2004-07-06 Software verification model generation method Expired - Lifetime JP4342392B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004199716A JP4342392B2 (en) 2004-07-06 2004-07-06 Software verification model generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004199716A JP4342392B2 (en) 2004-07-06 2004-07-06 Software verification model generation method

Publications (2)

Publication Number Publication Date
JP2006023852A true JP2006023852A (en) 2006-01-26
JP4342392B2 JP4342392B2 (en) 2009-10-14

Family

ID=35797103

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004199716A Expired - Lifetime JP4342392B2 (en) 2004-07-06 2004-07-06 Software verification model generation method

Country Status (1)

Country Link
JP (1) JP4342392B2 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010003123A (en) * 2008-06-20 2010-01-07 Sony Corp Data processor, its method, and program
KR101066519B1 (en) 2009-06-11 2011-09-21 수원대학교산학협력단 Cache memory device and error detection method using the same
CN102279768A (en) * 2010-06-10 2011-12-14 株式会社东芝 Simulation apparatus, simulation program and simulation method
WO2012049728A1 (en) * 2010-10-12 2012-04-19 富士通株式会社 Simulation device, method, and program
US8428927B2 (en) 2007-10-15 2013-04-23 Fujitsu Limited Simulation method and simulation apparatus
JP2014241031A (en) * 2013-06-11 2014-12-25 富士通株式会社 Calculation device, calculation method, and calculation program
WO2015045472A1 (en) * 2013-09-24 2015-04-02 富士通株式会社 Simulation device, simulation method, and simulation program
JP2015170081A (en) * 2014-03-06 2015-09-28 三菱電機株式会社 simulation device and simulation program
WO2018163387A1 (en) * 2017-03-09 2018-09-13 三菱電機株式会社 Analysis device, analysis method, and analysis program

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8428927B2 (en) 2007-10-15 2013-04-23 Fujitsu Limited Simulation method and simulation apparatus
US8370797B2 (en) 2008-06-20 2013-02-05 Sony Corporation Data processing apparatus, method therefor, and computer program
JP2010003123A (en) * 2008-06-20 2010-01-07 Sony Corp Data processor, its method, and program
KR101066519B1 (en) 2009-06-11 2011-09-21 수원대학교산학협력단 Cache memory device and error detection method using the same
CN102279768B (en) * 2010-06-10 2014-06-25 株式会社东芝 Simulation apparatus and simulation method
US8744831B2 (en) 2010-06-10 2014-06-03 Kabushiki Kaisha Toshiba Simulation apparatus, simulation method and recording medium for recording simulation program
CN102279768A (en) * 2010-06-10 2011-12-14 株式会社东芝 Simulation apparatus, simulation program and simulation method
WO2012049728A1 (en) * 2010-10-12 2012-04-19 富士通株式会社 Simulation device, method, and program
JP5278624B2 (en) * 2010-10-12 2013-09-04 富士通株式会社 Simulation apparatus, method, and program
US9207916B2 (en) 2010-10-12 2015-12-08 Fujitsu Limited Simulation apparatus, method and medium
JP2014241031A (en) * 2013-06-11 2014-12-25 富士通株式会社 Calculation device, calculation method, and calculation program
WO2015045472A1 (en) * 2013-09-24 2015-04-02 富士通株式会社 Simulation device, simulation method, and simulation program
JP6015865B2 (en) * 2013-09-24 2016-10-26 富士通株式会社 Simulation apparatus, simulation method, and simulation program
JP2015170081A (en) * 2014-03-06 2015-09-28 三菱電機株式会社 simulation device and simulation program
WO2018163387A1 (en) * 2017-03-09 2018-09-13 三菱電機株式会社 Analysis device, analysis method, and analysis program
JPWO2018163387A1 (en) * 2017-03-09 2019-03-14 三菱電機株式会社 Analysis apparatus, analysis method, and analysis program

Also Published As

Publication number Publication date
JP4342392B2 (en) 2009-10-14

Similar Documents

Publication Publication Date Title
US6751583B1 (en) Hardware and software co-simulation including simulating a target processor using binary translation
Schnerr et al. High-performance timing simulation of embedded software
US7533246B2 (en) Application program execution enhancing instruction set generation for coprocessor and code conversion with marking for function call translation
US6263302B1 (en) Hardware and software co-simulation including simulating the cache of a target processor
US6006033A (en) Method and system for reordering the instructions of a computer program to optimize its execution
JP3951925B2 (en) Hardware / software co-verification method
US7908592B2 (en) Software/hardware partitioning program and method
KR102161192B1 (en) Method and apparatus for data mining from core trace
CN102486813A (en) Transaction-level system power consumption estimation method and system
CN113901745A (en) Chip testing method and device, electronic equipment and computer readable storage medium
Lie et al. A simple method for extracting models for protocol code
Wang et al. Accurate source-level simulation of embedded software with respect to compiler optimizations
JP4342392B2 (en) Software verification model generation method
US9465595B2 (en) Computing apparatus, computing method, and computing program
US7676774B2 (en) System LSI verification system and system LSI verification method
Posadas et al. Fast data-cache modeling for native co-simulation
US7779393B1 (en) System and method for efficient verification of memory consistency model compliance
Ottlik et al. Context-sensitive timing simulation of binary embedded software
Lee et al. Timed compiled-code simulation of embedded software for performance analysis of SOC design
Posadas et al. M3-SCoPE: performance modeling of multi-processor embedded systems for fast design space exploration
Schnerr et al. Cycle accurate binary translation for simulation acceleration in rapid prototyping of socs
Lu et al. Fast cache simulation for host-compiled simulation of embedded software
JP4271072B2 (en) Software verification model generation method
Wang et al. Software performance simulation strategies for high-level embedded system design
Schnerr et al. Systemc-based performance analysis of embedded systems

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20061106

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20061106

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070605

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20081126

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090422

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: 20090507

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090707

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

Free format text: PAYMENT UNTIL: 20120717

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4342392

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term