WO2015075805A1 - ソースコード分割方法及びlsi実装装置 - Google Patents

ソースコード分割方法及びlsi実装装置 Download PDF

Info

Publication number
WO2015075805A1
WO2015075805A1 PCT/JP2013/081462 JP2013081462W WO2015075805A1 WO 2015075805 A1 WO2015075805 A1 WO 2015075805A1 JP 2013081462 W JP2013081462 W JP 2013081462W WO 2015075805 A1 WO2015075805 A1 WO 2015075805A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
source code
link
divided
processing
Prior art date
Application number
PCT/JP2013/081462
Other languages
English (en)
French (fr)
Inventor
田中 和彦
稲田 圭介
佐々本 学
浩朗 伊藤
小味 弘典
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2013/081462 priority Critical patent/WO2015075805A1/ja
Publication of WO2015075805A1 publication Critical patent/WO2015075805A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/39Circuit design at the physical level
    • G06F30/392Floor-planning or layout, e.g. partitioning or placement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/39Circuit design at the physical level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design

Definitions

  • the technical field relates to the layout of integrated circuit elements.
  • Patent Document 1 states that “in the conventional design method, floor planning is performed based on a logical hierarchy in which timing is not taken into account, so that these modules may be arranged apart from each other so as not to satisfy timing.
  • a gate-level netlist is obtained by logically synthesizing RTL-level design data.
  • Timing information is obtained by performing temporary wiring static timing analysis based on the obtained timing information and the gate-level netlist, and the timings between the flip-flops that are the start point and the end point, and between the flip-flops.
  • the unit to be created is defined as a floor plan module, and the entire physical circuit is grouped again based on the floor plan module, and the floor plan is performed based on the floor plan module, and a clock buffer is provided for each floor plan module.
  • the clock topology that minimizes the local clock skew in each floor plan module is constructed "(see Patent Documents 1 [0017] and [0018]).
  • Patent Document 1 does not consider the occurrence of a new critical path due to the rearrangement of elements.
  • the present application includes a plurality of means for solving the above-mentioned problems. For example, the processing contents of the source code described in the hardware description language are analyzed, and the data transfer between the nodes indicating the execution of the processing is performed.
  • a step of generating a directed graph configured as a collection of directed links having a direction indicating a direction, a step of dividing nodes included in the generated directed graph into two or more node groups, and 2 Extracting a description corresponding to a node included in the node group generated by the step of dividing the node group into two or more node groups, and combining them to generate a post-split source code corresponding to the node group;
  • the node includes a register node corresponding to the flip-flop in the source code and other nodes, and two nodes
  • the source node is directly connected from the register output link that is a link from the register node to another node or the input terminal link that is a link from the input terminal of the target circuit to another node. It is characterized in that it is divided into two or more node groups by disconnecting the link.
  • Example of conversion flow from verilog source to CDFG Example of circuit to be converted Verilog description example of conversion target circuit
  • Example of preprocessor processed file CDFG
  • Example of tree join processing flowchart Example of CDFG after binding
  • Example of processing flow of scheduling process Example of processing flow of sched_node function Provisional substep assignment example
  • Substep number adjustment example Example of CDFG after scheduling
  • Example of CDFG after scheduling Example of LSI mounting flow
  • Example of CDFG cone division (no overlap) Example of CDFG cone division (with overlap)
  • Example of verilog source code after grouping Example of verilog source code after grouping (upper hierarchy)
  • Example of grouping Example of code converter configuration
  • the nodes included in the graph are divided into several node groups based on the connection information between the nodes included in the graph. Thereafter, by arranging the circuits corresponding to each group in individual areas on the LSI in units of groups, the wiring length between elements included in the same group is shortened. When dividing the group, the output signal of the flip-flop is selected as the division position.
  • the grouping is performed in consideration of not only a part of elements included in the critical path but also the entire circuit, so that the mounting process can be quickly converged with little rework at the time of remounting. Is possible.
  • the number of gate stages in the group is increased compared to the case of dividing by the signal in the middle of the path between the flip-flops. Wide choice of methods.
  • FIG. 26 is an example of the LSI mounting design apparatus 1 according to the first embodiment.
  • the LSI mounting design apparatus 1 is configured by connecting a CDFG generation unit 2, an LSI mounting unit 3, a CPU 610, a memory 611, a recording unit 612, an input unit 613, and an output unit 614 via a bus 620. ing.
  • the CDFG generation unit 2 analyzes internal processing and data flow from the circuit data described in the hardware description language input from the input unit 613, and generates data having a graph structure called CDFG (Control Data Flow Graph). To do. Details of CDFG will be described later.
  • the LSI mounting unit 3 performs mounting processing such as logic synthesis and placement and routing on the circuit data input from the input unit 613, and generates final LSI design data (GDS2 and the like). In the present invention, the CDFG generated by the CDFG generation unit 2 is used when performing this mounting process.
  • the CDFG generation unit 2 is configured by connecting a preprocessor processing unit 600, a lexical analysis processing unit 601, a syntax analysis processing unit 602, a tree join processing unit 603, and a scheduling processing unit 604 via a bus 620. .
  • the preprocessor processing unit 600, the axis analysis processing unit 601, the syntax analysis processing unit 602, the tree join processing unit 603, and the scheduling processing unit 604 are mounted on the LSI packaging design apparatus 1 as hardware as illustrated in FIG. can do.
  • Each of the processing units 600 to 605 has the preprocessor program 600, the lexical analysis program 601, the syntax analysis program 602, the tree combination program 603, and the scheduling program 604 recorded in the recording unit 612 developed in the memory 611 by the CPU 610. Then, the CPU 610 may execute the developed programs so that the functions of the processing units are exhibited, and the programs may be installed in the LSI mounting design apparatus 1 as software.
  • each processing unit will be described as performing each processing mainly. Note that when each processing unit is realized by software, each processing unit realized by the CPU 610 executing the various programs will be described as the main body of each processing.
  • the preprocessor processing unit 600 performs preprocessor processing such as macro replacement and comment removal from the input source and header file.
  • the lexical analysis processing unit 601 performs lexical analysis processing on the preprocessor-processed file and divides it into units called tokens.
  • a token is a character string of the smallest unit that does not have its original meaning if it is further divided.
  • the syntax analysis processing unit 602 performs syntax analysis processing.
  • the parsing process is a process of generating a CDFG tree that is a partial CDFG structure from a token sequence corresponding to each line (or a block that is a block of several lines) of the verilog source code.
  • the tree join processing unit 603 performs a tree join process.
  • the tree combining process is a process of combining a plurality of CDFG trees into one CDFG.
  • the scheduling processing unit 604 performs ordering of each node, that is, scheduling processing in order to sequentially convert each node into a C language source code while maintaining the dependency of each processing.
  • FIG. 1 is a conversion flow from a source code described in a hardware description language to CDFG in this embodiment.
  • step 501 is expressed as S501.
  • description will be made by taking verilog as an example of the hardware description language, but the present invention is not limited to this.
  • FIG. 2 shows a circuit to be converted in this embodiment.
  • the conversion target circuit 20 includes a multiplier 21, adders 22 and 25, and flip-flops 23 and 24.
  • the flip-flops 23 and 24 operate at the rising edge of the clock signal clk, and the output is reset to 0 when the asynchronous reset signal rst_n is set to the Low level.
  • the circuit 20 is divided into two pipeline stages by flip-flops 23 and 24.
  • the left side of the flip-flops 23 and 24 is stage 0, and the right side is stage 1. Stages are sometimes expressed in terms of steps in the field of behavioral synthesis.
  • FIG. 3 shows an example in which this circuit is described in verilog.
  • the numbers on the left are line numbers and are not included in the source code. Since this list conforms to verilog, detailed description of each part will be omitted.
  • FIG. 4 shows a header file read by the include statement on the second line in FIG.
  • the header failure contains macro definitions.
  • the verilog source code 10 and the header file 11 are subject to conversion processing in this embodiment.
  • both the source code 10 and the header file 11 are realized by a single file, but may be constituted by a plurality of files or the header file 11 may not exist. .
  • Preprocessor processing S500 In the preprocessor processing S500 in FIG. 1, the preprocessor processing unit 600 reads the verilog source code 10 and the header file 11, and performs processing such as macro replacement and comment removal. An example of the preprocessor-processed file 12 that is the output of the preprocessor process S500 is shown in FIG. If the preprocessor processing is performed, the line number may change. If the correspondence between the line numbers before and after the preprocessor processing is tabulated and recorded in the recording unit 612, the corresponding rows can be easily obtained before and after the preprocessor processing. To be able to search.
  • FIG. 6 shows an example of the structure of CDFG.
  • FIG. 6A is a verilog source code to be converted in this example, and corresponds to the assign statement on the 32nd line in FIG. According to this verilog source code, after the signals a [15: 0] and b [15: 0] are multiplied, the signal x [15: 0] is added to the value obtained as a result of the multiplication. Has been.
  • FIG. 6 (b) is obtained by converting the verilog source code of FIG. 6 (a) into CDFG.
  • each process to be executed is represented by a node, and each node is connected by an arrow having a direction to form a graph structure as shown in FIG.
  • FIG. 6C shows an example of CDFG structure field information.
  • attribute information 40 for each node is stored.
  • the attribute information 40 includes an ID number 41, a node type 42, a signal name 43, bus information 44, inputs 45 to 47, st48, and sst49.
  • CDFG may be implemented by any method, but here it is implemented as a set of C language structures having a link structure.
  • signals a [15: 0], b [15: 0], and x [15: 0] correspond to the nodes 30, 31, and 32, respectively.
  • ID numbers 41 are assigned to these nodes as “1”, “2”, “3”, and the node type 42 is an identifier such as a signal name. It is “ID” indicating that there is.
  • the multiplication in the verilog source in FIG. 6A corresponds to the node 33, and the addition corresponds to the node 34.
  • the ID numbers 41 of the nodes 33 and 34 are “4” and “5”, respectively, and the type 42 is stored as “MULT” indicating multiplication and “ADD” indicating addition. .
  • the signals a [15: 0] and b [15: 0] are applied to the inputs 0 and 1 of the node 33, respectively.
  • ID numbers “1” and “2” indicating “” are stored as link information.
  • the ID numbers “4” and “3” indicating the node 33 and the node 32 are stored as link information in the inputs 0 and 1, respectively.
  • the output signal name s of the node 34 is specified by the verilog source code of FIG.
  • st48 and sst49 in this table mean steps and sub-steps, respectively.
  • the step is a concept corresponding to the pipeline stage in FIG.
  • the sub-step is a unit obtained by further subdividing the step, and details will be described later.
  • the value of the sub-step is determined in the scheduling process S504, and is not fixed at the time point before that, and is described as “ ⁇ ” in FIG. 6C. If CDFG is used in this way, it is possible to express data flow and control flow.
  • FIG. 7 is an explanatory diagram of lexical analysis and syntax analysis.
  • FIG. 8 is an explanatory diagram of syntax analysis and CDFG generation.
  • the preprocessor-processed file 12 is divided into units called tokens in the lexical analysis processing 501 by the lexical analysis processing unit 601.
  • Lex is famous as a tool for performing the lexical analysis processing S501, and the lexical analysis processing S501 in the present embodiment can also be realized by using lex. Since the usage is described in various documents, description thereof is omitted here.
  • a tool other than lex can be used, and the present invention is not limited to the case where lex is used.
  • syntax analysis processing unit 602 performs syntax analysis processing S502 on the token string obtained in the lexical analysis processing 501.
  • famous yacc is used as a syntax analysis tool.
  • a tool other than yacc can be used as described above, and the present invention is not limited to this. Absent.
  • the syntax of the language to be processed is prepared in advance as pattern information, and pattern matching is performed sequentially on the token strings. If they match, the rules defined in advance are supported. It will be in the form of performing processing.
  • matching is performed while sequentially scanning the given token sequence from the left, and the token sequence s [15: 0] is matched first (matching 50).
  • a rule is specified so as to generate a node whose node type is ID
  • a node s is generated as in the matching 50 of FIG.
  • node a and node b are generated by matching 51 and 52.
  • a multiplication node is generated and connected to the nodes a and b.
  • a node x is generated, and in the next matching 55, an addition node is generated and connected to the multiplication node and the node x.
  • the node on the left side and the node on the right side are joined by matching 56 to complete the CDFG tree corresponding to this row.
  • FIG. 9 is an example of a plurality of CDFG trees generated by sequentially performing the lexical analysis processing S501 and the syntax analysis processing S502 on the other lines of FIG.
  • the input / output port definitions on lines 9 to 15 in FIG. 5 are converted to the input / output nodes in FIG.
  • the node type 42 of the input signal is “IN”
  • the node type 42 of the output signal is “OUT”.
  • Bidirectional input / output ports are described by dividing them into two ports with node types 42 of “IN” and “OUT”.
  • the flip-flop description on lines 21 to 30 in FIG. 5 is converted as shown in FIG. 9B.
  • the flip-flop is expressed by two nodes on the input side and the output side, and the respective node types 42 are “FF0” and “FF1”.
  • the value of “FF0” is transferred to “FF1” at the rising edge of the clock.
  • the tree join processing unit 603 performs a tree join process S503. However, not all nodes are necessarily integrated into one CDFG. This process is a process of deleting a node whose node type is ID in each CDFG tree of FIG. 9 and switching to the original link destination.
  • FIG. 10 is an example of a flowchart of the tree joining process.
  • step 701 is expressed as S701.
  • a variable i for designating the ID number of each node is initialized to 0 (S702).
  • a node i whose node ID number is equal to i is searched for, and the node information is read (S703).
  • the original link destination is searched.
  • a variable j for designating the ID number of the link destination node is initialized to 0 (S705).
  • a node j whose node ID number is equal to j is searched for, and the node information is read (S706).
  • node j If the type of node j is not ID, OUT, or FF0, the signal names of node i and node j are compared (S708). If both are equal, node j is the original link destination, so all the nodes are scanned, and the link destination of the link whose link destination is node i is changed to all nodes j (S711). Thereafter, by deleting the node i, the node link destination changing process is completed. In S708, if the signal names do not match, the processing from S709 to S710 is performed.
  • FIG. 11 shows the result of performing the tree join processing S503 for all the nodes in FIG.
  • the scheduling processing unit 604 performs ordering of each node, that is, scheduling processing S504.
  • “Scheduling” here refers to scheduling that is a finer unit than the scheduling in units of clock cycles such as steps used in behavioral synthesis, and in order to realize this, a virtual time unit called a substep is introduced here.
  • a step may be abbreviated as st and a sub step may be abbreviated as sst.
  • scheduling is performed on the assumption that each node uses a time corresponding to one substep for execution of processing regardless of the node type.
  • FIG. 12 is an example of the overall flow of the scheduling process S504.
  • FIG. 13 is an example of a processing flow of the function sched_node that is recursively called from S725 in the flow of FIG.
  • the scheduling process S504 can be divided into a first half process for setting a temporary substep number for each node and a second half process for adjusting a temporary substep number to determine a final substep number.
  • Substep number 0 is set for the output node (OUT) and the input node (FF0) of FF.
  • the process 2 is recursively executed while sequentially tracing the nodes to the input side.
  • the first half (S722 to S727) of the scheduling process S504 in FIG. 12 corresponds to the process “1.”, and the function “sched_node” in FIG. 13 is recursively called and executed as the process “2.”.
  • the substep number to be set for the target node as one of the arguments.
  • the example in FIG. 13 assumes a case where the number of inputs at each node is three at the maximum, but the present invention is not limited to this.
  • FIG. 14 is an example of a state in which a temporary substep number is set for each node of the CDFG in FIG. 11 by the above procedure.
  • the numbers enclosed in pentagons are the substep numbers of each node. Since the sub step number is set while sequentially subtracting 1 from “0”, the sub step number is a number equal to or less than “0”.
  • the sub-step number of the node 40 is “ ⁇ 1” when the node 43 is traced and “ ⁇ 2” when the node 42 or 44 is traced. However, the sub-step number is finally determined by the processing of S732 to S734 in the function sched_node. “ ⁇ 2” which is the smallest value is set.
  • S760 and S761 performed at the beginning of the second half of the scheduling process 504 are processes for setting all substep numbers to a value of “0” or more.
  • S760 is a process of searching for the smallest value (sst_min) among all the substep numbers.
  • sst_min the smallest value
  • sst_min ⁇ 3
  • S761 the value of sst_min is subtracted from the value of the sub step number for all nodes.
  • FIG. 15 is an example of the result of performing the above processing on the CDFG of FIG.
  • S762 is performed, and the sub-step number of the input node and the output node (FF1) of FF is set to 0.
  • This processing is not essential, but there is an advantage that the illustrated CDFG is easy to see by aligning the timing of input and flip-flop update.
  • FIG. 16 is an example of CDFG in which the CDFG after S762 is arranged so that the same substep numbers are arranged in the same column, and the nodes having the same step number are grouped and rewritten. This is the CDFG in the state where the scheduling process S504 is completed.
  • FIG. 17 shows the field information of the CDFG structure after scheduling of the portion corresponding to FIG. Compared with FIG. 6C, it can be seen that the value of sst is stored and that the top three nodes are replaced with the combined nodes by the tree combination processing. Since the step number and substep number are held in the CDFG in this way, the source code of the hardware description language is generated from the step number from here, or the source code of the programming language is used by using the substep number. It is also possible to generate a language conversion hub as a CDFG.
  • the LSI mounting unit 3 includes a logic synthesis unit 800, a placement and routing unit 801, a timing analysis unit 802, an area division unit 803, and a mounting file generation unit 804. Note that, similar to the CDFG generation unit 2, each of these processing units may be realized by hardware, or may be realized by software operating on the CPU 610.
  • the area dividing unit 803 reads the verilog source file 10, the header file 11, and the CDFG file 14, and divides the circuit described in the verilog source file 10 into a plurality of modules based on the information stored in the CDFG file. .
  • the number of divisions may be set by a human, or a method may be used in which division is performed until the circuit scale of each module is equal to or less than a specified threshold value.
  • the circuit scale of each module may be estimated by weighting each node of the CDFG based on the operation type and totaling it, or may be fed back from the result of synthesis performed in the subsequent flow.
  • a method for realizing the division processing using CDFG will be described later.
  • the area dividing unit 803 After the division process is performed, the area dividing unit 803 generates a verilog source file 17 corresponding to the two modules after the division and the modules in the higher hierarchy.
  • the logic synthesis unit 800 performs logic synthesis on each source file using a commercially available logic synthesis tool sold by an EDA vendor or an FPGA vendor, and after synthesis of three corresponding to the source file 17 Get a netlist.
  • a specific processing algorithm of the logic synthesis tool is not described here because it is not the essence of the present invention.
  • the placement and routing unit 801 performs placement of circuit elements and wiring processing between elements using a commercially available placement and routing tool sold by EDA vendors and FPGA vendors.
  • a commercially available placement and routing tool sold by EDA vendors and FPGA vendors.
  • the size and position of the area may be specified by a human or the placement and routing tool may automatically determine.
  • the placement and routing tool is automatically selected for the sake of simplicity. It is assumed that a decision is made.
  • this patent is also effective when a person specifies the size and position of an area.
  • the placement and routing processing of the present embodiment after first determining areas for placing two modules, the placement of each module is optimized within each area. This time, in order to achieve the target operating frequency, optimization is performed so that the distance between elements connected to each other in each module is as short as possible.
  • the placement and routing tool next performs wiring processing to connect the elements. A description of a specific processing algorithm of the placement and routing tool will be omitted.
  • timing analysis is performed to confirm whether or not the next target operating frequency is satisfied. A detailed description of the processing contents of timing analysis is also omitted.
  • the LSI mounting data 19 is a file storing mask pattern information when the target LSI is an ASIC, and is information for configuration when the target LSI is an FPGA. Thus, the LSI or FPGA mounting flow is completed.
  • FIG. 3 A verilog source code corresponding to this circuit is shown in FIG. 3, and a CDFG generated from this source code is shown in FIG.
  • FIG. 17 a format as shown in FIG. 17 so as to be easily processed.
  • the nodes that are the sources of the respective nodes are grouped while going back from the node at the lower stage of the CDFG, that is, the output node (OUT) and the input node (FF0) of the FF.
  • a group is called a cone
  • the output node (OUT) and the input node (FF0) at the bottom are collectively called a sink node.
  • the uppermost node that is, the input node (IN) and the output node (FF1) of the FF are not included in the cone.
  • the input node (IN) at the top and the output node (FF1) of the FF are collectively referred to as a source node.
  • FIG. 19 shows the result of generating cones for all the sink nodes included in the CDFG of FIG.
  • each cone 70 to 73 is exclusive, but in an actual circuit, each cone is not necessarily exclusive.
  • cones 71 and 74 overlap at the node 33, and these cones are not exclusive.
  • the cone 74 in FIG. 20 becomes like the cone 74a in FIG. It is possible to make each cone exclusive.
  • each cone becomes exclusive by the above method, each cone is then grouped.
  • the method of dividing the cone into two groups will be described here. It is also possible to divide the circuit into any number of groups.
  • the FF1 node is considered to be included in a cone including the corresponding FF0.
  • the FF1 node 1000 of X is regarded as belonging to the cone 71 including the corresponding FF0 node 1001. Since there are 16 lines between the FF1 node 1000 of X and the cone 72, the connection between the cones 71 and 72 is defined to be 16. Similarly, the connection between the cones 72 and 73 is 8.
  • FIG. 22 shows the grouping status on the circuit diagram.
  • the upper side of the broken line 75 corresponds to the group 0, and there are circuits corresponding to the cones 70 and 73.
  • the lower side corresponds to group 1 and there are circuits corresponding to cones 71 and 72.
  • each node of CDFG corresponds to the verilog source code, it is possible to save the line number of the verilog source code corresponding to each node as attribute information when generating the CDFG.
  • the node 33 in FIG. 19 corresponds to the 32nd line in FIG. It can be seen that this corresponds to the 37th line in FIG. 3 using the line number correspondence table created when the preprocessor process 500 is executed.
  • the original verilog source code is divided into two source files 10a and 10b for each group, and each module is called from the source file 10c.
  • the module name of each module after division is changed to a module name obtained by adding a unique suffix to the original module name.
  • Each module has an extension to the new module name.
  • a file name with “v” is added and stored in the recording unit 612.
  • the node 33 in FIG. 19 belonging to the group 0 corresponds to the 37th line in FIG. 3, but this line appears in the 30th line of the source file 10a corresponding to the group 0.
  • the method of the present embodiment has an advantage in that the grouping can be performed without dividing the verilog source code within the line because the group is divided by the output of the flip-flop. There may be a case where group division is performed with the output link of the node 33 when the divided part of the group is an arbitrary link, but in this case, the 37th line in FIG. 3 is divided into two groups. A bad case can occur.
  • FIG. 25A shows a part of the optimization target circuit, and the data stored in the flip-flop 0 is propagated to the flip-flop 1 through the processing by the five combinational circuits AE.
  • the propagation from the flip-flop 0 to the flip-flop 1 needs to be performed within 10 ns corresponding to the clock cycle.
  • the group is always divided only immediately after the flip-flop by the method of this embodiment, it can be set to 10 ns for the entire combinational circuit AE as shown in FIG.
  • the setting of can be greatly simplified.
  • circuit optimization across the combinational circuits B and C cannot be performed, so that the optimization of the path between registers is restricted.
  • the combinational circuit B is a two-input OR gate and the combinational circuit C is also a two-input OR gate
  • the number of gate stages can be reduced by replacing it with a three-input OR gate.
  • the present invention requires a programmable circuit element, such as an FPGA, by programming it in advance.
  • the present invention can also be applied to a type of LSI that realizes various functions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Architecture (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

 集積回路全体を考慮した素子のレイアウトを行うためにハードウェア記述言語で記述された前記集積回路のソースコードを分割する方法であって、前記ソースコードの処理内容を解析し、処理の実行を示すノード間のデータの転送方向を示す向きを持った有向リンクの集合体として構成される有向グラフを生成するステップと、前記有向グラフに含まれるノードを、レジスタノードから他のノードへ向かうリンクであるレジスタ出力リンクまたは対象回路の入力端子からの他のノードへ向かうリンクである入力端子リンクから構成されるソースノード直結リンクを切断することで2つ以上のノードグループに分割するステップと、前記ソースコードから前記各ノードグループに含まれるノードに対応する記述を抽出し、それらを結合して前記各ノードグループに対応した分割後ソースコードを生成するステップとを備える。

Description

ソースコード分割方法及びLSI実装装置
 技術分野は、集積回路の素子のレイアウトに関する。
 特許文献1では、「従来の設計方法では、タイミングが考慮されていない論理階層に基づいてフロアプランを行うため、それらのモジュールがタイミングを満足しない程度に離れて配置されることがあるという問題点がある」(特許文献1[0014])こと等を課題とし、その解決手段として「RTLレベルの設計データを論理合成することによって、ゲートレベルのネットリストを得る。そのゲートレベルのネットリストに対して仮配線静的タイミング解析を行うことによって、タイミング情報を得る。得られたタイミング情報および前記ゲートレベルのネットリストに基づいて、始点および終点となる各フリップフロップと、それらフリップフロップの間のタイミングパス上に存在するゲートとからなる閉じたタイミンググループを構成する単位を、フロアプランモジュールとして定義する。そして、フロアプランモジュールに基づいて物理回路全体をグループ化し直し、フロアプランモジュールに基づいてフロアプランを行う。また、フロアプランモジュールごとにクロックバッファを設け、各フロアプランモジュール内の局所的なクロックスキューが最小になるようなクロックトポロジを構築する。」(特許文献1[0017]、[0018]参照)ことが記載されている。
特開2008-71000
 しかし、特許文献1では、素子の再配置により新たなクリティカルパスが生じることを考慮していない。
 上記課題を解決するために、例えば特許請求の範囲に記載の構成を採用する。
  本願は上記課題を解決する手段を複数含んでいるが、その一例を挙げるならば、ハードウェア記述言語で記述されたソースコードの処理内容を解析し、処理の実行を示すノード間のデータの転送方向を示す向きを持った有向リンクの集合体として構成される有向グラフを生成するステップと、生成した有向グラフに含まれるノードを、2つ以上のノードグループに分割するステップと、ソースコードから、2つ以上のノードグループに分割するステップによって生成されたノードグループに含まれるノードに対応する記述を抽出し、それらを結合してノードグループに対応した分割後ソースコードを生成するステップと、を備え、ノードはソースコード中のフリップフロップに対応するレジスタノードとそれ以外の他のノードとを含み、2つ以上のノードグループに分割するステップにおいて、レジスタノードから他のノードへ向かうリンクであるレジスタ出力リンクまたは対象回路の入力端子からの他のノードへ向かうリンクである入力端子リンクから構成されるソースノード直結リンクを切断することで2つ以上のノードグループに分割することを特徴とする。
 上記手段によれば、集積回路においてより低遅延な素子の配置を実現できる。
verilogのソースからCDFGへの変換フロー例 変換対象の回路例 変換対象回路のverilog記述例 変換対象回路のverilog記述から呼び出されるヘッダーファイルの例 プリプロセッサ処理済みファイルの例 CDFGの例 字句解析、構文解析の説明図 構文解析およびCDFG生成の説明図 生成されたCDFGツリー群の例 ツリー結合処理のフローチャートの例 結合後のCDFGの例 スケジューリング処理の処理フローの例 sched_node関数の処理フローの例 暫定サブステップ割り当て例 サブステップ番号調整例 スケジューリング後のCDFGの例 スケジューリング後のCDFGの例 LSI実装フローの例 CDFGのコーン分割の例(オーバーラップ無し) CDFGのコーン分割の例(オーバーラップ有り) CDFGのコーン分割の例(オーバーラップ有り) グループ分け後の回路例 グループ分け後のverilogソースコードの例 グループ分け後のverilogソースコードの例(上位階層) グループ分けの例 コード変換装置の構成の例
 LSI(Large Scale Integration)を実装する際に、要求された動作周波数で動作させるためには各フリップフロップ間のパスの最大遅延時間などのタイミングスペックを満足することが必要である。近年、LSIの微細化の進捗に伴い、素子間の配線遅延がパス全体の遅延時間に占める割合が大きくなってきている。これに伴い、回路素子の配置を最適化することで、タイミングクリティカルパス上にある回路素子間の配線長を短くし、配線遅延を低減することが重要となってきている。
 実際のLSIではフリップフロップ間のパスの組み合わせは大量に存在する。そのため、タイミングがクリティカルなパスに限定してそのパスに含まれる素子の配置を制御する方法を採ると、タイミングがクリティカルでないパスについては、配置時に考慮されない。そうすると、素子が分散して配置され、新たなクリティカルパスとなってしまう可能性がある。このように、タイミングがクリティカルである一部のパスを対策して、逐次潰していく方式では再実装を行う度にクリティカルパスの発生場所が変化してしまうことがあり、実装処理が収束しない可能性がある。
 以下の実施例では、対象回路全体をグラフ構造に変換した上で、グラフに含まれるノード間の接続情報に基づいて、グラフに含まれるノードをいくつかのノードグループに分割する。その後、各グループに対応した回路を、グループ単位でLSI上の個別の領域に配置していくことで、同一グループ内に含まれる素子間の配線長を短くする。グループを分割する際には、フリップフロップの出力信号を分割位置として選択するようにする。
 以下の実施例によれば、クリティカルパスに含まれる一部の素子だけでなく、回路全体を考慮した上でグループ分けを行うため、再実装時の手戻りが少なく速やかに実装処理を収束させることが可能となる。
 また、フリップフロップの出力信号でグループの分割を行うことによって、フリップフロップ間のパスの途中の信号で分割した場合と比較して、グループ内のゲート段数が多くなるため、使用可能な論理最適化手法の選択肢が広くなる。
 また、分割後の前後パスへのタイミング予算配分処理が不要となるため、タイミング制約を掛けやすい。また、フリップフロップの出力信号は論理合成前のRTLの回路記述に明示的な信号として存在しているため、RTLの回路記述を対象としたグループ分割を実施できる。
  以下、図面を用いて本実施例について説明する。
  図26は、実施例1にかかるLSI実装設計装置1の一例である。
 LSI実装設計装置1は、CDFG生成部2とLSI実装部3、CPU610と、メモリ611と、記録部612と、入力部613と、出力部614とが、バス620を介して接続されて構成されている。CDFG生成部2は入力部613から入力されたハードウェア記述言語で記述された回路データから、内部の処理やデータフローを解析して、CDFG(Control Data Flow Graph)と呼ばれるグラフ構造のデータを生成する。CDFGの詳細については後述する。LSI実装部3は、入力部613から入力された回路データに対して、論理合成、配置配線等の実装処理を行い、最終的なLSIの設計データ(GDS2等)を生成する。本発明ではこの実装処理を行う際に、CDFG生成部2で生成したCDFGを使用する。
 次に、図26の各部の動作を説明する。
  最初にCDFG生成部2の動作について説明する。CDFG生成部2は、プリプロセッサ処理部600と、字句解析処理部601と、構文解析処理部602と、ツリー結合処理部603と、スケジューリング処理部604が、バス620を介して接続されて構成される。
 プリプロセッサ処理部600と、軸解析処理部601と、構文解析処理部602と、ツリー結合処理部603と、スケジューリング処理部604は、図26に例示するようにハードウェアとしてLSI実装設計装置1に搭載することができる。
 また、600から605の各処理部は、記録部612に記録されたプリプロセッサプログラム600、字句解析プログラム601と、構文解析プログラム602と、ツリー結合プログラム603と、スケジューリングプログラム604をCPU610がメモリ611に展開し、展開した各プログラムをCPU610が実行することによって各処理部の機能を発揮するようにして、ソフトウェアとしてLSI実装設計装置1に搭載しても良い。
 以下では、説明を簡略化するため、各処理部が主体となって各処理を行うこととして説明する。なお各処理部をソフトウェアで実現した場合にはその各種プログラムをCPU610が実行することで実現される各処理部を各処理の主体として説明する。
 プリプロセッサ処理部600は、入力されたソースとヘッダーファイルからマクロの置換、コメントの除去などのプリプロセッサ処理を行う。
 字句解析処理部601は、プリプロセッサ処理済みファイルに字句解析処理を行い、トークンと呼ばれる単位に分割する。トークンとはこれ以上細かく分割すると、本来の意味を持たなくなる最小単位の文字列である。
 構文解析処理部602は、構文解析処理を行う。構文解析処理は、verilogソースコードの各行(または数行分の固まりであるブロック)に対応したトークン列から、部分的なCDFG構造であるCDFGツリーを生成する処理である。
 ツリー結合処理部603は、ツリー結合処理を行う。ツリー結合処理は、複数個のCDFGツリーを一つのCDFGに結合する処理である。
 スケジューリング処理部604は、各処理の依存関係を保ったまま、各ノードを順次C言語のソースコードに変換するために各ノードの順序付け、すなわち、スケジューリング処理を行う。
 図1は、本実施例におけるハードウェア記述言語で記述されたソースコードからCDFGへの変換フローである。本フローチャートにおいて例えばステップ501をS501というように表現する。
  本実施例では、ハードウェア記述言語としてverilogを例に説明するが、本発明はこれに限定されるものではない。
 図2は、本実施例で変換対象となる回路である。変換対象の回路20は乗算器21、加算器22、25、フリップフロップ23、24で構成されている。フリップフロップ23、24はクロック信号clkの立ち上がりエッジで動作し、非同期リセット信号rst_nをLowレベルに設定すると出力が0にリセットされる。この回路20は、フリップフロップ23、24によって二つのパイプラインステージに分割されている。フリップフロップ23、24よりも左側がステージ0、右側がステージ1となる。ステージは動作合成の分野ではステップという言葉で表現されることもある。
 図3に、この回路をverilogで記述した例を示す。この図において、左側の数字は行番号であり、ソースコードには含まれない。本リストはverilogに準拠しているため、各部の詳細説明は省略することとする。
 図4に、図3の2行目のinclude文で読み込まれるヘッダーファイルを示す。ヘッダーフェイルにはマクロの定義等が記載されている。
  このverilogソースコード10とヘッダーファイル11が本実施例における変換処理の対象となる。なお、本実施例では、ソースコード10とヘッダーファイル11はどちらも単一のファイルで実現しているが、複数のファイルで構成しても良いし、ヘッダーファイル11は存在しなくても構わない。
 [プリプロセッサ処理S500]
  図1中のプリプロセッサ処理S500において、プリプロセッサ処理部600はverilogソースコード10とヘッダーファイル11を読み込み、マクロの置換、コメントの除去などの処理を行う。プリプロセッサ処理S500の出力であるプリプロセッサ処理済みファイル12の例を図5に示す。プリプロセッサ処理を行うと行番号が変化することがあるため、プリプロセッサ処理前後の行番号の対応関係をテーブル化して記録部612に記録しておけば、両者のプリプロセッサ処理の前後で対応する行を容易に探索できるようになる。
 このプリプロセッサ処理済みファイル12に対して、字句解析S501、構文解析S502、ツリー結合S503が行われることで、元のソースコードで実行される処理に対応したデータフローと制御フローを一つにまとめた中間形式であるCDFG(Control Data Flow Graph)が生成される。
 [CDFGの構造]
  図6に、CDFGの構造の一例を示す。
  図6(a)は、この例における変換対象のverilogソースコードであり、図5の32行目のassign文に相当する。このverilogソースコードによれば、信号a[15:0]とb[15:0]の乗算を行った後に、乗算の結果得られた値に信号x[15:0]を加算することが示されている。
 図6(b)は、図6(a)のverilogソースコードをCDFGに変換したものである。CDFGにおいて、実行されるそれぞれの処理はノードで表わされ、各ノードは向きを持った矢印で接続されて図6(b)のようにグラフ構造となる。
 図6(c)は、CDFG構造体フィールド情報の例である。CDFG構造体フィールド情報には、各ノードごとの属性情報40が格納されている。属性情報40はID番号41、ノードタイプ42、信号名43、バス情報44、入力45~47、st48、sst49から構成される。
 CDFGはどのような方法で実装しても良いが、ここではリンク構造を持ったC言語の構造体の集合として実装している。
 図6(b)において、信号a[15:0]、b[15:0]、x[15:0]はそれぞれノード30、31、32に対応している。また、これらのノードには図6(c)に示すように、ID番号41が「1」、「2」、「3」のように割り振られており、ノードタイプ42は信号名等の識別子であることを示す「ID」となっている。
 図6(a)のverilogソース中の乗算はノード33に対応しており、加算はノード34に対応している。そして、ノード33、34のID番号41はそれぞれ「4」、「5」とされ、タイプ42は、それぞれ乗算であることを示す「MULT」、加算であることを示す「ADD」と格納される。
 ここで、まず信号a[15:0]とb[15:0]に対して乗算を実行するため、ノード33の入力0、1にそれぞれ信号a[15:0]とb[15:0]を示すID番号「1」と「2」がリンク情報として格納される。
 同様にノード34はノード33の出力とノード32の出力に対して加算を行うため、入力0、1にそれぞれノード33、ノード32を示すID番号「4」と「3」がリンク情報として格納される。ノード34の出力信号名であるsは、図6(a)のverilogソースコードで指定されている。
 なおこの表中のst48、sst49はそれぞれステップ、サブステップを意味している。ステップは図2におけるパイプラインステージに相当する概念である。サブステップは、ステップをさらに細分化した単位であり、詳細については後述する。サブステップの値はスケジューリング処理S504で決定するものであり、それ以前の時点では確定していないため、図6(c)では「-」で記載されている。
  この様にCDFGを使うとデータフロー及び制御フローを表現することが可能となる。
 [字句解析処理S501]
  次に図1のS501~S503のCDFGの生成手順を説明する。
  図7は、字句解析、構文解析の説明図である。
  図8は、構文解析及びCDFG生成の説明図である。
  プリプロセッサ処理済みファイル12は、字句解析処理部601による字句解析処理501でトークンと呼ばれる単位に分割される。字句解析処理S501を行うためのツールとしてはlexが有名であり、本実施例中の字句解析処理S501もlexを使って実現することが可能である。その使用方法については様々な文献に記載されているため、ここでは説明を省略する。また、lex以外のツールを使用することも可能であり、本発明はlexを使用した場合に限定されるものではない。
 [構文解析処理S502]
  次に、字句解析処理501で得られたトークン列に対して構文解析処理部602が構文解析処理S502を行う。本実施例では、構文解析ツールとして有名なyaccを使用する場合を想定しているが、上記と同様にyacc以外のツールを使用することも可能であり、本発明はこれに限定されるものではない。
 yaccを使用する場合には、あらかじめ処理対象とする言語の構文をパターン情報として用意しておき、トークン列に対して順次パターンマッチングを行い、マッチした場合にはあらかじめ定義しておいたルールに対応する処理を行うという形式になる。
 図7の構文解析S502の例では、与えられたトークン列を左から順次走査しながらマッチングをしており、トークン列s[15:0]が最初にマッチしている(マッチング50)。このパターンが出現した場合にはノードタイプがIDのノードを生成する様にルールを指定しておくと、図8のマッチング50にあるようにノードsが生成される。同様にマッチング51、52でノードaとノードbが生成される。マッチング53では乗算ノードが生成され、ノードa、bと接続される。マッチング54ではノードxが生成され、次のマッチング55では、加算ノードが生成され、乗算ノードとノードxに接続される。最後にマッチング56で左辺のノードと右辺のノードを結合することで、この行に対応したCDFGツリーが完成する。
 図9は、図5の他の行に対しても同様に字句解析処理S501と構文解析処理S502を順次実施することによって生成される、複数個のCDFGツリーの例である。
 図5の9~15行目の入出力ポート定義は図9(a)の入出力ノードに変換される。今回の例では入力信号のノードタイプ42は「IN」、出力信号のノードタイプ42は「OUT」となる。双方向の入出力ポートはノードタイプ42が「IN」および「OUT」の2つのポートに分けて記述する。
 図5の21~30行目のフリップフロップ記述は図9(b)の様に変換される。この図の様にフリップフロップは入力側と出力側の2つのノードで表現し、それぞれのノードタイプ42は「FF0」、「FF1」となる。「FF0」の値はクロックの立ち上がりで「FF1」に転送されることになる。
 図5の32~34行目の組み合わせ回路は図9(c)の様に変換される。
 [ツリー結合処理S503]
  ツリー結合処理部603は、ツリー結合処理S503を行う。ただし、必ずしも全てのノードが一つのCDFGに統合されるわけではない。この処理は、図9の各CDFGツリー中のノードタイプがIDであるノードを削除し、本来のリンク先につなぎ替える処理となる。
 図10は、ツリー結合処理のフローチャートの一例である。本フローチャートにおいて例えばステップ701をS701というように表現する。
  まず、各ノードのID番号を指定するための変数iを0に初期化する(S702)。次にノードのID番号がiに等しいノードiを探して、そのノード情報を読み込む(S703)。次に読み込んだノードiのノードタイプがIDであるかどうかの調査を行う(S704)。IDでない場合はつなぎ替えが不要なので、iに1を加算して、本ノードの処理は終了する(S713)。まだ調査していないノードが残っていれば、次のノードの調査を実施する(S714)。
 一方、調査S704でノードタイプがIDであった場合は、本来のリンク先の探索を行う。まず、リンク先のノードのID番号を指定するための変数jを0に初期化する(S705)。次にノードのID番号がjに等しいノードjを探して、そのノード情報を読み込む(S706)。
 次に読み込んだノードjのタイプがID、OUT、FF0であるかどうかの調査を行う(S707)。ID、OUT、FF0の場合にはそのノードは本来のリンク先になり得ないので、jに1を加算して、本ノードの処理は終了する(S709)。まだ調査していないノードが残っていれば、次のノードの調査を実施する(S710)。
 ノードjのタイプがID、OUT、FF0で無い場合は、ノードiとノードjの信号名を比較する(S708)。両者が等しい場合は、ノードjが本来のリンク先であるため、全てのノードを走査して、リンク先がノードiとなっているリンクのリンク先を全てのノードjに変更する(S711)。その後、ノードiを削除することで、ノードのリンク先変更処理が完了する。S708について、信号名が一致していない場合は、S709からS710の処理を行う。
 これらを全てのノードiに対して実行すると、ツリー結合処理S503が完了する。
 図11は、図9の全てのノードに対してツリー結合処理S503を行った結果である。
 [スケジューリング処理S504]
 スケジューリング処理部604は各ノードの順序付け、すなわち、スケジューリング処理S504を行う。
 ここで言うスケジューリングは動作合成等で用いられるステップのようなクロックサイクル単位のスケジューリングよりもさらに細かい単位のスケジューリングであり、これを実現するために、ここでサブステップという仮想時間単位を導入する。なお、以下の説明ではステップをst、サブステップをsstと省略することもある。この考え方では、各ノードはノードタイプにかかわらず、処理の実行に1サブステップ分の時間を使用するものと仮定してスケジューリングを行う。
 図12は、スケジューリング処理S504の全体フローの一例である。
  図13は、図12のフロー中のS725から再帰的に呼び出す関数sched_nodeの処理フローの一例である。
  スケジューリング処理S504は、各ノードに暫定的なサブステップ番号を設定する前半処理と、暫定的なサブステップ番号を調整して最終的なサブステップ番号を決定する後半処理に分けることができる。
 最初に、前半の暫定サブステップ番号の設定処理について説明する。この処理の概要は以下の通りである。
 1.出力ノード(OUT)、FFの入力ノード(FF0)に対して、サブステップ番号0を設定する。
 2.各出力ノードまたはFFの入力ノードを起点として、その入力ノードに対して、現在のノードのサブステップ番号から定数Nを減算した値を設定する(Nは正の定数であれば何でも良い。今回はN=1としている)。ただし、そのノードに既に別のサブステップ番号が設定されており、その値が新しく設定しようとしているサブステップ番号よりも小さい場合は、以前の設定値をそのままサブステップ番号として使用する。
 3.順次入力側へノードをたどりながら2の処理を再帰的に実行する。
 図12のスケジューリング処理S504の前半部分(S722~S727)が上記の「1.」の処理に該当し、そこから「2.」の処理として図13の関数sched_nodeを再帰的に呼び出して実行する。関数呼び出し時には引数の一つとして、対象とするノードに設定するサブステップ番号を指定する。なお、図13の例は、各ノードの入力数は最大で3個である場合を想定しているが、本発明はこれに限定されるものではない。
 図14は、上記の手順で図11のCDFGの各ノードに対して暫定的なサブステップ番号を設定した様子の一例である。図中において五角形で囲まれた数字が各ノードのサブステップ番号である。「0」から順次1を減算しながらサブステップ番号を設定しているため、サブステップ番号は「0」以下の数となっている。またノード40のサブステップ番号はノード43からたどった場合は「-1」、ノード42または44からたどった場合は「-2」となるが、関数sched_node 中のS732~S734の処理によって最終的に、一番小さい値である「-2」が設定されている。
 スケジューリング処理504の後半の最初に行うS760とS761は全てのサブステップ番号を「0」以上の値にするための処理である。S760は全てのサブステップ番号の中で一番小さい値(sst_min)を探す処理である。図14の例では「-3」が一番小さいのでsst_min=-3となる。次のS761では、全てのノードに対してサブステップ番号の値からsst_minの値を減算する。
 図15は、上記の処理を図14のCDFGに行った結果の例である。ここでS762を行い、入力ノードとFFの出力ノード(FF1)のサブステップ番号を0に設定する。この処理は必須ではないが、入力やフリップフロップ更新のタイミングを揃えることで、図示したCDFGが見やすくなるといったメリットがある。
 図16は、S762を行った後のCDFGを、同じサブステップ番号が同じ列に並ぶように配置し、ステップ番号が同じノードをグループ分けして書き直したCDFGの例である。これがスケジューリング処理S504が完了した状態におけるCDFGとなる。
 このようにスケジューリング後のCDFGでは、各ノードはステップ番号とサブステップ番号を持つことになる。図6に対応する部分のスケジューリング後のCDFG構造体のフィールド情報を図17に示す。図6(c)と比較すると、sstの値が格納されていることおよび、ツリー結合処理によって先頭の3つのノードが結合後のノードに置き換わっていることがわかる。この様にCDFG中にステップ番号とサブステップ番号を保持しているため、ここからステップ番号を用いてハードウェア記述言語のソースコードを生成することや、サブステップ番号を用いてプログラミング言語のソースコードを生成することが可能であり、CDFGに言語変換のハブの役割を持たせることも可能である。
 次にLSI実装部3の動作について図26を用いて説明する。
 LSI実装部3は、論理合成部800、配置配線部801、タイミング解析部802、領域分割部803、実装ファイル生成部804から構成されている。なお、CDFG生成部2と同様に、これらの各処理部についてはハードウェアで実現しても良いし、CPU610上で動作するソフトウェアで実現することも可能である。
 LSI実装部3の動作の概要を図18を用いて説明する。領域分割部803は、verilogソースファイル10とヘッダーファイル11、CDFGファイル14を読み込み、CDFGファイルに格納された情報を元に、verilogソースファイル10に記載されている回路を複数個のモジュールに分割する。本実施例では対象回路を2個の領域に分割する場合を例に説明するが、本発明はこれに限定されるものではない。分割数は人間が設定しても良いし、それぞれのモジュールの回路規模が指定した閾値以下になるまで分割するといった方法も可能である。この場合、各モジュールの回路規模はCDFGの各ノードに対して演算種に基づいた重み付けをして合計することで見積もっても良いし、後続のフローで実施する合成結果からフィードバックしても良い。CDFGを用いた分割処理の実現方法については後述する。
 領域分割部803は、分割処理が行われた後、分割後の2つのモジュール及びその上位階層のモジュールに対応したverilogソースファイル17が生成される。
 次に論理合成部800では、EDAベンダーやFPGAベンダーが発売している市販の論理合成ツールを用いて、それぞれのソースファイルに対して論理合成を行い、ソースファイル17に対応した3個の合成後ネットリストを得る。論理合成ツールの具体的な処理アルゴリズムについては、本発明の本質ではないためここでは説明しない。
 配置配線部801では、EDAベンダーやFPGAベンダーが発売している市販の配置配線ツールを用いて回路素子の配置および素子間の配線処理を行う。回路素子の配置方法としては、モジュール分割を無視して全素子を自由に配置する方法と、モジュール毎に配置する領域を制限して素子を配置する方法があるが、ここでは後者の方法を使用するものとする。この方法では、領域の大きさや位置を人間が指定する場合と、配置配線ツールが自動的に決定する場合があるが、ここでは説明を簡単にするため、本実施例では配置配線ツールが自動的に決定する場合を想定している。ただし、本特許は人間が領域の大きさや位置を指定する場合にも有効である。
 本実施例の配置配線処理では、最初に2つのモジュールを配置するための領域を決定した後、それぞれの領域内で各モジュールの配置を最適化する。今回は目標動作周波数を達成するために、各モジュール内で互いに接続される素子間の距離ができるだけ短くなるように最適化を行う。配置配線ツールは配置処理が完了して各素子の位置が決定すると、次に配線処理を実施し素子の間を接続していく。配置配線ツールの具体的な処理アルゴリズムの説明は省略する。 
 配置配線801が完了すると次に目標としている動作周波数を満足できているかを確認するため、タイミング解析を行う。タイミング解析についても具体的な処理内容の説明は省略する。
 タイミング解析の結果、実装後の回路が目標としている動作周波数で動作しないことが判明した場合には、本処理フローの前の処理に戻って、目標の動作周波数を満足するまでフローを繰り返し実行することになる。どの処理まで戻ればよいかは、状況に応じて変化するが、本実施例では配置配線処理801まで戻って、再度配置配線をやり直すこととする。配置をやり直す際には各素子の初期配置を決定するための乱数系列を変更するなどの方法で、前回実行したときとは異なる結果が得られるようにする。
 なお、今回はLSIを複数領域に分割して実装しているため、目標としている動作周波数を満足している領域については配置配線をやり直す必要はない。そのため、LSI全体でなく、目標としている動作周波数を満足していない部分のやり直しを行うこととなり、再配置配線処理の時間が短くて済む。この点は、領域分割を行うことによる大きな利点である。
 目標とする動作周波数を満足できた場合には、実装ファイル生成処理804によって、配置配線の結果をLSIの実装データ19に変換する。LSIの実装データ19は、対象LSIがASICの場合はマスクパターン情報を格納したファイルになり、FPGAの場合はコンフィギュレーションのための情報となる。
  以上で、LSIまたはFPGAの実装フローが完了することになる。
 次に、領域分割処理803についてその処理方法を図2の回路を例に説明する。この回路に対応するverilogソースコードは図3に、このソースコードから生成したCDFGは図16に示す。実際には、図16のCDFGは処理しやすいように図17のような形式でデータ化されている。領域分割する際には、CDFGの再下段にあるノードすなわち、出力ノード(OUT)、FFの入力ノード(FF0)からリンクを遡りながら、それぞれのノードのソースとなるノードをグループ化していく。以下の説明では、このようなグループをコーンと呼ぶこととし、最下段にある出力ノード(OUT)とFFの入力ノード(FF0)を総称してシンクノード呼ぶこととする。
 なお、コーンを生成する際に、最上段のノードすなわち入力ノード(IN)およびFFの出力ノード(FF1)はコーンに含めない。以下の説明では、最上段にある入力ノード(IN)とFFの出力ノード(FF1)を総称してソースノードと呼ぶこととする。
 図17のCDFGに含まれる全てのシンクノードに対してコーンを生成した結果を図19に示す。この例ではシンクノードは4つ存在するため、それぞれに対応する形で4つのコーン70~73が生成されることになる。図19の例では、それぞれのコーン70~73は排他になっているが、実際の回路では、各コーンは必ずしも排他になるわけではない。例えば、図20のようなCDFGではコーン71と74がノード33で重なり合っており、これらのコーンは排他では無くなっている。この場合には、領域分割処理803の中で、図21のように重複しているノード33を複製して新しいノード33aを生成することで、図20のコーン74は図21のコーン74aのように変化し、各コーンを排他にすることが可能である。
 以上の方法によって、各コーンが排他になったら、次に各コーンをグループ化していく。先に述べたように本実施例では、対象回路を2つのモジュールに分割して実装するため、ここではコーンを2つのグループに分割する方法について説明するが、これを繰り返していくことで、対象回路を任意の個数のグループに分割することも可能である。
 図19において、各コーンについて、そこに含まれているノードの数を数えることで、各コーンの論理規模を概算することが可能である。実際には、ノードの数を単純に数えるのではなく、ノードで実行する演算種による重み付け(加算は1、乗算はNなど)や、ビット幅によるスケーリング(8ビット幅の加算器は1ビット幅の加算器の8倍など)を行うことで、より正確に各コーンの論理規模を見積もれるようになる。
 またソースノードと各コーンを接続するリンクの総数から、コーン同士の結びつきを定量化することが可能である。なお、コーン同士の結びつきを定量化する際には、FF1ノードは、対応するFF0を含むコーンに含まれているものとみなして考える。
 図19の例では、XのFF1ノード1000は対応するFF0ノード1001が含まれるコーン71に属する物とみなす。XのFF1ノード1000とコーン72の間には16本の線があるため、コーン71と72の間の結びつきは16であると定義する。同様にコーン72と73の結びつきは8となる。
 以上の様にすることで、各コーンの論理規模と、各コーン間の結びつきを定量化することが可能である。この結果を用いて、コーンをグループ分けする。ここでは、各グループの論理規模に大きな差異が生じないこと、および各グループ間の結びつきができるだけ小さくなるようにするといった観点からコーンをグループ分けする。このグループ分けを行う際には、上記のような論理規模、コーン間の結びつきといったパラメータのどれを重視して、どのように評価するかによって結果が変わってくることになる。
 本実施例では、コーン71と72がグループ0に、コーン70と73がグループ1にグループ分けされた場合を仮定して話を進める。このグループ分け状況を回路図上で見ると図22のようになる。波線75よりも上側がグループ0に対応しており、コーン70と73に対応する回路がある。下側がグループ1に対応し、コーン71と72に対応する回路がある。
 CDFGの各ノードはverilogソースコードと対応しているので、CDFG生成時に各ノードに対応するverilogソースコードの行番号を属性情報として保存しておくことが可能である。例えば図19のノード33は図5の32行目に対応する。これはプリプロセッサ処理500を実行する際に作成した行番号の対応表を用いると図3の37行目に対応することが判る。
 この属性情報を用いて、verilogソースコードをグループ毎に分割した例を図23、24に示す。この例では、元のverilogソースコードをグループ毎に10a、10bの2つのソースファイルに分割し、それぞれのモジュールを10cのソースファイルから呼び出す形になっている。モジュール名の重複を避けるため、分割後の各モジュールのモジュール名は元のモジュール名に一意な接尾語を付けたモジュール名に変更する。それぞれのモジュールは、変更後のモジュール名に拡張子.vを付けたファイル名を付け、記録部612へ格納する。
 グループ0に属している図19のノード33は、図3の37行目に対応していたが、この行はグループ0に対応するソースファイル10aの30行目に現れている。
 本実施例の手法では、フリップフロップの出力でグループの分割を行うため、verilogソースコードを行内で分割せずにグループ分けできるという長所がある。グループの分割箇所が任意のリンクとなっているとノード33の出力リンクでグループ分けを行うようなケースがありうるが、この場合は図3の37行目が二つのグループに分断されてしまうようなケースが発生しうることになる。
 このように論理合成後のネットリストでなく、ソースコードの段階で分割するため、分割後のソースコードに対して異なる条件で独立に論理合成を行うことが可能である。このため、目標としている動作周波数を満足することが難しいモジュールを含むソースコードについては、性能は高いが実行時間の長い高度な合成オプションを適用することも可能であり、さらに必要な場合には、分割後の特定のソースコードのみを他のソースコードに影響を与えることなく、手修正で最適化することも可能である。
 またフリップフロップの出力でグループの分割を行うことで、タイミング制約を掛けやすくなり、さらに回路の最適化の範囲が拡がるという利点が生じる。これについて図25を用いて説明する。図25の(a)は最適化対象回路の一部を抜粋したものであり、フリップフロップ0に格納されているデータが、5つの組み合わせ回路A-Eによる処理を経由してフリップフロップ1に伝搬する回路であり、フリップフロップ0からフリップフロップ1への伝搬はクロック周期に対応する10ns以内に行われる必要がある。これをモジュール分けする場合(b)のようにフリップフロップの直後でなく、組み合わせ回路BとCの間の1010でグループ分けをした場合を考える。
 この場合、前半のグループと後半のグループとを最適化するためにそれぞれのグループに対してタイミング予算を設定する必要がある。ここでは組み合わせ回路A-Eの処理時間が全て等しいとして比例配分で前半に4ns、後半に6ns配分しているが、実際にはそれぞれの組み合わせ回路の処理時間は異なることが多いため、ゲート段数の仮見積もり等なんらかの手段でタイミング予算を割り当てる作業が必要になってしまう。
 一方、本実施例の方法により、必ずフリップフロップの直後でのみグループが分割されるようにすると、図(c)のように組み合わせ回路A-E全体で10nsというように設定すれば良く、タイミング予算の設定を大幅に簡略することが可能となる。
 また、図(b)のグループ分けでは、組み合わせ回路BとCとにまたがる回路最適化を行うことができないため、レジスタ間のパスの最適化に制約が生じることになる。例えば組み合わせ回路Bが二入力のORゲートで、組み合わせ回路Cも二入力のORゲートである場合、両者を跨る最適化を実施可能であれば、三入力のORゲートに置き換えることで、ゲート段数を減らして高速化が可能であるが、図(b)のグループ分けではこのような最適化を行えないことになる。
 一方、図(c)のグループ分けでは、組み合わせ回路A-Eのすべての範囲を跨いだ最適化が可能なため、上記のケースでは三入力のORゲートへの置換も可能であり、最適化の自由度が高くなっている。
 なお、以上の説明はASICのような通常のLSIを例に行ったが、本発明はFPGAのように、プログラミング可能な回路素子をあらかじめ配置しておき、各回路素子をプログラミングすることにより、必要な機能を実現するようなタイプのLSIにも適用することが可能である。
10:verilogで記載されたソースコード、11:verilogで記載されたソースコード用ヘッダーファイル、12:プリプロセッサ処理済みファイル、13:中間形式のファイル、14:CDFG形式のファイル、17:verilogで記載された分割後のソースコード、18:論理合成後のネットリスト、19:LSI実装データ、S50:verilog-CDFG変換、S500:プリプロセッサ処理、S501:字句解析処理、S502:構文解析処理、S503:ツリー結合処理、S504:スケジューリング処理、800論理合成処理、801:配置配線処理、802:タイミング解析処理、803:領域分割処理、804:実装ファイル生成処置

Claims (14)

  1.  ハードウェア記述言語で記述されたソースコードの処理内容を解析し、処理の実行を示すノード間のデータの転送方向を示す向きを持った有向リンクの集合体として構成される有向グラフを生成するステップと、
     生成した前記有向グラフに含まれるノードを、2つ以上のノードグループに分割するステップと、
     前記ソースコードから、前記2つ以上のノードグループに分割するステップによって生成されたノードグループに含まれるノードに対応する記述を抽出し、それらを結合して当該ノードグループに対応した分割後ソースコードを生成するステップと、を備え、
     前記ノードは前記ソースコード中のフリップフロップに対応するレジスタノードとそれ以外の他のノードとを含み、
     前記2つ以上のノードグループに分割するステップにおいて、レジスタノードから他のノードへ向かうリンクであるレジスタ出力リンクまたは対象回路の入力端子からの他のノードへ向かうリンクである入力端子リンクから構成されるソースノード直結リンクを切断することで2つ以上のノードグループに分割することを特徴としたソースコード分割方法。
  2.  前記2つ以上のノードグループに分割するステップにおいて、ノードグループ間を接続するリンクの本数に基づいてノードグループを分割することを特徴とした請求項1記載のソースコード分割方法。
  3.  前記ノードグループに含まれるノードは、当該ノードグループ以外の他のノードグループには含まれないことを特徴とした請求項1記載のソースコード分割方法。
  4.  ノードが複数のノードグループに含まれる場合に、当該ノードが1つのノードグループに含まれるよう当該ノード及び当該ノードに関連するリンクを複製することを特徴とする請求項3記載のソースコード分割方法。
  5.  複数の前記分割後ソースコードに対して異なる識別子を付けて記憶媒体へと書き出すステップを備えたことを特徴とした請求項1記載のソースコード分割方法。
  6.  前記分割後ソースコードに対して、個別に論理合成処理を行うステップを備え、
     複数の前記分割後ソースコードに対応した複数の分割後ゲートレベルネットリストを生成することを特徴とした請求項1記載のソースコード分割方法。
  7.  前記分割後ゲートレベルネットリストに対し、個別に配置配線処理を行うステップを備え、前記分割後ゲートレベルネットリストに対して配置配線処理を行い、前記分割後ゲートレベルネットリストに対応したLSI実装ブロックを生成した後、当該LSI実装ブロックの間を配線することを特徴とした請求項6記載のソースコード分割方法。
  8.  ハードウェア記述言語で記述されたソースコードの処理内容を解析し、処理の実行を示すノード間のデータの転送方向を示す向きを持った有向リンクの集合体として構成される有向グラフを生成する有向グラフ生成部と、
     生成した前記有向グラフに含まれるノードを、2つ以上のノードグループに分割し、当該分割されたノードグループに含まれるノードに対応する記述を抽出し、それらを結合して当該ノードグループに対応した分割後ソースコードを生成するノードグループ分割部と、を備え、
     前記ノードは前記ソースコード中のフリップフロップに対応するレジスタノードとそれ以外の他のノードとを含み、
     前記ノードグループ分割部は、レジスタノードから他のノードへ向かうリンクであるレジスタ出力リンクまたは対象回路の入力端子からの他のノードへ向かうリンクである入力端子リンクから構成されるソースノード直結リンクを切断することで2つ以上のノードグループに分割することを特徴としたLSI実装装置。
  9.  前記ノードグループ分割部は、ノードグループ間を接続するリンクの本数に基づいてノードグループを分割することを特徴とした請求項8記載のLSI実装装置。
  10.  前記ノードグループに含まれるノードは、当該ノードグループ以外の他のノードグループには含まれないことを特徴とした請求項8記載のLSI実装装置。
  11.  前記ノードグループ分割部は、ノードが複数のノードグループに含まれる場合に、当該ノードが1つのノードグループに含まれるよう当該ノード及び当該ノードに関連するリンクを複製することを特徴とする請求項10記載のLSI実装装置。
  12.  前記ノードグループ分割部は、複数の前記分割後ソースコードに対して異なる識別子を付けて記憶媒体へと書き出すことを特徴とした請求項8記載のLSI実装装置。
  13.  前記分割後ソースコードに対して個別に論理合成処理を行い、複数の前記分割後ソースコードに対応した複数の分割後ゲートレベルネットリストを生成する論理合成部を備えることを特徴とした請求項8記載のLSI実装装置。
  14.  前記分割後ゲートレベルネットリストに対し、個別に配置配線処理を行い、前記分割後ゲートレベルネットリストに対応したLSI実装ブロックを生成した後、当該LSI実装ブロックの間を配線する配置配線部を備えることを特徴とした請求項13記載のLSI実装装置。
PCT/JP2013/081462 2013-11-22 2013-11-22 ソースコード分割方法及びlsi実装装置 WO2015075805A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2013/081462 WO2015075805A1 (ja) 2013-11-22 2013-11-22 ソースコード分割方法及びlsi実装装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2013/081462 WO2015075805A1 (ja) 2013-11-22 2013-11-22 ソースコード分割方法及びlsi実装装置

Publications (1)

Publication Number Publication Date
WO2015075805A1 true WO2015075805A1 (ja) 2015-05-28

Family

ID=53179111

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/081462 WO2015075805A1 (ja) 2013-11-22 2013-11-22 ソースコード分割方法及びlsi実装装置

Country Status (1)

Country Link
WO (1) WO2015075805A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230072735A1 (en) * 2021-09-07 2023-03-09 International Business Machines Corporation Refinement of an integrated circuit design
US11907634B2 (en) 2021-09-01 2024-02-20 International Business Machines Corporation Automating addition of power supply rails, fences, and level translators to a modular circuit design

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09330339A (ja) * 1996-06-11 1997-12-22 Mitsubishi Electric Corp 自動記述分割装置
JP2012150631A (ja) * 2011-01-19 2012-08-09 Renesas Electronics Corp 半導体集積回路の設計方法および設計装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09330339A (ja) * 1996-06-11 1997-12-22 Mitsubishi Electric Corp 自動記述分割装置
JP2012150631A (ja) * 2011-01-19 2012-08-09 Renesas Electronics Corp 半導体集積回路の設計方法および設計装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11907634B2 (en) 2021-09-01 2024-02-20 International Business Machines Corporation Automating addition of power supply rails, fences, and level translators to a modular circuit design
US20230072735A1 (en) * 2021-09-07 2023-03-09 International Business Machines Corporation Refinement of an integrated circuit design

Similar Documents

Publication Publication Date Title
US6782511B1 (en) Behavioral-synthesis electronic design automation tool business-to-business application service provider
US7162704B2 (en) Method and apparatus for circuit design and retiming
US8782591B1 (en) Physically aware logic synthesis of integrated circuit designs
US8918748B1 (en) M/A for performing automatic latency optimization on system designs for implementation on programmable hardware
US8701059B2 (en) Method and system for repartitioning a hierarchical circuit design
JP2003518666A (ja) 動的に再構成可能な論理回路のための物理設計を実現する方法
US8667435B1 (en) Function symmetry-based optimization for physical synthesis of programmable integrated circuits
Jun et al. Partial connection-aware topology synthesis for on-chip cascaded crossbar network
US6763513B1 (en) Clock tree synthesizer for balancing reconvergent and crossover clock trees
Gibiluka et al. A bundled-data asynchronous circuit synthesis flow using a commercial EDA framework
JP4495865B2 (ja) 業者間アプリケーションサービスプロバイダ
JP2004013720A (ja) 論理回路のタイミング制約モデル生成方法、論理回路のタイミング制約モデル生成プログラム、およびタイミング制約モデルを用いるタイミングドリブンレイアウト方法
US6964027B2 (en) System and method for optimizing exceptions
US6581200B2 (en) Abstracting netlist to manage routing information
WO2015075805A1 (ja) ソースコード分割方法及びlsi実装装置
US20050039152A1 (en) Timing path detailer
Geralla et al. Optimization of physically-aware synthesis for digital implementation flow
JP5447547B2 (ja) マクロ遅延解析装置、マクロ境界パスの遅延解析方法、マクロ境界パスの遅延解析プログラム
Bommu et al. Retiming-based factorization for sequential logic optimization
Casu et al. Throughput-driven floorplanning with wire pipelining
Khvatov et al. Development of an IP-cores Libraries as Part of the Design Flow of Integrated Circuits on FPGA
Jun et al. Exploiting implementation diversity and partial connection of routers in application-specific network-on-chip topology synthesis
JP4216087B2 (ja) 論理回路最適化方法、論理回路最適化装置、及び、論理回路合成装置
Mao et al. Automated mapping of asynchronous circuits on fpga under timing constraints
Vij Algorithms and methodology to design asynchronous circuits using synchronous CAD tools and flows

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13897746

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13897746

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP