JP3246462B2 - Function synthesizing method using C language circuit model and recording medium storing the program - Google Patents
Function synthesizing method using C language circuit model and recording medium storing the programInfo
- Publication number
- JP3246462B2 JP3246462B2 JP36555998A JP36555998A JP3246462B2 JP 3246462 B2 JP3246462 B2 JP 3246462B2 JP 36555998 A JP36555998 A JP 36555998A JP 36555998 A JP36555998 A JP 36555998A JP 3246462 B2 JP3246462 B2 JP 3246462B2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- function
- rtl
- sentences
- model
- 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.)
- Expired - Fee Related
Links
Description
【0001】[0001]
【発明の属する技術分野】この発明は、汎用プログラム
言語(例えば、C言語)で記述されたプログラムを、該
プログラムが示す動作を有する電子回路に変換する機能
合成方法およびそのプログラムを記録した記録媒体に関
する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a function synthesizing method for converting a program described in a general-purpose program language (for example, C language) into an electronic circuit having an operation indicated by the program, and a recording medium on which the program is recorded. About.
【0002】[0002]
【従来の技術】論理回路の機能設計を行う方法として、
欲しい機能を回路イメージではなく処理フロー(フロー
チャート)で表現し、このフローチャートを、汎用プロ
グラム言語、例えばC言語を使用して表現し、C言語の
ソースプログラムを記述するのと同じように記述するこ
とが行われている。そして、このソースプログラム(以
下、「C言語モデル」と称する)をCコンパイラにかけ
て、実行可能形式のオブジェクトに変換した後、これを
実行し、その結果が当初もくろんでいた結果と一致した
場合は、機能設計にバグがなかったと判断して、前述の
C言語モデルに対して、機能合成ツールを用いてこれを
RTL回路に変換することが行われている。尚、全体の
回路規模が大きいときは無階層のフローチャートを書く
ことは現実的に不可能なので、ある纏まりのある処理を
1つのサブルーチン(関数)で定義し、この関数を用い
て全回路を記述することが行われている。従って、C言
語モデルは複数の関数から成っているのが一般的であ
る。また、C言語モデルは1つのファイルに格納する場
合もあるし、複数のファイルに対して分割して格納する
場合もある。また、従来の方法では、機能合成されたC
言語モデル(RTLモデル)を1つの回路に構成するた
めに使用されるTOP RTL modelは、各C言語
モデルで使用されている変数を参照して、人手で作成し
ていた。2. Description of the Related Art As a method of designing the function of a logic circuit,
Express the desired function not as a circuit image but as a processing flow (flowchart), and express this flowchart using a general-purpose programming language, for example, C language, and describe it in the same way as describing a C language source program. Has been done. Then, this source program (hereinafter referred to as “C language model”) is converted into an executable object by a C compiler and executed, and when the result matches the initially intended result, It is determined that there is no bug in the functional design, and the C language model is converted to an RTL circuit using a function synthesizing tool. Note that it is practically impossible to write a non-hierarchical flowchart when the entire circuit scale is large. Therefore, a group of processes is defined by one subroutine (function), and the entire circuit is described using this function. That is being done. Therefore, the C language model is generally composed of a plurality of functions. In addition, the C language model may be stored in one file, or may be stored separately for a plurality of files. Further, in the conventional method, the function synthesized C
The TOP RTL model used to configure a language model (RTL model) into one circuit has been manually created by referring to variables used in each C language model.
【0003】[0003]
【発明が解決しようとする課題】ところで、前述したフ
ローチャートは処理の流れをシーケンシャルに表現した
ものであり、また、それを記述したC言語モデルもシー
ケンシャルな処理でしか記述できない。従って、C言語
モデルに対し既存の機能合成ツールを適用すると、それ
に対応するハードもシーケンシャルな動きをするRTL
回路になってしまう。ところが、実際の回路としては、
シーケンシャルではなくて、並列動作が可能な処理があ
る。このような場合、動作速度が低下すると言う問題が
あった。The above-described flowchart represents the flow of processing in a sequential manner, and a C language model describing the flow can be described only by sequential processing. Therefore, when an existing function synthesis tool is applied to a C language model, the corresponding hardware also performs RTL that moves sequentially.
It becomes a circuit. However, as an actual circuit,
There are processes that can be performed in parallel instead of sequentially. In such a case, there is a problem that the operation speed is reduced.
【0004】なお、これに対して、上記課題を解決する
装置の一例が、特開平10−149382号公報に記載
されている。この装置では、汎用プログラム言語で記述
された回路中の並列動作を行う関数を特定し、この特定
した関数を並列動作させるためのプログラムを追加生成
する。On the other hand, an example of an apparatus for solving the above-mentioned problem is described in Japanese Patent Application Laid-Open No. H10-149382. In this device, a function that performs parallel operation in a circuit described in a general-purpose program language is specified, and a program for causing the specified function to operate in parallel is additionally generated.
【0005】しかしながら、この装置においては、「並
列動作を行う関数を特定」する際に、プログラム中の関
数同士の全ての組み合わせについて(並列動作の可否
を)シミュレーションしなくてはならず、該シミュレー
ションのために膨大な処理が必要となり、その結果、機
能合成に長時間を要する、という課題があった。However, in this apparatus, when “specifying a function that performs parallel operation”, all combinations of functions in a program must be simulated (whether or not parallel operation is possible). Therefore, there is a problem that a huge amount of processing is required, and as a result, it takes a long time to synthesize the functions.
【0006】本発明は、このような背景の下になされた
もので、汎用プログラム言語で記述されたプログラム
を、該プログラムが示す回路の並列動作を考慮しなが
ら、かつ、簡単な処理で(即ち、短時間で)、電子回路
へ変換することができる機能合成方法およびそのプログ
ラムを記録した記録媒体を提供することを目的とする。The present invention has been made under such a background, and a program described in a general-purpose program language is processed by simple processing while considering the parallel operation of circuits indicated by the program (ie, It is an object of the present invention to provide a function synthesizing method that can be converted into an electronic circuit (in a short time) and a recording medium that records the program.
【0007】[0007]
【課題を解決するための手段】請求項1記載の発明は、
論理回路の処理フローをCプログラム言語を用いて記述
したC言語モデルをRTL回路モデルに変換する機能合
成方法において、前記C言語モデル中の関数を1つ選択
する第1のステップと、前記第1のステップで選択され
た関数を構成している複数のプログラム文に対し、それ
らの中から互いに並列動作可能な文の集合を1つのグル
ープとして分割する第2のステップと、前記第2のステ
ップにより分割されたグループ毎に機能合成ツールを用
いてRTL回路モデルに変換する第3のステップとを有
することを特徴とする。According to the first aspect of the present invention,
In a function synthesizing method for converting a C language model in which a processing flow of a logic circuit is described using a C programming language into an RTL circuit model, a first step of selecting one function in the C language model; A second step of dividing a set of statements which can operate in parallel from each other as one group from among a plurality of program statements constituting the function selected in the step, and the second step A third step of converting each divided group into an RTL circuit model using a function synthesizing tool.
【0008】請求項2記載の発明は、請求項1記載の機
能合成方法において、前記第2のステップにより分割さ
れたグループは、互いに並列動作できない文を排除した
残りの文の集合であることを特徴とする。According to a second aspect of the present invention, in the function synthesizing method according to the first aspect, the group divided by the second step is a set of remaining sentences excluding sentences that cannot operate in parallel with each other. Features.
【0009】請求項3記載の発明は、請求項1または請
求項2のいずれかに記載の機能合成方法において、前記
第2のステップは、互いに並列動作できない文を選別
し、選別されずに残った文があるならば、それらの文を
グループ化し、全ての文のグループ化が完了するまで、
前記選別およびグループ化を繰り返すことからなること
を特徴とする。According to a third aspect of the present invention, in the function synthesizing method according to any one of the first and second aspects, the second step selects sentences which cannot be operated in parallel with each other and remains without being selected. If there is a sentence, group them, and until all sentences have been grouped,
The method is characterized by repeating the selection and grouping.
【0010】請求項4記載の発明は、請求項1から請求
項3のいずれかに記載の機能合成方法において、前記C
言語モデル中に複数の関数がある時は、初めに、それら
の関数を1つに纏め、纏めた関数に対して、前記第1の
ステップ以降の処理を行うことを特徴とする。According to a fourth aspect of the present invention, there is provided the function synthesizing method according to any one of the first to third aspects, wherein the C
When there are a plurality of functions in the language model, the functions are first combined into one, and the combined functions are subjected to the processing of the first step and thereafter.
【0011】請求項5記載の発明は、請求項1から請求
項4のいずれかに記載の機能合成方法において、各C言
語モデルにおいて、代入文の右辺にある変数は入力と
し、代入文の左辺にある変数は出力とし、if文の比較
で用いられる変数は入力とし、これらの入力と出力とを
リストにして、その入力と出力とを接続するようなTO
P RTL modelを生成し、機能合成ツールによる
変換後、前記TOP RTL modelに記載されてい
る接続関係に従って、RTL回路モデルを1つの回路に
構成することを特徴とする。According to a fifth aspect of the present invention, in the function synthesizing method according to any one of the first to fourth aspects, in each C language model, a variable on a right side of an assignment statement is an input, and a left side of the assignment statement is an input. Is an output, a variable used in the comparison of if statements is an input, a list of these inputs and outputs, and a TO that connects the inputs and outputs.
After the P RTL model is generated and converted by the function synthesizing tool, the RTL circuit model is configured into one circuit in accordance with the connection relation described in the TOP RTL model.
【0012】請求項6記載の発明は、請求項1から請求
項5のいずれかに記載の機能合成方法において、前記第
4のステップは、各RTL回路モデルのサイクル数の中
から最大のサイクル数を求め、共有可能な回路要素が複
数のRTL回路モデル間に存在するか否かを判断し、共
有可能な回路要素が存在する場合には、共有可能と判断
された回路要素が同時に動作しているか否かを判断し、
共有可能と判断された回路要素が同時に動作する場合に
は、共有可能と判断された回路要素を有するRTL回路
モデルのサイクル数の和が前記最大サイクル数より小さ
いか否かを判断し、前記サイクル数の和が前記最大サイ
クル数より小さい場合には、共有可能と判断された回路
要素を有するRTL回路モデルを1つのグループとして
まとめ、該まとめられたグループを、再度、機能合成す
ることからなることを特徴とする。According to a sixth aspect of the present invention, in the function synthesizing method according to any one of the first to fifth aspects, the fourth step comprises the step of selecting the maximum number of cycles among the number of cycles of each RTL circuit model. Is determined, and it is determined whether a sharable circuit element exists between a plurality of RTL circuit models. If there is a sharable circuit element, the circuit elements determined to be sharable operate simultaneously. Judge whether or not
When the circuit elements determined to be sharable operate simultaneously, it is determined whether or not the sum of the number of cycles of the RTL circuit model having the circuit element determined to be sharable is smaller than the maximum number of cycles. If the sum of the numbers is smaller than the maximum number of cycles, the RTL circuit models having the circuit elements determined to be sharable are combined into one group, and the combined group is subjected to function synthesis again. It is characterized by.
【0013】請求項7記載の発明は、コンピュータに請
求項1記載の発明を実行させるためのプログラムを記録
したことを特徴とする。請求項8記載の発明は、コンピ
ュータに請求項2記載の発明を実行させるためのプログ
ラムを記録したことを特徴とする。請求項9記載の発明
は、コンピュータに請求項3記載の発明を実行させるた
めのプログラムを記録したことを特徴とする。請求項1
0記載の発明は、コンピュータに請求項4記載の発明を
実行させるためのプログラムを記録したことを特徴とす
る。請求項11記載の発明は、コンピュータに請求項5
記載の発明を実行させるためのプログラムを記録したこ
とを特徴とする。請求項12記載の発明は、コンピュー
タに請求項6記載の発明を実行させるためのプログラム
を記録したことを特徴とする。A seventh aspect of the present invention is characterized in that a program for causing a computer to execute the first aspect of the present invention is recorded. An eighth aspect of the invention is characterized in that a program for causing a computer to execute the second aspect of the invention is recorded. A ninth aspect of the present invention is characterized in that a program for causing a computer to execute the third aspect of the present invention is recorded. Claim 1
The invention according to claim 0 is characterized in that a program for causing a computer to execute the invention according to claim 4 is recorded. The invention according to claim 11 provides the computer with claim 5
A program for executing the described invention is recorded. A twelfth aspect of the invention is characterized in that a program for causing a computer to execute the sixth aspect of the invention is recorded.
【0014】[0014]
【発明の実施の形態】§1.実施形態の概要 図1は、本発明の実施形態の概要の一例を示す説明図で
ある。この図において、入力されるC modelには
上述のC言語モデルが格納されている。回路全体の規模
が大きい場合は、全体回路を複数の部分に分けて記述
し、各々を別々のファイルに格納することが行われるた
めに、入力C modelファイルは複数存在する場合
もある。parametaファイルとは、1つの関数の
中で予め分割したい場所が分かっている場合は、外部か
ら手動で分割するオプション記述である。例えば、「関
数Aの第何行目〜何行目を分けろ」と言う指示を行う制
御ファイルである。図1の「再分割」処理は、後述する
説明に基づいて、入力C言語モデル記述に対して、互い
に並列処理可能な部分を1つのグループとして分割し、
各グループ毎に分けたC言語モデルを出力する。また、
分割された出力C言語モデルの各々をRTLモデルに変
換した後、これら得られたRTL回路要素間の接続をど
のようにして行い、全体回路を構成するのかを指示する
ものが、TOP RTL modelである。このTOP
RTL modelは、上記再分割時に、自動発生され
る。DESCRIPTION OF THE PREFERRED EMBODIMENTS §1. 1. Outline of Embodiment FIG. 1 is an explanatory diagram illustrating an example of an outline of an embodiment of the present invention. In this figure, the above-mentioned C language model is stored in the input C model. When the scale of the entire circuit is large, the entire circuit is described by dividing it into a plurality of parts, and each is stored in a separate file. Therefore, a plurality of input C model files may exist. The parameta file is an optional description for manually dividing from outside when a place to be divided in one function is known in advance. For example, it is a control file that instructs “from what line to what line of the function A.” The “re-partitioning” process of FIG. 1 divides a part that can be processed in parallel with each other into one group with respect to the input C language model description based on the description described later.
The C language model divided for each group is output. Also,
After converting each of the divided output C language models into an RTL model, the TOP RTL model indicates how to connect these obtained RTL circuit elements and configure the entire circuit. is there. This TOP
The RTL model is automatically generated at the time of the above subdivision.
【0015】なお、TOP RTL modelの自動発
生の具体的方法は、以下の通りである。C言語モデルか
ら1つの関数を取り出し、該関数を分割する際に、代入
文の右辺にある変数は入力となり、左辺にある変数は出
力になる。また、if文の比較で用いられる変数は入力
になる。これらの入力と出力とをリストにして、その入
力と出力とを接続するようなRTL modelを生成
する。例えば、以下のようなプログラムを2つのモジュ
ールに分割した場合を考える。 a=b; ……モジュール(1) if(a==c){ ……モジュール(2) x=1; }else{ x=0; } この場合、モジュール(1)の入力はbになり、出力は
aになる。また、モジュール(2)の入力はa,cにな
り、出力はxになる。そして、モジュール(1)の出力
aとモジュール(2)の入力aとが接続される。入力
b,cと出力xとは、モジュール(1),(2)の外部
から与えられるため、外部端子となる(図2参照)。The specific method of automatically generating the TOP RTL model is as follows. When one function is extracted from the C language model and the function is divided, a variable on the right side of the assignment statement becomes an input and a variable on the left side becomes an output. Also, variables used in comparison of if statements are input. The input and the output are listed, and an RTL model that connects the input and the output is generated. For example, consider the case where the following program is divided into two modules. a = b; module (1) if (a == c) {module (2) x = 1; {else} x = 0;} In this case, the input of module (1) is b, The output is a. Further, the input of the module (2) becomes a and c, and the output becomes x. Then, the output a of the module (1) and the input a of the module (2) are connected. The inputs b and c and the output x are provided from outside the modules (1) and (2), and thus become external terminals (see FIG. 2).
【0016】§2.第1実施形態 以下、図面を参照して、この発明の第1実施形態につい
て説明する。図3は、第1実施形態による機能合成方法
の一例を示すフローチャートである。本実施形態による
機能合成方法は、一例として、CPU(中央処理装置)
およびその周辺回路からなるコンピュータ装置で実行さ
れる。該コンピュータ装置は、ROM(リードオンリメ
モリ)やハードディスク装置等の所定の記録媒体に格納
された制御プログラムにより、以下に示す機能合成方法
を実行する。§2. First Embodiment Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. FIG. 3 is a flowchart illustrating an example of the function synthesizing method according to the first embodiment. The function synthesizing method according to the present embodiment is, for example, a CPU (Central Processing Unit).
And its peripheral circuits. The computer device executes the following function synthesizing method using a control program stored in a predetermined recording medium such as a ROM (Read Only Memory) or a hard disk device.
【0017】ここで、まず、オペレータが、上記コンピ
ュータ装置に接続された入力装置を使用して、上記汎用
プログラム言語で記述された複数の関数からなるプログ
ラムを指定すると、上記CPUの処理は、図3のステッ
プS1へ進む。なお、本実施形態では、上記汎用プログ
ラム言語は、一例として、C言語であるとする。ステッ
プS1では、指定されたプログラムから関数を1つ取り
出し、ステップS2へ進む。Here, first, when the operator specifies a program including a plurality of functions described in the general-purpose program language using an input device connected to the computer device, the processing of the CPU is performed as shown in FIG. The process proceeds to Step S1 of Step 3. In the present embodiment, the general-purpose program language is assumed to be a C language, for example. In step S1, one function is extracted from the designated program, and the process proceeds to step S2.
【0018】ステップS2では、ステップS1で取り出
した関数(以下、「処理対象関数」と称する)におい
て、複数の文で使用されている変数の有無を判断する。
この判断結果が「YES」の場合、即ち、複数の文で使
用されている変数がある場合には、ステップS3へ進
む。In step S2, it is determined whether or not there is a variable used in a plurality of sentences in the function extracted in step S1 (hereinafter, referred to as "processing target function").
If the result of this determination is “YES”, that is, if there is a variable used in a plurality of sentences, the process proceeds to step S3.
【0019】ステップS3では、上記処理対象関数にお
いて、for文とwhile文とcase文とを、これ
らの文に等価な代入文またはif文に変換し、ステップ
S4へ進む。ステップS3の処理によって、処理対象関
数は代入文とif文のみを使用した表記となる。ここ
で、「代入文またはif文への変換」は、以下の通りに
行われる。In step S3, the for statement, while statement, and case statement in the function to be processed are converted into an assignment statement or if statement equivalent to these statements, and the flow advances to step S4. By the processing in step S3, the processing target function is a notation using only the assignment statement and the if statement. Here, the “conversion into an assignment statement or an if statement” is performed as follows.
【0020】(1)for文またはwhile文の場合 for文またはwhile文の{}内の文(以下、「実
行文」と称する)を(該for文またはwhile文
の)条件式で規定された回数だけ実行する文に変換す
る。即ち、例えば、 という文の場合、 a=a+1; a=a+1; a=a+1; という複数の文に変換する。(1) In the case of a for statement or a while statement A statement in the parentheses of a for statement or a while statement (hereinafter referred to as an “executable statement”) is defined by a conditional expression (of the for statement or the while statement). Convert to a statement to be executed the number of times. That is, for example, In the case of the sentence a, a = a + 1; a = a + 1; a = a + 1;
【0021】(2)case文の場合 各条件式に対応するif文に変換する。即ち、例えば、 という文の場合、 という複数の文に変換する。(2) In the case of a case sentence Convert to an if sentence corresponding to each conditional expression. That is, for example, Statement, Into multiple sentences.
【0022】ステップS4では、変換後の処理対象関数
を、文単位に分割し、ステップS5へ進む。ステップS
5では、ステップS4の分割結果の中から、先頭の1文
(以下、「先頭文」と称する)を取り出し、ステップS
6へ進む。ステップS6では、上記先頭文と残りの(即
ち、上記先頭文以外の)文とを比較することによって
(以下、先頭文と比較される1文を「比較文」と称す
る)、該残りの文の中から、上記先頭文と並列動作でき
ない文を排除し、ステップS7へ進む。ここで、「並列
動作できない文」は、以下の基準に基づいて判別され
る。In step S4, the function to be processed after the conversion is divided into sentences, and the flow advances to step S5. Step S
In step 5, the first sentence (hereinafter, referred to as “head sentence”) is extracted from the division result in step S4, and
Proceed to 6. In step S6, the first sentence is compared with the remaining sentences (that is, other than the first sentence) (hereinafter, one sentence to be compared with the first sentence is referred to as a "comparison sentence"), and the remaining sentences are compared. Are excluded from the statements that cannot operate in parallel with the first sentence, and the process proceeds to step S7. Here, the “sentence that cannot be operated in parallel” is determined based on the following criteria.
【0023】(1)先頭文が代入文である場合 文の種類(代入文またはif文)を問わず、同じ変数を
使用している文は並列動作不可とする。 (2)先頭文がif文である場合 文の種類(代入文またはif文)を問わず、同じ変数を
使用している文は並列動作不可とする(但し、先頭文と
比較文とが共にif文であり、かつ、両者の条件式のみ
において同じ変数が使用されている場合を除く)。(1) When the first sentence is an assignment statement Regardless of the type of statement (assignment statement or if statement), statements using the same variable cannot be operated in parallel. (2) When the first sentence is an if statement Regardless of the type of statement (assignment statement or if statement), statements using the same variable are not allowed to operate in parallel. if statement and the same variable is used only in both conditional expressions).
【0024】次に、ステップS7では、上記先頭文とス
テップS6で排除されなかった文とを1つのグループに
まとめ(以下、「グループ化」と称する)、ステップS
8へ進む。ステップS8では、グループ化されていない
文があるか否か判断する。この判断結果が「YES」の
場合、即ち、グループ化されていない文がある場合に
は、ステップS5へ戻る。この場合、ステップS5〜S
7の動作が再び行われる。即ち、ステップS5では、グ
ループ化されていない文の中から、先頭の1文(先頭
文)を取り出し、ステップS6では、上記先頭文と残り
の(グループ化されていない)文とを比較し、該残りの
文の中から、上記先頭文と並列動作できない文を排除
し、ステップS7では、上記先頭文とステップS6で排
除されなかった文とを1つのグループにまとめ、ステッ
プS8へ進む。Next, in step S7, the head sentence and the sentences not excluded in step S6 are combined into one group (hereinafter, referred to as "grouping").
Proceed to 8. In step S8, it is determined whether there is any ungrouped sentence. If the result of this determination is "YES", that is, if there are ungrouped sentences, the process returns to step S5. In this case, steps S5 to S
Operation 7 is performed again. That is, in step S5, the first sentence (head sentence) is extracted from the ungrouped sentences, and in step S6, the head sentence is compared with the remaining (ungrouped) sentences. From the remaining sentences, sentences that cannot be operated in parallel with the head sentence are excluded. In step S7, the head sentence and the sentences not excluded in step S6 are grouped into one group, and the process proceeds to step S8.
【0025】一方、ステップS8の判断結果が「NO」
の場合、即ち、全ての文がグループ化された場合には、
ステップS9へ進む。また、ステップS2の判断結果が
「NO」の場合、即ち、処理対象関数において、複数の
文で使用されている変数が無い場合にも、ステップS9
へ進む。On the other hand, the judgment result of step S8 is "NO"
, That is, if all statements are grouped,
Proceed to step S9. Also, if the determination result of step S2 is "NO", that is, if there is no variable used in a plurality of statements in the processing target function, step S9
Proceed to.
【0026】ステップS9では、処理対象プログラム中
の全ての関数について、ステップS1〜S8の処理が行
われたか否かを判断する。この判断結果が「NO」の場
合、即ち、未だ処理されていない関数がある場合には、
ステップS1へ戻る。一方、ステップS9の判断結果が
「YES」の場合、即ち、全ての関数について処理が行
われた場合には、ステップS10へ進む。In step S9, it is determined whether or not the processing in steps S1 to S8 has been performed for all functions in the processing target program. If the result of this determination is “NO”, that is, if there is a function that has not yet been processed,
It returns to step S1. On the other hand, if the result of the determination in step S9 is "YES", that is, if the processing has been performed for all functions, the process proceeds to step S10.
【0027】ステップS10では、ステップS7で生成
された各グループを機能合成することによって、各グル
ープ内の文をRTLレベルで示したブロック(以下、
「RTLブロック」と称する)を生成し、ステップS1
1へ進む。ステップS11では、ステップS10で生成
されたRTLブロックをスケジューリングし、全ての処
理を終了する。In step S10, each group generated in step S7 is subjected to function synthesis to form a block (hereinafter, referred to as RTL level) indicating a sentence in each group.
“RTL block” is generated, and step S1
Proceed to 1. In step S11, the RTL block generated in step S10 is scheduled, and all processing ends.
【0028】図4は、ステップS11で行われるスケジ
ューリングの一例を示すフローチャートである。この図
において、ステップS101では、ステップS10で生
成された各RTLブロックのサイクル数を調べ、その中
から最大サイクル数を求め、ステップS102へ進む。FIG. 4 is a flowchart showing an example of the scheduling performed in step S11. In this figure, in step S101, the number of cycles of each RTL block generated in step S10 is checked, and the maximum number of cycles is obtained from the number, and the process proceeds to step S102.
【0029】ステップS102では、ステップS10で
生成された各RTLブロックを比較し、共有可能な回路
要素(加算器,比較器,メモリ等)が複数のRTLブロ
ック間に存在するか否かを判断する。共有可能な回路要
素とは、入力信号項目が同じで、回路要素内部で入力さ
れた信号に対して同一の処理を行い、値を返す回路要素
のことである。例えば、入出力bit数が等しい比較器や
加算器や乗算器などである。この判断結果が「NO」の
場合、即ち、共有可能な回路要素が複数のRTLブロッ
ク間に存在しない場合には、そのままスケジューリング
を終了する。一方、ステップS102の判断結果が「Y
ES」の場合、即ち、共有可能な回路要素が複数のRT
Lブロック間に存在する場合には、ステップS103へ
進む。In step S102, each RTL block generated in step S10 is compared, and it is determined whether a sharable circuit element (adder, comparator, memory, etc.) exists between a plurality of RTL blocks. . A sharable circuit element is a circuit element that has the same input signal item, performs the same processing on a signal input inside the circuit element, and returns a value. For example, a comparator, an adder, a multiplier or the like having the same number of input / output bits. If the result of this determination is “NO”, that is, if there is no sharable circuit element between the plurality of RTL blocks, the scheduling ends as it is. On the other hand, if the determination result of step S102 is “Y
ES ", that is, when the sharable circuit element is a plurality of RTs.
If it exists between the L blocks, the process proceeds to step S103.
【0030】ステップS103では、ステップS102
で共有可能と判断された回路要素が同時に動作している
か否かを判断する。共有可能な回路要素(例えば同一bi
t数の加算器)が、機能合成により生成された複数のR
TL modelに存在して、それらのRTL mode
lが同一サイクルで動作する場合、それらのRTL m
odelに含まれる共有可能な回路要素は、同時に動作
させる必要があるため、存在する回路毎に必要になる。
この判断結果が「NO」の場合、即ち、共有可能と判断
された回路要素が既に同時には動作していない場合に
は、スケジューリングの必要がないので、そのまま終了
する。一方、ステップS103の判断結果が「YES」
の場合、即ち、共有可能と判断された回路要素が同時に
動作する場合には、これらの回路要素が時間的にぶつか
り合わないようにスケジューリングする必要があるの
で、ステップS104へ進む。In step S103, step S102
It is determined whether the circuit elements determined to be sharable at the same time are operating at the same time. Shareable circuit elements (for example, the same bi
t), a plurality of Rs generated by functional synthesis
Exist in the TL model and their RTL mode
l operate in the same cycle, their RTL m
Since the sharable circuit elements included in the “odel” need to be operated at the same time, they are required for each existing circuit.
If the result of this determination is “NO”, that is, if the circuit elements determined to be sharable are not operating at the same time, there is no need for scheduling, and the process ends. On the other hand, the determination result of step S103 is “YES”
In other words, if the circuit elements determined to be sharable operate at the same time, it is necessary to perform scheduling so that these circuit elements do not temporally collide, and the process proceeds to step S104.
【0031】ステップS104では、ステップS102
で共有可能と判断された回路要素を有するRTLブロッ
クのサイクル数の和が(ステップS101で求められ
た)上記最大サイクル数より小さいか否かを判断する。
この判断結果が「NO」の場合、即ち、共有可能と判断
された回路要素を有するRTLブロックのサイクル数の
和が上記最大サイクル数より大きい場合には、スケジュ
ーリングの結果、最大サイクル数が大きくなってしまう
ので、そのままスケジューリングを終了する。一方、ス
テップS104の判断結果が「YES」の場合、即ち、
上記サイクル数の和が上記最大サイクル数より小さい場
合には、ステップS105へ進む。In step S104, step S102
It is determined whether or not the sum of the number of cycles of the RTL block having the circuit element determined to be sharable is smaller than the maximum number of cycles (determined in step S101).
If this determination result is “NO”, that is, if the sum of the number of cycles of the RTL block having the circuit element determined to be sharable is larger than the maximum number of cycles, the maximum number of cycles becomes large as a result of scheduling. Therefore, the scheduling ends. On the other hand, if the determination result in step S104 is “YES”, that is,
If the sum of the cycle numbers is smaller than the maximum cycle number, the process proceeds to step S105.
【0032】ステップS105では、ステップS102
で共有可能と判断された回路要素を有するRTLブロッ
クについて、該RTLブロックに機能合成された(元
の)グループを1つのグループとしてまとめ、該まとめ
られたグループを、再度、機能合成し、スケジューリン
グを終了する。In step S105, step S102
In the RTL block having the circuit element determined to be sharable in (1), the (original) group functionally combined with the RTL block is combined into one group, and the combined group is combined with the function again and the scheduling is performed. finish.
【0033】次に、具体的な例を挙げて本発明の第1実
施形態による機能合成方法を説明する。図3のステップ
S1において、以下に示す関数func1が取り出され
たとする。ここで、各変数は全てグローバル変数であ
る。 Next, the function synthesizing method according to the first embodiment of the present invention will be described with a specific example. In step S1 of FIG. 3, it is assumed that the following function func1 is extracted. Here, each variable is a global variable.
【0034】ステップS2では、上記関数func1に
おいて、変数a,x1 ,x2 が複数の文で使用されてい
るので、ステップS3へ進む。In step S2, since the variables a, x1, and x2 are used in a plurality of sentences in the function func1, the process proceeds to step S3.
【0035】ステップS3では、上記関数func1中
のfor文を代入文に等価変換し、ステップS4へ進
む。これによって、上記関数func1は以下に示す関
数func1’となる。 In step S3, the for statement in the function func1 is equivalently converted into an assignment statement, and the flow advances to step S4. As a result, the function func1 becomes a function func1 ′ shown below.
【0036】ステップS4では、上記関数func1’
を、以下に示す文〜に分割し、ステップS5へ進
む。なお、ここでは、わかりやすくするために、if文
については改行を行わず1行で表記する。 a=a+1; …… a=a+1; …… a=a+1; …… if(a==b){x1 =b;}else{x1 =0;} …… if(a==d){x2 =d;}else{x2 =0;} …… c=x1 &&x2 ; ……In step S4, the function func1 '
Is divided into the following sentences, and the process proceeds to step S5. Here, for simplicity, the if sentence is represented by one line without line breaks. a = a + 1;.. a = a + 1;... if (a == b) {x1 = b;} else {x1 = 0;}... if (a == d) {x2 = d; {else} x2 = 0;} ... c = x1 &&x2;
【0037】ステップS5では、上記文〜の中か
ら、先頭の文を取り出し、ステップS6へ進む。ステ
ップS6では、上記文と残りの文〜とを比較し、
該残りの文〜の中から、文と並列動作できない文
を排除する。ここで、文と文とは、代入文と代入文
との比較であり、かつ、両者において同じ変数(a)が
使用されているので、文は文と並列動作できない。
同じ理由で、文は文と並列動作できない。また、文
と文とは、代入文とif文との比較であり、かつ、
両者において同じ変数(a)が使用されているので、文
は文と並列動作できない。同じ理由で、文は文
と並列動作できない。一方、文と文とは、代入文と
代入文との比較であり、かつ、両者において同じ変数は
使用されていないので、文は文と並列動作可能であ
る。以上のように、この例では、文〜が、文と並
列動作できない文として排除される。次にステップS7
へ進む。In step S5, the first sentence is taken out of the above-mentioned sentences (1) to (6), and the flow advances to step S6. In step S6, the above sentence is compared with the remaining sentences ~.
A sentence that cannot operate in parallel with the sentence is excluded from the remaining sentences. Here, the statement is a comparison between the assignment statement and the assignment statement, and the statement cannot operate in parallel with the statement because the same variable (a) is used in both.
For the same reason, a sentence cannot operate in parallel with a sentence. The sentence is a comparison between the assignment sentence and the if sentence, and
Since the same variable (a) is used in both, the sentence cannot operate in parallel with the sentence. For the same reason, a sentence cannot operate in parallel with a sentence. On the other hand, a statement is a comparison between an assignment statement and an assignment statement, and the same variable is not used in both, so that the statement can operate in parallel with the statement. As described above, in this example, the sentence 〜 is excluded as a sentence that cannot operate in parallel with the sentence. Next, step S7
Proceed to.
【0038】ステップS7では、ステップS5で取り出
された1文(文)とステップS6で排除されなかった
文(文)とをグループ化し、ステップS8へ進む。ス
テップS8では、文〜がグループ化されていないの
で、ステップS5へ戻る。In step S7, one sentence (sentence) extracted in step S5 and a sentence (sentence) not excluded in step S6 are grouped, and the flow advances to step S8. In step S8, since the sentences are not grouped, the process returns to step S5.
【0039】ステップS5では、グループ化されていな
い文(文〜)の中から、先頭の文を取り出し、ス
テップS6へ進む。ステップS6では、上記文と残り
の文〜とを比較し、該残りの文〜の中から、文
と並列動作できない文を排除する。ここで、文と文
とは、代入文と代入文との比較であり、かつ、両者に
おいて同じ変数(a)が使用されているので、文は文
と並列動作できない。また、文と文とは、代入文
とif文との比較であり、かつ、両者において同じ変数
(a)が使用されているので、文は文と並列動作で
きない。同じ理由で、文は文と並列動作できない。
以上のように、この例では、残りの全ての文〜が、
文と並列動作できない文として排除される。次にステ
ップS7へ進む。In step S5, the first sentence is extracted from the ungrouped sentences (sentences), and the process proceeds to step S6. In step S6, the above sentence and the remaining sentences are compared, and a sentence that cannot operate in parallel with the sentence is excluded from the remaining sentences. Here, the statement is a comparison between the assignment statement and the assignment statement, and the statement cannot operate in parallel with the statement because the same variable (a) is used in both. In addition, a sentence is a comparison between an assignment sentence and an if sentence, and since the same variable (a) is used in both, the sentence cannot operate in parallel with the sentence. For the same reason, a sentence cannot operate in parallel with a sentence.
As described above, in this example, all the remaining sentences ~
It is excluded as a statement that cannot operate in parallel with the statement. Next, the process proceeds to step S7.
【0040】ステップS7では、上記残りの全ての文
〜が、文と並列動作できないので、ステップS5で
取り出された1文(文)を単文でグループ化し、ステ
ップS8へ進む。ステップS8では、文〜がグルー
プ化されていないので、ステップS5へ戻る。In step S7, since all of the remaining sentences (1) to (4) cannot operate in parallel with the sentences, one sentence (sentence) extracted in step S5 is grouped into a single sentence, and the process proceeds to step S8. In step S8, since the sentences are not grouped, the process returns to step S5.
【0041】ステップS5では、グループ化されていな
い文(文〜)の中から、先頭の文を取り出し、ス
テップS6へ進む。ステップS6では、上記文と残り
の文,とを比較し、該残りの文,の中から、文
と並列動作できない文を排除する。ここで、文と文
とは、代入文とif文との比較であり、かつ、両者に
おいて同じ変数(a)が使用されているので、文は文
と並列動作できない。同じ理由で、文は文と並列
動作できない。以上のように、この例では、残りの全て
の文,が、文と並列動作できない文として排除さ
れる。次にステップS7へ進む。In step S5, the first sentence is extracted from the ungrouped sentences (sentences), and the process proceeds to step S6. In step S6, the sentence is compared with the remaining sentences, and a sentence that cannot operate in parallel with the sentence is excluded from the remaining sentences. Here, the sentence is a comparison between the assignment sentence and the if sentence, and since the same variable (a) is used in both, the sentence cannot operate in parallel with the sentence. For the same reason, a sentence cannot operate in parallel with a sentence. As described above, in this example, all the remaining sentences are excluded as sentences that cannot operate in parallel with the sentences. Next, the process proceeds to step S7.
【0042】ステップS7では、上記残りの全ての文
,が、文と並列動作できないので、ステップS5
で取り出された1文(文)を単文でグループ化し、ス
テップS8へ進む。ステップS8では、文,がグル
ープ化されていないので、ステップS5へ戻る。In step S7, all of the remaining sentences cannot operate in parallel with the sentences.
The one sentence (sentence) extracted by is grouped by a single sentence, and the process proceeds to step S8. In step S8, since the sentences are not grouped, the process returns to step S5.
【0043】ステップS5では、グループ化されていな
い文(文,)の中から、先頭の文を取り出し、ス
テップS6へ進む。ステップS6では、上記文と残り
の文とを比較する。ここで、文と文とは、if文
とifとの比較であり、かつ、両者において同じ変数
(a)は条件式でのみ使用されているので、文は文
と並列動作可能である。次にステップS7へ進む。In step S5, the first sentence is extracted from the ungrouped sentences (sentence,), and the flow advances to step S6. In step S6, the above sentence is compared with the remaining sentences. Here, a sentence and a sentence are a comparison between an if sentence and an if sentence, and since the same variable (a) is used only in a conditional expression in both cases, the sentence can operate in parallel with the sentence. Next, the process proceeds to step S7.
【0044】ステップS7では、ステップS5で取り出
された1文(文)とステップS6で排除されなかった
文(文)とをグループ化し、ステップS8へ進む。ス
テップS8では、全ての文がグループ化されたので、ス
テップS9へ進む。以上のように、ステップS5〜S8
の処理の繰り返しによって、上記文〜は、以下の4
つのグループに分けられる。 文, ……グループA 文 ……グループB 文 ……グループC 文, ……グループDIn step S7, one sentence (sentence) extracted in step S5 and a sentence (sentence) not excluded in step S6 are grouped, and the flow advances to step S8. In step S8, all the sentences have been grouped, so the process proceeds to step S9. As described above, steps S5 to S8
By repeating the above processing, the above sentence
Divided into two groups. Sentence …… Group A sentence …… Group B sentence …… Group C sentence …… Group D
【0045】ステップS9では、プログラム中の全ての
関数について、ステップS1〜S8の処理が行われたか
否かを判断し、まだ処理の行われていない関数(関数f
unc2等)がある場合には、ステップS1へ戻り、該
関数に対して同様の処理(ステップS1〜S8)を行
う。そして、全ての関数についてステップS1〜S8の
処理が行われると、ステップS10へ進む。In step S9, it is determined whether or not the processing in steps S1 to S8 has been performed for all the functions in the program.
If there is unc2), the process returns to step S1, and the same processing (steps S1 to S8) is performed on the function. When the processes in steps S1 to S8 are performed for all the functions, the process proceeds to step S10.
【0046】ステップS10では、ステップS7で生成
された各グループを機能合成することによって、図5に
示すようなRTLブロックを生成し、ステップS11へ
進む。ステップS11では、必要となる回路要素数が最
小となるように、ステップS10で生成されたブロック
をスケジューリングする。即ち、図4のステップS10
1に処理が移り、該ステップS101では、ステップS
10で生成された各RTLブロックのサイクル数を調
べ、その中から最大サイクル数を求める。図5の例で
は、グループA〜Cがそれぞれ1サイクルであり、グル
ープDが4サイクルであるので、最大サイクルは4サイ
クルとなる。In step S10, RTL blocks as shown in FIG. 5 are generated by synthesizing the functions of the groups generated in step S7, and the flow advances to step S11. In step S11, the blocks generated in step S10 are scheduled so that the required number of circuit elements is minimized. That is, step S10 in FIG.
1 and the process proceeds to step S101.
The number of cycles of each RTL block generated in step 10 is checked, and the maximum number of cycles is obtained from the number. In the example of FIG. 5, each of the groups A to C has one cycle and the group D has four cycles, so the maximum cycle is four cycles.
【0047】次に、ステップS102では、ステップS
10で生成された各RTLブロックを比較し、共有可能
な回路要素が複数のRTLブロック間に存在するか否か
を判断する。図5の例では、グループA〜Cが共有可能
な回路要素(「+1」の加算器)を有すると判断され、
ステップS103へ進む。Next, in step S102, step S
The RTL blocks generated in step 10 are compared to determine whether a sharable circuit element exists between the plurality of RTL blocks. In the example of FIG. 5, it is determined that the groups A to C have sharable circuit elements (“+1” adders),
Proceed to step S103.
【0048】次に、ステップS103では、ステップS
102で共有可能と判断された回路要素が同時に動作し
ているか否かを判断する。図5の例では、グループA〜
Cの回路要素(「+1」の加算器)が同時に動作してい
ると判断され、ステップS104へ進む。Next, in Step S103, Step S
It is determined whether the circuit elements determined to be sharable in 102 are operating simultaneously. In the example of FIG.
It is determined that the C circuit elements (“+1” adders) are operating at the same time, and the process proceeds to step S104.
【0049】ステップS104では、ステップS102
で共有可能と判断された回路要素を有するRTLブロッ
クのサイクル数の和が(ステップS101で求められ
た)上記最大サイクル数より小さいか否かを判断する。
図5の例では、グループA〜Cのサイクルの和(3サイ
クル)は、上記最大サイクル(4サイクル)よりも小さ
いので、ステップS105へ進む。In step S104, step S102
It is determined whether or not the sum of the number of cycles of the RTL block having the circuit element determined to be sharable is smaller than the maximum number of cycles (determined in step S101).
In the example of FIG. 5, since the sum of the cycles of the groups A to C (3 cycles) is smaller than the maximum cycle (4 cycles), the process proceeds to step S105.
【0050】ステップS105では、ステップS102
で共有可能と判断された回路要素を有するRTLブロッ
クについて、該RTLブロックに機能合成された(元
の)グループを1つのグループとしてまとめ、該まとめ
られたグループを、再度、機能合成する。図5の例で
は、グループA〜Cの「+1」の加算器が共有可能と判
断され、、その結果、グループA〜Cは、図6に示すよ
うな1つのRTLブロックに機能合成される。In step S105, step S102
For the RTL block having the circuit element determined to be sharable in (1), the (original) group functionally combined with the RTL block is combined into one group, and the combined group is combined with the function again. In the example of FIG. 5, it is determined that the “+1” adders of the groups A to C can be shared, and as a result, the groups A to C are functionally combined into one RTL block as shown in FIG.
【0051】以上述べたように、第1実施形態は、設計
時に階層的に記述した処理フロー(関数)、すなわち、
階層的機能モジュールの関数ごとに再分割するものであ
る。なお、上記の方法では、全関数をRTLブロックに
機能合成した後で、上述したTOP RTL model
に記載されているRTLブロックの回路要素の接続関係
に従って、全RTLブロックを1つの回路に構成する。
ここで、TOP RTL modelに基づいて回路を構
成する方法は、従来と同様である。As described above, in the first embodiment, the processing flow (function) described hierarchically at the time of design, that is,
Subdivision is performed for each function of the hierarchical function module. Note that, in the above method, after all functions are functionally synthesized into an RTL block, the above-described TOP RTL model is used.
All RTL blocks are configured into one circuit according to the connection relation of the circuit elements of the RTL block described in (1).
Here, a method of configuring a circuit based on the TOP RTL model is the same as the conventional method.
【0052】§3.第2実施形態 以下、図面を参照して、この発明の第2実施形態につい
て説明する。図7は、第2実施形態による機能合成方法
の一例を示すフローチャートである。図7に示すフロー
チャートは、図3に示すフローチャートからステップS
1,S9を削除し、代わりにステップS0を追加したも
のである。§3. Second Embodiment Hereinafter, a second embodiment of the present invention will be described with reference to the drawings. FIG. 7 is a flowchart illustrating an example of the function synthesizing method according to the second embodiment. The flowchart shown in FIG. 7 is different from the flowchart shown in FIG.
1 and S9 are deleted, and step S0 is added instead.
【0053】ここで、ステップS0では、プログラム中
の複数の関数を1つの関数にまとめる。具体的には、各
関数から、該各関数中の文を全て取り出し、所定の名前
の関数にまとめる。即ち、第1実施形態では、プログラ
ム中の各関数毎に(各関数中の)文をグループ化してい
たのに対して、第2実施形態では、プログラム中の各関
数を1つの関数と見なして、(この1つにまとめられた
関数中の)文をグループ化する。図4における残りのス
テップ(ステップS2〜S8,S10,S11)の動作
は、図3に示すステップの動作と同じものであるので、
ここでは、その説明を省略する。Here, in step S0, a plurality of functions in the program are combined into one function. More specifically, all the sentences in each function are extracted from each function and collected into a function having a predetermined name. That is, in the first embodiment, statements (in each function) are grouped for each function in the program, whereas in the second embodiment, each function in the program is regarded as one function. , (In the function that is grouped together). The operation of the remaining steps (steps S2 to S8, S10, S11) in FIG. 4 is the same as the operation of the step shown in FIG.
Here, the description is omitted.
【0054】次に、具体的な例を挙げて本発明の第2実
施形態による機能合成方法を説明する。本実施例の処理
対象であるC言語モデルは、以下に示す関数f1および
f2から成り、プログラム実行時には、他の関数から関
数f1→関数f2の順番で呼び出されるものとする。こ
こで、各変数は全てグローバル変数である。 Next, the function synthesizing method according to the second embodiment of the present invention will be described with a specific example. The C language model to be processed in the present embodiment includes functions f1 and f2 described below, and is assumed to be called from other functions in the order of function f1 → function f2 when executing a program. Here, each variable is a global variable.
【0055】まず、ステップS0では、プログラム中の
複数の関数を1つの関数にまとめる。これにより、上記
関数f1,f2は以下の関数f0にまとめられる。 First, in step S0, a plurality of functions in the program are combined into one function. Thus, the functions f1 and f2 are combined into the following function f0.
【0056】次に、ステップS2では、上記関数f0に
おいて、変数a,b,c,y,zが複数の文で使用され
ているので、ステップS3へ進む。ステップS3では、
上記関数f0中には、for文,while文,cas
e文が存在しないので、そのままステップS4へ進む。Next, in step S2, in the function f0, since the variables a, b, c, y, and z are used in a plurality of sentences, the process proceeds to step S3. In step S3,
In the above function f0, for statement, while statement, cas
Since there is no e-statement, the process directly proceeds to step S4.
【0057】ステップS4では、上記関数f0を、以下
に示す文〜に分割し、ステップS5へ進む。なお、
ここでは、わかりやすくするために、if文については
改行を行わず1行で表記する。 a=a+1; …… if(a==b){x=y;}else{x=0;} …… if(a==c){z=1;}else{z=0;} …… if(b==s){a=0;} …… b=z; …… if(c==x){y=z;}else{y=1;} …… c=c+1; …… if(c==d){y=0;}else{y=e;} …… b=b+y; ……In step S4, the function f0 is divided into the following statements (1) and (2), and the flow advances to step S5. In addition,
Here, for simplicity, if sentences are described in one line without line breaks. a = a + 1;... if (a == b) {x = y;} else {x = 0;} if (a == c) {z = 1;} else {z = 0;} if (b == s) = a = 0; b = z; if (c == x) {y = z;} else {y = 1;} c c = c + 1; if (C == d) {y = 0;} else {y = e;} b = b + y;
【0058】ステップS5では、上記文〜の中か
ら、先頭の文を取り出し、ステップS6へ進む。ステ
ップS6では、上述した「並列動作できない文の基準」
に基づいて文と残りの文〜とを比較し、該残りの
文〜の中から、文と並列動作できない文を排除す
る。この結果、この例では、,,,〜が、文
と並列動作できない文として排除される。次にステッ
プS7へ進む。In step S5, the first sentence is extracted from the above sentences 1 to 6, and the flow advances to step S6. In step S6, the above-mentioned “criterion for a statement that cannot be operated in parallel”
Is compared with the remaining sentences based on, and a sentence that cannot operate in parallel with the sentence is excluded from the remaining sentences. As a result, in this example,,,... Are excluded as statements that cannot operate in parallel with the statement. Next, the process proceeds to step S7.
【0059】ステップS7では、ステップS5で取り出
された1文(文)とステップS6で排除されなかった
文(文,)とをグループ化し、ステップS8へ進
む。ステップS8では、文,,,〜がグルー
プ化されていないので、ステップS5へ戻る。In step S7, one sentence (sentence) extracted in step S5 and a sentence (sentence) not excluded in step S6 are grouped, and the flow advances to step S8. In step S8, since the statements,... Are not grouped, the process returns to step S5.
【0060】ステップS5では、グループ化されていな
い文(文,,,〜)の中から、先頭の文を
取り出し、ステップS6へ進む。ステップS6では、上
述した「並列動作できない文の基準」に基づいて文と
残りの文,,〜とを比較し、該残りの文,
,〜の中から、文と並列動作できない文を排除
する。この結果、この例では、,,が、文と並
列動作できない文として排除される。次にステップS7
へ進む。In step S5, the first sentence is extracted from the ungrouped sentences (sentences,,...), And the flow advances to step S6. In step S6, the sentence and the remaining sentences,... Are compared based on the above-mentioned “criterion of sentences that cannot operate in parallel”, and the remaining sentences,
, To exclude sentences that cannot operate in parallel with the sentence. As a result, in this example,,, are excluded as sentences that cannot operate in parallel with the sentence. Next, step S7
Proceed to.
【0061】ステップS7では、ステップS5で取り出
された1文(文)とステップS6で排除されなかった
文(文,)とをグループ化し、ステップS8へ進
む。ステップS8では、文,,がグループ化され
ていないので、ステップS5へ戻る。In step S7, one sentence (sentence) extracted in step S5 and a sentence (sentence) not excluded in step S6 are grouped, and the flow advances to step S8. In step S8, since the sentences and are not grouped, the process returns to step S5.
【0062】ステップS5では、グループ化されていな
い文(文,,)の中から、先頭の文を取り出
し、ステップS6へ進む。ステップS6では、上述した
「並列動作できない文の基準」に基づいて文と残りの
文,とを比較し、該残りの文,は、文と並列
動作可能と判断される。次にステップS7へ進む。In step S5, the first sentence is extracted from the ungrouped sentences (sentence ,,), and the flow advances to step S6. In step S6, the sentence and the remaining sentences are compared based on the above-mentioned "criterion of sentences that cannot be operated in parallel", and it is determined that the remaining sentences can be operated in parallel with the sentence. Next, the process proceeds to step S7.
【0063】ステップS7では、ステップS5で取り出
された1文(文)とステップS6で排除されなかった
文(文,)とをグループ化し、ステップS8へ進
む。ステップS8では、全ての文がグループ化されたの
で、ステップS10へ進む。以上のように、ステップS
5〜S8の処理の繰り返しによって、上記文〜は、
以下の3つのグループに分けられる。 文,, ……グループE 文,, ……グループF 文,, ……グループGIn step S7, one sentence (sentence) extracted in step S5 and a sentence (sentence) not excluded in step S6 are grouped, and the flow advances to step S8. In step S8, since all the sentences have been grouped, the process proceeds to step S10. As described above, step S
By repeating the processing of 5 to S8, the above sentence
It is divided into the following three groups. Sentence, ... group E sentence, ... group F sentence, ... group G
【0064】ステップS10では、ステップS7で生成
された各グループを機能合成することによって、図8に
示すようなRTLブロックを生成し、ステップS11へ
進む。ステップS11では、必要となる回路要素数が最
小となるように、ステップS10で生成されたブロック
に対して、第1実施形態と同様のスケジューリングを行
い、全ての処理を終了する。In step S10, RTL blocks as shown in FIG. 8 are generated by synthesizing the functions of the groups generated in step S7, and the flow advances to step S11. In step S11, the same scheduling as in the first embodiment is performed on the blocks generated in step S10 so that the required number of circuit elements is minimized, and all the processing ends.
【0065】以上述べたように、第2実施形態では、階
層的に記述した全体回路のC言語モデルを、一旦、ベタ
(無階層)に展開した全体回路のC言語モデルに変換し
てから、再分割する。第2実施形態は、回路全体に対し
て再分割するので、第1実施形態よりも並列度が上が
り、また、全体回路に対して共通回路要素を見つけるの
で、物理的な回路面積も小さくなる。As described above, in the second embodiment, the C language model of the whole circuit described hierarchically is temporarily converted to the C language model of the whole circuit developed in a solid (non-hierarchical) manner. Subdivide. In the second embodiment, since the entire circuit is re-divided, the degree of parallelism is higher than in the first embodiment, and a common circuit element is found in the entire circuit, so that the physical circuit area is also reduced.
【0066】§4.補足 以上、この発明の実施形態を図面を参照して詳述してき
たが、具体的な構成はこの実施形態に限られるものでは
なく、この発明の要旨を逸脱しない範囲の設計の変更等
があってもこの発明に含まれる。例えば、上述した実施
形態では、上記汎用プログラム言語はC言語であるとし
たが、本発明が適用されるプログラム言語はC言語に限
定されず、他のプログラム言語(Pascal,BAS
IC等)であっても構わない。また、上述した実施形態
では、ステップS4の分割において、関数を文単位で分
割したが、この分割単位は1文に限定されず、2文毎や
3文毎など、任意の単位で分割しても構わない。§4. Supplement Although the embodiment of the present invention has been described in detail with reference to the drawings, the specific configuration is not limited to the embodiment, and there may be a design change or the like without departing from the gist of the present invention. Even this is included in the present invention. For example, in the above-described embodiment, the general-purpose program language is C language. However, the program language to which the present invention is applied is not limited to C language, and other program languages (Pascal, BAS) may be used.
IC etc.). In the above-described embodiment, in the division in step S4, the function is divided in units of a sentence. However, the division unit is not limited to one sentence, and may be divided in arbitrary units such as every two sentences or every three sentences. No problem.
【0067】[0067]
【発明の効果】以上説明したように、この発明によれ
ば、並列動作不可能な文を機能合成前に選別するので、
プログラム中の関数の全ての組み合わせについて(並列
動作の可否を)シミュレーションする必要が無くなり、
その結果、汎用プログラム言語で記述されたプログラム
を、該プログラムが示す回路の並列動作を考慮しなが
ら、かつ、簡単な処理で(即ち、短時間で)、電子回路
へ変換することができる。As described above, according to the present invention, sentences that cannot be operated in parallel are sorted out before synthesizing functions.
It is no longer necessary to simulate all combinations of functions in the program (whether or not parallel operation is possible),
As a result, a program described in a general-purpose programming language can be converted into an electronic circuit by simple processing (that is, in a short time) while considering the parallel operation of the circuit indicated by the program.
【図1】 本発明の実施形態の概要の一例を示す説明図
である。FIG. 1 is an explanatory diagram showing an example of an outline of an embodiment of the present invention.
【図2】 モジュール間の接続の一例を示す説明図であ
る。FIG. 2 is an explanatory diagram showing an example of connection between modules.
【図3】 この発明の第1実施形態による機能合成方法
の一例を示すフローチャートである。FIG. 3 is a flowchart illustrating an example of a function synthesizing method according to the first embodiment of the present invention.
【図4】 図3のステップS11で行われるスケジュー
リングの一例を示すフローチャートである。FIG. 4 is a flowchart illustrating an example of scheduling performed in step S11 of FIG. 3;
【図5】 第1実施形態によって生成されたRTLブロ
ックの一例を示す説明図である。FIG. 5 is an explanatory diagram illustrating an example of an RTL block generated according to the first embodiment.
【図6】 スケジューリング後のRTLブロックの一例
を示す説明図である。FIG. 6 is an explanatory diagram showing an example of an RTL block after scheduling.
【図7】 この発明の第2実施形態による機能合成方法
の一例を示すフローチャートである。FIG. 7 is a flowchart illustrating an example of a function synthesizing method according to a second embodiment of the present invention.
【図8】 第2実施形態によって生成されたRTLブロ
ックの一例を示す説明図である。FIG. 8 is an explanatory diagram illustrating an example of an RTL block generated according to the second embodiment.
Claims (12)
語を用いて記述したC言語モデルをRTL回路モデルに
変換する機能合成方法において、 前記C言語モデル中の関数を1つ選択する第1のステッ
プと、 前記第1のステップで選択された関数を構成している複
数のプログラム文に対し、それらの中から互いに並列動
作可能な文の集合を1つのグループとして分割する第2
のステップと、 前記第2のステップにより分割されたグループ毎に機能
合成ツールを用いてRTL回路モデルに変換する第3の
ステップと、 RTL回路モデルをスケジューリングする第4のステッ
プとを有することを特徴とする機能合成方法。1. A function synthesizing method for converting a C language model in which a processing flow of a logic circuit is described using a C programming language into an RTL circuit model, a first step of selecting one function in the C language model And dividing a set of statements that can operate in parallel from each other into one group from among a plurality of program statements constituting the function selected in the first step.
And a third step of converting an RTL circuit model into a RTL circuit model using a function synthesis tool for each of the groups divided by the second step, and a fourth step of scheduling the RTL circuit model. Function synthesis method.
に並列動作できない文を排除した残りの文の集合である
ことを特徴とする機能合成方法。2. The function synthesizing method according to claim 1, wherein the group divided in the second step is a set of remaining sentences excluding sentences that cannot operate in parallel with each other. .
載の機能合成方法において、 前記第2のステップは、 互いに並列動作できない文を選別し、 選別されずに残った文があるならば、それらの文をグル
ープ化し、 全ての文のグループ化が完了するまで、前記選別および
グループ化を繰り返すことからなることを特徴とする機
能合成方法。3. The function synthesizing method according to claim 1, wherein in the second step, sentences which cannot be operated in parallel with each other are selected. A grouping of the sentences, and repeating the selection and the grouping until the grouping of all the sentences is completed.
の機能合成方法において、 前記C言語モデル中に複数の関数がある時は、初めに、
それらの関数を1つに纏め、纏めた関数に対して、前記
第1のステップ以降の処理を行うことを特徴とする機能
合成方法。4. The function synthesizing method according to claim 1, wherein when there are a plurality of functions in the C language model, first,
A function synthesizing method, wherein the functions are combined into one, and the processing after the first step is performed on the combined functions.
の機能合成方法において、 各C言語モデルにおいて、代入文の右辺にある変数は入
力とし、代入文の左辺にある変数は出力とし、if文の
比較で用いられる変数は入力とし、これらの入力と出力
とをリストにして、その入力と出力とを接続するような
TOP RTLmodelを生成し、 機能合成ツールによる変換後、前記TOP RTL mo
delに記載されている接続関係に従って、RTL回路
モデルを1つの回路に構成することを特徴とする機能合
成方法。5. The function synthesizing method according to claim 1, wherein in each C language model, a variable on the right side of the assignment statement is an input, and a variable on the left side of the assignment statement is an output. , If statements are inputs, a list of these inputs and outputs is generated, and a TOP RTL model that connects the inputs and outputs is generated. After conversion by the function synthesis tool, the TOP RTL mo
A function synthesizing method, wherein an RTL circuit model is configured into one circuit in accordance with a connection relation described in "del".
の機能合成方法において、 前記第4のステップは、 各RTL回路モデルのサイクル数の中から最大のサイク
ル数を求め、 共有可能な回路要素が複数のRTL回路モデル間に存在
するか否かを判断し、 共有可能な回路要素が存在する場合には、共有可能と判
断された回路要素が同時に動作しているか否かを判断
し、 共有可能と判断された回路要素が同時に動作する場合に
は、共有可能と判断された回路要素を有するRTL回路
モデルのサイクル数の和が前記最大サイクル数より小さ
いか否かを判断し、 前記サイクル数の和が前記最大サイクル数より小さい場
合には、共有可能と判断された回路要素を有するRTL
回路モデルを1つのグループとしてまとめ、該まとめら
れたグループを、再度、機能合成することからなること
を特徴とする機能合成方法。6. The function synthesizing method according to claim 1, wherein in the fourth step, a maximum number of cycles is obtained from among the number of cycles of each RTL circuit model, and the function is sharable. It is determined whether the circuit element exists between a plurality of RTL circuit models. If there is a sharable circuit element, it is determined whether the circuit elements determined to be sharable are operating simultaneously. When the circuit elements determined to be sharable operate simultaneously, it is determined whether or not the sum of the number of cycles of the RTL circuit model having the circuit element determined to be sharable is smaller than the maximum number of cycles; If the sum of the cycle numbers is smaller than the maximum cycle number, the RTL having the circuit element determined to be sharable
A function synthesizing method, comprising: combining circuit models into one group; and synthesizing the combined group again.
をCプログラム言語を用いて記述したC言語モデルをR
TL回路モデルに変換することを実行させるためのプロ
グラムを記録した記録媒体において、 前記C言語モデル中の関数を1つ選択する第1のステッ
プと、 前記第1のステップで選択された関数を構成している複
数のプログラム文に対し、それらの中から互いに並列動
作可能な文の集合を1つのグループとして分割する第2
のステップと、 前記第2のステップにより分割されたグループ毎に機能
合成ツールを用いてRTL回路モデルに変換する第3の
ステップとを実行させるためのプログラムを記録した記
録媒体。7. A computer is provided with a C language model that describes the processing flow of a logic circuit using a C programming language.
A recording medium storing a program for executing a conversion to a TL circuit model, a first step of selecting one function in the C language model, and a function selected in the first step For a plurality of program statements, a set of statements that can operate in parallel from each other is divided into one group.
And a third step of performing a step of converting into an RTL circuit model using a function synthesizing tool for each of the groups divided by the second step.
に並列動作できない文を排除した残りの文の集合である
ことを特徴とする記録媒体。8. The recording medium according to claim 7, wherein the group divided in the second step is a set of remaining sentences excluding sentences that cannot operate in parallel with each other.
載の記録媒体において、 前記第2のステップは、 互いに並列動作できない文を選別し、 選別されずに残った文があるならば、それらの文をグル
ープ化し、 全ての文のグループ化が完了するまで、前記選別および
グループ化を繰り返すことからなることを特徴とする記
録媒体。9. The recording medium according to claim 7, wherein in the second step, sentences that cannot be operated in parallel with each other are selected, and if there is a sentence that has not been selected, A recording medium comprising the steps of grouping the sentences and repeating the selection and grouping until the grouping of all the sentences is completed.
載の記録媒体において、 前記C言語モデル中に複数の関数がある時は、初めに、
それらの関数を1つに纏め、纏めた関数に対して、前記
第1のステップ以降の処理を行うことを特徴とする記録
媒体。10. The recording medium according to claim 7, wherein when there are a plurality of functions in the C language model, first,
A recording medium characterized by combining those functions into one and performing the processing after the first step on the combined functions.
記載の記録媒体において、 各C言語モデルにおいて、代入文の右辺にある変数は入
力とし、代入文の左辺にある変数は出力とし、if文の
比較で用いられる変数は入力とし、これらの入力と出力
とをリストにして、その入力と出力とを接続するような
TOP RTLmodelを生成し、 機能合成ツールによる変換後、前記TOP RTL mo
delに記載されている接続関係に従って、RTL回路
モデルを1つの回路に構成することを特徴とする記録媒
体。11. The recording medium according to claim 7, wherein in each C language model, a variable on the right side of the assignment statement is an input, and a variable on the left side of the assignment statement is an output, The variables used in the comparison of the if statement are inputs, the input and the output are listed, a TOP RTL model that connects the input and the output is generated, and the TOP RTL model is converted by the function synthesizing tool.
A recording medium comprising an RTL circuit model formed into one circuit in accordance with a connection relationship described in "del".
記載の記録媒体において、 前記第4のステップは、 各RTL回路モデルのサイクル数の中から最大のサイク
ル数を求め、 共有可能な回路要素が複数のRTL回路モデル間に存在
するか否かを判断し、 共有可能な回路要素が存在する場合には、共有可能と判
断された回路要素が同時に動作しているか否かを判断
し、 共有可能と判断された回路要素が同時に動作する場合に
は、共有可能と判断された回路要素を有するRTL回路
モデルのサイクル数の和が前記最大サイクル数より小さ
いか否かを判断し、 前記サイクル数の和が前記最大サイクル数より小さい場
合には、共有可能と判断された回路要素を有するRTL
回路モデルを1つのグループとしてまとめ、該まとめら
れたグループを、再度、機能合成することからなること
を特徴とする記録媒体。12. The recording medium according to claim 7, wherein in the fourth step, a maximum cycle number is obtained from a cycle number of each RTL circuit model, and the sharable circuit is obtained. Determining whether the element exists between a plurality of RTL circuit models; if there is a sharable circuit element, determining whether the circuit elements determined to be sharable are operating simultaneously; When the circuit elements determined to be sharable operate simultaneously, it is determined whether or not the sum of the number of cycles of the RTL circuit model having the circuit element determined to be sharable is smaller than the maximum number of cycles; If the sum of the numbers is smaller than the maximum number of cycles, the RTL having the circuit element determined to be sharable is used.
A recording medium comprising combining circuit models into one group, and synthesizing the combined group again.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP36555998A JP3246462B2 (en) | 1998-12-22 | 1998-12-22 | Function synthesizing method using C language circuit model and recording medium storing the program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP36555998A JP3246462B2 (en) | 1998-12-22 | 1998-12-22 | Function synthesizing method using C language circuit model and recording medium storing the program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000187675A JP2000187675A (en) | 2000-07-04 |
| JP3246462B2 true JP3246462B2 (en) | 2002-01-15 |
Family
ID=18484565
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP36555998A Expired - Fee Related JP3246462B2 (en) | 1998-12-22 | 1998-12-22 | Function synthesizing method using C language circuit model and recording medium storing the program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3246462B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005242569A (en) | 2004-02-25 | 2005-09-08 | Fujitsu Ltd | DATA PROCESSING DEVICE DESIGNING METHOD, DATA PROCESSING DEVICE DESIGNING DEVICE, AND PROGRAM |
-
1998
- 1998-12-22 JP JP36555998A patent/JP3246462B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000187675A (en) | 2000-07-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP2062175B1 (en) | Hardware definition language generation for frame-based processing | |
| US6226777B1 (en) | Method and system for improving the performance of a circuit design verification tool | |
| JP2001202397A (en) | System-on-chip architecture design support system and architecture generation method | |
| EP0847022A2 (en) | Method for designing an architectural system | |
| JP4204039B2 (en) | Behavioral synthesis system, behavioral synthesis method, control program, readable recording medium, logic circuit manufacturing method, and logic circuit | |
| JP6776069B2 (en) | RTL optimization system and RTL optimization program | |
| JPH05101141A (en) | High-level composition device | |
| JP4492803B2 (en) | Behavioral synthesis apparatus and program | |
| US6532573B1 (en) | LSI verification method, LSI verification apparatus, and recording medium | |
| JP3246462B2 (en) | Function synthesizing method using C language circuit model and recording medium storing the program | |
| JP4083491B2 (en) | Module-to-module interface automatic synthesis apparatus, synthesis method, program, and portable storage medium | |
| JP4968478B2 (en) | Method for reconstructing a statement and computer system having the function | |
| JP3602697B2 (en) | Logic circuit design support system | |
| JP4293562B2 (en) | Hardware verification programming description generation device, high-level synthesis device, hardware verification programming description generation method, hardware verification program generation method, control program, and readable recording medium | |
| CN117725862A (en) | Chip hardware synthesis method based on multi-layer intermediate representation | |
| JP2024062940A (en) | Apparatus, program, and method for performing equivalence checking for high-level synthesis | |
| US20040143813A1 (en) | System development supporting apparatus, system development supporting method, and computer-readable recorded medium | |
| JP2001209670A (en) | High-level synthesis method and recording medium used for implementing high-level synthesis method | |
| Fricke et al. | Automatic tool-flow for mapping applications to an application-specific cgra architecture | |
| US20070271080A1 (en) | Model generation method for software/hardware collaboration design | |
| JP2008204341A (en) | Interface composite device | |
| US6430726B1 (en) | Logic circuit synthesizing method and logic synthesizing system | |
| US20120226890A1 (en) | Accelerator and data processing method | |
| US6035112A (en) | Cell library generating method and apparatus | |
| JP2938170B2 (en) | Functional design support device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20011002 |
|
| LAPS | Cancellation because of no payment of annual fees |