JP2006190085A - Modeling method and design method for digital circuit - Google Patents

Modeling method and design method for digital circuit Download PDF

Info

Publication number
JP2006190085A
JP2006190085A JP2005001501A JP2005001501A JP2006190085A JP 2006190085 A JP2006190085 A JP 2006190085A JP 2005001501 A JP2005001501 A JP 2005001501A JP 2005001501 A JP2005001501 A JP 2005001501A JP 2006190085 A JP2006190085 A JP 2006190085A
Authority
JP
Japan
Prior art keywords
bit width
source code
state
variable
digital circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2005001501A
Other languages
Japanese (ja)
Inventor
Hideaki Sasahara
英明 笹原
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.)
Asahi Kasei Corp
Original Assignee
Asahi Kasei Corp
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 Asahi Kasei Corp filed Critical Asahi Kasei Corp
Priority to JP2005001501A priority Critical patent/JP2006190085A/en
Publication of JP2006190085A publication Critical patent/JP2006190085A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To enhance simulation speed, to improve readability and maintenability of a source code so as to shorten a design period, and to inspect for errors in a design stage by a means other than the simulation. <P>SOLUTION: By elimination of bit width designation from RTL (register transfer level) description, the simulation speed is increased, and the readability and maintenability are improved. A means for automatic conversion from RTL without bit width designation to RTL with bit width designation is provided to automate a process for bit width decision and shorten the design period. Furthermore, the source code is made operable with an existing logic synthesis tool and simulator. A means for manually designating a bit width is provided, and a means which automatically collates the manually designated bit width with an automatically estimated bit width and issues an alert if any contradiction therebetween is found. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、デジタル回路のモデリング方法及び設計方法に関し、特に、レジスタトランスファレベル(RTL: Register Transfer Level)での記述、論理合成、検証する方法に関する。   The present invention relates to a digital circuit modeling method and design method, and more particularly, to a register transfer level (RTL) description, logic synthesis, and verification method.

デジタル回路のシミュレータおよび論理合成装置の入力としてRTL記述が広く用いられている。RTL記述ができるものとして、ハードウェア記述言語として知られているVHDL、およびVerilog−HDL、およびC言語ベースのSystemCなどが広く使用されている。しかし、ハードウェア記述言語の言語仕様上、あるいは論理合成装置の制約により、全ての変数にはビット幅があらかじめ割り当てられている必要がある。   RTL descriptions are widely used as inputs for digital circuit simulators and logic synthesis devices. VHDL, Verilog-HDL, and C language-based SystemC, which are known as hardware description languages, are widely used as RTL descriptions. However, due to the language specification of the hardware description language or due to restrictions of the logic synthesis apparatus, it is necessary to assign a bit width to all variables in advance.

図11は、従来の設計例のフローチャートを示す。
図11の設計フローのステップのうち、ステップ102とステップ103は回路設計の中心をなす。
FIG. 11 shows a flowchart of a conventional design example.
Of the steps in the design flow of FIG. 11, step 102 and step 103 are the center of circuit design.

この従来の設計フローでは、ステップ103は人手で行う必要がある。状態遷移規則とビット幅の定義に矛盾が生じないよう人間が考えながら慎重に行う必要があり、そのためステップ102とステップ103との間にやりとりが発生する。また、この過程で誤りも発生しやすい。また、計算の途中結果を保持する変数を定義する必要があるが、この場合もその途中結果がどの範囲の値をとりうるか、人間が計算して必要最小限のビット幅を割り当てなければならない。ビット幅の定義が実際に必要とされるより小さすぎると予期せぬ動作が発生する。しかも、回路シミュレータも論理合成装置もこのような誤りを警告しない。   In this conventional design flow, step 103 must be performed manually. It is necessary for humans to carefully consider the state transition rule and the bit width definition so that no contradiction arises. Therefore, an exchange occurs between step 102 and step 103. Also, errors are likely to occur during this process. In addition, it is necessary to define a variable that holds an intermediate result of the calculation. In this case as well, it is necessary for a human to calculate the range of values that the intermediate result can take and assign a necessary minimum bit width. Unexpected behavior will occur if the bit width definition is too small than is actually required. Moreover, neither circuit simulators nor logic synthesis devices warn of such errors.

また、回路シミュレータは標準で4値論理を扱う。すなわち、0、1、X(不定)、Z(ハイ・インピーダンス)である。しかしながら、特に設計初期の段階で4値論理が必要な部分はそれほど多くない。4値論理の計算は通常の演算の2倍以上の時間がかかる。また、ビット幅を限定するのにも演算処理が必要である。このため、RTL記述のシミュレーションはハードウェアの動作を完全に模擬できる利点があるが、必要以上の演算処理により時間がかかるという欠点もある。   The circuit simulator handles quaternary logic as standard. That is, 0, 1, X (undefined), and Z (high impedance). However, there are not so many parts that require quaternary logic especially in the early design stage. The calculation of quaternary logic takes more than twice as long as a normal operation. Also, arithmetic processing is necessary to limit the bit width. For this reason, the simulation of the RTL description has an advantage that the operation of the hardware can be completely simulated, but there is also a disadvantage that it takes time due to an unnecessarily arithmetic processing.

そこで、ビット幅の情報を人手で与えるのを最小限にして、回路の論理的構造を解析してビット幅を自動的に計算する方法がある(例えば、特許文献1)。   Therefore, there is a method for automatically calculating the bit width by analyzing the logical structure of the circuit while minimizing the manual supply of the bit width information (for example, Patent Document 1).

また、動作合成の直前にビット幅を確定する方法もある(例えば、特許文献2)。特許文献2では、RTLより抽象度の高い動作記述でC言語を使ってハードウェアを記述することにより、C言語のビット幅の仕様(16、32あるいは64ビット)がそのままハードウェアに反映されてしまい、ビットが冗長になるという問題を指摘し、C++を使って冗長のないビット幅を使うことができると述べている。   There is also a method of determining the bit width immediately before behavioral synthesis (for example, Patent Document 2). In Patent Document 2, by describing the hardware using the C language with an operation description having a higher abstraction level than the RTL, the C language bit width specification (16, 32, or 64 bits) is directly reflected in the hardware. Therefore, it points out the problem that the bit becomes redundant, and states that it is possible to use a non-redundant bit width by using C ++.

特開平5−54098号公報JP-A-5-54098 特開2003−216678号公報(第13頁、図9、図10参照)JP 2003-216678 A (see page 13, FIG. 9, FIG. 10)

しかし、特許文献1の方法によれば、入力のビット幅、記憶素子のビット幅、およびビット幅計算ライブラリを必要とする。特許文献1の方法は変数のビット幅から推定する方法であり、変数の定義域を厳密に解析する方法ではないため、nビットの変数でも2種類全ての場合をとらない変数の場合、推定結果に無駄を生じる可能性がある。 However, according to the method of Patent Document 1, an input bit width, a bit width of a storage element, and a bit width calculation library are required. The method of Patent Document 1 is a method of estimating from the bit width of a variable, and is not a method of strictly analyzing the domain of the variable. Therefore, even if an n-bit variable does not take all 2 n types of cases, estimation is performed. The result can be wasted.

また、特許文献2では、冗長のないビット幅を自動的に決定する手段を提供していない。   Patent Document 2 does not provide means for automatically determining a bit width without redundancy.

そこで、本発明の目的は、RTL記述を簡略化し、かつシミュレーション速度を高速化することが可能な、デジタル回路のモデリング方法、ビット幅決定方法、デジタル回路の設計装置、並びにビット幅変換装置を提供することにある。   Therefore, an object of the present invention is to provide a digital circuit modeling method, a bit width determination method, a digital circuit design device, and a bit width conversion device that can simplify RTL description and increase the simulation speed. There is to do.

また、本発明の他の目的は、ビット幅決定にかかる工程を自動化し、設計期間を短縮することが可能な、デジタル回路のモデリング方法及び設計方法を提供することにある。   Another object of the present invention is to provide a digital circuit modeling method and design method capable of automating the process for determining the bit width and shortening the design period.

本発明は、デジタル回路のモデリング方法であって、デジタル回路のソースコードを、ビット幅未定義の変数を含んだレジスタ転送レベルで記述することを特徴とする。   The present invention is a digital circuit modeling method, characterized in that the source code of a digital circuit is described at a register transfer level including a variable whose bit width is undefined.

前記ビット幅未確定の変数はビット幅を同一幅に揃えてシミュレーションを行うようにしてもよい。   The variable whose bit width is uncertain may be simulated by aligning the bit width to the same width.

本発明は、デジタル回路の設計方法であって、デジタル回路のソースコードを、ビット幅未定義の変数を含んだレジスタ転送レベルで記述する状態遷移規則定義ステップと、前記ソースコードをコンパイルした後、回路動作を確認するシミュレーションを行うシミュレーションステップと、前記シミュレーションステップを経たソースコードに基づいて、前記複数の変数のビット幅を所望の値にそれぞれ決定し、該ビット幅が決定された前記変数を有するソースコードを生成するビット幅定義ステップと、前記ビット幅が決定された変数を有するソースコードに基づいて、論理合成を行い、ゲートレベルのデジタル回路に変換する論理合成ステップとを具えたことを特徴とする。   The present invention is a digital circuit design method, in which a state transition rule defining step for describing a source code of a digital circuit at a register transfer level including a variable whose bit width is undefined, and after compiling the source code, A simulation step for performing a simulation for confirming circuit operation, and determining the bit widths of the plurality of variables to desired values based on the source code that has undergone the simulation step, and having the variables for which the bit widths have been determined A bit width defining step for generating a source code; and a logic synthesis step for performing logic synthesis based on the source code having the variable for which the bit width is determined, and converting the logic into a gate level digital circuit. And

前記状態遷移規則定義ステップにおいて、前記変数のうち、真及び偽の2値論理をとる変数はそのビット幅を1ビットとし、該変数以外の変数はそのビット幅を多ビットとしてもよい。   In the state transition rule definition step, among the variables, a variable having true and false binary logic may have a bit width of 1 bit, and variables other than the variable may have a bit width of multiple bits.

前記ビット幅定義ステップは、ビット幅未定義の変数を含んだ前記レジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップとを含んでもよい。   The bit width defining step is based on a parsing step for parsing a digital circuit source code described at the register transfer level including a variable whose bit width is undefined, and a parsing result of the parsing An initial state and a state transition function extracting step for extracting an initial state of a register in the source code and a state transition function of the source code, and the state transition based on the state of the input signal and the initial state A state search step of repeatedly performing image calculation by a function until the state set does not change, a bit width allocation step of determining a bit width of the variable to a desired value based on the result of the image calculation, and the parsing Based on the analysis result and the bit width information obtained from the bit width allocation step, the variable for which the bit width is determined It may include a source code output step for generating a source code.

前記ビット幅定義ステップにおいて決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証するステップを具えてもよい。   A step of comparing the bit width value determined in the bit width defining step with a predetermined bit width value and verifying whether or not the two values match by the comparison may be provided.

本発明は、ビット幅決定方法であって、ビット幅未定義の変数を含んだRTLで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップとを具えたことを特徴とする。   The present invention relates to a method for determining a bit width, a parsing step for performing parsing on a source code of a digital circuit described in RTL including a variable whose bit width is not defined, and an analysis result of the parsing Based on the initial state of the register in the source code and the initial state and state transition function extracting step for extracting the state transition function of the source code, based on the state of the input signal and the initial state, A state search step of repeatedly performing image calculation by a state transition function until the state set does not change, a bit width allocation step of determining a bit width of the variable to a desired value based on the result of the image calculation, and the syntax Based on the analysis result of the analysis and the bit width information obtained from the bit width assignment step, the source having the variable for which the bit width has been determined. Characterized in that comprises a source code output step for generating a Sukodo.

前記ビット幅定義手段において決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証する手段を具えてもよい。   Means for comparing the value of the bit width determined by the bit width defining means with the value of the bit width specified in advance and verifying whether the two values match by the comparison may be provided.

本発明は、コンピュータにより、上記記載のビット幅決定方法を実行可能なプログラムを提供する。   The present invention provides a program capable of executing the above-described bit width determination method by a computer.

本発明は、コンピュータにより実行される上記記載のプログラムを記録したコンピュータ読み取り可能な記録媒体を提供する。   The present invention provides a computer-readable recording medium that records the above-described program executed by a computer.

本発明は、論理合成方法であって、ビット幅未定義の変数を含んだレジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップと、前記ビット幅が決定された変数を有するソースコードに基づいて、論理合成を行い、ゲートレベルのデジタル回路に変換する論理合成ステップとを具えたことを特徴とする。   The present invention relates to a logic synthesis method, a parsing step for parsing a source code of a digital circuit described at a register transfer level including a variable whose bit width is undefined, and an analysis of the parsing Based on the result, the initial state of the register in the source code and the state transition function extraction step for extracting the state transition function of the source code, based on the state of the input signal and the initial state, A state search step of repeatedly performing image calculation by the state transition function until a state set does not change; a bit width allocation step of determining a bit width of the variable to a desired value based on a result of the image calculation; Based on the analysis result of the syntax analysis and the bit width information obtained from the bit width allocation step, the variable whose bit width is determined A source code output step of generating a source code to be performed, and a logic synthesis step of performing a logic synthesis based on the source code having the variable whose bit width is determined and converting it into a gate level digital circuit. Features.

本発明は、コンピュータにより、上記記載の論理合成方法を実行可能なプログラムを提供する。   The present invention provides a program capable of executing the above-described logic synthesis method by a computer.

本発明は、コンピュータにより実行される上記記載のプログラムを記録したコンピュータ読み取り可能な記録媒体を提供する。   The present invention provides a computer-readable recording medium that records the above-described program executed by a computer.

本発明は、ビット幅変換装置であって、ビット幅未定義の変数を含んだRTLで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析手段と、前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出手段と、入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索手段と、前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当て手段と、前記構文解析の解析結果及び前記ビット幅割り当て手段から得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力手段とを具えたことを特徴とする。   The present invention relates to a bit width conversion apparatus, a syntax analysis means for performing syntax analysis on a source code of a digital circuit described in RTL including a variable whose bit width is not defined, and an analysis result of the syntax analysis. Based on the initial state of the register in the source code and the state transition function extracting means for extracting the state transition function of the source code, and based on the state of the input signal and the initial state, State search means for repeatedly performing image calculation by a state transition function until the state set no longer changes, bit width assignment means for determining a bit width of the variable to a desired value based on the result of the image calculation, and the syntax Based on the analysis result of the analysis and the bit width information obtained from the bit width allocating means, a source code having a variable whose bit width is determined is generated. Characterized in that comprises an Sukodo output means.

前記ビット幅定義手段において決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証する手段を具えてもよい。   Means for comparing the value of the bit width determined by the bit width defining means with the value of the bit width specified in advance and verifying whether the two values match by the comparison may be provided.

本発明は、上記記載のビット幅変換装置を具えた論理合成装置を提供する。   The present invention provides a logic synthesis apparatus comprising the bit width conversion apparatus described above.

本発明によれば、状態遷移規則を定義し、シミュレーションステップを経たソースコードに基づいて、複数の変数のビット幅を所望の値にそれぞれ決定し、該ビット幅が決定された変数を有するソースコードを生成し、ビット幅が決定された変数を有するソースコードに基づいて論理合成を行ってゲートレベルのデジタル回路に変換するようにしたので、ビット幅を指定したRTL記述に比べて簡便な記述とすることができ、また、抽象度が高いことから、シミュレーション速度も速くすることができ、さらに、ビット幅を指定した場合と同等の数値厳密性を保つことができ、これにより、ソースコードの可読性、保守性を上げ、設計期間を短縮でき、設計段階での誤りをシミュレーション以外の手法で検査することができる。   According to the present invention, the state transition rules are defined, and based on the source code that has undergone the simulation step, the bit widths of a plurality of variables are respectively determined as desired values, and the source code having the variables for which the bit widths are determined Is generated and converted into a gate-level digital circuit by performing logic synthesis based on the source code having a variable whose bit width is determined, so that the description is simpler than the RTL description specifying the bit width. In addition, since the level of abstraction is high, the simulation speed can be increased, and the same numerical strictness as when the bit width is specified can be maintained. Therefore, maintainability can be improved, the design period can be shortened, and errors at the design stage can be inspected by a method other than simulation.

また、本発明によれば、各変数のビット幅を指定しないRTLを定義し、ビット幅を指定しないRTL記述からビット幅を指定した従来のRTL記述を生成する処理を適用するようにしたので、RTLよりさらに上流側の処理で抽象度の高い動作記述で変数のビット幅を指定する処理を不要とすることができる。   Also, according to the present invention, the RTL that does not specify the bit width of each variable is defined, and the conventional RTL description that specifies the bit width from the RTL description that does not specify the bit width is applied. It is possible to eliminate the process of designating the bit width of the variable with the action description having a high abstraction level in the process further upstream than the RTL.

さらに、本発明によれば、入力のビット幅を変更しなければならない場合においてもそれに合わせて全ての変数のビット幅が自動的に最適な値に調整することができ、必要な情報は入力の状態集合および初期状態集合のみで、記憶素子のビット幅もビット幅計算ライブラリも不要とすることができる。   Furthermore, according to the present invention, even when the bit width of the input has to be changed, the bit widths of all the variables can be automatically adjusted to the optimum values in accordance with the change, and necessary information can be input. Only the state set and the initial state set can eliminate the bit width of the storage element and the bit width calculation library.

さらにまた、本発明によれば、記憶素子のビット幅をあらかじめ指定した場合、状態遷移規則から推定されるビット幅と矛盾がないか検査する機能も提供でき、ビット幅の推定は変数の定義域を厳密に解析することによって行うことから、ビット幅のみを指定した推定方法に比べて冗長度の小さいビット幅を推定することができる。   Furthermore, according to the present invention, when the bit width of the storage element is specified in advance, it is possible to provide a function for checking whether there is a contradiction with the bit width estimated from the state transition rule. Therefore, it is possible to estimate a bit width having a small redundancy compared to an estimation method in which only the bit width is specified.

以下、図面を参照して、本発明の実施の形態を詳細に説明する。
[第1の例]
本発明の第1の実施の形態を、図1〜図4に基づいて説明する。
(構成)
図1は、本発明に係る、ビット幅変換装置1の構成を示す。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[First example]
A first embodiment of the present invention will be described with reference to FIGS.
(Constitution)
FIG. 1 shows a configuration of a bit width conversion apparatus 1 according to the present invention.

本装置1は、ビット幅定義部4と、論理合成部5と、検証部6とを備える。なお、その他の構成として、装置全体の統括的な制御を行うCPU10と、主制御プログラム等を記憶したROM11と、演算処理や本発明に係る制御プログラム等を記憶したRAM12、データ入出力部13等も備えている。   The apparatus 1 includes a bit width definition unit 4, a logic synthesis unit 5, and a verification unit 6. Other configurations include a CPU 10 that performs overall control of the entire apparatus, a ROM 11 that stores a main control program, a RAM 12 that stores arithmetic processing and a control program according to the present invention, a data input / output unit 13, and the like. It also has.

ビット幅定義部4は、シミュレーションステップを経たビット幅未定義の変数を含むソースコードに基づいて、ビット幅未定義の変数のビット幅を所望の値にそれぞれ決定し、該ビット幅が決定された変数を有するソースコードを生成する機能をもつ。   The bit width defining unit 4 determines the bit widths of the variables whose bit width is not defined based on the source code including the variables whose bit width is undefined after the simulation step, and the bit width is determined. It has a function to generate source code having variables.

論理合成部5は、ビット幅が決定された変数を有するソースコードに基づいて、論理合成を行い、ゲートレベルのデジタル回路に変換する機能をもつ。   The logic synthesis unit 5 has a function of performing logic synthesis based on a source code having a variable whose bit width is determined and converting it into a gate level digital circuit.

検証部6は、ビット幅定義部4において決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、それらが一致しているかどうかを検証する。なお、この検証部6は、システム構成の必要性に応じて任意に装備される。   The verification unit 6 compares the value of the bit width determined by the bit width definition unit 4 with the value of the bit width specified in advance, and verifies whether they match. In addition, this verification part 6 is arbitrarily equipped according to the necessity of a system configuration.

(動作)
ここでは、デジタル回路のモデリング方法について説明する。
なお、本例では、C++言語を使ってRTL記述を行うが、本発明は使用言語を限定するものではない。
(Operation)
Here, a digital circuit modeling method will be described.
In this example, RTL description is performed using C ++ language, but the present invention does not limit the language used.

図2は、本発明に係るデジタル回路のモデリング方法を示すフローチャートである。
まず、状態遷移規則定義202の工程では、デジタル回路のソースコードを、ビット幅未定義の変数を含んだRTL(Register Transfer Level、レジスタ転送レベル)で記述する。この工程では、従来の方法で見られた変数のビット幅定義204と並行して行う必要は無く、ビット幅を意識する必要も無い。ビット幅を意識しない設計は次の通りである。
FIG. 2 is a flowchart showing a digital circuit modeling method according to the present invention.
First, in the state transition rule definition 202 step, the source code of the digital circuit is described in RTL (Register Transfer Level, register transfer level) including a variable whose bit width is undefined. In this step, it is not necessary to carry out in parallel with the variable bit width definition 204 found in the conventional method, and there is no need to be aware of the bit width. The design without regard to bit width is as follows.

ここで、ステップ202の状態遷移規則定義の工程において、変数のうち、真及び偽の2値論理をとる変数はそのビット幅を1ビットとし、それ以外の変数はそのビット幅を多ビットとする。   Here, in the process of defining the state transition rule in step 202, among variables, a variable that takes true and false binary logic has a bit width of 1 bit, and other variables have a bit width of multiple bits. .

例えば、C++でRTLを記述する場合、変数を宣言するにあたり、明らかに「真」か「偽」の2値しかとらない変数はbool型として宣言し、それ以外はint型で宣言する。これにより、int型で宣言した変数はC++コンパイラの仕様にも依存するが、多くのコンパイラでは32ビット確保される。   For example, when RTL is described in C ++, when declaring a variable, a variable that clearly takes only two values, “true” or “false”, is declared as a “bool” type, and otherwise, it is declared as an “int” type. Thus, a variable declared as an int type depends on the specification of the C ++ compiler, but many compilers secure 32 bits.

C++でRTLを記述する際、int型で宣言される変数のビット幅を意識する必要のある場合はそれほど多くなく、RTLで状態遷移規則を記述する際、ほとんどの場合ビット幅無制限という仮定で設計を行うことができる。   When describing RTL in C ++, there are not many cases where it is necessary to be aware of the bit width of a variable declared with an int type. When describing state transition rules in RTL, the design is based on the assumption that in most cases the bit width is unlimited. It can be performed.

32ビットを超えそうな場合は64ビット型(Microsoft社のVisual C++を使用する場合、__int64型)を使用する。int型を使うことにより、シミュレーションに使用するCPUに最も適したビット幅で計算されるため、高速にシミュレーションすることができる。   If it is likely to exceed 32 bits, the 64-bit type (_int64 type when using Microsoft Visual C ++) is used. By using the int type, the calculation is performed with the bit width most suitable for the CPU used for the simulation, so that the simulation can be performed at high speed.

ステップ203のシミュレーションの工程では、ソースコードをコンパイルした後、回路動作を確認するシミュレーションを行う。例えば、C++で記述された回路は通常のC++コンパイラでコンパイルすることにより実行イメージを作成し、ビット幅を確定しないでシミュレーションを実行する。   In the simulation process of step 203, after compiling the source code, a simulation for confirming the circuit operation is performed. For example, a circuit described in C ++ creates an execution image by compiling with a normal C ++ compiler, and executes a simulation without determining the bit width.

シミュレーションを行い、正しい動作が得られたならば、本装置1を使用してステップ204の変数のビット幅定義の工程を実行する。   If a simulation is performed and correct operation is obtained, the apparatus 1 is used to execute the variable bit width defining step of step 204.

シミュレーションステップを経たソースコードに基づいて、複数の変数のビット幅を所望の値にそれぞれ決定し、ビット幅が決定された変数を備えるソースコードを生成する。例えば、C++でビット幅未確定の状態で記述されたソースコードを入力し、ビット幅が全て指定されたVerilogで記述されたRTLのソースコードを出力する。   Based on the source code that has undergone the simulation step, the bit widths of the plurality of variables are respectively determined as desired values, and source code including the variables for which the bit widths are determined is generated. For example, the source code described in the state where the bit width is undefined in C ++ is input, and the RTL source code described in Verilog with all the bit widths specified is output.

その後は、ステップ205の論理合成の工程を経て、ゲートレベルの回路に変換され、設計を完了する。   Thereafter, the circuit is converted into a gate level circuit through the logic synthesis process of step 205, and the design is completed.

なお、レジスタ転送レベル(RTL)とは、回路を乗算器、算術論理ユニット、レジスタファイルといった機能ユニット間の同期転送として回路を記述する抽象度レベルのことをいう。   The register transfer level (RTL) is an abstraction level at which a circuit is described as a synchronous transfer between functional units such as a multiplier, an arithmetic logic unit, and a register file.

ゲートレベルとは、回路をAND,OR,NOTあるいはフリップフロップの組み合わせで記述する抽象度レベルのことであり、回路図と同等である。   The gate level is an abstraction level at which a circuit is described by a combination of AND, OR, NOT, or flip-flop, and is equivalent to a circuit diagram.

<具体例>
次に、デジタル回路のモデリング方法の具体例について説明する。
以下、従来の処理と比較して説明していく。
<Specific example>
Next, a specific example of a digital circuit modeling method will be described.
Hereinafter, a description will be given in comparison with conventional processing.

具体例として、無限インパルス応答(IIR)のデジタルフィルタの設計例について説明する。なお、言語は、SystemCを使用した。   As a specific example, a design example of an infinite impulse response (IIR) digital filter will be described. The language used was SystemC.

図3は、前述した従来技術の図11のフローチャートに対応したプログラム100の1例を示すものであり、言語としてSystemCを使用して記述した無限インパルス応答(IIR)のデジタルフィルタの設計を比較して示す例である。   FIG. 3 shows an example of the program 100 corresponding to the flowchart of FIG. 11 of the prior art described above, and compares the design of an infinite impulse response (IIR) digital filter described using SystemC as a language. It is an example shown.

図3のプログラムにおいて、図11のステップ102に相当する部分は、420〜425行目の文である。   In the program of FIG. 3, the part corresponding to step 102 of FIG. 11 is the sentence on the 420th to 425th lines.

ここで入力信号inおよび内部状態を表す信号zregに演算処理あるいは写像を施し、得られた値を次の状態を表す値としてzregに代入する。この文は411行目によって、クロック信号clkの立ち上がりエッジで駆動されることが指定される。よって、クロックclkの立ち上がりエッジの前後でのzregの変化を表しているので、これが状態遷移規則に当たる。   Here, arithmetic processing or mapping is performed on the input signal in and the signal zreg representing the internal state, and the obtained value is substituted into zreg as a value representing the next state. This sentence is designated by the 411st line to be driven at the rising edge of the clock signal clk. Therefore, it represents a change in zreg before and after the rising edge of the clock clk, and this corresponds to the state transition rule.

図11のステップ103に相当する部分は、405〜407行目の文であり、sc_uint<10>あるいはsc_uint<20>と宣言されている部分である。   The portion corresponding to step 103 in FIG. 11 is a sentence on lines 405 to 407, and is a portion declared as sc_uint <10> or sc_uint <20>.

状態を表す変数zregがとりうる値は、420〜425行目の文を見て設計者が注意深く追跡した結果、0〜220−1までの値をとりうることがわかる。 The value that can be taken by the variable zreg representing the state can be a value from 0 to 2 20 −1 as a result of careful tracing by the designer looking at the sentences in the 420th to 425th lines.

そこで、20ビットあればこれらの値を表現するのに必要十分であるという判断を下し、20ビット符号なしと宣言している。それから出力である変数outはzregを10ビット右シフトしたものであるから、10ビット符号なしでよいとわかる。   Therefore, a determination is made that 20 bits are necessary and sufficient to express these values, and a 20-bit unsigned code is declared. Then, since the output variable “out” is obtained by shifting zreg to the right by 10 bits, it can be understood that there is no 10-bit code.

もし、420〜425行目の文を書き換えた場合、設計者は再度zregの取りうる範囲を評価し、ビット幅を変更する必要あると判断した場合は関連する405〜407行目の文におけるビット幅を修正する。   If the sentence on the 420th to 425th lines is rewritten, the designer again evaluates the range that zreg can take, and if it is determined that the bit width needs to be changed, the bit in the related sentence on the 405th to 407th lines Correct the width.

このように、図11のステップ102とステップ103とは、互いにフィードバックがある。   Thus, step 102 and step 103 in FIG. 11 have feedback from each other.

次に、図4は、本発明に係る図2のフローチャートに対応したプログラム200の1例を示すものであり、言語としてSystemCを使用して記述した無限インパルス応答(IIR)のデジタルフィルタの設計例を示す。   Next, FIG. 4 shows an example of the program 200 corresponding to the flowchart of FIG. 2 according to the present invention, and an infinite impulse response (IIR) digital filter design example described using SystemC as a language. Indicates.

前述した従来の図3のプログラム例では変数outおよびzregがビット幅および符号を指定して宣言されているのに対して、本発明に係る図4のプログラム例では全てint型で宣言する。   In the conventional program example of FIG. 3 described above, the variables out and zreg are declared by specifying the bit width and the sign, whereas in the program example of FIG. 4 according to the present invention, all are declared in the int type.

図4のプログラムにおいて、図2のステップ202に相当する工程は、520〜525行目の文であり、形式的には、ステップ420〜425行目と変わりは無い。   In the program of FIG. 4, the process corresponding to step 202 of FIG. 2 is a sentence on lines 520 to 525, and formally, there is no change from steps 420 to 425.

しかし、従来の図3のプログラムでは、状態遷移規則である420〜425行目の文を修正した場合、405〜407行目の文における変数のビット幅を修正する必要が生じることがあるのに対して、本発明の図4のプログラムでは、520〜525行目の文を修正するだけでよい。   However, in the conventional program of FIG. 3, when the sentence of the 420th to 425th lines, which is the state transition rule, is modified, it may be necessary to modify the bit width of the variable in the sentence of the 405th to 407th lines. On the other hand, in the program of FIG. 4 of the present invention, it is only necessary to correct the sentence on the 520th to 525th lines.

従来の図3のプログラムでは、405〜407行目の文における修正を忘れると予期せぬ動作となるのに対して、本発明の図4のプログラムでは、その危険性がない。   In the conventional program shown in FIG. 3, if the sentence in the lines 405 to 407 is forgotten to be corrected, an unexpected operation is performed. On the other hand, the program shown in FIG.

ただし、従来の図3のプログラムも、本発明の図4のプログラムも設計しようとするデジタル回路を表現したものであると同時にC++のプログラムであるので既存のC++コンパイラを使ってコンパイルし、コンピュータ上で実行することができる。   However, since the conventional program of FIG. 3 and the program of FIG. 4 of the present invention both express the digital circuit to be designed and are a C ++ program, they are compiled using an existing C ++ compiler, Can be done with.

このコンパイルされたC++プログラムを実行する工程が、従来の図11のステップ104あるいは本発明の図2のステップ203に相当するシミュレーションである。   The process of executing the compiled C ++ program is a simulation corresponding to the conventional step 104 in FIG. 11 or the step 203 in FIG. 2 of the present invention.

本発明の図4のプログラムには、ビット幅の情報が入っていないが、ビット幅を指定した従来の図3のプログラムと同一のシミュレーション結果が得られる。   Although the program of FIG. 4 of the present invention does not contain bit width information, the same simulation result as that of the conventional program of FIG. 3 in which the bit width is specified can be obtained.

シミュレーション結果を解析し、予期していた動作となっていれば、従来技術では、図11のステップ105の論理合成の工程にかける。これは、市販の論理合成装置を使ってゲートレベルに変換する。実際のLSIになるまでにはさらにレイアウトなどいくつかの工程があるが、本発明とは関係ないので省略する。   If the simulation result is analyzed and the expected operation is obtained, the conventional technique goes to the logic synthesis step of step 105 in FIG. This is converted to the gate level using a commercially available logic synthesis device. There are a number of further steps such as layout until an actual LSI is obtained, but it is omitted because it is not related to the present invention.

図11のステップ104の終了時点では正しく動作する図3のソースコードがあり、全ての変数にビット幅が定義されている。このようなソースコードを処理できる論理合成装置は市販されている。   At the end of step 104 in FIG. 11, there is the source code in FIG. 3 that operates correctly, and the bit width is defined for all variables. Logic synthesis apparatuses capable of processing such source code are commercially available.

一方、図2のステップ203の終了時点では正しく動作する図4のソースコードがあるが、outおよびzregは確定していない。既存の論理合成装置は処理を拒絶するか、C++コンパイラと同一解釈をして多くの場合int型を符号付32ビットと解釈する。しかし、zregは20ビットあればよいので12ビット分無駄な回路が生成される。   On the other hand, there is the source code of FIG. 4 that operates correctly at the end of step 203 of FIG. 2, but out and zreg are not fixed. Existing logic synthesizers either reject the processing or interpret the same as the C ++ compiler and often interpret the int type as signed 32 bits. However, since zreg only needs 20 bits, a wasteful circuit of 12 bits is generated.

図2のステップ204は、この問題を解決するために存在する。すなわち、ステップ204では、本発明の図4のプログラムで表されたソースコードを、従来の図3のプログラムの形式に自動変換する。その際、各変数を表現できる必要十分なビット幅を自動的に決定する。ステップ204の入力および出力は本例ではSystemCであるが、Verilog−HDLなど別の言語で出力してもよい。これにより、既存の論理合成装置で論理合成できる。   Step 204 of FIG. 2 exists to solve this problem. That is, in step 204, the source code represented by the program of FIG. 4 of the present invention is automatically converted into the conventional program format of FIG. At that time, a necessary and sufficient bit width capable of expressing each variable is automatically determined. The input and output of step 204 is SystemC in this example, but may be output in another language such as Verilog-HDL. Thereby, logic synthesis can be performed by an existing logic synthesis device.

なお、505行目にある入力変数inにはビット幅を指定する必要がある。これはinがどの変数にも依存していないため、inのとりうる範囲を推定できないためである。但し、inが他のモジュールの出力に接続されている場合で、そのモジュールの出力の変数の取りうる範囲が推定できるのであれば、inの宣言にビット幅を指定する必要は無い。   It is necessary to specify the bit width for the input variable in on the 505th line. This is because in does not depend on any variable, and therefore the range that in can take cannot be estimated. However, if in is connected to the output of another module and the range of the output variable of that module can be estimated, there is no need to specify the bit width in the declaration of in.

[第2の例]
本発明の第2の実施の形態を、図5〜図10に基づいて説明する。なお、前述した第1の例と同一部分については、その説明を省略し、同一符号を付す。
[Second example]
A second embodiment of the present invention will be described with reference to FIGS. In addition, about the same part as the 1st example mentioned above, the description is abbreviate | omitted and the same code | symbol is attached | subjected.

(構成)
図5は、ビット幅変換装置50の構成例を示す。このビット幅変換装置50は、前述した第1の例の図1に示したデジタル回路の設計装置1内のビット幅定義部4の処理に対応するものである。
(Constitution)
FIG. 5 shows a configuration example of the bit width conversion device 50. The bit width conversion apparatus 50 corresponds to the processing of the bit width defining unit 4 in the digital circuit design apparatus 1 shown in FIG. 1 of the first example.

ビット幅変換装置50は、ビット幅未確定のソースコード51が入力されるソースコード入力部52と、構文解析部53と、状態遷移規則抽出部54と、状態検索部55と、ビット幅割り当て部56と、ビット幅の確定したソースコード62を出力するソースコード出力部57と、解析木記憶部58と、記号表記憶部59と、状態遷移関数記憶部60と、既到達状態集合記憶部61とからなる。   The bit width conversion device 50 includes a source code input unit 52 to which a source code 51 whose bit width is not determined, a syntax analysis unit 53, a state transition rule extraction unit 54, a state search unit 55, and a bit width allocation unit. 56, a source code output unit 57 that outputs a source code 62 with a determined bit width, an parse tree storage unit 58, a symbol table storage unit 59, a state transition function storage unit 60, and a reached state set storage unit 61. It consists of.

(動作)
次に、本装置50の動作について説明する。
ここでは、ビット幅決定方法について説明する。
(Operation)
Next, the operation of the apparatus 50 will be described.
Here, a bit width determination method will be described.

図6は、ビット幅を指定しないRTL記述からビット幅を指定したRTL記述に変換する処理例を示すフローチャートである。   FIG. 6 is a flowchart showing an example of processing for converting an RTL description not specifying a bit width into an RTL description specifying a bit width.

この図6のフローチャートは、前述した図2のフローチャートにおけるステップ204の詳細を示すものである。   The flowchart of FIG. 6 shows details of step 204 in the flowchart of FIG. 2 described above.

このビット幅を指定しないRTL記述からビット幅を指定したRTL記述に変換する理由は、ビット幅を指定しないRTLを論理合成できる論理合成装置は存在しないので、論理合成する際にはビット幅を指定したRTL記述を生成する図2のステップ204の工程が必要となるからである。   The reason for converting this RTL description that does not specify the bit width to the RTL description that specifies the bit width is that there is no logic synthesis device that can synthesize RTL that does not specify the bit width, so the bit width is specified when performing logic synthesis. This is because the process of step 204 in FIG. 2 for generating the RTL description is required.

以下、図6を用いて、ビット幅を指定しないRTLからビット幅を指定したRTLを生成する処理において、ビット幅推定の手順について説明する。   Hereinafter, a procedure for estimating the bit width in the process of generating the RTL specifying the bit width from the RTL not specifying the bit width will be described with reference to FIG.

ビット幅推定のために必要なものは、ステップ302のC++ソースコードである。   What is needed for bit width estimation is the C ++ source code of step 302.

まず、ステップ303の工程では、ビット幅未定義の変数を含んだステップ302に示すRTLで記述されたデジタル回路のソースコードに対して、構文解析を行う。   First, in the process of step 303, syntax analysis is performed on the source code of the digital circuit described in the RTL shown in step 302 including a variable whose bit width is undefined.

ステップ304の初期状態及び状態遷移関数を抽出する工程では、構文解析の解析結果に基づいて、ソースコード内にあるレジスタの初期状態と、ソースコードの状態遷移関数とを抽出する。   In the process of extracting the initial state and the state transition function in step 304, the initial state of the register in the source code and the state transition function of the source code are extracted based on the analysis result of the syntax analysis.

ここで、抽出された状態遷移関数は、現在の状態と入力の状態の直積集合から1クロック先の状態への写像を表現する。また、リセット直後のレジスタの初期状態は、ソースコード中にあるリセット信号を指定して、リセット時の代入文から求める。リセット状態が定義されていなければ定数を代入している代入文から求める。定数を代入している代入文が存在しない場合は0を初期状態とする。   Here, the extracted state transition function represents a mapping from a Cartesian product set of the current state and the input state to a state one clock ahead. The initial state of the register immediately after reset is obtained from an assignment statement at the time of reset by designating a reset signal in the source code. If the reset state is not defined, it is obtained from an assignment statement that assigns a constant. If there is no assignment statement that assigns a constant, 0 is set as the initial state.

ステップ306の状態探索の工程では、入力信号の状態及び初期状態に基づいて、状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う。   In the state search step of step 306, based on the state of the input signal and the initial state, image calculation using the state transition function is repeated until the state set does not change.

すなわち、ステップ304で得られた初期状態集合定義を最初の既到達状態集合として、既到達状態集合を状態遷移関数で写像した像集合を既到達状態集合に追加することを繰り返し、最終的には既到達状態が変化しなくなるまで続ける。   That is, the initial state set definition obtained in step 304 is used as the first reached state set, and an image set obtained by mapping the reached state set with the state transition function is repeatedly added to the reached state set. Continue until the reached state no longer changes.

ステップ307の工程では、ステップ306の状態探索の像計算の結果、全ての変数のとりうる状態が数値として得られるので、この数値を表現できる必要最小限なビット幅を割り当てる。   In the step 307, as a result of the image calculation of the state search in the step 306, possible states of all the variables are obtained as numerical values. Therefore, a necessary minimum bit width capable of expressing these numerical values is assigned.

最後に、ステップ308のビット幅付きRTLソースコードを出力する工程では、構文解析の解析結果及びビット幅割り当てのステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成する。   Finally, in the step of outputting the RTL source code with the bit width in step 308, the variable having the bit width determined based on the analysis result of the parsing and the bit width information obtained from the bit width allocation step is included. Generate source code.

例えば、ステップ303にてC++ソースコードを構文解析した結果と、ステップ307にて割り当てたビット幅の情報とを結合し、C++ソースコードとして出力する。
論理合成を行う場合は、VHDLソースコードやVerilogソースコードとして出力してもよい。
For example, the result of parsing the C ++ source code in step 303 and the bit width information assigned in step 307 are combined and output as C ++ source code.
When performing logic synthesis, it may be output as VHDL source code or Verilog source code.

ここで、レジスタに関しては仕様上ビット幅が確定できることも少なくない。この場合については状態集合をあらかじめ与えることができるので状態探索にかかる処理を省略することができ、より高速に全変数のビット幅を推定することができる。   Here, it is not uncommon for the register to be able to determine the bit width due to specifications. In this case, since the state set can be given in advance, the processing for the state search can be omitted, and the bit widths of all the variables can be estimated at higher speed.

また、この場合でも状態探索を行い、あらかじめ指定されたビット幅と比較し、一致していなければ警告を出すという使い方をすれば、前述した第1の例の検証部6に相当する検証装置として構成することもできる。   Even in this case, if a state search is performed, compared with a bit width specified in advance and a warning is issued if they do not match, a verification device corresponding to the verification unit 6 of the first example described above can be obtained. It can also be configured.

また、本発明により出力されるデータを、前述した第1の例の論理合成部5に相当する論理合成装置に取り込むことができる。   Further, the data output by the present invention can be taken into a logic synthesis device corresponding to the logic synthesis unit 5 of the first example described above.

すなわち、図2のステップ204の変数のビット幅定義の工程に対応する本発明にかかる図6のフローチャートで処理されて出力されるデータを、図2のフローチャートにおけるステップ205の論理合成の工程に取り込むと、ビット幅が確定していないRTLのソースコードを入力できるように、従来の論理合成装置の仕様を拡張できる。これにより、状態探索と最適化を同時に行うことができ、本例で示したように、一旦ビット幅を確定してから論理合成する従来の方法に比べて、短時間で論理合成を完了することができる。   That is, the data processed and output in the flowchart of FIG. 6 according to the present invention corresponding to the variable bit width definition process of step 204 of FIG. 2 is taken into the logic synthesis process of step 205 in the flowchart of FIG. Thus, the specification of the conventional logic synthesis device can be expanded so that RTL source code whose bit width is not fixed can be input. As a result, state search and optimization can be performed at the same time, and as shown in this example, logic synthesis can be completed in a short time compared to the conventional method in which the bit width is once determined and then logic synthesis is performed. Can do.

<具体例>
次に、ビット幅決定方法の具体例について説明する。
図7は、ビット幅が未確定の変数を含むソースコードを、ビット幅が全て確定したソースコードに変換する処理のフローチャートを示す。
<Specific example>
Next, a specific example of the bit width determination method will be described.
FIG. 7 shows a flowchart of processing for converting a source code including a variable whose bit width is undetermined into a source code whose bit width is all fixed.

設計者は、図7に示す、ステップ501のビット幅が未確定の変数を含むソースコードを作成し、シミュレーションを行ってそれが期待通り動作することを確認する(図2のステップ202、203参照)。   The designer creates source code including a variable whose bit width is uncertain in step 501 shown in FIG. 7 and performs simulation to confirm that it operates as expected (see steps 202 and 203 in FIG. 2). ).

図7のステップ502の構文解析処理では、ステップ202、203を経て作成されたステップ501のソースコードを構文解析し、解析木と記号表を生成し、それぞれ図5の58、59に格納する。   In the syntax analysis process of step 502 in FIG. 7, the source code of step 501 created through steps 202 and 203 is parsed to generate a parse tree and a symbol table, which are stored in 58 and 59 of FIG.

例えば、図4のプログラムの520〜525行目の文を構文解析した解析木は、図8で示されたような構造になる。また、同じく図4のソースコードを構文解析して生成された記号表は、図9のような構造になる。   For example, the parse tree obtained by syntactically analyzing the sentences in lines 520 to 525 of the program shown in FIG. 4 has a structure as shown in FIG. Similarly, the symbol table generated by parsing the source code of FIG. 4 has a structure as shown in FIG.

図7のステップ503のクロックエッジ駆動関数抽出処理では、図5の解析木記憶部58に格納された解析木をたどり、図5の記号表記憶部59に格納された記号表に登録された関数のなかからクロックエッジで駆動される関数を検索する。   In the clock edge driving function extraction process in step 503 in FIG. 7, the analysis tree stored in the analysis tree storage unit 58 in FIG. 5 is traced, and the functions registered in the symbol table stored in the symbol table storage unit 59 in FIG. A function driven by a clock edge is searched from among them.

図8、図9の例を参照すると、まず大域的記号表701の中から種類が「モジュール」として登録された項目704が抽出される。   Referring to the examples of FIGS. 8 and 9, first, an item 704 whose type is registered as “module” is extracted from the global symbol table 701.

項目704に所属する局所的記号表702がさらに探索され、種類が「関数」として登録されている項目706が抽出される。   The local symbol table 702 belonging to the item 704 is further searched, and the item 706 whose type is registered as “function” is extracted.

項目706の名前clock_eventを持つ項目を解析木の中の図4のプログラムの510〜511行目の文に相当する部分が探索され、clock_eventがそこに登録されていることがわかる。   A part corresponding to the sentence on the 510th to 511th lines of the program of FIG. 4 in the analysis tree is searched for an item having the name clock_event of the item 706, and it can be seen that clock_event is registered there.

さらに、図4のプログラムの11行目の記述により、クロック変数clkの立ち上がりエッジにて駆動されていることがわかるので、項目706は、クロックエッジ駆動関数と判定される。   Furthermore, since the description in the eleventh line of the program of FIG. 4 indicates that the clock is driven at the rising edge of the clock variable clk, the item 706 is determined as a clock edge driving function.

図7のステップ504の代入文抽出処理では、ステップ503のクロックエッジ抽出処理で、クロックエッジ駆動関数と判定された全ての関数を解析木から探索し、代入文を全て抽出する。   In the assignment statement extraction process in step 504 of FIG. 7, all functions determined as clock edge driving functions in the clock edge extraction process in step 503 are searched from the parse tree, and all assignment statements are extracted.

図7のステップ505の状態遷移規則抽出処理では、ソースコードの中から状態遷移規則を表す部分を解析木の中から抽出し、状態遷移関数として、次のステップ509の状態探索処理に適したデータ構造に変換し、図5の状態遷移関数記憶部60に格納する。   In the state transition rule extraction process in step 505 in FIG. 7, a part representing the state transition rule is extracted from the analysis tree from the source code, and data suitable for the state search process in the next step 509 is extracted as a state transition function. It converts into a structure and stores it in the state transition function storage part 60 of FIG.

図7のステップ506の状態変数抽出処理では、各モジュールに所属する局所的記号表の中から種類が「変数」として登録されたものを抽出する。   In the state variable extraction process in step 506 of FIG. 7, the type registered as “variable” is extracted from the local symbol table belonging to each module.

ここで、ステップ506の状態変数抽出処理の動作を、図8および図9の例で説明する。   Here, the operation of the state variable extraction process in step 506 will be described with reference to the examples of FIGS.

まず、大域的記号表701の中から種類が「モジュール」として登録された変数名IIRFilterの項目704を選択し、それに所属する局所的記号表702をさらに検索する。項目702の中から種類が「変数」として登録されたzregの項目705があるのでそれを抽出する。次に、ステップ504で抽出された代入文を解析し、左辺にzregが現れるかどうかを解析する。図4のプログラムの521、524行目の文、それに対応する解析木602、603は左辺にzregが現れているのでzregは状態変数と判定し、記号表の項目705の種類を「変数」から「状態変数」に書き換える。状態変数は、最終的には記憶素子に割り当てられる変数である。   First, the item 704 of the variable name IIRFfilter whose type is registered as “module” is selected from the global symbol table 701, and the local symbol table 702 belonging to it is further searched. Since there is an item 705 of zreg registered as a “variable” among the items 702, it is extracted. Next, the assignment statement extracted in step 504 is analyzed to analyze whether zreg appears on the left side. In the program of FIG. 4, the statements on the 521 and 524th lines and the corresponding analysis trees 602 and 603 have zreg appearing on the left side. Rewrite as "state variable". A state variable is a variable that is ultimately assigned to a storage element.

図7のステップ507の初期状態抽出処理では、ステップ507で抽出された全ての状態変数に対してステップ504の代入文抽出処理で抽出された代入文を検査し、定数が代入されていればその定数を初期状態集合として図5の既到達状態集合記憶部61に格納する。複数の定数代入があれば全て初期状態集合として図5の既到達状態集合記憶部61に格納する。また「リセット信号」として指定された信号が存在すればそれによって代入される文を探索し、その右辺値の状態集合を初期状態集合とする。ただし、右辺値の状態集合が未知であれば警告を出して0を初期状態集合に加える。   In the initial state extraction process in step 507 of FIG. 7, the assignment statement extracted in the assignment statement extraction process in step 504 is checked for all the state variables extracted in step 507, and if a constant is substituted, The constant is stored as an initial state set in the reached state set storage unit 61 of FIG. If there are a plurality of constant assignments, all are stored in the reached state set storage unit 61 of FIG. 5 as the initial state set. If there is a signal designated as a “reset signal”, a sentence assigned by the search is searched, and the state set of the right-hand side value is set as the initial state set. However, if the state set of the right-side value is unknown, a warning is issued and 0 is added to the initial state set.

「リセット信号」の指定は#pragma指令によって指定する。504行目にその例が示されている。定数代入と「リセット信号」による代入のいずれも存在しなければ警告を出して0だけを初期状態集合として図5の既到達状態集合記憶部61に加える。図4の例では、521行目が定数代入と「リセット信号」による代入の両方を満たしているので0が初期状態集合になる。   The “reset signal” is designated by the #pragma command. An example is shown in line 504. If neither constant substitution nor substitution by “reset signal” exists, a warning is issued and only 0 is added to the reached state set storage unit 61 of FIG. 5 as an initial state set. In the example of FIG. 4, the 521st line satisfies both the constant substitution and the substitution by the “reset signal”, so 0 is the initial state set.

図7のステップ508の依存関係解析処理では、ステップ504の代入文抽出処理で抽出された代入文を全て解析し、依存関係グラフとして格納する。   In the dependency relationship analysis process in step 508 of FIG. 7, all assignment statements extracted in the assignment statement extraction process in step 504 are analyzed and stored as a dependency relationship graph.

図10は、図4のプログラムにおけるソースコードに現れた変数の依存関係グラフを示す。   FIG. 10 shows a dependency graph of variables appearing in the source code in the program of FIG.

左辺に現れる変数は右辺に表れる全ての変数に依存するので、その依存関係を依存関係枝として表し、さらに、代入文が選択文の中に入っている場合は条件式に現れる変数にも依存するので、それも依存先に加える。図4のプログラム例では、524行目の代入文の左辺にzregがあり、右辺にinがあるのでzregはinに依存する。さらに、524行目の代入文は520行目の条件選択文の中に含まれているので520行目のif文の()内の変数resetにも依存する。また、519行目はSystemCの解釈では代入の扱いで、outはzregに依存する。   Since the variable that appears on the left side depends on all the variables that appear on the right side, the dependency is expressed as a dependency branch. In addition, if the assignment statement is in the selection statement, it also depends on the variable that appears in the conditional expression. So add that to your dependencies. In the program example of FIG. 4, zreg is dependent on in because zreg is on the left side of the assignment statement on line 524 and in is on the right side. Furthermore, since the assignment statement on the 524th line is included in the condition selection statement on the 520th line, it also depends on the variable reset in parentheses in the if statement on the 520th line. The 519st line is treated as an assignment in the interpretation of SystemC, and out depends on zreg.

ステップ509の状態探索処理では、図5の既到達状態集合記憶部61に格納された既到達集合に対してステップ505の状態遷移規則抽出処理で抽出され、図5の状態遷移関数記憶部60に格納された状態遷移関数で写像を行い、その結果得られた像集合と写像前の既到達状態集合との和を求めて図5の既到達状態集合記憶部61に書き戻す。前記処理を繰り返し行い、前記処理によって図5の既到達状態集合記憶部61に格納された既到達状態集合が変化しなくなったら探索を終了する。   In the state search process in step 509, the reached state stored in the reached state set storage unit 61 in FIG. 5 is extracted by the state transition rule extraction process in step 505 and stored in the state transition function storage unit 60 in FIG. Mapping is performed using the stored state transition function, and the sum of the image set obtained as a result and the reached state set before mapping is obtained and written back to the reached state set storage unit 61 in FIG. The above process is repeated, and the search is terminated when the reached state set stored in the reached state set storage unit 61 of FIG.

場合によっては記憶領域に不足が生じることがあるので、この場合はエラー(状態爆発)として処理を中止する。   In some cases, a shortage may occur in the storage area. In this case, the processing is stopped as an error (state explosion).

また、図7のステップ508の依存関係解析処理による変数の依存関係は、状態変数が複数あった場合の状態探索を行う変数の順序を決定する。つまり、依存関係の根元にある変数から状態探索を行い、状態が確定したら次の順位の変数の状態探索を行うという具合に順次、状態探索を行う。   Further, the dependency relationship of the variables by the dependency relationship analysis processing in step 508 of FIG. 7 determines the order of the variables for performing the state search when there are a plurality of state variables. That is, the state search is sequentially performed such that the state search is performed from the variable at the root of the dependency relationship, and when the state is determined, the state search is performed for the next rank variable.

場合によっては依存関係がループになっていることがある。この場合はループになっている変数をまとめて状態探索する。全ての状態変数をまとめて状態探索する方法もあり、より正確な状態探索を行うことができるが、必要な記憶領域が多くなる。   In some cases, the dependency relationship may be a loop. In this case, the state search is performed for the variables in the loop. There is also a method in which all the state variables are collectively searched, and a more accurate state search can be performed, but a necessary storage area increases.

図7のステップ509の状態探索処理がステップ506の状態変数抽出処理で抽出された全ての変数の処理を終えると、図5の既到達状態集合記憶部61に格納された既到達状態集合は全ての状態変数のとりうる範囲が記録されている。   When the state search process in step 509 in FIG. 7 finishes processing all variables extracted in the state variable extraction process in step 506, all the reached state sets stored in the reached state set storage unit 61 in FIG. The range of possible state variables is recorded.

図7のステップ510のビット幅割り当て処理では、図5の既到達状態集合記憶部61に格納された既到達状態集合を解析してとりうる範囲を全て表現できる必要最小限のビット幅を割り当てる。   In the bit width allocation process in step 510 of FIG. 7, a necessary minimum bit width capable of expressing all possible ranges by analyzing the reached state set stored in the reached state set storage unit 61 of FIG. 5 is assigned.

図7のステップ510のビット幅割り当て処理では、記号表の中で型がintで登録されている変数をsc_int<n>あるいはsc_uint<n>に書き換える。   In the bit width allocation processing in step 510 of FIG. 7, the variable registered with the type int in the symbol table is rewritten to sc_int <n> or sc_uint <n>.

図7のステップ511のソースコード出力処理では、ビット幅の確定した記号表と解析木とからビット幅の確定したソースコード62を出力する。   In the source code output process in step 511 of FIG. 7, the source code 62 with a determined bit width is output from the symbol table with the determined bit width and the parse tree.

(従来例との比較)
ビット幅決定方法に関して、特許文献1の方法は入力、出力、記憶素子のビット幅をあらかじめ与えておく必要がある。また、ビット幅計算のためのライブラリを用意しておく必要がある。
(Comparison with conventional example)
Regarding the bit width determination method, the method of Patent Document 1 needs to give the input, output, and bit width of the storage element in advance. It is also necessary to prepare a library for bit width calculation.

これに対して、本発明は、入力のビット幅あるいは取り得る値の範囲を与えておくだけでよい。   On the other hand, the present invention only needs to give the input bit width or a range of possible values.

また、最適化方法に関して、特許文献1の方法は、与えられた入力と記憶素子のビット幅から推定された出力のビット幅があらかじめ与えられた出力のビット幅より大きい場合、出力のビット幅から逆算して必要なビット幅を推定し直す方法である。   As for the optimization method, the method of Patent Document 1 is based on the output bit width when the output bit width estimated from the given input and the bit width of the storage element is larger than the predetermined output bit width. This is a method of recalculating the necessary bit width by back calculation.

これに対して、本発明は、入力のビット幅と、ソースコードから指定あるいは推定された初期状態から状態探索を行い、到達可能な状態を全て列挙することによって全ての変数の取りうる範囲を正確に求め、それを元にビット幅を割り当てる方法である。   On the other hand, the present invention performs a state search from the input bit width and the initial state specified or estimated from the source code, and enumerates all reachable states to accurately determine the range that all variables can take. This is a method of assigning a bit width based on this.

出力は入力および状態変数に依存するので出力のビット幅が既知である必要はない。仮に出力のビット幅が与えられた場合は、推定されたビット幅と与えられたビット幅に違いがある場合、その出力変数はオーバーフローを起こすか、無駄なビットがあることになる。特にオーバーフローは設計上のミスである。特許文献1の方法では、出力のビット幅を与えることが必要条件であるので、このようなミスを検知することはできない。   Since the output depends on the input and state variables, the bit width of the output need not be known. If an output bit width is given, if there is a difference between the estimated bit width and the given bit width, the output variable will overflow or there will be wasted bits. In particular, overflow is a design error. In the method of Patent Document 1, since it is a necessary condition to provide the output bit width, such a mistake cannot be detected.

特許文献1の方法は、動作記述を対象としている。
これに対して、本発明は、動作記述より抽象度の低いRTL記述を対象としている。動作記述は動作合成装置により、一旦RTL記述に変換される。
The method of Patent Document 1 is intended for behavioral description.
On the other hand, the present invention is directed to an RTL description having a lower abstraction level than the behavioral description. The behavioral description is once converted into an RTL description by the behavioral synthesis device.

一方、本発明によりRTL記述でのビット幅の指定が一部の入力変数以外には不要になるため、動作記述でもビット幅を考慮する必要がなくなり、特許文献1の必要性は消滅する。   On the other hand, according to the present invention, designation of the bit width in the RTL description is not necessary except for some input variables, so that it is not necessary to consider the bit width in the operation description, and the necessity of Patent Document 1 disappears.

本発明のビット幅変換装置の構成を示すブロック図である。It is a block diagram which shows the structure of the bit width conversion apparatus of this invention. デジタル回路のモデリング方法を示すフローチャートである。3 is a flowchart illustrating a digital circuit modeling method. 従来技術の図11のフローチャートに対応したプログラムの1例を示す説明図である。It is explanatory drawing which shows an example of the program corresponding to the flowchart of FIG. 11 of a prior art. 本発明に係る図2のフローチャートに対応したプログラムの1例を示す説明図である。It is explanatory drawing which shows an example of the program corresponding to the flowchart of FIG. 2 which concerns on this invention. 本発明の第2の実施の形態である、ビット幅を指定しないRTL記述からビット幅を指定したRTL記述に変換する処理例を示すブロック図である。It is a block diagram which shows the example of a process which is the 2nd Embodiment of this invention, and converts into the RTL description which designated the bit width from the RTL description which does not designate the bit width. ビット幅を指定しないRTL記述からビット幅を指定したRTL記述に変換する処理例を示すフローチャートである。It is a flowchart which shows the example of a process which converts into the RTL description which designated the bit width from the RTL description which does not designate a bit width. ビット幅が未確定の変数を含むソースコードを、ビット幅が全て確定したソースコードに変換する処理のフローチャートである。It is a flowchart of the process which converts the source code containing the variable whose bit width is undetermined into the source code where all the bit widths are fixed. 図4のプログラムの文を構文解析した解析木の構造を示す説明図である。FIG. 5 is an explanatory diagram illustrating a structure of an analysis tree obtained by performing syntax analysis on the program sentence of FIG. 4. 図4のソースコードを構文解析して生成された記号表の構造を示す説明図である。FIG. 5 is an explanatory diagram showing a structure of a symbol table generated by parsing the source code of FIG. 4. 図4のプログラムにおけるソースコードに現れた変数の依存関係を示す説明図である。It is explanatory drawing which shows the dependency relation of the variable which appeared in the source code in the program of FIG. 従来の設計例を示すフローチャートである。It is a flowchart which shows the example of a conventional design.

符号の説明Explanation of symbols

1 ビット幅変換装置
4 ビット幅定義部
5 論理合成部
6 検証部
10 CPU
11 ROM
12 RAM
50 ビット幅変換装置
51 ソースコード
52 ソースコード入力部
53 構文解析部
54 状態遷移規則抽出部
55 状態検索部
56 ビット幅割り当て部
57 ソースコード出力部
58 解析木記憶部
59 記号表記憶部
60 状態遷移関数記憶部
61 既到達状態集合記憶部
62 ソースコード
1 bit width conversion device 4 bit width definition unit 5 logic synthesis unit 6 verification unit 10 CPU
11 ROM
12 RAM
50 bit width conversion device 51 source code 52 source code input unit 53 syntax analysis unit 54 state transition rule extraction unit 55 state search unit 56 bit width allocation unit 57 source code output unit 58 parse tree storage unit 59 symbol table storage unit 60 state transition Function storage 61 Reached state set storage 62 Source code

Claims (16)

デジタル回路のモデリング方法であって、
デジタル回路のソースコードを、ビット幅未確定の変数を含んだレジスタ転送レベルで記述することを特徴とするデジタル回路のモデリング方法。
A digital circuit modeling method,
A digital circuit modeling method, wherein a source code of a digital circuit is described at a register transfer level including a variable whose bit width is not determined.
前記ビット幅未確定の変数はビット幅を同一幅に揃えてシミュレーションを行うようにした請求項1記載のデジタル回路のモデリング方法。   The digital circuit modeling method according to claim 1, wherein the simulation is performed with the bit width indefinite variable having the same bit width. デジタル回路の設計方法であって、
デジタル回路のソースコードを、ビット幅未確定の変数を含んだレジスタ転送レベルで記述する状態遷移規則定義ステップと、
前記ソースコードをコンパイルした後、回路動作を確認するシミュレーションを行うシミュレーションステップと、
前記シミュレーションステップを経たソースコードに基づいて、前記複数の変数のビット幅を所望の値にそれぞれ決定し、該ビット幅が決定された前記変数を有するソースコードを生成するビット幅定義ステップと、
前記ビット幅が決定された変数を有するソースコードに基づいて、論理合成を行い、ゲートレベルのデジタル回路に変換する論理合成ステップと
を具えたことを特徴とするデジタル回路の設計方法。
A digital circuit design method,
State transition rule definition step describing the source code of the digital circuit at a register transfer level including a variable whose bit width is uncertain,
After compiling the source code, a simulation step for performing a simulation for checking the circuit operation;
A bit width defining step for determining a bit width of each of the plurality of variables to a desired value based on the source code that has undergone the simulation step, and generating a source code having the variable for which the bit width has been determined;
A digital circuit design method comprising: a logic synthesis step of performing a logic synthesis based on a source code having a variable whose bit width is determined and converting it into a gate level digital circuit.
前記ビット幅未確定の変数はビット幅を同一幅に揃えてシミュレーションを行うようにした請求項3記載のデジタル回路の設計方法。   4. The digital circuit design method according to claim 3, wherein the simulation is performed with the bit width indefinite variable having the same bit width. 前記ビット幅定義ステップは、
ビット幅未確定の変数を含んだ前記レジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、
前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、
入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、
前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、
前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップと、
を含むことを特徴とする請求項3記載のデジタル回路の設計方法。
The bit width defining step includes:
A parsing step for performing parsing on the source code of the digital circuit described at the register transfer level including the variable whose bit width is not determined;
An initial state and a state transition function extracting step for extracting an initial state of a register in the source code and a state transition function of the source code based on an analysis result of the parsing;
Based on the state of the input signal and the initial state, a state search step of repeatedly performing image calculation by the state transition function until the state set no longer changes,
A bit width assignment step for determining a bit width of the variable to a desired value based on the result of the image calculation;
A source code output step for generating a source code having a variable whose bit width is determined based on the analysis result of the parsing and information on the bit width obtained from the bit width assignment step;
The digital circuit design method according to claim 3, further comprising:
前記ビット幅定義ステップにおいて決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証するステップ
をさらに具えたことを特徴とする請求項3ないし5のいずれかに記載のデジタル回路の設計方法。
The method further comprises the step of comparing the bit width value determined in the bit width defining step with a predetermined bit width value and verifying whether the two values match by the comparison. 6. The digital circuit designing method according to claim 3, wherein the digital circuit is designed.
ビット幅決定方法であって、
ビット幅未確定の変数を含んだレジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、
前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、
入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、
前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、
前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップと
を具えたことを特徴とするビット幅決定方法。
A bit width determination method,
A parsing step for parsing the source code of a digital circuit described at a register transfer level including a variable whose bit width is uncertain,
An initial state and a state transition function extracting step for extracting an initial state of a register in the source code and a state transition function of the source code based on an analysis result of the parsing;
Based on the state of the input signal and the initial state, a state search step of repeatedly performing image calculation by the state transition function until the state set no longer changes,
A bit width assignment step for determining a bit width of the variable to a desired value based on the result of the image calculation;
A source code output step for generating a source code having a variable for which the bit width is determined based on the analysis result of the parsing and the bit width information obtained from the bit width assignment step. How to determine the bit width.
前記ビット幅定義手段において決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証する手段
を具えたことを特徴とする請求項7に記載のビット幅決定方法。
Comparing a bit width value determined by the bit width defining means with a bit width value designated in advance, and means for verifying whether the two values match by the comparison The bit width determination method according to claim 7.
コンピュータにより、請求項8記載のビット幅決定方法を実行可能なことを特徴とするプログラム。   A program capable of executing the bit width determination method according to claim 8 by a computer. コンピュータにより実行される請求項9記載のプログラムを記録したことを特徴とするコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium having recorded thereon the program according to claim 9 executed by a computer. 論理合成方法であって、
ビット幅未定義の変数を含んだレジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析ステップと、
前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出ステップと、
入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索ステップと、
前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当てステップと、
前記構文解析の解析結果及び前記ビット幅割り当てステップから得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力ステップと、
前記ビット幅が決定された変数を有するソースコードに基づいて、論理合成を行い、ゲートレベルのデジタル回路に変換する論理合成ステップと
を具えたことを特徴とする論理合成方法。
A logic synthesis method,
A parsing step for parsing a digital circuit source code described at a register transfer level including a variable whose bit width is undefined;
An initial state and a state transition function extracting step for extracting an initial state of a register in the source code and a state transition function of the source code based on an analysis result of the parsing;
Based on the state of the input signal and the initial state, a state search step of repeatedly performing image calculation by the state transition function until the state set no longer changes,
A bit width assignment step for determining a bit width of the variable to a desired value based on the result of the image calculation;
A source code output step for generating a source code having a variable whose bit width is determined based on the analysis result of the parsing and information on the bit width obtained from the bit width assignment step;
A logic synthesis method comprising: a logic synthesis step of performing logic synthesis based on a source code having a variable whose bit width is determined and converting it into a gate level digital circuit.
コンピュータにより、請求項11記載の論理合成方法を実行可能なことを特徴とするプログラム。   A program capable of executing the logic synthesis method according to claim 11 by a computer. コンピュータにより実行される請求項12記載のプログラムを記録したことを特徴とするコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium having recorded thereon the program according to claim 12 executed by a computer. ビット幅変換装置であって、
ビット幅未定義の変数を含んだレジスタ転送レベルで記述されたデジタル回路のソースコードに対して、構文解析を行う構文解析手段と、
前記構文解析の解析結果に基づいて、前記ソースコード内にあるレジスタの初期状態と、前記ソースコードの状態遷移関数とを抽出する初期状態及び状態遷移関数抽出手段と、
入力信号の状態及び前記初期状態に基づいて、前記状態遷移関数による像計算を状態集合が変化しなくなるまで繰り返し行う状態探索手段と、
前記像計算の結果に基づいて、前記変数のビット幅を所望の値に決定するビット幅割り当て手段と、
前記構文解析の解析結果及び前記ビット幅割り当て手段から得られたビット幅の情報に基づいて、ビット幅が決定された変数を有するソースコードを生成するソースコード出力手段と
を具えたことを特徴とするビット幅変換装置。
A bit width converter,
Parsing means for parsing the source code of a digital circuit described at a register transfer level including a variable whose bit width is undefined,
An initial state and state transition function extracting means for extracting an initial state of a register in the source code and a state transition function of the source code based on an analysis result of the syntax analysis;
Based on the state of the input signal and the initial state, state search means for repeatedly performing image calculation by the state transition function until the state set no longer changes,
A bit width allocating means for determining a bit width of the variable to a desired value based on a result of the image calculation;
Source code output means for generating source code having a variable whose bit width is determined based on the analysis result of the syntax analysis and the bit width information obtained from the bit width allocation means. Bit width conversion device.
前記ビット幅定義手段において決定されたビット幅の値と、あらかじめ指定されたビット幅の値とを比較し、該比較により両者の値が一致しているかどうかを検証する手段
を具えたことを特徴とする請求項14に記載のビット幅変換装置。
Comparing a bit width value determined by the bit width defining means with a bit width value designated in advance, and means for verifying whether the two values match by the comparison The bit width conversion device according to claim 14.
請求項14または15に記載のビット幅変換装置を具えたことを特徴とする論理合成装置。
16. A logic synthesis apparatus comprising the bit width conversion apparatus according to claim 14.
JP2005001501A 2005-01-06 2005-01-06 Modeling method and design method for digital circuit Pending JP2006190085A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005001501A JP2006190085A (en) 2005-01-06 2005-01-06 Modeling method and design method for digital circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005001501A JP2006190085A (en) 2005-01-06 2005-01-06 Modeling method and design method for digital circuit

Publications (1)

Publication Number Publication Date
JP2006190085A true JP2006190085A (en) 2006-07-20

Family

ID=36797230

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005001501A Pending JP2006190085A (en) 2005-01-06 2005-01-06 Modeling method and design method for digital circuit

Country Status (1)

Country Link
JP (1) JP2006190085A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010204720A (en) * 2009-02-27 2010-09-16 Nec Corp Circuit design support system, circuit design support method and program
JP2011138183A (en) * 2009-12-25 2011-07-14 Fujitsu Ltd Verification support program and verification support device
US8527919B2 (en) 2008-09-26 2013-09-03 Kabushiki Kaisha Toshiba Description rewriting device, design description rewriting method, and computer readable medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8527919B2 (en) 2008-09-26 2013-09-03 Kabushiki Kaisha Toshiba Description rewriting device, design description rewriting method, and computer readable medium
JP2010204720A (en) * 2009-02-27 2010-09-16 Nec Corp Circuit design support system, circuit design support method and program
JP2011138183A (en) * 2009-12-25 2011-07-14 Fujitsu Ltd Verification support program and verification support device

Similar Documents

Publication Publication Date Title
US6026226A (en) Local compilation in context within a design hierarchy
US6745160B1 (en) Verification of scheduling in the presence of loops using uninterpreted symbolic simulation
Cerny et al. SVA: the power of assertions in systemVerilog
US9501269B2 (en) Automatic source code generation for accelerated function calls
US8904367B1 (en) Auto pipeline insertion
US8326592B2 (en) Method and system for verifying electronic designs having software components
US20070276644A1 (en) Conversion of circuit description to a transaction model
US20060064680A1 (en) Extensible internal representation of systems with parallel and sequential implementations
JP2007528059A (en) Systems and methods for software modeling, abstraction, and analysis
US20020152061A1 (en) Data processing system and design system
JPH11513512A (en) Method of manufacturing digital signal processor
US5949993A (en) Method for the generation of ISA simulators and assemblers from a machine description
JPH07160744A (en) Autonomously evolving hardware design system
US7086047B1 (en) Determining hardware generated by high level language compilation through loop optimizations
JP2006285333A (en) Operation composition device and method
Devarajegowda et al. Meta-model based automation of properties for pre-silicon verification
Soeken et al. Automating the translation of assertions using natural language processing techniques
WO2010040567A1 (en) Device and method for refactoring hardware code
US8650517B1 (en) Automatically documenting circuit designs
JP2006190085A (en) Modeling method and design method for digital circuit
Devarajegowda et al. How to keep 4-eyes principle in a design and property generation flow
WO2004036463A9 (en) Compiler and logic circuit design method
US7111274B1 (en) Scheduling hardware generated by high level language compilation to preserve functionality of source code design implementations
US9098661B1 (en) Extensible platform for back-annotation of target-specific characterization onto a model of a hardware system
US5854926A (en) Method and apparatus for identifying flip-flops in HDL descriptions of circuits without specific templates

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080711

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080718

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080916

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081010