The present invention relates to technology in which program descriptions for a simulation or circuit descriptions for specifying hardware are automatically generated from program descriptions. By way of example, it relates to technology which is effective when applied to the design of a logic circuit executing a pipeline operation, for example, a logic circuit such as CPU (Central Processing Unit).
There has been technology for generating the circuit descriptions of a digital circuit with a program language. A technique stated in Patent Document 1 includes a collective assignment part according to which variables are classified into ones indicative of registers and ones indicative of the inputs of the registers, whereupon the second variables are collectively assigned to the first variables after processing in a module part. A technique stated in Patent Document 2 consists in that parts which are sequentially controlled within a program descriptive of circuit operations in a universal program language are specified in a specification process part, that the descriptions of the parts to be sequentially controlled are thereafter converted so as to operate as state machines, in a conversion process part and by employing the universal program language, that the program after the conversion is acquired, that parts which operate in parallel are subsequently extracted from within the converted program in a program generation process part, and that a program which accesses all the extracted parts is generated.
The method according to Patent Document 1 includes three constituents; (1) modules which indicate circuit operations, (2) the collective assignment part which performs the register assignments, and (3) a loop part which is iterated every clock cycle. It particularly features that the register assignments (2) are executed after obtaining the modules (1), within the loop part (3). However, the modules (1) do not contain clock boundaries, and the clock boundaries are infallibly contained in the loop part (3). Therefore, in order to describe a circuit operation which extends over a plurality of cycles, the circuit operation needs to be divided at the clock boundaries. By way of example, it must be described that, when a certain condition has held, a circuit operation is begun at an intermediate position of a circuit operation executed in a preceding cycle, but the method is difficult of making such a description. It has been found out by the inventors that, especially when a circuit which performs a pipeline operation attended with a stall operation is described by the method stated in Patent Document 1, a complicated job might be involved, program descriptions becoming complicated.
The method according to Patent Document 2 has four features; (1) that the parts to be sequentially processed are identified from within the program described in the universal language and are converted into general-purpose program descriptions expressive of state machines, (2) that parallelism at a function level is extracted, (3) that the association between a program to be turned into hardware and a software program to control the former program is automated, and (4) that, in forming hardware within the parts to-be-sequentially-processed, parts requiring a flip-flop and a latch are identified and are converted into the HDL. However, there is no means for explicitly affording clock boundaries, and descriptions at a cycle precision cannot be directly made. According to an embodiment of Patent Document 2, the clock boundary is set from a function to another function, and it is difficult to describe, for example, that, when a certain condition has held, a circuit operation is begun at an intermediate position of a circuit operation executed in a preceding cycle. It has been found out by the inventors that, especially a circuit which performs a pipeline operation attended with a stall operation can be described by the method stated in Patent Document 2, but that a complicated job might be involved, program descriptions becoming complicated.
An object of the present invention is to provide a compiler which can automatically generate hardware descriptions from program descriptions that explicitly indicate clock boundaries.
Another object of the invention is to provide a compiler which can easily generate the program descriptions or circuit descriptions of a circuit capable of a pipeline operation attended with a stall operation.
Still another object of the invention is to provide a logic circuit design method which can design a circuit capable of a pipeline operation attended with a stall operation.
The above and other objects and novel features of the invention will be clarified from the following description of the specification when read in conjunction with the accompanying drawings.
Typical aspects of the invention disclosed in the present application will be briefly outlined below.
[1] The outline of the present invention will be generally explained. Pseudo C descriptions (1) are input in which parallel operations can be described at a statement level and at a cycle precision by clock boundaries (descriptors $) and register assignment statements (descriptions containing operators=$), the register assignment statements are identified (S2) to generate executable C descriptions (3) (S3 and S4), and to extract state machines having undergone reductions in the numbers of states and to decide whether or not a loop to be executed in the 0th cycle is existent (S5), and if the loop is nonexistent, circuit descriptions (4) which can be logically synthesized are generated (S6).
Owing to the above, the pseudo C descriptions in which the clock boundaries are explicitly inserted into the C descriptions are input, and the pseudo C descriptions which permit the register assignment statements to be described in parallel at the statement level are input, so that a pipeline operation attended with a stall operation can be represented.
The C descriptions which can be compiled by a conventional C compiler can be output on the basis of the pseudo C descriptions. Since the numbers of states are reduced, the circuit descriptions can be output which are accompanied by state machines in the number of states equal to, at most, (the number of clock boundaries afforded by the descriptions+1).
Since functions can be designed at the program level without caring about the state machines, the quantity of descriptions is decreased, so that the design method contributes, not only to shortening the term of a development, but also to enhancing a quality.
Besides, it is permitted to describe a bus interface circuit and an arbitration circuit which cannot be represented by the general descriptions of program level as do not designate the clock boundaries. Especially, since the register assignments are describable, descriptions can be made in consideration of parallelism at the statement level, and a complicated circuit operation such as the pipeline operation attended with the stall operation can be easily described with a smaller quantity of codes than in the C descriptions.
Besides, since the pseudo C descriptions are converted into the C descriptions which are compilable by the conventional C compiler, a high-speed simulation is realized, and the number of man-hour for verifying functions can be sharply diminished. In the function design, accordingly, sharp diminutions in the number of man-hour are realized in both the logic design and the logic verification.
A state machine of Mealy type can be generated from the program descriptions in which the clock boundaries are designated, so that a model inspection at the program level is possible.
The design method is applicable to the development of, for example, a cache controller or a DMA controller of which the cycle precision is required and for which a high-level synthetic tool is unsuitable, and it is greatly contributive to shortening the term of the design.
[2] In the first aspect of a compiler according to the present invention, a compiler can convert first program descriptions (1) described by diverting a predetermined program language, into circuit descriptions (4); the first program descriptions containing register assignment statements (descriptions containing operators=$) and clock boundary descriptions ($) which permit circuit operations to be specified at a cycle precision; the circuit descriptions specifying hardware which realizes the circuit operations specified by the first program descriptions, in a predetermined hardware description language.
In the second aspect of the compiler according to the invention, a compiler can convert first program descriptions described by diverting a predetermined program language, into second program descriptions (3) employing a predetermined program language; the first program descriptions containing register assignment statements (descriptions containing operators=$) and clock boundary descriptions ($) which permit circuit operations to be specified at a cycle precision. The second program descriptions contain transformed assignment statements (13) into which the register assignment statements are transformed so as to be capable of referring to states of preceding cycles, and register assignment description insertion statements (12) which associate variables of the transformed assignment statements with changes of registers attendant upon cycle changes, in correspondence with the clock boundary descriptions.
In the third aspect of the compiler according to the invention, a compiler can convert first program descriptions (1) described by diverting a predetermined program language, into second program descriptions (3) employing a predetermined program language, and circuit descriptions (4). The first program descriptions contain register assignment statements and clock boundary descriptions which permit circuit operations to be specified at a cycle precision. The second program descriptions contain transformed assignment statements into which the register assignment statements are transformed so as to be capable of referring to states of preceding cycles, and register assignment description insertion statements which associate variables of the transformed assignment statements with changes of registers attendant upon cycle changes, in correspondence with the clock boundary descriptions. The circuit descriptions specify hardware which is defined by the second program descriptions, in a predetermined hardware description language.
The predetermined program language is, for example, a C language. The hardware description language is, for example, a description language of RTL level.
[3] The first aspect of a logic circuit design method according to the invention comprises the first step (S1) of inputting first program descriptions (1) which contain register assignment statements (descriptions containing operators=$) and clock boundary descriptions ($) that are described by diverting a predetermined program language in order to define circuit operations on the basis of timing specifications, and that permit the circuit operations to be specified at a cycle precision; and the second step of generating circuit information which satisfies the timing specifications, on the basis of the first program descriptions.
The second step may include the step of converting the first program descriptions, and generating as the circuit information, second program descriptions (3) containing descriptions (13, 12) into which the register assignment statements are transformed using input variables and output variables (S2), and which assign the input variables to the output variables in correspondence with the clock boundary descriptions (S4).
The second step may include the step of converting the second program descriptions, and generating circuit descriptions (4) which serve to specify hardware satisfying the timing specifications, in a predetermined hardware description language, as the further circuit information on the basis of the second program descriptions.
The design method may further comprise the third step of performing a simulation of a circuit to-be-designed by employing the second program descriptions.
Regarding the second step, it is also possible to separately grasp second program descriptions (5) containing descriptions (13) into which the register assignment statements are transformed using input variables and output variables (S2), and third program descriptions (3) containing descriptions (12) which assign the input variables to the output variables in correspondence with the clock boundary descriptions (S4). On this occasion, a simulation is performed on the basis of the third program descriptions by the third step.
[4] The second aspect of the logic circuit design method according to the invention comprises an input step of inputting first program descriptions containing register assignment statements and clock boundary descriptions as are described by diverting a predetermined program language in order to define circuit operations on the basis of timing specifications, and as permit the circuit operations to be specified at a cycle precision (S1); and a conversion step of generating second program descriptions containing descriptions (13, 12) into which the register assignment statements are transformed using input variables and output variables (S2) and which assign the input variables to the output variable in correspondence with the clock boundary descriptions (S4), and being described in the predetermined program language.
The conversion step may well be a step in which, in course of generating a CFG on the basis of the first program descriptions, it sets clock boundary nodes in the CFG in correspondence with the clock boundary descriptions, whereupon it inserts the register assignment descriptions behind the clock boundary nodes.
The design method may well further comprise an optimization step of optimizing codes of the second program descriptions, while a variable table of respective state transitions is being created by utilizing the CFG.
The design method may well further comprise a “retain” step of extracting parts in which variables do not change between states within the variable table, as parts which need to be retained, and adding descriptions for assigning the input variables to the output variables, to the extracted parts.
The design method may well further comprise an extraction step of extracting the codes which constitute state machines, on the basis of the variables and arguments of the respective state transitions within the variable table having undergone the “retain” step.
The design method may well further comprise the step of generating circuit descriptions which describe hardware of a circuit satisfying the circuit specifications, in a predetermined hardware description language, while reference is being had to the state machine constituting codes extracted by the extraction step, and to the second program descriptions.
Whether or not a loop to be executed in the 0th cycle is existent is decided for the first program descriptions, and that, when the loop has been decided to be nonexistent, the conversion step is performed.
<<Outline of Design Method>>
A logic circuit design method according to the present invention is exemplified in
The pseudo C program 1 is a program which includes a clock boundary description (also written “clock boundary” simply) capable of specifying a circuit operation at a cycle precision, and a register assignment statement, and which is capable of parallel descriptions at a statement level. The expression “pseudo C description” is used in the sense that it differs from a so-called “native” C language description in which the clock boundary and the register assignment statement are not defined. It shall not be excluded to base the program language on a high-class language other than the C language.
The compiler processing 2 is performed in such a way that a computer apparatus, not shown, executes a compiler and loads the pseudo C program 1. First, the pseudo C program 1 is loaded (S1). The register assignment statement is identified for the loaded pseudo C program 1, and the identified register assignment statement is transformed so as to be capable of referring to the state of a preceding cycle, in other words, it is transformed using an input variable and an output variable (S2). The transformed register assignment statement is also termed the “transformed assignment statement”. The pseudo C program in which the register assignment statement has been transformed into the transformed assignment statement, is stored in the register information storage section 5. This pseudo C program in which the register assignment statement has been transformed into the transformed assignment statement, is fetched from the register information storage section 5, and the control flow graph (hereinbelow, abbreviated to “CFG”) thereof is generated (S3). The generated CFG is stored in an intermediate representation storage section 6. The CFG stored in the intermediate representation storage section 6, and the pseudo C program stored in the register information storage section 5 are converted into the executable C description program (S4). By way of example, there is inserted a register assignment description insertion statement which adapts the variables of the transformed assignment statement to the change of a register attendant upon a cycle change, in correspondence with the clock boundary description. In other words, there is inserted a register assignment description insertion statement which assigns the output variable of the transformed assignment statement to the input variable thereof in correspondence with the clock boundary description.
In a case where the HDL descriptions 4 are obtained on the basis of the pseudo C program 5, etc., state machines are first generated by inputting them (S5). The state machine generation (S5) is broadly classified into a number-of-states reduction process (S5A), the optimization of a code (S5B), a “retain” analysis for conforming to the HDL descriptions (S5C), and state machine extraction (S5D). The number-of-states reduction process (S5A) and the optimization of the code (S5B) may well be grasped as processes which belong to the category of optimization processing. At the stage of the optimization of the code (S5B), whether or not a loop to be executed in the 0th cycle is existent is decided. If the loop is nonexistent, the “retain” analysis for conforming to the HDL descriptions (S5C), and the state machine extraction (S5D) are performed. In obtaining the C description program, the register assignment description insertion statement may be inserted into, for example, a clock boundary node. In obtaining the HDL description, however, even in a case where a register value does not change at the clock boundary, this fact needs to be explicitly described. Therefore, the “retain” analysis (S5C) is made. The state machine to be generated is generated on the basis of a conversion table of every state transition. The generated state machine is held in a state machine storage section 7. The HDL descriptions 4 are generated on the basis of such state machines held (S6).
The HDL description 4 are made convertible into logic circuit diagram data by utilizing a logic synthesis tool. The C descriptions 3 are utilized for the simulation of a logic circuit which is to be logically synthesized, and so forth.
Now, the pseudo C program and the compiler processing thereof will be described in detail. The ensuing detailed description will exemplify a circuit design in which specifications in
<<Circuit to be Designed>>
Shown in
(1) When an input signal valid_a rises, the value of an input signal “a” in a cycle whose signal level has become a high level is accepted. Here, the rise change of the signal valid_a becomes an issue.
(2) When the signal level of an input signal valid_b becomes the high level in a cycle next to the rise of the input signal valid_a or in a still later cycle, the value of an input signal “b” in the cycle is accepted. As to the input signal valid_b, only level detection suffices, and the detection of an edge change is unnecessary.
(3) When the signals “a” and “b” have been accepted by the operations (1) and (2), the added result of the signals “a” and “b” is delivered as an output signal “out” in the next cycle, the signal level of an output signal valid_out is brought to the high level in the same cycle, and the signal level of the output signal valid_out is brought to a low level in the next cycle.
(4) Unless a new added result is assigned by the operations (1), (2) and (3), the output signal “out” assumes the same value.
(5) The output signal valid_out has its signal level rendered high only in the cycle in which the new added result has been assigned to the output signal “out” by the operations (1), (2) and (3), and it assumes the low level else.
<<Pseudo C Program>>
Exemplified in
The details of the circuit operation description part 11 are as follows:
Symbol “$” signifies the clock boundary description, and symbol “=$” the register assignment. They are not the general descriptors or operators of the C language. The pseudo C program employing them can be called “program descriptions diverting the C language” in that sense.
As understood from the circuit operation description part 11, the parallel operation can be simply described at a statement level and at a cycle precision by the clock boundary descriptions and the register assignment statements. The “cycle precision” signifies that synchronism with clock cycles is intended.
There will be explained the descriptive contents of the circuit operation description part 11 in
The register assignment statement at Line 22 in
<<Identification of Register Assignment Statement>>
Next, the register assignment statement identifying process S2 will be described. In the register assignment statement identifying process part, an assignment statement in which the symbol $ is added between symbol=and the right hand is identified, the register assignment statement in the circuit operation description part 11 and the type and initial value of the variable at the left hand of the register assignment statement are stored, and the identified register assignment statement:
It is possible to grasp signal_latched_i as an input variable as which an input at the current time is given, and signal_latched_o as an output variable as which an output in the last cycle is assigned. The new variables having developed by the alteration:
Especially in a case where the variable at the left hand of the register assignment is of the pointer type (to which symbol * is affixed), a variable declaration is done using the pointer type. In case of, for example:
Especially for the variable to-be-added, a flag variable which is of the same type and whose initial value is “0” is also stored as such. In case of this example:
Exemplified in
<<CFG Generation>>
Next, the CFG generation process will be explained. The “CFG” generally signifies a graph which indicates the flow of a control within each function.
In the CFG generation process, the CFG is created by loading the circuit operation description part 11. In particular, the process creates the CFG which has nodes for identifying the loops of “while”, “for”, etc., the conditional branches of “if”, “case”, etc., and label branches to labels based on goto statements. After all, the process creates the CFG which has as its nodes, the loops of “while”, “for”, etc., the conditional branches of “if”, “case”, etc., and the label branches to the labels based on the goto statements. The CFG is created in such a way that individual statements are loaded till the end of the program, and that the nodes are connected by directed sides (sides having directions) along the flow of the program while the nodes are being created in accordance with a procedure of steps 1)-7) stated below. A creation process for the CFG as conforms to the procedure of steps 1)-7) is shown in due course in
1) At the start of a loop, the line No. of the loop and a terminal symbol expressive of the loop, such as “while” or “for”, are registered in the loop statement stack, a loop start node (NDs) is created, and the line No. and the terminal symbol are affixed to the node. Besides, in the presence of a “for” or “while” loop end condition, the condition is assigned to a suitable symbol and is affixed to an output branch, and the affixed condition is stored in a pair with the allotted symbol.
2) At the end of a loop, information lying at the head is taken away from the loop statement stack, a loop end node expressive of the loop end is created, and the line No. and “end of the terminal symbol” of the loop are affixed to the node. However, “continue” or “break” is not handled as the end of the loop. Besides, in the presence of a “do-while” loop end condition, the condition is assigned to a suitable symbol and is affixed to an output branch, and the affixed condition is stored in a pair with the allotted symbol.
3) At the start of a conditional branch, the line No. of the branch and a terminal symbol expressive of the branch, such as “if” or “case”, are registered in the branch statement stack, a conditional branch start node is created, and the line No. and the terminal symbol are affixed to the node. Besides, a branch condition is assigned to a suitable symbol and is affixed to an output branch, and the affixed condition is stored in a pair with the allotted symbol.
4) At the end of a conditional branch, information lying at the head is taken away from the branch statement stack, a conditional branch end node expressive of the conditional branch end is created, and the line No. and “end of the terminal symbol” of the branch are affixed to the node.
5) In case of a label, a label node expressive of the label is created, and the line No. and label symbol of the label are affixed to the node.
6) In case of a clock boundary, a clock boundary node is created, and the line No. and symbol $ of the clock boundary are affixed to the node.
7) In any case other than the above, a node to which the corresponding line No. and statement are affixed is created, and the node is merged until any of the cases 1)-6) is met.
The CFG is created in accordance with the above procedure of steps. In the ensuing description, however, the CFG in which information items on the clock boundary, the start point/end point of the branch, and the start point/end point of the loop are not affixed as exemplified in
<<C Description Generation>>
The C description generation process S4 will be explained. In the C description generation process S4, there are inserted a statement which assigns “1” to a flag variable among the variables stored as the variables to-be-added in the register assignment statement identifying process, the flag variable lying directly under the part (transformed assignment statement) altered in the register assignment statement identifying process, and a statement which assigns “0” to a flag variable lying directly under an assignment statement that is not a register assignment statement and that is for the variable of the left hand of the register assignment statement. Simultaneously therewith, the variable declaration stored in the register assignment statement identifying part is added to the local variable declaration part. In
Subsequently, register assignment description insertion statements are determined. Herein, the register assignment description insertion statements are created for all the variables of the right hand of the register assignment statement identified in the register assignment statement identifying process S2. More specifically, subject to:
The descriptions are created for all the variables of the right hand of the register assignment statement identified in the register assignment statement identifying process. In the case of the example, the following descriptions are obtained:
As exemplified in
Exemplified in
<<State Machine Generation—Number-of-States Reduction>>
The state machine generation process S5 will be described. The number-of-states reduction process S5A is performed in conformity with, for example, a first or second rule. The first rule of the number-of-states reduction process is exemplified in
<<State Machine Generation—Code Optimization>>
In the code optimization process S5B, as exemplified in
Here, the process of the code optimization will be described using another example especially simplified, with reference to
The optimization process is performed on the basis of, for example, the variable table in
As the deletion of the redundant statement, in the first place, in a case where at least two descriptions “def”s exist within the column of the state transition for an identical variable, the following processing step 1) or 2) is executed:
1) A substep 1-1) or 1-2) to be explained below is executed up to this side of the description “pred(cond){ . . . }” existing posteriorly to the descriptions “def” (irrespective of the existence or nonexistence of the description “pred(cond){ . . . }”). 1-1): In a case where the description “def” accompanied by the description “use” does not exist posteriorly to the description “def”, only a statement corresponding to the last description “def” is left. 1-2): In a case where the description “def” accompanied by the description “use” exists posteriorly to the description “def”, only the description “def” not accompanied by the description “use” is left if it exists posteriorly to the description “def” accompanied by the description “use”, and the description “def” accompanied by the description “use” and the description “def” anterior to the description “def” accompanied by the description “use” are left else. This is iterated until no change comes to occur, and only statements corresponding to the left descriptions “def”s are left.
2) If the description “pred(cond){ . . . }” does not exist posteriorly to the descriptions “def”s, the processing step is ended, and if it exists, a substep 2-1) or 2-2) to be explained below is executed. 2-1) In a case where the condition of the description “pred(cond){ . . . }” refers to the result of the description “def”, the processing step is ended. 2-2) In a case where the condition of the description “pred(cond){ . . . }” does not refer to the result of the description “def”, a branch to the processing step 1) is done.
As the deletion process for the redundant statement, in the second place, the variable as to which the description “use” does not exist in any state transition is deleted.
In the redundant statement deletions for the variable table in
Another aspect of the optimization process is the deletion of any local variable. As the deletion process for the local variable, in the first place, each of the following processing steps 1)-3) is executed rightwards sequentially until no change comes to occur, in the state transition column of each variable:
1) In a case where the description “use” exists posteriorly to the description “def” without holding the description “pred(cond){ . . . }” therebetween, a substep 1-1), 1-2), 1-3) or 1-4) is performed. 1-1): In a case where the description “use” itself is the description “use@pred”, an assignment operation is executed, and the description “def” is deleted. 1-2): In a case where a variable in the description “@” is the local variable and where it is used as the description “use@pred”, an assignment operation is not executed. 1-3): In a case where a variable in the description “@” is a local variable and where it is not used as the description “use@pred”, an assignment operation is executed, and the description “def” is deleted. 1-4): In a case where a variable in the description “@” is an argument, an assignment operation is executed, and the description “def” is deleted.
2) In a case where the description “use” exists posteriorly to the description “def” with the description “pred(cond){ . . . }” held therebetween, and where a variable used in the condition of the description “pred(cond){ . . . }” is an argument, the substeps 1-1) through 1-4) are applied.
3) In a case where the description “use” exists posteriorly to the description “def” with the description “pred(cond){ . . . } ” held therebetween, and where a variable used in the condition of the description “pred(cond){ . . . }” is the local variable, a substep 3-1) or 3-2) is performed. 3-1): In a case where the condition of the description “pred(cond){ . . . }” does not refer to the result of the description “def”, the substeps 1-1) through 1-4) are applied. 3-2): In a case where the condition of the description “pred(cond){ . . . }” refers to the result of the description “def”, an assignment operation is not executed.
As the deletion process for the local variable, in the second place, the variable as to which the description “def” does not exist in any state transition is deleted, and a CFG after an assignment operation is analyzed again, thereby to update a variable table.
The variables to be deleted in the local variable deletions for the variable table in
Exemplified in
As the optimization of codes, the simplification of arithmetic formulae as exemplified in
<<State Machine Generation—Retain Analysis>>
Now, the description shall refer again to the example of the circuit design which satisfies the specifications in
The algorithm of the “retain” analysis is exemplified in
The diagram shown in
Here, the “highest-level node” signifies all of nodes to the node of the description “def” or “use” at the shortest distance from the root of the tree, and the brother nodes thereof.
In a case, for example, where the information of the variable “var” in the state transition STn−>STm as based on a variable table is pred(cond—0){pred(cond—1){use@var—1} [j], pred(cond—2){def[k], pred(cond—3){def[s]}}}, the diagram becomes as shown in
Exemplified in
Actual codes which are to be added to the parts “retain” in the variable table can be acquired from the variable table. More specifically, in a process for information acquisition from the variable table of the “retain” analysis result, output variables and local variables as to which the information “retain” is inserted in the columns of the variable table are acquired. By way of example:
<<State Machine Generation—State Machine Extraction>>
Next, the state machine extraction process S5D will be described. In the state machine extraction process S5D, search is made by the depth-first search from each assigned state till arrival at a clock boundary, namely, at a state which is not an initial state, the information of a node which is not any of a loop, a conditional branch and a label branch obtained by the search is acquired, and the acquired information is merged with the “retain” information of the variable table, thereby to extract a state machine for use in a HDL description. An example of a start state ST0 is shown in
Especially, regarding the variable to which the description “nxt_”has been affixed by the “retain” information, the state machine for the HDL description is extracted using a variable name bearing the description “nxt_”, not the original variable name. Besides, the “&” operation between a signal and a constant has been used for the bit width analysis and has become unnecessary, so that it is deleted. Incidentally, the constant is converted into the binary notation of HDL in consideration of the number of bits of the left hand of an input, so as to conform to the HDL description.
In the acquisition of the “retain” information of the variable table, from among individual state transition columns, there are acquired all columns in which the same state as at the start of the depth-first search is a start state, and it is identified whether the “retain” information depends only upon the start state or also upon an arrival state, or it depends upon the arrival state and a branch condition. Except in a case where the “retain” information depends only upon the start state, the description “pred( )” of the “retain” information is compared with the branch condition of the CFG, whereby an assignment formula stored in the variable table is inserted into the appropriate position of the HDL code as the “retain” information. Exemplified in
Acquired examples of state machine descriptions conforming to the HDL description, in the start state ST0 are shown in
<<HDL Description Generation Process>>
In the HDL description generation process S6, a module declaration generates an HDL description which is obtained in such a way that symbols * expressive of a type and a pointer are deleted from a function declaration in the C description as contains the circuit operation description part, and that descriptions “clk” and “reset_n” are added to the resulting declaration. An input/output declaration is generated as an HDL description in such a way that a variable which is an argument in the function declaration and which exists only at the left hand of an assignment formula is set as an output, while a variable which exists only at the right hand of the assignment formula is set as an input, and the bit width of the HDL description is identified by the method explained in the descriptive contents of the C description. A “reg” declaration is generated as an HDL description together with the “reg” specification statement of the descriptions “clk” and “reset_n”, in such a way that variables finally left in the conversion processing thus far performed, and variables added in the conversion processing thus far performed are identified among the local variables stated in the C description. The HDL description of the “wire” declaration of a variable allotted to a branch condition in the CFG generation process is generated, so as to generate an HDL description which contains the assignment statement of the branch condition for the allotted variable. Also, the HDL description of a parameter specification statement for expressing an assigned state as a binary number is generated.
Besides, regarding register assignment statements, all the register assignment statements and variable declarations at the right hands thereof are acquired. Ina case, for example, where the acquired information items are:
the following HDL descriptions are generated:
Subsequently, reference is had to the storage of a variable bearing the description “nxt_” as obtained in the state machine extraction part, and the declaration part of the variable is acquired. In case of this example, “a_tmp” is pertinent, and the declaration part is:
At the generation of the “reg” declaration description, the effective bit width has been known 15 bits from the assignment:
Therefore, the following description is generated:
Besides, the HDL descriptions of the extracted state machines are joined. For the left hands of the assignment statements in the respective states, statements are created in which corresponding variables of “_o” are assigned to the variables of the left hands of the register assignments and the variables added in the register assignment statement identifying part, while initial values are assigned to the other variables. Also, a statement “nxt_state=ST0” is created. Parts corresponding to the defaults of “case” statements are created, and they are also joined. The variables of the right hands, and the variables of “wire” declaration are arrayed through “or”s, thereby to generate the following description:
The joined HDL descriptions are inserted between the “case” statements, and a description “endmodule” is affixed to the last line. Thus, the HDL description generation is completed. The Nos. of lines are merely added.
The HDL descriptions generated by the HDL description generation process S6 are exemplified in
According to the design method thus far elucidated, functions and advantages to be stated below are attained.
Pseudo C descriptions in which clock boundaries are explicitly inserted into C descriptions are input, thereby to realize parallel descriptions of statement level based on register assignment statements, so that a pipeline operation attended with a stall operation can be represented.
Since functions can be designed at a program level without caring about state machines, the quantity of descriptions is decreased, so that the design method contributes, not only to shortening the term of a development, but also to enhancing a quality.
Besides, it is permitted to describe a bus interface circuit and an arbitration circuit which cannot be represented by the general descriptions of program level as do not designate the clock boundaries. Especially, since register assignments are describable, descriptions can be made in consideration of parallelism at the statement level, and a complicated circuit operation such as the pipeline operation attended with the stall operation can be easily described with a smaller quantity of codes than in the C descriptions.
Besides, since the pseudo C descriptions are converted into the C descriptions which are compilable by a conventional C compiler, a high-speed simulation is realized, and the number of man-hour for verifying functions can be sharply diminished. In the function design, accordingly, sharp diminutions in the number of man-hour are realized in both the logic design and the logic verification.
The design method is applicable to the development of, for example, a cache controller or a DMA controller of which a cycle precision is required and for which a high-level synthetic tool is unsuitable, and it is greatly contributive to shortening the term of the design.
Although the invention made by the inventors has been concretely described above in conjunction with the embodiments, the present invention is not restricted thereto, but it is, of course, variously alterable within a scope not departing from the purport thereof.
By way of example, the program descriptions and circuit descriptions explained before are merely exemplary, and they can be applied to various logic designs. The HDL is not always restricted to the RTL. The program description language is not restricted to the C language, but it may well be any other high-class language. Further, it is possible to employ a virtual machine language such as “Java” (registered trademark).
The present invention is extensively applicable to the design of a CPU and the like logic circuits.
Number | Date | Country | Kind |
---|---|---|---|
2002-300073 | Oct 2002 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP03/12839 | 10/7/2003 | WO | 4/14/2005 |