JP2014067353A - Rtl optimization method, device and program - Google Patents

Rtl optimization method, device and program Download PDF

Info

Publication number
JP2014067353A
JP2014067353A JP2012213760A JP2012213760A JP2014067353A JP 2014067353 A JP2014067353 A JP 2014067353A JP 2012213760 A JP2012213760 A JP 2012213760A JP 2012213760 A JP2012213760 A JP 2012213760A JP 2014067353 A JP2014067353 A JP 2014067353A
Authority
JP
Japan
Prior art keywords
branch
statement
correction
rtl
signal
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
JP2012213760A
Other languages
Japanese (ja)
Inventor
Naoto Shimoji
直人 下地
Yasuhisa Ootomo
尉央 大友
Shizuko Maruyama
志津子 丸山
Koji Uda
幸治 右田
Kazuhiko Hatae
一彦 波多江
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012213760A priority Critical patent/JP2014067353A/en
Publication of JP2014067353A publication Critical patent/JP2014067353A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To optimize a description of an if-else branch in an RTL source.SOLUTION: An if-else extraction part 11 of an RTL optimization device 1 extracts an if-else branch from an RTL source 21, and a data generation part 13 generates information about the if-else branch having the number of paragraphs that is equal to or higher than a threshold determined by a threshold determination part 12. A correction method determination part 14 determines a correction method on the basis of the number of bits of a signal, presence or absence of the same name signal and presence or absence of AND connection in a condition for an if-else sentence, and a correction part 15 corrects the RTL source 21 in accordance with the determined correction method and outputs a corrected RTL 27.

Description

本発明は、ハードウェア記述言語(HDL)の1つであるRTL(Register Transfer Level)記述を最適化する処理に関する。   The present invention relates to processing for optimizing RTL (Register Transfer Level) description, which is one of hardware description languages (HDL).

ハードウェア記述の1つであるRTLは、ハードウェア内部の構造を定義し、クロック動作に基づいたレジスタからレジスタへの機能を記述する。ハードウェアの論理回路設計段階では、RTLソースの記述の文法規約をチェックするだけでなく、記述に基づく論理回路がより適正に動作をする構成になっているかをチェックする必要がある。   The RTL, which is one of the hardware descriptions, defines a structure inside the hardware and describes a function from register to register based on a clock operation. At the hardware logic circuit design stage, it is necessary not only to check the grammar conventions of the description of the RTL source, but also to check whether the logic circuit based on the description is configured to operate more appropriately.

RTLソースで、分岐を記述するif−elseについて、if−else文のネスト段階が深い場合に、回路化した際にタイミングが悪化することが認識されている。そのため、RTLチェックの従来手法では、一定数以上の段数を持つif−else文を警告対象としている。警告がなされたif−else分岐について、修正が必要であるか、どのように修正するかを、作業者は自らの経験則に基づいて手作業で修正している。   With regard to if-else describing a branch in an RTL source, it is recognized that the timing is deteriorated when the if-else statement is deeply nested when the nest stage is deep. Therefore, in the conventional method of RTL check, an if-else statement having a certain number of stages or more is targeted for warning. The operator manually corrects whether or not the if-else branch for which warning has been made is necessary or how to correct it based on his own rule of thumb.

また、RTL修正の従来手法として、RTLソース内のif−else文をcase文に自動変更する手法が知られている。   Further, as a conventional technique for RTL correction, a technique for automatically changing an if-else sentence in an RTL source to a case sentence is known.

特開平10−187781号公報Japanese Patent Laid-Open No. 10-187781

上記の従来手法では、RTLソース内のif−else文をcase文に修正するが、単に、if−else文をcase文に変形すると、論理回路が冗長な構成になってしまうという問題がある。   In the above conventional method, the if-else statement in the RTL source is corrected to the case statement. However, if the if-else statement is simply transformed into the case statement, there is a problem that the logic circuit becomes redundant.

図34および図35は、従来手法による修正の問題を説明するための図である。図34(A)は、元の(修正前の)RTLソースの例を示す図、図34(B)は、従来手法による修正後のRTLソースの例を示す図である。図35(A)は、図34(A)の元のRTLソースによる回路構成例を示す図、図35(B)は、図34(B)の修正後のRTLソースによる回路構成例を示す図である。   34 and 35 are diagrams for explaining the problem of correction by the conventional method. FIG. 34A is a diagram showing an example of the original (before correction) RTL source, and FIG. 34B is a diagram showing an example of the RTL source after correction by the conventional method. 35A shows a circuit configuration example using the original RTL source in FIG. 34A, and FIG. 35B shows a circuit configuration example using the modified RTL source in FIG. 34B. It is.

図34(A)に示すRTLソースの第7〜11行に記述されているif−else文が、図34(B)に示すRTLソースの第7〜14行に記述されているcase文に変形される。回路構成で示すと、図35(A)に示すように、1ビット(bit)入力のセレクタ3段が直列に接続する構成が、図35(B)に示すように、3ビット一致比較と1ビットANDの構成に変形される。すなわち、元のRTLソースでは、信号の選択条件が1条件であるが、修正後のRTLソースでは、信号の選択条件が2条件となるため2つの比較回路が必要となってしまう。修正後のRTLソースによる回路構成は、一般的に、冗長な判断論理の追加と判断される。   The if-else statement described in the 7th to 11th lines of the RTL source shown in FIG. 34A is transformed into the case statement described in the 7th to 14th lines of the RTL source shown in FIG. Is done. In terms of the circuit configuration, as shown in FIG. 35A, a configuration in which three stages of 1-bit (bit) input selectors are connected in series is shown in FIG. It is transformed into a bit AND configuration. That is, in the original RTL source, the signal selection condition is one condition, but in the corrected RTL source, since the signal selection condition is two conditions, two comparison circuits are required. The circuit configuration with the corrected RTL source is generally determined as addition of redundant determination logic.

従来手法によるif−else文のcase文への自動変形は、回路構成を最適化するものではないため、作業者は、回路構成が最適となる段数を考慮してif−else文を手作業で修正しなければならないという問題は解決できなかった。   Since the automatic transformation of the if-else statement into the case statement by the conventional method does not optimize the circuit configuration, the operator manually handles the if-else statement in consideration of the number of stages at which the circuit configuration is optimal. The problem that had to be fixed could not be solved.

本発明の目的は、RTLソースに含まれるif−else文による分岐の記述を最適化する処理方法、装置およびプログラムを提供することである。   An object of the present invention is to provide a processing method, apparatus, and program for optimizing the description of a branch by an if-else statement included in an RTL source.

本発明の一態様として開示するRTL最適化方法は、コンピュータが、1)対象回路を記述するRTLソースから、予め設定された閾値が示す段数以上のif−else文の段数で構成されたif−else分岐を抽出し、2)予め、if−else分岐の複数の修正方法をif−else文の条件に対応付けて設定しておき、抽出した前記if−else分岐を構成する条件をもとに、該複数の修正方法の1つを決定し、3)前記RTLソースの抽出した前記if−else分岐を、決定した修正方法に基づいて修正する、処理を実行するものである。   The RTL optimization method disclosed as one aspect of the present invention is a method in which a computer 1) if-else statements having a number of stages of an if-else statement equal to or greater than the number of stages indicated by a preset threshold from an RTL source describing a target circuit Else branches are extracted, and 2) a plurality of if-else branch correction methods are set in advance in association with the conditions of the if-else statement, and based on the conditions that constitute the extracted if-else branches. One of the plurality of correction methods is determined, and 3) a process of correcting the extracted if-else branch extracted from the RTL source based on the determined correction method is executed.

開示したRTL最適化方法によれば、ネストの段数が多いif−else分岐を最適な記述に自動変更することができ、論理回路設計においてRTL修正作業の負荷を軽減することができる。   According to the disclosed RTL optimization method, an if-else branch having a large number of nesting stages can be automatically changed to an optimal description, and the load of RTL correction work can be reduced in logic circuit design.

開示するRTL最適化装置の一実施例におけるブロック構成例を示す図である。It is a figure which shows the block structural example in one Example of the disclosed RTL optimization apparatus. 一実施例におけるログ記憶部のデータ構成例を示す図である。It is a figure which shows the example of a data structure of the log memory | storage part in one Example. 一実施例における修正対象記憶部のデータ構成例を示す図である。It is a figure which shows the example of a data structure of the correction object memory | storage part in one Example. 一実施例における閾値決定に用いる設定テーブルの例を示す図である。It is a figure which shows the example of the setting table used for the threshold value determination in one Example. 一実施例におけるRTL最適化装置の概要処理フロー例を示す図である。It is a figure which shows the example of an outline processing flow of the RTL optimization apparatus in one Example. ステップS3の処理のより詳細な処理フロー例を示す図である。It is a figure which shows the example of a more detailed process flow of the process of step S3. ステップS4の処理のより詳細な処理フロー例を示す図である。It is a figure which shows the example of a more detailed process flow of the process of step S4. ステップS33の処理のより詳細な処理フロー例を示す図である。It is a figure which shows the more detailed process flow example of a process of step S33. 第1の修正方法による修正の場合のブロック分割の説明図である。It is explanatory drawing of the block division | segmentation in the case of correction by the 1st correction method. 第1の修正方法による修正の場合のブロック分割の具体例を示す図である。It is a figure which shows the specific example of the block division | segmentation in the case of correction by the 1st correction method. 第1の修正方法による修正の場合のブロック分割の具体例を示す図である。It is a figure which shows the specific example of the block division | segmentation in the case of correction by the 1st correction method. 第1の修正方法による修正対象を含むRTLソースの例を示す図である。It is a figure which shows the example of the RTL source containing the correction object by a 1st correction method. 第1の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 1st correction method. 第1の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 1st correction method. 第1の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 1st correction method. 第1の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 1st correction method. 第1の修正方法による修正前のRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the RTL source before correction by the 1st correction method. 第1の修正方法による修正後の修正済みRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the corrected RTL source after correction by the 1st correction method. 第2の修正方法による修正の場合のブロック分割の説明図である。It is explanatory drawing of the block division | segmentation in the case of correction by the 2nd correction method. 第2の修正方法による修正対象を含むRTLソースの例を示す図である。It is a figure which shows the example of the RTL source containing the correction object by the 2nd correction method. 第2の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 2nd correction method. 第2の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 2nd correction method. 第2の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 2nd correction method. 第2の修正方法による修正の説明図である。It is explanatory drawing of the correction by a 2nd correction method. 第2の修正方法による修正前のRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the RTL source before correction by the 2nd correction method. 第2の修正方法による修正後の修正済みRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the corrected RTL source after correction by the 2nd correction method. 第3の修正方法による修正対象を含むRTLソースの例を示す図である。It is a figure which shows the example of the RTL source containing the correction object by the 3rd correction method. 第3の修正方法による修正の説明図である。It is explanatory drawing of the correction by the 3rd correction method. 第3の修正方法による修正の説明図である。It is explanatory drawing of the correction by the 3rd correction method. 第3の修正方法による修正の説明図である。It is explanatory drawing of the correction by the 3rd correction method. 第3の修正方法による修正前のRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the RTL source before correction by the 3rd correction method. 第3の修正方法による修正後の修正済みRTLソースの回路構成を示す図である。It is a figure which shows the circuit structure of the corrected RTL source after correction by the 3rd correction method. RTL最適化装置のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of a RTL optimization apparatus. 従来手法による修正の問題の説明図である。It is explanatory drawing of the problem of correction by a conventional method. 従来手法による修正の問題の説明図である。It is explanatory drawing of the problem of correction by a conventional method.

以下、本発明の一態様として開示するRTL最適化装置について説明する。   Hereinafter, an RTL optimization device disclosed as one aspect of the present invention will be described.

図1は、開示するRTL最適化装置の一実施例におけるブロック構成例を示す図である。   FIG. 1 is a diagram illustrating a block configuration example in an embodiment of the disclosed RTL optimization device.

RTL最適化装置1は、if−else抽出部11、閾値決定部12、データ生成部13、修正方法決定部14、修正部15、およびこれらの処理部が使用または生成する各種データを記憶する記憶部を備える。   The RTL optimization device 1 stores an if-else extraction unit 11, a threshold determination unit 12, a data generation unit 13, a correction method determination unit 14, a correction unit 15, and various types of data used or generated by these processing units. A part.

if−else抽出部11は、対象回路をRTL(Register Transfer Level)で記述するRTLソース21から、if−else文による分岐(以下、「if−else分岐」または単に「if−else」という)を全て抽出し、抽出したif−else分岐に関する情報(ログ情報)をログ記憶部22に記憶する。if−else分岐の抽出は、既知のRTLスタイルチェッカーを用いた構文解析処理により実施する。if−elseに関するログ情報は、例えば、if−else文の位置(行)、段数、該if−else文が含まれるファイル名等である。   The if-else extraction unit 11 performs branching by an if-else statement (hereinafter referred to as “if-else branch” or simply “if-else”) from the RTL source 21 in which the target circuit is described in RTL (Register Transfer Level). All are extracted, and information (log information) regarding the extracted if-else branch is stored in the log storage unit 22. The extraction of the if-else branch is performed by a parsing process using a known RTL style checker. The log information related to the if-else is, for example, the position (line) of the if-else statement, the number of stages, the name of a file including the if-else statement, and the like.

閾値決定部12は、if−elseを修正対象とするかを判定する閾値th(if−elseの段数)を決定し、閾値保持部24に記憶する。   The threshold determination unit 12 determines a threshold th (the number of stages of if-else) for determining whether or not if-else is a correction target, and stores the threshold th in the threshold holding unit 24.

修正対象とするif−elseの判定手段である閾値thとして、例えば、固定値、ユーザが与える任意の値、対象回路の情報に基づく値(例えば、動作周波数)等を用いることができる。閾値決定部12は、判定手段の指定23に基づいて閾値thを設定する。   For example, a fixed value, an arbitrary value given by the user, a value based on information on the target circuit (for example, operating frequency), or the like can be used as the threshold th that is a means for determining if-else to be corrected. The threshold determination unit 12 sets the threshold th based on the designation 23 of the determination unit.

判定手段の指定23は、判定手段とする閾値thを指定する情報であり、RTL最適化装置1が初期設定として保持し、または、データ生成部13の処理開始前に閾値決定部12に与えられる。   The determination means specification 23 is information for specifying the threshold th used as the determination means. The RTL optimization apparatus 1 holds the initial setting as an initial setting, or is given to the threshold determination section 12 before the data generation section 13 starts processing. .

データ生成部13は、ログ記憶部22に記憶されているif−else分岐が、閾値決定部12で決定された閾値thを超える段数を持つかを判定し、閾値thを超える段数を持つif−else分岐を修正対象とし、該当するif−elseに関する情報(修正対象情報)を修正対象記憶部25に記憶する。   The data generation unit 13 determines whether the if-else branch stored in the log storage unit 22 has a number of stages exceeding the threshold th determined by the threshold determination unit 12, and if- The else branch is set as a correction target, and information regarding the corresponding if-else (correction target information) is stored in the correction target storage unit 25.

修正方法決定部14は、予め複数の修正方法を保持し、修正対象記憶部25に記憶されたif−else分岐に対して実行する修正方法を決定し、決定した修正方法26を保持する。修正方法決定部14は、if−else分岐について、構成するif−else文の条件の内容(信号のビット数、各条件での同名信号の有無やAND構成の有無等)をもとに分類した修正方法を決定する。以下は、修正方法の分類の条件の例である。
(1)if−else文の条件が1ビット信号のみで構成されているか。
(2)全ての条件に同名信号が存在しないか。
(3)全条件がANDで構成されているか。
(4)条件に他の信号がないか。
The correction method determination unit 14 holds a plurality of correction methods in advance, determines a correction method to be executed for the if-else branch stored in the correction target storage unit 25, and holds the determined correction method 26. The modification method determination unit 14 classifies the if-else branch based on the contents of the conditions of the if-else statement to be configured (number of signal bits, presence / absence of the same name signal in each condition, presence / absence of AND configuration, etc.) Determine how to fix. The following are examples of conditions for classification of correction methods.
(1) Whether the condition of the if-else statement is composed of only a 1-bit signal.
(2) Does the same name signal exist in all conditions?
(3) Are all conditions configured with AND?
(4) Is there any other signal in the condition?

修正方法として、例えば、以下のような方法が用意される。   As a correction method, for example, the following method is prepared.

[第1の修正方法]
第1の修正方法は、if−else文の条件に設定された信号が1ビット信号であり、各条件に同名の信号が存在しない場合に選択される。
[First correction method]
The first correction method is selected when the signal set in the condition of the if-else statement is a 1-bit signal and a signal with the same name does not exist in each condition.

第1の修正方法では、分岐の段数が所定数(閾値)以内になるようにif−else文をブロックに分割し、if−else文の構成内に分割した各ブロックのif−else分岐を構成し、各ブロックのif−else分岐が所定の段数以内となるように構成を修正する。   In the first correction method, the if-else statement is divided into blocks so that the number of branch stages is within a predetermined number (threshold value), and the if-else branch of each block is configured in the structure of the if-else statement. Then, the configuration is modified so that the if-else branch of each block is within a predetermined number of stages.

この修正により、元のRTLソース21のif−else分岐に対応する論理回路では、セレクタ回路が適正な段数を超えて直列に接続する構成となる場合に、セレクタ回路が直列に接続する段数が一定数以内に抑えられ、さらに、部分的に並列に接続する構成が実現できる。   With this modification, in the logic circuit corresponding to the if-else branch of the original RTL source 21, when the selector circuit is connected in series beyond the appropriate number of stages, the number of stages to which the selector circuit is connected in series is constant. It is possible to realize a configuration in which the number of connections is limited to a few and the connections are partially connected in parallel.

[第2の修正方法]
第2の修正方法は、前記の第1の修正方法または後述する第3の修正方法に該当しない場合に選択される。例えば、if−else文の条件に設定された信号が複数ビットであり、各条件に同名信号が存在、かつ条件がANDで構成されている場合に、第2の修正方法が選択される。
[Second modification method]
The second correction method is selected when it does not correspond to the first correction method or the third correction method described later. For example, if the signal set in the condition of the if-else statement is a plurality of bits, a signal having the same name exists in each condition, and the condition is composed of AND, the second correction method is selected.

第2の修正方法では、条件に設定された信号名および信号値でif−else文を分類し、分類に用いた信号および信号値でまとめたif−else文のグループごとに第1の修正方法を実施してif−else分岐を修正する。   In the second correction method, the if-else sentence is classified by the signal name and signal value set in the condition, and the first correction method is performed for each group of if-else sentences grouped by the signal and signal value used for classification. To correct the if-else branch.

この修正により、信号名および信号値でまとめた入力信号に対応するセレクタ回路を、適正な段数以内で直列に接続し、部分的に並列に接続する構成が実現できる。   With this modification, it is possible to realize a configuration in which selector circuits corresponding to input signals summarized by signal names and signal values are connected in series within an appropriate number of stages and partially connected in parallel.

[第3の修正方法]
第3の修正方法は、if−else文の条件に設定される信号が複数ビット信号であり、各条件に他の信号が存在しない場合に、選択される。
[Third Modification Method]
The third correction method is selected when the signal set in the condition of the if-else statement is a multi-bit signal and there is no other signal in each condition.

第3の修正方法では、if−else分岐の各段の条件を要素とするcase分岐に変形する。   In the third correction method, the case is transformed into a case branch having the condition of each stage of the if-else branch as an element.

この修正により、元のRTLソース21のif−else分岐に基づく論理回路では、セレクタ回路が適正数を超えて直列に接続する構成を、代替の回路で実現することができる。   With this modification, in the logic circuit based on the if-else branch of the original RTL source 21, the configuration in which the selector circuits are connected in series exceeding the appropriate number can be realized by an alternative circuit.

修正部15は、RTLソース21に含まれる修正対象のif−else分岐を決定した修正方法26に従って修正し、修正済みRTLソース27を出力する。   The correction unit 15 corrects the correction target if-else branch included in the RTL source 21 according to the correction method 26 determined, and outputs a corrected RTL source 27.

図2は、ログ記憶部22のデータ構成例を示す図である。   FIG. 2 is a diagram illustrating a data configuration example of the log storage unit 22.

ログ記憶部22には、RTLソース21から抽出されたn個のif−else文各々について、識別番号(n)、段数(an−1)、ファイル名(Fn−1)、行番号(Ln−1)を含むデータが記憶される。「識別番号」はデータの識別番号、「段数」はif−else文のネストの段数、「ファイル名」はif−else文を含むファイルの名称、「行番号」はファイル(RTLソース)内でif−else文が記述されている行の番号である。 In the log storage unit 22, for each of the n if-else statements extracted from the RTL source 21, an identification number (n), the number of stages (a n−1 ), a file name (F n−1 ), a line number ( L n−1 ) is stored. “Identification number” is the data identification number, “Number of stages” is the number of nested stages of the if-else statement, “File name” is the name of the file containing the if-else statement, and “Line number” is in the file (RTL source) This is the line number in which the if-else statement is described.

図3は、修正対象記憶部25のデータ構成例を示す図である。   FIG. 3 is a diagram illustrating a data configuration example of the correction target storage unit 25.

修正対象記憶部25には、ログ記憶部22から、段数が閾値thを超えて修正対象として抽出されたm個(m≦n)のif−else文各々について、識別番号(m)、段数(am−1)、ファイル名(Fm−1)、行番号(Lm−1)を含むデータが記憶される。「識別番号」はデータの識別番号、「段数」はif−else文のネストの段数、「ファイル名」はif−else文を含むファイルの名称、「行番号」はファイル(RTLソース)内でif−else文が記述されている行の番号である。 The correction target storage unit 25 stores the identification number (m) and the number of stages (m) for each of m (m ≦ n) if-else statements that are extracted from the log storage unit 22 as the correction target when the number of stages exceeds the threshold th. a m-1 ), a file name (F m-1 ), and data including a line number (L m-1 ) are stored. “Identification number” is the data identification number, “Number of stages” is the number of nested stages of the if-else statement, “File name” is the name of the file containing the if-else statement, and “Line number” is in the file (RTL source) This is the line number in which the if-else statement is described.

図4は、閾値決定に用いる設定テーブルの例を示す図である。   FIG. 4 is a diagram illustrating an example of a setting table used for threshold value determination.

設定テーブルは、対象回路の動作周波数(MHz)と閾値との対応を示すデータテーブルである。   The setting table is a data table indicating the correspondence between the operating frequency (MHz) of the target circuit and the threshold value.

閾値決定部12は、判定手段の指定23が「対象回路の動作周波数に基づく設定」である場合に、対象回路の動作周波数(f)を示す情報を取得し、図4に示す設定テーブルから、取得した動作周波数に対応する閾値thを決定する。   When the determination means designation 23 is “setting based on the operating frequency of the target circuit”, the threshold value determination unit 12 acquires information indicating the operating frequency (f) of the target circuit, and from the setting table illustrated in FIG. A threshold th corresponding to the obtained operating frequency is determined.

上記の構成を有するRTL最適化装置1によって、適正な段数を超えるような直列の接続を解消して、先頭と最後のセレクタ回路で出力タイミング差にばらつきが生じうるという問題を解決し、段数の均等化により出力タイミング差のばらつきをなくすことが可能な回路構成を実現することができる。   The RTL optimizing device 1 having the above configuration eliminates the serial connection exceeding the appropriate number of stages and solves the problem that the output timing difference may vary between the first and last selector circuits. It is possible to realize a circuit configuration capable of eliminating variations in output timing difference by equalization.

図5は、RTL最適化装置1の概要処理フロー例を示す図である。   FIG. 5 is a diagram illustrating an example of an outline processing flow of the RTL optimization device 1.

RTL最適化装置1では、if−else抽出部11が、対象回路のRTLソース21を取得し(ステップS1)、RTLソース21からif−else文を全て抽出し、抽出したif−else文に関する情報(ログ情報)をログ記憶部22に格納する(ステップS2)。ステップS2の処理により,図2に示す情報がログ記憶部22に記憶される。   In the RTL optimizing device 1, the if-else extraction unit 11 acquires the RTL source 21 of the target circuit (step S1), extracts all if-else sentences from the RTL source 21, and information on the extracted if-else sentence (Log information) is stored in the log storage unit 22 (step S2). The information shown in FIG. 2 is stored in the log storage unit 22 by the process of step S2.

データ生成部13は、閾値保持部24に記憶されている閾値thを用いて、ログ記憶部22に記憶されたログ情報から、段数が閾値thを超えるif−else文を処理対象として抽出し、処置対象としたif−else文に関する情報(修正対象情報)を修正対象記憶部25に記憶する(ステップS3)。ステップS3の処理により,図3に示す情報が修正対象記憶部25に記憶される。   The data generation unit 13 uses the threshold th stored in the threshold holding unit 24 to extract, from the log information stored in the log storage unit 22, an if-else statement whose number of stages exceeds the threshold th as a processing target, Information (correction target information) related to the if-else sentence to be treated is stored in the correction target storage unit 25 (step S3). The information shown in FIG. 3 is stored in the correction target storage unit 25 by the process of step S3.

なお、判定手段の指定23が外部から与えられる場合には、ステップS3の処理前に、閾値決定部12によって閾値thが決定され、閾値保持部24に記憶されているものとする。   If the determination means designation 23 is given from the outside, it is assumed that the threshold th is determined by the threshold determining unit 12 and stored in the threshold holding unit 24 before the process of step S3.

修正方法決定部14は、修正対象記憶部25に記憶されたif−else文について修正方法を決定し、決定した修正方法26をif−else文に対応付けて記憶しておく(ステップS4)。修正部15は、RTLソース21の修正対象のif−else文を、決定した修正方法26に従って変形し、修正済みRTLソース27を出力する(ステップS5)。   The correction method determination unit 14 determines a correction method for the if-else sentence stored in the correction target storage unit 25, and stores the determined correction method 26 in association with the if-else sentence (step S4). The modification unit 15 transforms the if-else statement to be modified of the RTL source 21 according to the determined modification method 26, and outputs a modified RTL source 27 (step S5).

図6は、ステップS3の処理のより詳細な処理フロー例を示す図である。   FIG. 6 is a diagram showing a more detailed processing flow example of the processing in step S3.

データ生成部13は、ログ記憶部22に記憶されたログ情報を取得し(ステップS21)、閾値保持部24に記録された閾値thを用いて閾値thを取得する(ステップS22)。データ生成部13は、カウンタiを0に設定して(ステップS23)、i番目(0≦i≦n−1)のif−elseの段数aについて、段数aが閾値th以下であるかを判定する(ステップS24)。段数a≦閾値thでなければ(ステップS24のN)、データ生成部13は、そのif−elseの情報を修正対象記憶部25に格納して(ステップS25)、ステップS26に進み、段数a≦閾値thであれば(ステップS24のY)、そのままステップS26に進む。 The data generation unit 13 acquires log information stored in the log storage unit 22 (step S21), and acquires a threshold th using the threshold th recorded in the threshold holding unit 24 (step S22). Data generator 13, a counter i is set to 0 (step S23), i th the if-else the number a n of (0 ≦ i ≦ n-1 ), or number a i is equal to or less than the threshold value th Is determined (step S24). If the number of stages a i ≦ threshold th is not satisfied (N in step S24), the data generation unit 13 stores the if-else information in the correction target storage unit 25 (step S25), and proceeds to step S26, where the number of stages a If i ≦ threshold th (Y in step S24), the process directly proceeds to step S26.

ステップS26では、データ生成部13は、i=n−1であるかを判定し、i=n−1でなければ(ステップS26のN)、i=i+1として(ステップS27)、ステップS24に戻り、i=n−1であれば(ステップS26のY)、処理を終了する。   In step S26, the data generation unit 13 determines whether i = n−1. If i = n−1 (N in step S26), i = i + 1 is set (step S27), and the process returns to step S24. If i = n−1 (Y in step S26), the process is terminated.

図6に示す処理により、RTLソース21に含まれるm個のif−elseの要素が、閾値th以上と判断され、修正対象となる。   With the processing shown in FIG. 6, it is determined that the m number of if-else elements included in the RTL source 21 are equal to or greater than the threshold th and are to be corrected.

図7は、ステップS4の処理のより詳細な処理フロー例を示す図である。   FIG. 7 is a diagram showing a more detailed processing flow example of the processing in step S4.

修正方法決定部14は、修正対象記憶部25から修正対象情報を取得し(ステップS31)、カウンタiを0に設定して(ステップS32)、i番目(0≦i≦m−1)のif−elseの修正方法を選択する(ステップS33)。ステップS33の処理の詳細は、図8を用いて後述する。   The correction method determination unit 14 acquires the correction target information from the correction target storage unit 25 (step S31), sets the counter i to 0 (step S32), and the i-th (0 ≦ i ≦ m−1) if. -Else correction method is selected (step S33). Details of the processing in step S33 will be described later with reference to FIG.

その後、修正方法決定部14は、i=m−1であるかを判定し(ステップS34)、i=m−1でなければ(ステップS34のN)、修正方法決定部14は、i=i+1として(ステップS35)、ステップS33に戻り、i=m−1であれば(ステップS34のY)、処理を終了する。   Thereafter, the correction method determination unit 14 determines whether i = m−1 (step S34). If i = m−1 is not satisfied (N in step S34), the correction method determination unit 14 determines that i = i + 1. (Step S35), the process returns to Step S33, and if i = m−1 (Y in Step S34), the process ends.

図8は、ステップS33の処理のより詳細な処理フロー例を示す図である。   FIG. 8 is a diagram showing a more detailed processing flow example of the processing in step S33.

修正方法決定部14は、修正対象情報のi番目の(0≦i≦m−1)のif−else文を抽出し(ステップS341)、条件に設定された信号が1ビット(bit)信号であるかを判定する(ステップS342)。信号が1ビット信号であれば(ステップS342のY)、修正方法決定部14は、さらに、条件に同名の信号があるかを判定する(ステップS343)。条件に同名信号がなければ(ステップS343のN)、修正方法決定部14は、そのif−elseの修正方法を「第1の修正方法」に決定し(ステップS344)、処理を終了する(ステップS34の処理へ進む)。   The correction method determination unit 14 extracts the i-th (0 ≦ i ≦ m−1) if-else statement of the correction target information (step S341), and the signal set as the condition is a 1-bit (bit) signal. It is determined whether or not there is (step S342). If the signal is a 1-bit signal (Y in step S342), the correction method determination unit 14 further determines whether there is a signal with the same name in the condition (step S343). If there is no signal with the same name in the condition (N in Step S343), the correction method determination unit 14 determines the correction method of the if-else as “first correction method” (Step S344), and ends the processing (Step S344). The process proceeds to S34).

ステップS343の判定で、条件に同名信号があれば(ステップS343のY)、修正方法決定部14は、さらに、条件がANDで構成されているかを判定する(ステップS345)。条件がANDで構成されていれば(ステップS345のY)、修正方法決定部14は、そのif−elseの修正方法を「第2の修正方法」に決定して(ステップS346)、処理を終了し、条件がANDで構成されていなければ(ステップS345のN)、ステップS344へ戻り、そのif−else文の修正方法を「第1の修正方法」に決定する。   If it is determined in step S343 that there is a signal with the same name in the condition (Y in step S343), the correction method determination unit 14 further determines whether the condition is configured by AND (step S345). If the condition is composed of AND (Y in step S345), the correction method determination unit 14 determines that the if-else correction method is the “second correction method” (step S346), and ends the process. If the condition is not composed of AND (N in step S345), the process returns to step S344, and the correction method of the if-else statement is determined as the “first correction method”.

ステップS342の判定で、条件に設定された信号が1ビット信号でなければ(ステップS342のN)、修正方法決定部14は、さらに、条件に他の信号があるかを判定する(ステップS347)。条件に他の信号があれば(ステップS347のY)、そのif−else文の修正方法を「第3の修正方法」に決定して(ステップS348)、処理を終了し、条件に他の信号がなければ(ステップS347のN)、ステップS343へ戻る。   If the signal set in the condition is not a 1-bit signal in the determination in step S342 (N in step S342), the correction method determination unit 14 further determines whether there is another signal in the condition (step S347). . If there is another signal in the condition (Y in step S347), the modification method of the if-else statement is determined to be “third modification method” (step S348), the process is terminated, and another signal is included in the condition. If there is not (N of step S347), it will return to step S343.

修正部15は、修正対象となったRTLソース21のif−elseについて、決定された修正方法に応じた修正を行う。以下に、各修正方法によるif−elseの修正処理を、より詳細に説明する。   The correcting unit 15 corrects the if-else of the RTL source 21 to be corrected according to the determined correction method. The if-else correction process by each correction method will be described in more detail below.

[第1の修正方法による修正]
(1)前処理(ブロック分割処理)
修正部15は、修正の前処理(ブロック分割処理)として、以下の処理S151〜S152を行う。
[Correction by the first correction method]
(1) Preprocessing (block division processing)
The correction unit 15 performs the following processes S151 to S152 as preprocessing (block division processing) for correction.

処理S151: if−else文の分割するブロック数Lを算出する。   Process S151: The number L of blocks to be divided by the if-else statement is calculated.

処理S152: 各ブロックに格納されるif−else文の段数Pを算出する。 Processing S152: calculating the number P L of if-else statements stored in each block.

ここで段数の分割として、修正部15は、以下の2つの処理のいずれかで行う。   Here, as the division of the number of stages, the correction unit 15 performs either of the following two processes.

第1の分割方法: 段数aを2で割る。このとき、段数a−1を2で割ることになるため、L=2となる。さらに、Pは、(a−1)/2の小数点以下を切り上げた値となり、P=(a−1)−Pとなる。すなわち、(a−1)が偶数のときにP=(a−1)/2となり、(a−1)が奇数のときにP=P+1となる(P=P−1でもよい)。 First division method: Divide stage number a i by 2. At this time, since the number of stages a i −1 is divided by 2, L = 2. Further, P 0 is a value obtained by rounding up the decimal point of (a i −1) / 2, and P 1 = (a i −1) −P 0 . That, (a i -1) P 0 = (a i -1) when the even / 2, and the P 0 = P 1 +1 when is an odd number (a i -1) (P 0 = P It may be 1 -1).

第2の分割方法: (a−1)を閾値th−1で割る。このとき、ブロック数Lは、(a−1)/(th−1)の小数点以下を切り上げた値となる。 Second division method: (a i -1) is divided by a threshold th-1. At this time, the number of blocks L is a value obtained by rounding up the decimals of (a i −1) / (th−1).

図9に示すように、段数aであるif−else文を閾値th未満になるようにAL−1という名前のL個のブロックに分解し、その中に含まれるif−else文の個数がPL−1(<th)であるとすると、分割した各ブロックにelse項を挿入するために、全てのif−else文の段数が増加する。そこで、段数を閾値thで割った場合には各ブロックのif−else文の段数が最終的に閾値thを超えてしまうことがあるため、段数(a−1)を閾値th−1で割ることとする。各ブロックのif−else文の段数を閾値th−1に抑制することによって、閾値thを超えることを防止する。また、段数aから引いている1は、else項を除外して計算することによる。 As shown in FIG. 9, the if-else statement with the number of stages a i is decomposed into L blocks named A L-1 so as to be less than the threshold th, and the number of if-else statements included therein Is P L-1 (<th), the number of stages in all if-else statements increases in order to insert an else term into each divided block. Therefore, when the number of stages is divided by the threshold th, the number of stages in the if-else statement of each block may eventually exceed the threshold th, and therefore the stage number (a i −1) is divided by the threshold th−1. I will do it. By suppressing the number of stages of the if-else statement of each block to the threshold value th-1, it is possible to prevent the threshold value th from being exceeded. Further, 1 subtracted from the stage number a i is obtained by excluding the else term.

以下に、前処理(各Pの算出)の具体例を説明する。第1の分割方法については、P≦th−1であるときに、第2の分割方法の一例とみなすことができ、同様の手順で説明することができる。よって、第2の分割方法についての具体例を説明する。 Hereinafter, a specific example of the pretreatment (calculation of the P L). The first division method can be regarded as an example of the second division method when P L ≦ th−1, and can be described in the same procedure. Therefore, a specific example of the second division method will be described.

図10(A)は、a=7のif−else文、th=4の場合の分割例を示す図である。この場合に、L=(a−1)/(th−1)=(7−1)/(4−1)=6/3=2となり、さらに、P=(a−1)/L=(7−1)/2=6/2=3となる。したがって、P=3、P=3となる。 FIG. 10A is a diagram illustrating an example of division when an if-else statement with a i = 7 and th = 4. In this case, L = (a i −1) / (th−1) = (7-1) / (4-1) = 6/3 = 2, and P 0 = (a i −1) / L = (7-1) / 2 = 6/2 = 3. Therefore, P 0 = 3 and P 1 = 3.

図10(B)は、a=6のif−else文、th=4の場合の分割例を示す図である。この場合に、L=(a−1)/(th−1)=(6−1)/(4−1)=5/3<2となり、さらに、P=(a−1)/L=(6−1)/2=5/2<3となる。したがって、P=2、P=3となる。各ブロックのPが異なるとき、最終ブロックから順に並べていき、先頭ブロックが最小の段数となるように割り当てるようにしてもよい。 FIG. 10B is a diagram illustrating an example of division when an if-else statement with a i = 6 and th = 4. In this case, L = (a i −1) / (th−1) = (6-1) / (4-1) = 5/3 <2, and P 0 = (a i −1) / L = (6-1) / 2 = 5/2 <3. Therefore, P 0 = 2 and P 1 = 3. When P i of each block is different, the blocks may be arranged in order from the last block and assigned so that the top block has the minimum number of stages.

図11(A)は、a=13のif−else文、th=5の場合の分割例を示す図である。この場合に、L=(a−1)/(th−1)=(13−1)/(5−1)=12/4=3となり、さらに、P=(a−1)/L=(13−1)/3=12/3=4となる。したがって、P=4、P=4、P=4となる。 FIG. 11A is a diagram illustrating an example of division when an if-else statement with a i = 13 and th = 5. In this case, L = (a i −1) / (th−1) = (13-1) / (5-1) = 12/4 = 3, and P 0 = (a i −1) / L = (13-1) / 3 = 12/3 = 4. Therefore, P 0 = 4, P 1 = 4, and P 2 = 4.

図11(B)は、a=12のif−else文、th=5の場合の分割例を示す図である。この場合に、L=(a−1)/(th−1)=(12−1)/(5−1)=11/4<3となり、さらに、P=(a−1)/L=(12−1)/3=11/3<4となる。したがって、P=3、P=4、P=4となる。 FIG. 11B is a diagram illustrating an example of division when an if-else statement with a i = 12 and th = 5. In this case, L = (a i -1) / (th-1) = (12-1) / (5-1) = 11/4 <3, and P 0 = (a i -1) / L = (12-1) / 3 = 11/3 <4. Therefore, P 0 = 3, P 1 = 4, and P 2 = 4.

(2)本処理(修正処理)
次に、本処理(修正処理)として、修正部15は、RTLの文法規約に従ってRTLソース21の修正対象の記述を変形する処理として、以下の処理S153〜S156を行う。
(2) This process (correction process)
Next, as this processing (correction processing), the correction unit 15 performs the following processing S153 to S156 as processing for transforming the description of the correction target of the RTL source 21 according to the RTL grammar rules.

処理S153: 前処理で算出した分割したブロック数L、各ブロック内のif−else文の段数P数に応じて複数ブロックを生成し、各ブロックの記述を行う。 Processing S153: the number of blocks obtained by dividing calculated in preprocessing L, to generate a plurality of blocks according to the number of stages P L number of if-else statements in each block, performing a description of each block.

RTLソース21の文法規約に従って、先頭ブロックでは“if ( ) begin 〜 end”の構造を、最終ブロックでは“else begin 〜 end”の構造をそれぞれ記述する。それ以外のブロックがある場合に各ブロックでは“else if ( ) begin 〜 end”の構造を記述する。なお、この時点で、各if()内の要素(条件式)は空とする。   In accordance with the grammatical rules of the RTL source 21, the structure of “if () begin to end” is described in the first block, and the structure of “else begin to end” is described in the last block. When there are other blocks, the structure of “else if () begin to end” is described in each block. At this time, the element (conditional expression) in each if () is empty.

図12は、第1の修正方法による修正対象を含むRTLソース21の例を示す図である。   FIG. 12 is a diagram illustrating an example of the RTL source 21 including a correction target according to the first correction method.

図12に示すRTLソース21では、第7行〜27行のif−elseが修正対象となっている。そして、前処理により、if−else文の各段が、先頭ブロックに分類する要素(第7〜15行)と、最終ブロックに分類する要素(第16〜27行)とに分割されているとする。   In the RTL source 21 shown in FIG. 12, the if-else in the seventh line to the 27th line is a correction target. Then, if each stage of the if-else statement is divided into elements to be classified as the first block (lines 7 to 15) and elements to be classified as the last block (lines 16 to 27) by preprocessing. To do.

ここで、各ブロックへのif−else文の段数がわかっていることから、図13に示すように、先頭ブロックの先頭行(第7行)にif−elseの開始記述である“if ( ) begin”、最終行(第20行)に終了記述である“end”を記述する。同様に、最終ブロックの先頭行(第21行)に“else begin”、最終行(第34行)に“end”をそれぞれ記述する。   Here, since the number of stages of the if-else statement for each block is known, as shown in FIG. 13, “if (), which is the start description of if-else, is displayed in the first line (seventh line) of the first block. “begin” and “end” as the end description are described in the last line (line 20). Similarly, “else begin” is described in the first line (the 21st line) of the last block, and “end” is described in the last line (the 34th line).

処理S154: 各ブロックの先頭になるif()に挿入する条件式の論理を抽出する。より詳しくは、if−else文の各段の要素をもとに、j番目のブロックに対して、先頭からΣP(i=0 〜 j−1)+1番目のif−else文からP個のif−else文の条件式を抽出しOR結合した条件式を“if ( ) begin”の()内に挿入する。この処理を、全てのブロックについて実行する。 Process S154: The logic of the conditional expression to be inserted into if () at the head of each block is extracted. More specifically, on the j-th block, ΣP i (i = 0 to j−1) +1 P j from the first if-else statement based on the elements in each stage of the if-else statement. The conditional expression of the if-else statement is extracted and ORed and inserted into () of “if () begin”. This process is executed for all blocks.

図14に示すように、図12に示すRTLソース21の第7、第10、第13行のif−else文から抽出した各条件式(A_IN==1’b1)、(B_IN==1’b1)、(C_IN==1’b1)をOR結合した条件を、第7行の“if ( ) begin”の()内に記述する。   As shown in FIG. 14, the conditional expressions (A_IN == 1′b1) and (B_IN == 1 ′) extracted from the if-else statements in the seventh, tenth, and thirteenth lines of the RTL source 21 shown in FIG. b1) and the condition of (C_IN == 1′b1) ORed together are described in () of “if () begin” in the seventh row.

処理S155: 各ブロックに、if−else文を挿入する。より詳しくは、j番目のブロックに、S154の処理で条件を抽出したif−else文を全て挿入する。この処理を、全てのブロックについて実行する。   Process S155: An if-else statement is inserted into each block. More specifically, all if-else statements whose conditions are extracted in the process of S154 are inserted into the j-th block. This process is executed for all blocks.

図15に示すように、図12に示すRTLソース21の第7〜第15のif−else文を、先頭ブロックの第8〜16行に記述し、RTLソース21の第16〜27行のif−else文を、最終ブロックの第22〜30行に記述する。   As shown in FIG. 15, the 7th to 15th if-else statements of the RTL source 21 shown in FIG. 12 are described in the 8th to 16th lines of the first block, and the ifs of the 16th to 27th lines of the RTL source 21 -The else statement is described in the 22nd to 30th lines of the final block.

処理S156: 各ブロックに、RTLソース21から抽出したelse項の記述を挿入する。   Process S156: The description of the else term extracted from the RTL source 21 is inserted into each block.

図16に示すように、図12に示すRTLソース21の第25〜26行のelse項を、先頭ブロックの第17〜19行、最終ブロックの第31〜33行にそれぞれ記述する。   As shown in FIG. 16, the else terms of the 25th to 26th lines of the RTL source 21 shown in FIG. 12 are described in the 17th to 19th lines of the first block and the 31st to 33rd lines of the last block, respectively.

図17は、第1の修正方法による修正前のRTLソース21の回路構成を示す図であり、図18は、第1の修正方法による修正後の修正済みRTLソース27の回路構成を示す図である。図17および図18では、比較のため、回路の構成要素を簡略に表している。   FIG. 17 is a diagram showing a circuit configuration of the RTL source 21 before correction by the first correction method, and FIG. 18 is a diagram showing a circuit configuration of the corrected RTL source 27 after correction by the first correction method. is there. In FIG. 17 and FIG. 18, circuit components are simply shown for comparison.

修正前のRTLソース21によれば、図17に示すように、6つのセレクタ回路が直列に接続し、セレクタFに入力する信号3’b110は、出力信号Y_OUT[2:0]までに通過するセレクタ数が6段であり、一方、セレクタCに入力する信号3’b011は、出力信号Y_OUT[2:0]までに通過するセレクタ数が3段となっている。   According to the RTL source 21 before correction, as shown in FIG. 17, six selector circuits are connected in series, and the signal 3′b110 input to the selector F passes by the output signal Y_OUT [2: 0]. The number of selectors is six. On the other hand, the signal 3′b011 input to the selector C has three stages of selectors that pass by the output signal Y_OUT [2: 0].

これに対し、修正済みRTLソース27によれば、図18に示すように、セレクタ回路数が1つ増加するが、セレクタ回路を並列に接続し、セレクタFに入力する信号3’b110は、出力信号Y_OUT[2:0]までに通過するセレクタ数が4段となり、セレクタCに入力する信号3’b011も、出力信号Y_OUT[2:0]までに通過するセレクタ数が4段となる。   On the other hand, according to the modified RTL source 27, as shown in FIG. 18, the number of selector circuits increases by one, but the signal 3′b110 input to the selector F by connecting the selector circuits in parallel is output. The number of selectors passing by the signal Y_OUT [2: 0] is four stages, and the signal 3′b011 input to the selector C is also four stages of selectors passing by the output signal Y_OUT [2: 0].

したがって、元のRTLソース21では、出力のタイミング差のバラツキが大きい構成であるが、RTL最適化装置1により出力される修正済みRTLソース27では、出力のタイミング差のバラツキが解消されていることがわかる。   Therefore, the original RTL source 21 has a configuration in which the variation in the output timing difference is large, but in the modified RTL source 27 output by the RTL optimization device 1, the variation in the output timing difference is eliminated. I understand.

[第2の修正方法による修正]
(1)前処理(ブロック分割処理)
修正部15は、修正の前処理(ブロック分割処理)として、以下の処理S161〜S162を行う。第2の修正方法による修正の前処理は、第1の修正方法による修正の前処理とほぼ同様の処理である。対象のif−else文の段数をaとする。
[Correction by the second correction method]
(1) Preprocessing (block division processing)
The correction unit 15 performs the following processes S161 to S162 as preprocessing for correction (block division processing). The preprocessing for correction by the second correction method is substantially the same as the preprocessing for correction by the first correction method. Let a i be the number of stages in the target if-else statement.

処理S161: if−else文の分割するブロック数Lを算出する。   Process S161: The number L of blocks to be divided by the if-else statement is calculated.

全ての条件文に表れる信号のビット(bit)数に基づいて、以下の規則によりブロック数Lを決定する。
「規則:ビット数をNとするとき、分割するブロック数L=2とする。」
処理S162: 各ブロックに格納されるif−else文の段数Pを算出する。
Based on the number of bits of the signal appearing in all conditional statements, the block number L is determined according to the following rules.
“Rule: When the number of bits is N, the number of blocks to be divided is L = 2N .”
Processing S162: calculating the number P L of if-else statements stored in each block.

段数Pは、ブロック数Lの算出で使用した各条件式の信号値をもとに場合分けを行い、該当するif−else文をカウントすることで算出する。 The stage number P 1 is calculated by performing case classification based on the signal value of each conditional expression used in the calculation of the block number L and counting the corresponding if-else statements.

例えば、if−else文の全条件文に現れる信号を抽出し、if−else文を格納するブロック数Lを、以下のように定めておく。
・ 条件文の信号が1ビットの場合は、ブロック数L=最大2とする。
・ 条件文の信号が2ビットの場合は、ブロック数L=最大4とする。
・ 条件文の信号が3ビットの場合は、ブロック数L=最大8とする。
・ 条件文の信号がNビットの場合は、ブロック数L=最大2とする。
For example, signals appearing in all conditional statements of an if-else statement are extracted, and the number of blocks L in which the if-else statement is stored is determined as follows.
• If the conditional statement signal is 1 bit, the number of blocks L = 2 at maximum.
• If the conditional statement signal is 2 bits, the number of blocks L = 4 at maximum.
-If the conditional statement signal is 3 bits, the number of blocks L = 8 at maximum.
• If the conditional statement signal is N bits, the number of blocks L = 2 N at maximum.

さらに、抽出した信号の値ごとに分割を行う。これにより、元のRTLソース21のif−else文がどのブロックに挿入されるかが決定する。   Further, division is performed for each value of the extracted signal. Thereby, it is determined in which block the if-else statement of the original RTL source 21 is inserted.

図19は、第2の修正方法による修正の場合のブロック分割を説明するための図である。   FIG. 19 is a diagram for explaining block division in the case of correction by the second correction method.

図19(A)は、条件文の信号が1ビットである場合のブロック分割例を示す。この場合に、if−else文の格納ブロック数が最大=2となり、if−else文格納ブロックA、Aは、それぞれ、段数がP=2、P=4となり、else項の段数=1となる。 FIG. 19A shows an example of block division when the conditional statement signal is 1 bit. In this case, the number of storage blocks of the if-else statement is maximum = 2, and the number of stages of the if-else statement storage blocks A 0 and A 1 are P 0 = 2 and P 1 = 4, respectively. = 1.

図19(B)は、条件文の信号が2ビットである場合のブロック分割例を示す。この場合に、if−else文の格納ブロック数が最大=4となり、if−else文格納ブロックA、A、A、Aは、それぞれ、段数がP=1、P=2、P=3、P=4となり、else項の段数=1となる。 FIG. 19B shows an example of block division when the conditional statement signal is 2 bits. In this case, the maximum number of if-else statement storage blocks is 4, and the if-else statement storage blocks A 0 , A 1 , A 2 , and A 3 have the number of stages P 0 = 1 and P 1 = 2, respectively. , P 2 = 3, P 3 = 4, and the number of stages in the else term = 1.

(2)本処理(修正処理)
次に、修正部15は、本処理(修正処理)を行う。
(2) This process (correction process)
Next, the correction unit 15 performs this processing (correction processing).

図20は、第2の修正方法による修正対象を含むRTLソース21の例を示す図である。図20に示すRTLソース21で、第7〜24行のif−elseが修正対象となっている。前処理により、分割数L=2、段数P=2、P=3であるとする。 FIG. 20 is a diagram illustrating an example of the RTL source 21 including a correction target by the second correction method. In the RTL source 21 shown in FIG. 20, the if-else in the 7th to 24th lines is a correction target. It is assumed that the number of divisions L = 2, the number of stages P 0 = 2 and P 1 = 3 by preprocessing.

処理S163: if−else文の全ての条件に現れる同名信号の信号値を探索し、if−else文の条件を同名信号かつ信号値と反転値とに分類する。図20のRTLソース21のif−else文を、条件の同名信号および信号値、ここでは(A_IN==1’b0)と(A_IN==1’b1)とをもとに、2つの要素(第7〜12行)と3つの要素(第13〜21行)とに分類する。   Process S163: The signal value of the signal with the same name that appears in all conditions of the if-else statement is searched, and the condition of the if-else statement is classified into a signal with the same name, a signal value, and an inverted value. The if-else statement of the RTL source 21 in FIG. 20 is divided into two elements (namely, based on a signal having the same name and a signal value, here (A_IN == 1′b0) and (A_IN == 1′b1)). 7th to 12th lines) and 3 elements (13th to 21st lines).

以降の処理として、RTLソース21の文法規約に従って、各ブロックで分類した条件式の要素を挿入してif−else文を修正する。この修正は、第1の修正方法による修正の処理S153〜S156とほぼ同様の処理である。   As the subsequent processing, in accordance with the grammatical rules of the RTL source 21, the elements of the conditional expressions classified in each block are inserted to correct the if-else statement. This correction is substantially the same process as the correction processes S153 to S156 according to the first correction method.

処理S164: 処理S153と同様に、先頭ブロックでは“if ( ) begin 〜 end”の構造を、最終ブロックでは“else begin 〜 end”の構造をそれぞれ記述する。   Process S164: Similar to process S153, the structure of “if () begin to end” is described in the first block, and the structure of “else begin to end” is described in the last block.

図21に示すように、先頭ブロックの先頭行(第7行)に“if ( ) begin”、最終行(第17行)に“end”を、最終ブロックの先頭行(第18行)に“else begin”、最終行(第31行)に“end”をそれぞれ記述する。   As shown in FIG. 21, “if () begin” in the first row (seventh row) of the first block, “end” in the last row (17th row), and “end” in the first row (18th row) of the last block. “else begin” and “end” in the last line (line 31), respectively.

処理S165: 処理S154と同様に、各ブロックの先頭になるif()に挿入する条件式の論理を抽出する。   Process S165: Similarly to process S154, the logic of the conditional expression to be inserted into if () at the head of each block is extracted.

図22に示すように、ブロック数Lの算出で用いた同名信号および信号値の組み合わせの1つとして図20に示すRTLソース21から抽出した条件式(A_IN==1’b0)を第7行の“if ( ) begin ”の()内に記述する。   As shown in FIG. 22, the conditional expression (A_IN == 1′b0) extracted from the RTL source 21 shown in FIG. 20 as one of the combination of the signal of the same name and the signal value used in the calculation of the number L of blocks is shown in the seventh row. “If () begin” in ().

処理S166において、処理S155と同様に、記述した条件以外の条件について、if−else文の()内に記述する。   In process S166, as in process S155, conditions other than the described conditions are described in parentheses in the if-else statement.

図23に示すように、図20に示すRTLソース21の第7〜8行のif−else文の条件((A_IN==1’b0)&&(B_IN==1’b0)&&(C_IN==1’b1))から既に抽出した信号と信号値(A_IN==1’b0)以外の信号と信号値とをANDした条件((B_IN==1’b0)&&(C_IN==1’b1))を設定したif−else文を、先頭ブロックの第8〜13行に記述する。同様に、図20に示すRTLソース21の第10〜12行のif−else文の条件式をもとに、条件((B_IN==1’b1)&&(C_IN==1’b0))を設定したif−else文を、先頭ブロックの第11〜13行に記述する。さらに、同様に、図20のRTLソース21の第13〜15行、第16〜18行、第19〜21行の条件をもとにif−else文を最終ブロックの第19〜21行、第22〜24行、第25〜27行にそれぞれ記述する。   As shown in FIG. 23, the conditions of the if-else statement in the seventh to eighth lines of the RTL source 21 shown in FIG. 20 ((A_IN == 1′b0) && (B_IN == 1′b0) && (C_IN == 1'b1)) and a condition obtained by ANDing a signal other than the signal already extracted from the signal value (A_IN == 1'b0) and the signal value ((B_IN == 1'b0) && (C_IN == 1'b1) If-else statement in which) is set is described in the 8th to 13th lines of the top block. Similarly, based on the conditional expression of the if-else statement in the 10th to 12th lines of the RTL source 21 shown in FIG. 20, the condition ((B_IN == 1′b1) && (C_IN == 1′b0)) is changed. The set if-else statement is described in the 11th to 13th lines of the top block. Further, similarly, the if-else statement is changed to the 19th to 21st lines of the final block based on the conditions of the 13th to 15th lines, the 16th to 18th lines, and the 19th to 21st lines of the RTL source 21 of FIG. Described in lines 22 to 24 and lines 25 to 27, respectively.

処理S167: 処理S156と同様に、図24に示すように、図20に示すRTLソース21の第22〜23行のelse項を、先頭ブロックの第14〜15行、最終ブロックの第28〜29行にそれぞれ記述する。   Process S167: As in process S156, as shown in FIG. 24, the else term in the 22nd to 23rd lines of the RTL source 21 shown in FIG. 20 is replaced with the 14th to 15th lines of the first block and the 28th to 29th of the last block. Each line is described.

図25は、第2の修正方法による修正前のRTLソース21の回路構成を示す図であり、図26は、第2の修正方法による修正済みRTLソース27の回路構成を示す図である。図25および図26では、比較のため、回路の構成要素を簡略に表している。   FIG. 25 is a diagram showing a circuit configuration of the RTL source 21 before correction by the second correction method, and FIG. 26 is a diagram showing a circuit configuration of the RTL source 27 corrected by the second correction method. In FIGS. 25 and 26, circuit components are simply shown for comparison.

修正前のRTLソース21によれば、図25に示すように、3ビット信号の入力を持つセレクタが5つ直列に接続している。セレクタEに入力する信号3’b111は、出力信号Y_OUT[2:0]までに通過するセレクタ数が5段であり、一方、セレクタBに入力する信号3’b010は、出力信号Y_OUT[2:0]までに通過するセレクタ数が2段となっている。   According to the RTL source 21 before correction, as shown in FIG. 25, five selectors having a 3-bit signal input are connected in series. The signal 3′b111 input to the selector E has five stages of selectors that pass by the output signal Y_OUT [2: 0], while the signal 3′b010 input to the selector B has the output signal Y_OUT [2: 0] is two stages.

これに対し、修正済みRTLソース27によれば、図26に示すように、2ビット信号の入力を持つ5段のセレクタと1ビット信号の入力を持つ1つのセレクタとに構成が変更されている。セレクタ数が1つ増加するが、セレクタが並列に接続される構成となり、セレクタEに入力する信号3’b111は、出力信号Y_OUT[2:0]までに通過するセレクタ数が4段となり、速度が改善されていることがわかる。   On the other hand, according to the corrected RTL source 27, as shown in FIG. 26, the configuration is changed to a 5-stage selector having a 2-bit signal input and a selector having a 1-bit signal input. . Although the number of selectors increases by one, the selectors are connected in parallel, and the signal 3′b111 input to the selector E has four stages of selectors that pass by the output signal Y_OUT [2: 0], and the speed It can be seen that is improved.

[第3の修正方法による修正]
次に、本処理(修正処理)として、修正部15は、RTLの文法規約に従ってRTLソース21の修正対象のif−else分岐をcase分岐に変形する処理として、以下の処理S171〜S174を行う。
[Modification by the third modification method]
Next, as the main process (correction process), the correction unit 15 performs the following processes S171 to S174 as a process of transforming the correction target if-else branch of the RTL source 21 into a case branch in accordance with the RTL grammar rules.

図27は、第3の修正方法による修正対象を含むRTLソース21の記述例を示す図である。図27に示すRTLソース21で、第7〜24行のif−elseが修正対象となっている。   FIG. 27 is a diagram illustrating a description example of the RTL source 21 including a correction target by the third correction method. In the RTL source 21 shown in FIG. 27, the if-else in the 7th to 24th lines is a correction target.

処理S171: if−else文の条件から信号名“SEL_IN”を抽出する。   Process S171: The signal name “SEL_IN” is extracted from the condition of the if-else statement.

処理S172: 抽出した条件文の信号名から、対象のif−else文の段数aを取得する。 Process S172: The number of stages a i of the target if-else statement is acquired from the signal name of the extracted conditional statement.

処理S173: RTLの文法規約に従って、if−elseの記述の代わりに、case()を構成する開始記述であるcase()文と終了記述であるendcaseとを記述する。   Process S173: In accordance with the RTL grammar rules, instead of describing if-else, a case () statement that is a start description constituting case () and an endcase that is an end description are described.

図28に示すように、先頭行(第7行)に“case ( )”を最終行(第14行)に“endcase”を記述し、“case ( )”の()内に抽出した信号名“SEL_IN”を記述する。   As shown in FIG. 28, “case ()” is described in the first line (seventh line), “endcase” is described in the last line (14th line), and the signal name extracted in () of “case ()”. “SEL_IN” is described.

処理S174: 元のRTLソース21の格段のif−else文の条件を、case文の条件である“条件式の信号値:動作処理”に書き換える。   Process S174: The condition of the exceptional if-else statement of the original RTL source 21 is rewritten to “signal value of conditional expression: operation process” which is a condition of the case statement.

図29に示すように、図27に示すRTLソース21の第7〜8行、第10〜11行、第13〜14行、第16〜17行、第19〜20行の条件を、第8〜12行にそれぞれ記述する。例えば、第7〜8行のif文の“SEL_IN == 4’b0000”と“Y_OUT = 3’b000”を取り出し、case文の対応する条件として“4’b0000:Y_OUT = 3’b000”を第8行に記述する。他のif文についても同様に記述する。   As shown in FIG. 29, the conditions of the 7th to 8th lines, the 10th to 11th lines, the 13th to 14th lines, the 16th to 17th lines, and the 19th to 20th lines of the RTL source 21 shown in FIG. Describe each in ~ 12 lines. For example, “SEL_IN == 4′b0000” and “Y_OUT = 3′b000” of the if statement in the seventh to eighth lines are extracted, and “4′b0000: Y_OUT = 3′b000” is set as the corresponding condition of the case statement. Describe in 8 lines. The same applies to other if statements.

処理S175: if−else文のelse項を、case文のdefault項に書き換える。   Process S175: The else term of the if-else statement is rewritten to the default term of the case statement.

図30に示すように、図27に示すRTLソース21の第22〜23行のelse項の条件(Y_OUT = 3’b101)をもとに、default項の条件“default:Y_OUT = 3’b101”を第13行に記述する。   As shown in FIG. 30, based on the condition of the else term (Y_OUT = 3′b101) in the 22nd to 23rd lines of the RTL source 21 shown in FIG. 27, the condition of the default term “default: Y_OUT = 3′b101”. Is described on line 13.

図31は、第3の修正方法による修正前のRTLソース21の回路構成を示す図であり、図32は、第3の修正方法による修正済みRTLソース27の回路構成を示す図である。図31および図32では、比較のため、回路の構成要素を簡略に表している。   FIG. 31 is a diagram showing a circuit configuration of the RTL source 21 before correction by the third correction method, and FIG. 32 is a diagram showing a circuit configuration of the RTL source 27 corrected by the third correction method. 31 and 32, circuit components are simply shown for comparison.

修正前のRTLソース21によれば、図31に示すように、4ビット信号の入力を持つ3ビット出力セレクタが5つ直列に接続し、信号がセレクタを通過する時間が長くなるため、速度改善の余地がある。   According to the RTL source 21 before correction, as shown in FIG. 31, five 3-bit output selectors having four-bit signal inputs are connected in series, and the time for the signal to pass through the selector becomes longer, so the speed is improved. There is room for.

これに対し、修正済みRTLソース27によれば、図32に示すように、4ビットセレクタ信号を、4ビット信号入力の一致比較回路と3ビットAND回路とに構成が変更されている。AND回路が6段となるが並列に接続しているため、出力信号Y_OUT[2:0]までの通過時間の速度が改善されていることがわかる。   On the other hand, according to the corrected RTL source 27, as shown in FIG. 32, the configuration of the 4-bit selector signal is changed into a 4-bit signal input match comparison circuit and a 3-bit AND circuit. It can be seen that since the AND circuit has six stages, but is connected in parallel, the speed of the transit time to the output signal Y_OUT [2: 0] is improved.

以上説明したRTL最適化装置1は、図1に示す処理部を備える専用ハードウェアとして実施することができる。   The RTL optimization apparatus 1 described above can be implemented as dedicated hardware including the processing unit illustrated in FIG.

また、RTL最適化装置1を、図33に示すような、CPU101、メモリ102、記憶装置(ハードディスク)103、入力装置(キーボード、マウス等)104、出力装置(ディスプレイ、プリンタ等)105、通信制御部106等が内部のネットワーク等で接続されたコンピュータ100として実施することができる。   Also, the RTL optimizing apparatus 1 includes a CPU 101, a memory 102, a storage device (hard disk) 103, an input device (keyboard, mouse, etc.) 104, an output device (display, printer, etc.) 105, and communication control as shown in FIG. The unit 106 or the like can be implemented as the computer 100 connected via an internal network or the like.

さらに、RTL最適化装置1を、コンピュータ100で実行可能なプログラムとして実施することができる。この場合に、図1に示すRTL最適化装置1の処理部の機能を実現するプログラムを実装し、コンピュータ100上で実行することにより実施する。   Furthermore, the RTL optimization device 1 can be implemented as a program that can be executed by the computer 100. In this case, a program that realizes the function of the processing unit of the RTL optimization apparatus 1 shown in FIG. 1 is installed and executed on the computer 100.

すなわち、図1に示したif−else抽出部11、閾値決定部12、データ生成部13、修正方法決定部14、修正部15の各機能をコンピュータに実行させる実行プログラムをコンピュータ100に読み込ませ、実行させることによって,RTL最適化装置1を実現することができる。   That is, the computer 100 is caused to read an execution program that causes the computer to execute the functions of the if-else extraction unit 11, the threshold determination unit 12, the data generation unit 13, the correction method determination unit 14, and the correction unit 15 illustrated in FIG. By executing it, the RTL optimizing device 1 can be realized.

この場合に、コンピュータ100のCPU101が、例えば、
・ 上記の実行プログラムおよび入力となる情報(RTLソース21)をファイルとしてハードディスク103に格納する。
・ 入力装置104から実行プログラムを起動し、起動された実行プログラムが、メモリ102にロードされ、必要に応じてRTLソース21,判定手段の指定23をハードディスク103からメモリ102に読み出しながら処理を進め、処理中に、処理結果(ログ情報、修正対象情報、決定した修正方法等)をメモリ102、ハードディスク103に格納する。
・ 修正済みRTLソース27をディスプレイ105に表示し、ファイル形式で出力する、
といった手順で処理を実行する。
In this case, the CPU 101 of the computer 100, for example,
The above execution program and input information (RTL source 21) are stored in the hard disk 103 as a file.
An execution program is activated from the input device 104, and the activated execution program is loaded into the memory 102. The RTL source 21 and the determination means designation 23 are read from the hard disk 103 to the memory 102 as necessary, and the process proceeds. During processing, processing results (log information, correction target information, determined correction method, etc.) are stored in the memory 102 and the hard disk 103.
-Display the corrected RTL source 27 on the display 105 and output it in a file format.
The process is executed according to the procedure.

なお、実行プログラムは、CD−ROM、CD−RW、DVD−R、DVD−RAM、DVD−RW等やフレキシブルディスク等の記録媒体だけでなく、通信回線の先に備えられた他の記憶装置やコンピュータのハードディスク等に記憶されるものであってもよい。   The execution program is not only a recording medium such as a CD-ROM, CD-RW, DVD-R, DVD-RAM, DVD-RW, or flexible disk, but also other storage devices provided at the end of the communication line. It may be stored in a computer hard disk or the like.

なお、RTL最適化装置1を構成する要素は、任意の組合せで実現されてもよい。複数の構成要素が1つの部材として実現されてもよく、1つの構成要素が複数の部材から構成されてもよい。また、RTL最適化装置1は、上述した実施形態に限定されず、本発明の要旨を逸脱しない範囲において各種の改良および変更を行ってもよいことは当然である。   Note that the elements constituting the RTL optimization device 1 may be realized in any combination. A plurality of components may be realized as one member, and one component may be configured from a plurality of members. The RTL optimizing apparatus 1 is not limited to the above-described embodiment, and various improvements and changes may naturally be made without departing from the gist of the present invention.

以上説明したように、開示したRTL最適化装置1によれば、RTLソース21のif−else文による分岐の記述を、論理回路構成上より最適となるように自動的に修正し、修正済みRTLソース27を出力することができる。よって、論理回路の分岐に関連する構成を改善するための作業工数を大幅に削減することができ、また、人手作業で生じる修正のばらつきをなくすことができる。よって、論理回路設計の効率化を実現することができる。   As described above, according to the disclosed RTL optimizing apparatus 1, the description of the branch by the if-else statement of the RTL source 21 is automatically corrected so as to be more optimal in terms of the logic circuit configuration, and the corrected RTL Source 27 can be output. Therefore, the number of work steps for improving the configuration related to the branching of the logic circuit can be greatly reduced, and the variation in correction caused by manual work can be eliminated. Therefore, the efficiency of logic circuit design can be realized.

1 RTL最適化装置
11 if−else抽出部
12 閾値決定部
13 データ生成部
14 修正方法決定部
15 修正部
21 RTLソース
22 ログ記憶部
23 判定手段の指定
24 閾値保持部
25 修正対象記憶部
26 決定した修正方法
27 修正済みRTLソース
DESCRIPTION OF SYMBOLS 1 RTL optimization apparatus 11 if-else extraction part 12 Threshold value determination part 13 Data generation part 14 Correction method determination part 15 Correction part 21 RTL source 22 Log storage part 23 Specification of determination means 24 Threshold holding part 25 Correction object storage part 26 Determination Modified 27 Modified RTL source

Claims (8)

ハードウェア記述言語のRTLを最適化する方法であって、
コンピュータが、
対象回路を記述するRTLソースから、予め設定された閾値が示す段数以上のif−else文の段数で構成されたif−else分岐を抽出し、
予め、if−else分岐の複数の修正方法をif−else文の条件に対応付けて設定しておき、抽出した前記if−else分岐を構成する条件をもとに、該複数の修正方法の1つを決定し、
前記RTLソースの抽出した前記if−else分岐を、決定した修正方法に基づいて修正する、処理を実行する
ことを特徴とするRTL最適化方法。
A method for optimizing a hardware description language RTL, comprising:
Computer
From the RTL source describing the target circuit, extract an if-else branch composed of the number of stages of an if-else statement equal to or greater than the number of stages indicated by a preset threshold value;
A plurality of correction methods for the if-else branch are set in advance in association with the conditions of the if-else statement, and one of the plurality of correction methods is determined based on the extracted conditions that constitute the if-else branch. Decide
An RTL optimization method comprising: executing a process of correcting the if-else branch extracted from the RTL source based on the determined correction method.
前記修正方法は、前記if−else分岐を構成するif−else文の条件に含まれる、信号のビット数、同名信号の有無、および、AND条件の有無に対応付けて設定される
ことを特徴とする請求項1に記載のRTL最適化方法。
The correction method is set in association with the number of signal bits, presence / absence of a signal with the same name, and presence / absence of an AND condition, which are included in a condition of an if-else statement constituting the if-else branch. The RTL optimization method according to claim 1.
前記if−else分岐を構成するif−else文の条件の信号ビット数が1ビットであって、該条件各々に同名の信号が存在しない場合に、前記修正方法の1つとして第1の修正方法が決定され、
前記第1の修正方法は、抽出した前記if−else分岐を修正する際に、該if−else分岐を構成する各段のif−else文を予め設定された段数以内のブロックに分割し、
前記if−else分岐内に、前記ブロックごとに分割したif−else文で構成したif−else分岐を設定する
ことを特徴とする請求項2に記載のRTL最適化方法。
If the number of signal bits in the condition of the if-else statement constituting the if-else branch is 1 bit and there is no signal of the same name in each of the conditions, the first correction method is one of the correction methods. Is determined,
In the first modification method, when modifying the extracted if-else branch, the if-else statement of each stage constituting the if-else branch is divided into blocks within a preset number of stages,
The RTL optimization method according to claim 2, wherein an if-else branch configured by an if-else statement divided for each block is set in the if-else branch.
前記if−else分岐を構成するif−else文の条件の信号ビット数が1ビットであって、該条件各々に同名信号が存在かつ該条件の全てがAND条件で構成されている場合に前記修正方法の1つとして第2の修正方法が決定され、
前記第2の修正方法では、抽出した前記if−else分岐を修正する際に、該if−else分岐を構成する各段のif−else文を、該if−else文の条件の同名信号および該同名信号の信号値をもとに分類し、前記分類した前記if−else文のグループごとに、前記第1の修正方法による修正を行う
ことを特徴とする請求項3に記載のRTL最適化方法。
The correction is made when the number of signal bits of the condition of the if-else statement constituting the if-else branch is 1 bit, a signal having the same name exists in each of the conditions, and all of the conditions are configured by AND conditions. A second correction method is determined as one of the methods,
In the second correction method, when the extracted if-else branch is corrected, the if-else statement of each stage constituting the if-else branch is changed to the same name signal of the condition of the if-else statement and the 4. The RTL optimization method according to claim 3, wherein classification is performed based on signal values of signals having the same name, and correction is performed by the first correction method for each group of the classified if-else statements. .
前記if−else分岐を構成するif−else文の条件の信号ビット数が複数ビットであって、該条件各々に他の信号が存在しない場合に、前記修正方法の1つとして第3の修正方法が決定され、
前記第3の修正方法では、抽出した前記if−else分岐を構成する各if−else文を条件の信号値および動作処理を示す要素とし、抽出した前記if−else分岐を構成するelse文を初期条件とするcase文による分岐に変更する
ことを特徴とする請求項2に記載のRTL最適化方法。
If the number of signal bits of the condition of the if-else statement constituting the if-else branch is a plurality of bits and no other signal exists in each of the conditions, a third correction method is one of the correction methods. Is determined,
In the third correction method, each if-else statement constituting the extracted if-else branch is used as an element indicating a signal value of a condition and an operation process, and the else statement constituting the extracted if-else branch is initialized. The RTL optimization method according to claim 2, wherein the branch is changed to a branch by a case statement as a condition.
前記閾値は、少なくとも、任意の固定値、または、前記対象回路の動作周波数に基づいて予め定められた値である
ことを特徴とする請求項1ないし請求項5のいずれか一項に記載のRTL最適化方法。
The RTL according to any one of claims 1 to 5, wherein the threshold is at least an arbitrary fixed value or a value determined in advance based on an operating frequency of the target circuit. Optimization method.
ハードウェア記述言語のRTLを最適化するために、コンピュータに、
対象回路を記述するRTLソースから、予め設定された閾値が示す段数以上のif−else文の段数で構成されたif−else分岐を抽出し、
予め、if−else分岐の複数の修正方法をif−else文の条件に対応付けて設定しておき、抽出した前記if−else分岐を構成する条件をもとに、該複数の修正方法の1つを決定し、
前記RTLソースの抽出した前記if−else分岐を、決定した修正方法に基づいて修正する、処理を実行させる
ことを特徴とするRTL最適化プログラム。
In order to optimize the hardware description language RTL,
From the RTL source describing the target circuit, extract an if-else branch composed of the number of stages of an if-else statement equal to or greater than the number of stages indicated by a preset threshold value;
A plurality of correction methods for the if-else branch are set in advance in association with the conditions of the if-else statement, and one of the plurality of correction methods is determined based on the extracted conditions that constitute the if-else branch. Decide
An RTL optimization program for executing a process of correcting the if-else branch extracted from the RTL source based on a determined correction method.
ハードウェア記述言語のRTLを最適化するため、
対象回路を記述するRTLソースから、予め設定された閾値が示す段数以上のif−else文の段数で構成されたif−else分岐を抽出する抽出部と、
予め、if−else分岐の複数の修正方法をif−else文の条件に対応付けて設定しておき、抽出した前記if−else分岐を構成する条件をもとに、該複数の修正方法の1つを決定する修正方法決定部と、
前記RTLソースの抽出した前記if−else分岐を、決定した修正方法に基づいて修正する修正部とを備える
ことを特徴とするRTL最適化装置。
To optimize the hardware description language RTL,
An extraction unit that extracts, from an RTL source describing the target circuit, an if-else branch composed of the number of stages of an if-else statement that is equal to or greater than the number of stages indicated by a preset threshold;
A plurality of correction methods for the if-else branch are set in advance in association with the conditions of the if-else statement, and one of the plurality of correction methods is determined based on the extracted conditions that constitute the if-else branch. A correction method determination unit for determining one;
An RTL optimizing apparatus comprising: a correcting unit that corrects the if-else branch extracted from the RTL source based on the determined correcting method.
JP2012213760A 2012-09-27 2012-09-27 Rtl optimization method, device and program Pending JP2014067353A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012213760A JP2014067353A (en) 2012-09-27 2012-09-27 Rtl optimization method, device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012213760A JP2014067353A (en) 2012-09-27 2012-09-27 Rtl optimization method, device and program

Publications (1)

Publication Number Publication Date
JP2014067353A true JP2014067353A (en) 2014-04-17

Family

ID=50743653

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012213760A Pending JP2014067353A (en) 2012-09-27 2012-09-27 Rtl optimization method, device and program

Country Status (1)

Country Link
JP (1) JP2014067353A (en)

Similar Documents

Publication Publication Date Title
US20100185836A1 (en) Arithmetic program conversion apparatus, arithmetic program conversion method, and program
JP2017517082A (en) Parallel decision tree processor architecture
JP6309795B2 (en) Information processing apparatus, information processing method, and program
US8935512B2 (en) Instruction operation code generation system
US10990073B2 (en) Program editing device, program editing method, and computer readable medium
US8903699B2 (en) Determining large-scale finite state machines using constraint relaxation
JP6925823B2 (en) Equipment and methods for extracting data
JP2014067353A (en) Rtl optimization method, device and program
JP5267243B2 (en) Behavior description conversion apparatus, behavior description conversion method, and program
JP6173571B2 (en) Circuit design apparatus and circuit design program
US8239717B2 (en) Logic verification apparatus
US20190138495A1 (en) Data processing apparatus, data processing method, and program recording medium
US20130254201A1 (en) Data structure, data structure generation method, information processing apparatus, information processing system, and computer-readable storage medium having stored therein information processing program
JP2018124901A (en) Program analyzing apparatus, program analyzing method, and program analyzing program
JP2022034897A (en) Information processing device, machine learning method and machine learning program
JP2005208709A (en) Data classification processing apparatus, data classification processing method and computer program
JP6547345B2 (en) Test case generation program, test case generation method and test case generation apparatus
JP2019153047A (en) Generation device, generation method, and program
JP5136257B2 (en) Route management method
JP6398729B2 (en) Design support apparatus and design support method
JP5417950B2 (en) Genetic processing apparatus, genetic processing method and program
CN109740249B (en) MUX tree logic structure optimization method, module and storage medium
JP2014120119A (en) Device, method and program for design verification
JP6193674B2 (en) CONVERSION CIRCUIT DESIGN DEVICE, CONVERSION CIRCUIT DESIGN PROGRAM, AND CONVERSION CIRCUIT DESIGN METHOD
JP6641749B2 (en) Document generality estimating apparatus, document generality estimating method and program