The invention relates to circuit design, and more particularly to circuit partitioning and trace assignment.
For the design of circuits (e.g., digital or analog circuits) on the scale of VLSI (very large scale integration) technology, designers often employ computer aided techniques. Schematics and/or description languages have been used to describe the design of circuits (digital or analog). Standard languages such as Hardware Description Languages (HDLs) have been developed to describe digital circuits to aide in the design and simulation of complex digital circuits. Several hardware description languages, such as VHDL and Verilog, have evolved as industry standards. VHDL and Verilog are general purpose hardware description languages that allow definition of a hardware model at the gate level, the register transfer level (RTL) or the behavioral level using abstract data types. As device technology continues to advance, various product design tools have been developed to adapt HDLs for use with newer devices and design styles.
In designing an integrated circuit with an HDL code, the code is first written and then compiled by an HDL compiler. The HDL source code describes at some level the circuit elements, and the compiler produces an RTL netlist from this compilation. The RTL netlist is typically a technology independent netlist in that it is independent of the technology/architecture of a specific vendor's integrated circuit, such as field programmable gate arrays (FPGA) or an application-specific integrated circuit (ASIC). The RTL netlist corresponds to a schematic representation of circuit elements (as opposed to a behavioral representation). A mapping operation is then performed to convert from the technology independent RTL netlist to a technology specific netlist which can be used to create circuits in the vendor's technology/architecture. It is well known that FPGA vendors utilize different technology/architecture to implement logic circuits within their integrated circuits. Thus, the technology independent RTL netlist is mapped to create a netlist which is specific to a particular vendor's technology/architecture.
One operation, which is often desirable in this process, is to plan the layout of a particular integrated circuit and to control timing problems and to manage interconnections between regions of an integrated circuit. This is sometimes referred to as “floor planning.” A typical floor planning operation divides the circuit area of an integrated circuit into regions, sometimes called “blocks,” and then assigns logic to reside in a block. These regions may be rectangular or non-rectangular. This operation has two effects: the estimation error for the location of the logic is reduced from the size of the integrated circuit to the size of the block (which tends to reduce errors in timing estimates), and the placement and the routing typically runs faster because as it has been reduced from one very large problem into a series of simpler problems.
Logic partitioning is typically performed in the design of a digital circuit. Partitioning circuits enable one to apply divide-and-conquer techniques to simplify the design process (e.g., placement and routing). For example, a large digital circuit can be partitioned into portions so that each portion is implemented in an FPGA chip; and, the FPGA chips are interconnected by wire traces on a circuit board. Further, a digital circuit on a chip can be partitioned into regions on the chip, interconnected with chip wiring.
Partitioning algorithms have been developed to minimize the communication between partitions while ensuring that each portion is no larger than allowed (e.g., constrained by the capacity of an FPGA chip, or the area of a region on a chip). For example, U.S. Pat. No. 5,854,752 describes a method for partitioning a logic circuit for emulation under a virtual wires method using programmable logic devices. Many existing partitioning algorithms based on bipartitioning techniques, which find two partitions of a network of cells connected by nets such that the number of nets that connect the cells in both partitions is minimal. For example, the Fiduccia-Mattheyses algorithm (described in C. M. Fiduccia and R. M. Mattheyses, “A Linear-Time Heuristic for Improving Network Partitions”, Proceedings of the 19th Design Automation Conference, pp. 175-181, June 1982) is one of such bipartitioning techniques. A bipartitioning algorithm may be used repeatedly to partition a circuit into more than two partitions. Some multi-way partitioning techniques can also be found in the literature (e.g., Pak K. Chan, Martine D. F. Schlag, Jason Y. Zien, “Spectral-Based Multi-Way FPGA Partitioning”, Proceedings of the third international ACM symposium on Field-programmable gate arrays, p. 133-139, Feb. 12-14, 1995; George Karypis and Vipin Kumar, “Multilevel k-way Hypergraph Partitioning”, Proceedings of the 36th ACM/IEEE conference on Design automation conference, p. 343-348, Jun. 21-25, 1999).
Methods and apparatuses for circuit partitioning and incremental trace assignment are described here. Some embodiments of the present invention are summarized in this section.
In one embodiment of the present invention, a cost function based on both the partitioning solution and the trace assignment solution is used for the partitioning of a circuit; in reducing the cost function, blocks of circuits are moved among partitions and the trace assignment are updated accordingly to evaluate the cost function. In one embodiment, the traces and nets are grouped according to the partitions they connect for trace assignment. In one embodiment, a flow diagram is constructed for assigning nets to traces; and, maximum flow algorithms are used. In one embodiment, a flow diagram includes feedthrough solutions, in which flow is not conserved at certain nodes. In one embodiment, linear programming techniques (e.g., integer linear programming techniques) are used for assigning nets to traces. In one embodiment, a distribution of nets, which defines the numbers of blocks that each net has in each partition, is computed and maintained for efficient determination of the number of nets in net groups.
In one embodiment of the present invention, a method for designing at least one integrated circuit (IC) includes: partitioning a circuit into portions which represent a partitioning solution; assigning traces to interconnect the portions to generate a trace assignment solution; and optimizing the circuit through a modification of at least one of the partitioning solution and the trace assignment solution, the optimizing based on evaluating a design parameter which is based at least in part on the trace assignment solution. In one example, the optimizing is through a modification to both the partitioning solution and the trace assignment solution; and, the design parameter is further based on the partitioning solution. In one example, the design parameter is a cost function; the cost function increases as the number of nets that cannot be assigned to traces in the trace assignment solution increases; and, the cost function increases as an area of circuits in a partition in the partitioning solution that excesses a threshold increases. In one example, the optimizing includes: first evaluating the design parameter; modifying the partitioning solution after evaluating the design parameter; modifying the trace assignment solution after modifying the partitioning solution; second evaluating the design parameter after modifying the trace assignment solution; and determining if the design parameter is improved through modifying the partitioning solution and modifying the trace assignment solution. In one example, the optimizing further includes: determining gains in the design parameter for a plurality of modification candidates for the partitioning solution; selecting first one from the modification candidates based on the gains; and performing the first one selected from the modification candidates.
In one embodiment of the present invention, a method for circuit design includes: determining a distribution of nets of a circuit, the distribution of the nets comprising numbers of blocks that each net has in each of a plurality of partitions of the circuit in a partitioning solution; moving a first block of the circuit from a source partition to a destination partition to modify the partitioning solution; updating the distribution of the nets after the move. In one example, updating the distribution of the nets includes: updating numbers of blocks that each net connecting the first block has in the source and destination partitions. In one example, updating the distribution of the nets includes: determining a first net that connects the first block; decreasing the number of blocks that the first net has in the source partition by one; and increasing the number of blocks that the first net has in the destination partition by one. In one example, nets are grouped according to the partitions they connect; each net group contains nets that connect a same set of partitions; after a first net that is moved from a source net group to a destination net group is determined, number of nets in the source net group is decreased by one; and, the number of nets in the destination net group is increased by one. In one example, when the number of blocks that the first net has in a partition changes between 1 and 0, the first net is determined to be moved from the source net group to the destination group (e.g., when a change from 1 to 0 in a number of blocks that the first net has in the source partition is detected, or when a change from 0 to 1 in a number of blocks that the first net has in the destination partition is detected).
In one embodiment of the present invention, a method for circuit partitioning comprising: evaluating a design goal indicator, which is a function of a partitioning solution for a circuit and a function of a trace assignment solution for the circuit; and improving the design goal indicator through modifying the first partitioning solution and through modifying the first trace assignment solution. In a partitioning solution, the circuit is partitioned into a plurality of partitions; and, the plurality of partitions containing a plurality of first portions of the circuit respectively in the first partitioning solution. In the first partitioning solution, first nets of the circuit interconnects the plurality of the first portions. At least a portion of the first nets is assigned to traces in the first trace assignment solution. Traces are wiring resources available for interconnecting portions of the circuits in the plurality of partitions. The design goal indicator is first evaluated based on a first partitioning solution for the circuit and a first trace assignment solution for the circuit. The first partitioning solution is modified to generate a second partitioning solution; and, the first trace assignment solution is modified to generate a second trace assignment solution. In the second partitioning solution, the plurality of partitions containing a plurality of second portions of the circuit respectively in the second partitioning solution; and, second nets of the circuit interconnects the plurality of the second portions. In the second trace assignment solution, at least a portion of the second nets is assigned to traces in the second trace assignment solution. In one example, the design goal indicator is a function of unassigned nets in a trace assignment solution in which the unassigned nets lack corresponding traces for connectivity. In one example, the design goal indicator is a function of a number of unassigned nets in a group of nets which interconnect portions in a group of partitions in the plurality of partitions; and, the design goal indicator is further a function of a number of traces in a group of traces which provide wiring resources for a group of partitions in the plurality of partitions. In one example, the design goal indicator is further a function of the area used by a portion of the circuit in one of the plurality of partitions in a partitioning solution and a function of the area available for the one of the plurality of partitions. In one example, improving the design goal indicator includes: performing a first modification to the first partitioning solution to generate a third partitioning solution; determining a third trace assignment solution according to the third partitioning solution; and comparing the design goal indicator based on the third partitioning solution and the third trace assignment solution with the design goal indicator based on the first partitioning solution and the first trace assignment solution to select the second partitioning solution from the first and third trace assignment solutions and to select the second trace assignment solution from the first and third trace assignment solutions. In one example, the first modification includes: moving a first block of the circuit from a first one of the plurality of partitions to a second one of the plurality of partitions. In one example, improving the design goal indicator further includes: determining to move the first block from the first one of the plurality of partitions to the second one of the plurality of partitions from a list of modifications according to a gain in the design goal indicator due to each of the list of the modifications. In one example, the first modification further includes: moving a second block of the circuit from a third one of the plurality of partitions to a fourth one of the plurality of partitions after moving the first block. In one example, improving the design goal indicator further includes: determining to move the second block from the third one of the plurality of partitions to the fourth one of the plurality of partitions after said moving the first block.
In one embodiment of the present invention, a method for trace assignment includes: grouping nets into net groups, grouping traces into trace groups, assigning at least a portion of the nets to the traces through maximizing a sum of assignment of nets in each of the net groups to traces in corresponding at least one of the trace groups. In a partitioning solution for a circuit, the nets interconnect portions of the circuit; the portions are contained within a plurality of partitions of the circuit respectively; and, each net of a net group interconnects portions of the circuit that are contained respectively within a same group of partitions of the plurality of partitions. The traces provides wiring resources for interconnecting portions of the circuit contained respectively within the plurality of partitions of the circuit; and, each trace of a trace group provides wiring resources for the same group of partitions of the plurality of partitions. In one embodiment, assigning the nets to traces includes: determining maximum flow in a graph, the graph including net nodes, trace nodes and matching edges, each net node representing a corresponding one of the net groups, flow from each net node representing a number of nets to be assigned from the corresponding one of the net groups, each trace node representing a corresponding one of the trace groups, flow into each trace node indicating a number of traces in the corresponding one of the trace groups that are assigned to corresponding nets, each matching edge connecting one of the net nodes to one of the trace nodes to conduct flow from the one of the net nodes to the one of the trace nodes, the maximum flow corresponding to a sum of flow in the matching edges. In one example, a first portion of nets in a first one of the net groups are assigned to traces in a first one of the trace groups; and, a second portion of the nets in the first one of the net groups are assigned to traces in a second one of the trace groups. In another embodiment, assigning the nets to traces includes: determining maximum flow in a graph, the graph including net nodes, tree nodes, trace nodes and matching edges, each net node representing a corresponding one of the net groups, flow from each net node representing a number of nets to be assigned from the corresponding one of the net groups, each trace node representing a corresponding one of the trace groups, flow into each trace node indicating a number of traces in the corresponding one of the trace groups that are assigned to corresponding nets, each tree node representing a group of trace groups and connecting to a corresponding group of trace nodes through corresponding ones of the tree edges, each tree edge conducting flow from one of the tree nodes to one of the trace nodes, an amount of flow into each tree node causing the amount of flow to each of the corresponding group of trace nodes, each matching edge connecting one of the net nodes to one of the tree nodes and the trace nodes to conduct flow from the one of the net nodes to one of the tree nodes and the trace nodes, the maximum flow corresponding to a sum of flow in the matching edges. In one example, a first portion of nets in a first one of the net groups are assigned to traces in a first one of the trace groups and traces in a second one of the trace groups.
In one embodiment of the present invention, a method for trace assignment includes: grouping traces into trace groups, the traces providing wiring resources for interconnecting portions of a circuit in partitions of the circuit, the traces being grouped into the trace groups according to partitions connected by each of the traces; grouping first nets into first net groups, the first nets interconnecting first portions of a circuit, the first portions being in the partitions respectively according to a first partitioning solution, the first nets being grouped into the first net groups according to partitions within which portions connected by each of the first nets are contained; determining maximum assignment of the first nets to the traces through maximizing a flow in a first graph from first net nodes, the first net nodes representing the first net groups, the flow in the first graph flowing into trace nodes, the trace nodes representing the trace groups, flow from a net node to a trace node representing assignment of net to trace from the net node to the trace node; grouping second nets into second net groups, the second nets interconnecting second portions of a circuit, the second portions being in the partitions respectively according to a second partitioning solution, the second nets being grouped into the second net groups according to portions connected by each of the second nets; and determining maximum assignment of the second nets to the traces through modifying the first graph to generate a second graph, in which second net nodes representing the second net groups, and through maximizing a flow in the second graph from the second net nodes. In one example, the traces comprise at least one of: a) wire traces for interconnecting portions of the circuit in a plurality of regions of a printed circuit board; and b) routing resources for interconnecting portions of the circuit in a plurality of regions of a chip. In one example, each of the first and second graphs comprises a source node connected to each net node through a net edge, each net edge allowing flow from the source node to a net node, each net node having total out flow that is equal to total in flow. In one example, each of the first and second graphs comprises a target node connected to each trace node through a trace edge, each trace edge allowing flow from a trace node to the target node, each trace node having total out flow that is equal to total in flow. In one example, each of the first and second graphs comprises matching edges, each matching edge connecting a net node and a matching trace node, flow in each matching edge representing assignment of net to trace. In one example, each of the first and second graphs comprises tree nodes and matching edges, each tree node connected to a plurality of trace nodes through tree edges to represent a combination of traces in the plurality of trace nodes for providing a connection, each matching edges connecting a net node to one of: a tree node and a trace node, flow in each matching edge representing assignment of net to trace, flow in a matching edge into each tree node causing equal amount of out flow to the plurality of trace nodes through the trace nodes. In one example, modifying the first graph to generate the second graph includes: modifying flow capacity for a portion of the first graph according to the second net groups to generate the second graph. In another example, modifying the first graph to generate the second graph further comprises: modifying capacity for flow for a portion of the first graph to generate the second graph.
In one embodiment of the present invention, a method to design a circuit includes: determining a first multiplexing ratio; and determining a first partition solution of the circuit and a first trace assignment solution for nets crossing partition boundaries of the first partition solution of the circuit according to the first multiplexing ratio. The first trace assignment solution time multiplexes signals for a first plurality nets crossing partition boundaries of the first partition solution according to the first multiplexing ratio so that the first trace assignment solution satisfies a trace constraint. The first partition solution satisfies an area constraint when circuitry for time multiplexing signals for the first plurality nets is considered. In one embodiment, the multiplexing ratio is incrementally adjusted (e.g., reduced by one at a time) to tighten the trace requirement. In one example, after the first multiplexing ratio is adjusted to determine a second multiplexing ratio, a second partition solution of the circuit and a second trace assignment solution for nets crossing partition boundaries of the second partition solution of the circuit are determined according to the second multiplexing ratio. The second trace assignment solution time multiplexes signals for a second plurality nets crossing partition boundaries of the second partition solution according to the second multiplexing ratio so that the second trace assignment solution satisfies a trace constraint. The second partition solution satisfies an area constraint when circuitry for time multiplexing signals for the second plurality nets is considered. In one example, determining the first partition solution of the circuit and the first trace assignment solution includes: selectively moving a block of the circuit from a first partition to a second partition to improve a design goal which is a function of both a partition solution and a trace assignment solution. In one example, resources available for nets crossing partition boundaries are determined according to the first multiplexing ratio; and, the trace constraint is based on the trace resource determined according to the first multiplexing ratio. In one example, determining the trace resources includes: reserving a number of traces between a first partition and a second partition for a number of signals that cannot be time multiplexed; and multiplying remaining number of traces between the first partition and the second partition, which are not reserved, by the first multiplexing ratio to determined the trace resources.
The present invention includes methods and apparatuses which perform these methods, including data processing systems which perform these methods, and computer readable media which when executed on data processing systems cause the systems to perform these methods.
Other features of the present invention will be apparent from the accompanying drawings and from the detailed description which follows.
The present invention is illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate similar elements.
The following description and drawings are illustrative of the invention and are not to be construed as limiting the invention. Numerous specific details are described to provide a thorough understanding of the present invention. However, in certain instances, well known or conventional details are not described in order to avoid obscuring the description of the present invention. References to an or one embodiment in the present disclosure are not necessary to the same embodiment; and, such references means at least one.
Many of the methods of the present invention may be performed with a digital processing system, such as a conventional, general purpose computer system. Special purpose computers which are designed or programmed to perform only one function may also be used.
As shown in
It will be apparent from this description that aspects of the present invention may be embodied, at least in part, in software. That is, the techniques may be carried out in a computer system or other data processing system in response to its processor, such as a microprocessor, executing sequences of instructions contained in a memory, such as ROM 107, volatile RAM 105, non-volatile memory 106, cache 104 or a remote storage device. In various embodiments, hardwired circuitry may be used in combination with software instructions to implement the present invention. Thus, the techniques are not limited to any specific combination of hardware circuitry and software nor to any particular source for the instructions executed by the data processing system. In addition, throughout this description, various functions and operations are described as being performed by or caused by software code to simplify description. However, those skilled in the art will recognize what is meant by such expressions is that the functions result from execution of the code by a processor, such as the microprocessor 103.
A machine readable medium can be used to store software and data which when executed by a data processing system causes the system to perform various methods of the present invention. This executable software and data may be stored in various places including for example ROM 107, volatile RAM 105, non-volatile memory 106 and/or cache 104 as shown in
Thus, a machine readable medium includes any mechanism that provides (i.e., stores and/or transmits) information in a form accessible by a machine (e.g., a computer, network device, personal digital assistant, manufacturing tool, any device with a set of one or more processors, etc.). For example, a machine readable medium includes recordable/non-recordable media (e.g., read only memory (ROM); random access memory (RAM); magnetic disk storage media; optical storage media; flash memory devices; etc.), as well as electrical, optical, acoustical or other forms of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.); etc.
Conventional partitioning techniques do not take the trace connectivity between containers into account. Thus, a partition solution of a conventional partitioning technique may require more wire traces than what are available on a circuit board to interconnect the partitions of the circuit. To meet the constraint on wire traces, Time Domain Multiplexing (TDM) may be used to send multiple signals for different nets across a time shared wire. However, TDM introduces additional delay in the circuit; and, TDM can be very complex when there are multiple clock domains in the circuit.
At least one embodiment of the present invention partitions a circuit (e.g., a gate level logic circuit, a register transfer level circuit, a behavioral level circuit, or others) into multiple partition containers connected by traces according to the trace connectivity available between the containers. A partition container hosts a portion of the circuit. For example, a partition container can be a chip on a printed circuit board where the chips are interconnected by wire traces on the board; a partition container can also be a physical region on a chip where the regions on the chip are interconnected with chip wiring. A partition container has multiple connection points or pins through which the portion of the circuit hosted inside the partition container can be connected to other portions of the circuit outside the partition container. A trace (e.g., a wire trace on a printed circuit board, or chip wiring, or routing resource on a chip, or others) provides wiring resources (e.g., wire connections) to interconnect portions of a circuit hosted in two or more containers.
In one embodiment of the present invention, a circuit is split into multiple portions such that: 1) each of the multiple portions can fit into one container; and, 2) there are a sufficient number of traces among the containers to ensure the required net connectivity. Conventional partitioning methods take into account the area and the number of pins of the container without considering the trace connections among the containers. Such conventional methods may lead to infeasible solutions due to that the constraints on the available trace connections between the containers are not considered during the partitioning process. For example, consider a container that has 100 pins, 50 of which are used by the 50 traces that connect to another container. The remaining 50 pins are used for connections to other containers. A conventional method may generate a partition solution that requires only 60 nets to be assigned to the 50 traces between the two containers. Such a solution is not feasible (without TDM), even though the constraints on the pin numbers are met (only 60 of 100 pins are used).
C=F(CT,CA)
where CT represents the trace cost due to the excessive nets in a partition solution that can not be assigned to available traces; and, CA represents the area cost for the partition solution. The total cost of the partition is a function of trace cost and area cost. In one embodiment of the present invention, F(CT, CA) represents a weighted summation of the trace cost (CT) and the area cost (CA).
Given a partitioning of the logic circuit, nets that span multiple containers to connect logic blocks assigned to different containers need to be assigned to traces. A net is connected to a container if the container has at least one logic block connected to the net. Trace assignment is performed through finding a matching trace for each net. A matching trace is a trace that can be used to implement the net. If the set of containers connected by a net is a subset of or equal to the set of containers connected by a trace, the trace is a matching trace of the net. There can be several matches for each net, which results in different net-to-trace assignments. In the present application, it is appreciated that when set Γ is equal to set Ω, set Γ can be consider the subset of set Ω; and, set Γ can also be consider the superset of set Ω.
In one embodiment of the present invention, the traces are grouped according to the sets of partitions they connect; and, the nets are also grouped according to the sets of the partitions they connect. The trace cost of the partition is the cost of all unassigned nets. For example,
where f1 (ni, mi) is the cost of unassigned nets for connecting ith set of partitions; ni is the number of unassigned nets for the ith set of partitions (e.g., ith net group); mi is the total number of traces that a net for ith set of partitions can be assigned to; and N is the total number of net groups. Thus, mi is the sum of the traces in all the trace groups that connects the sets of partitions that are equal to or the supersets of the ith set of partitions (e.g., for ith net group). The cost is zero if all the nets can be assigned. The cost increases as ni increases (e.g., f1 is proportional to ni). In one embodiment of the present invention,
It is understood that other types of functions (e.g., with a different exponent) can also be used.
Similarly, the area cost of the partition is computed by:
where ai is the area of the logic block assigned to partition i; and, Ai is the maximum area of partition i. In one embodiment of the present invention,
for (ai>Athreshold), where Athreshold is the threshold area below which the area cost is 0. Thus, there is no penalty for staying within the capacity constraints. Athreshold is typically a value equal to or less than Ai. However, Athreshold can also be greater than Ai. A different exponent can also be used in penalizing overutilization.
A method to find a maximum matching is used to find a trace assignment solution to maximize the number of nets that can be assigned to traces. In one embodiment of the present invention, maximum matching is found by transforming the trace assignment problem into a maximum-flow problem. A flow network is constructed, in which flows correspond to matching. In determining the cost associated with trace assignment, one embodiment of the present invention uses a flow model to assign nets to traces.
In one embodiment of the present invention, nodes are created in a flow graph to represent groups of nets and traces. After a source node and a target node are created, nets connecting the same set of partitions are grouped and represented by a net node in the flow graph. All nets in a net node connect the same set of partitions. Net edges are added from the source node to each of the net nodes; and, the capacity of each net edge is set to the number of nets represented by the corresponding net node. Nodes can be created for each net; however, grouping the nets decreases the size of the graph by a considerable amount, which decreases the complexity of the problem. Similarly, traces connecting the same set of partitions are grouped and represented by a trace node in the flow graph. All traces in a trace node connect the same set of partitions. Trace edges are added from the trace nodes to the target node; and, the capacity of each trace edge is set to the number of traces in the corresponding trace node. After creating the net nodes and trace nodes, matching edges are created between matching net nodes and trace nodes. An edge is created between a net node and a trace node if the set of partitions of a net node is equal to or a subset of the set of partitions of a trace node. The capacities of the trace edges are fixed for a given set of connections between the partitions, which limit the number of nets that can be assigned to a certain type of traces. Therefore, the capacity of the matching edge can be set to the capacity of the trace edge corresponding to the trace node. However, it is understood that the capacity of the matching edge can also be set to a number that is larger than the capacity of the trace edge corresponding to the trace node, which will not affect the resulting flow.
Variations can be used to model the flow graph. In one embodiment of the present invention, matching edges between net nodes and trace nodes are assigned a weight to prefer one matching to the other that matches the same number of nets.
The above illustrated flow diagrams show examples in which the direction of flow is from net nodes to trace nodes. However, it is understood that the direction of flow can also be set to be from the trace nodes to the net nodes. For example, in another variation, edges can be created between from the source node to the trace nodes, and from net nodes to the target node; and, matching edges can be created from trace nodes to the net nodes. A matching edge is created between a trace node and a net node if the set of partitions that the trace connects is a superset of the set of partition that the net connects. Maximum flow can be found from source to target.
Consider a partition solution illustrated in
In the present application, it is appreciated that a block can be a single element or a cluster of elements. Multiple elements can be grouped as a block in a clustering process before the partitioning of the circuit.
To determine a solution of assigning nets to traces, one embodiment of the present invention uses a flow model. Traces are grouped according to the partitions they connect. For example, traces 351 connect partitions 301 (A), 303 (B) and 307 (C); and, trace node 421 (ABC) is created in the graph in
Similarly, nets are grouped according to the partitions in which the portions of the circuit they connect are contained. For example, nets 331, 341 and 339 connect the portions of the circuit that are in partitions 301 (A), 303 (B) and 307 (C); and, net node 413 (ABC) is created in the graph in
In one embodiment of the present invention, source node 401 is connected to each net nodes through a net edge (e.g., 431-437) to conduct flow from the source node into the net node; and, target node 403 is connected to each trace node through a trace edge (e.g., 441-447) to conduct from the trace node into target node. A net node matches a trace node when a net represented by the net node can be assigned to a trace represented by the trace node. A matching edge can be used to connect a net node to a matched trace node to allow flow from the net node to the trace nodes. For example, a net of net node 411 (AC) can be assigned to a trace of trace node 421 (ABC) or trace node 427 (ABCD); thus, matching edges 451 and 453 are used to connect net node 411 to trace nodes 421 and 427. In one embodiment of the present invention, the flow capacity of the net edges (e.g., 431-437) are determined by the number of nets represented by the corresponding net nodes their connect; and, the flow capacity of the trace edges (e.g., 441-447) are determined by the number of traces represented by the corresponding trace nodes they connect. The reverse capacities (i.e., the capacities from the net nodes to the source, from the trace nodes to the net nodes, and from the target node to the trace nodes) of these edges are all zero. The flow in the matching edges from the net nodes to the trace nodes represents a solution for assigning the nets to the traces. It is understood that, in the graph of
In one embodiment of the present invention, there is no limit on the flow capacity of the matching edges. In an alternative embodiment of the present invention, the flow capacity of each matching edge is set to the flow capacity of the corresponding trace edge which connects to the trace node that the matching edge connects (e.g., the capacity of edge 453 is equal to the capacity of edge 447). It is understood that various modifications to the graph in
In the graph in
In one embodiment of the present invention, the flow maximization algorithm is used to maximize the flow in the graph of a flow model to assign nets to traces.
In one embodiment of the present invention, the cost for trace assignment depends also on how the unassigned nets are distributed amount different net groups. Thus, alternative maximum flow patterns in the graph can be found to search for a solution with minimum trace cost.
Thus, the trace assignment cost can be computed from the flow graph by running any maximum flow algorithm. Any IP module in the design corresponding to an IP block on the board will guide the trace based combined cost partitioner to partition logic blocks connected to the IP module, to the chips connected to the IP block on the board. Traditional partitioning methods, which do not take traces into account, will not be able to take advantage of the connectivity of the board and may fail to partition the logic blocks to the chips connected to the IP block on the board.
From this description, a person skilled in the art understands that a trace assignment solution can be determined from such a flow model. Various flow maximization algorithms known in the art (e.g., the augmenting path of Lestor R. Ford, Jr., and D. R. Fulkerson, described in “Flows in Networks”, Princeton University Press, 1962; the shortest path of Jack Edmonds and Richard M. Karp, described in “Theoretical improvements in the algorithmic efficiency for network flow problems”, Journal of the ACM, 19:248-264, 1972; the preflow-push method of Andrew V. Goldberg and Robert E. Tarjan, described in “A new approach to the maximum flow problem”, in proceedings of the Eighteenth Annual ACM Symposium on Theory of Computing, pages 136-146, 1986; and others) can be used in obtaining a trace assignment solution. Further, a trace assignment solution can be obtained by solving the following maximization problem using mathematical techniques such as integer linear programming.
Where Mij represents the number of traces assigned from the ith net group to the jth trace group; Mij≧0 if the ith net group matches the jth trace group; Mij=0 if the ith net group does not match the jth trace group;
Ni represents the number of nets in the ith net group;
and, Tk represents the number of nets in the kth trace group.
Alternatively, the trace cost function can be minimized to assign the nets to traces. For example,
where CT is the total trace cost function.
One embodiment of the present invention uses an incremental algorithm (e.g., based on the flow model, or based on the integer linear programming model) to compute trace cost function CT, in which the trace assignment solution before a modification (e.g., moving a block from one partition to another) made to the partitioning solution is used as the starting point for the search for the trace assignment solution after the modification for the new partitioning solution. Since the incremental algorithm is used, the computation of the solution to the trace assignment after the modification can be shortened.
In one embodiment of the present invention, modifications to a partition scheme are made to search for a best partitioning solution that minimizes the cost function. When a partition scheme is modified, the flow graph for the previous trace assignment solution is modified and used as a starting point in the flow maximization process to obtain a trace assignment solution for the current partitioning scheme. The flow maximization process does not start from the graph of zero flow.
After the topology and capacity constraints are changed in the graph, due to the modification to the partitioning solution, the flow in the new graph can be updated and maximized. For example, net edge 521 has excessive flow. Thus, a path from the source node to the target node can be found to remove (or redirect) the excessive flow. For example, in
Logic blocks assigned to non-adjacent regions need to connect indirectly through some intermediate regions using feedthrough. A connectivity graph that shows the connectivity between regions can be used to obtain various possible feedthrough solutions to interconnect two or more regions for nets that connect portions of the circuit in these regions.
Connectivity between non-adjacent regions can be realized by finding a set of interconnected nodes (e.g., a tree or a path) in the graph that connect the nodes representing the regions. In one embodiment of the present invention, only trees, which contain no cycles, that connect the required nodes are selected as possible feedthrough solutions, since a set of interconnected nodes with one or more cycles can be converted into a tree by removing one or more edges. A such generated tree provides the same type of connection with less wiring resources than the original set of interconnected nodes with one or more cycles
In general, there are several trees in a graph connecting a set of nodes, which represent the partitioned regions. Some edges in a tree can be redundant so that removing the edge will not break the connectivity between the set of nodes. In one embodiment of the present invention, only minimal trees that have no redundant edges are used as feedthrough solutions to realize the required connectivity among the set of regions.
Further, tree nodes (e.g., 821-827) represent possible feedthrough solutions for trace assignment. For example, trace node 821 represents feedthrough solution illustrated in
Matching edges (e.g., 861-867) connects net nodes to tree nodes or trace nodes to represent possible assignment of net to traces. For example, a net connecting regions A and C, which is represent by net node 811, can be assigned to a feedthrough solution represented by tree node 821; thus, matching edge 861 connects net node 811 to tree node 821 to allow flow (assignment of net to trace).
In one embodiment of the present invention, not all possible matching edges are present in the flow graph. For example, a flow from net node 811 to tree node 825 is possible. However, tree node 821 provides an outlet for net node 811; and, tree node 821 depends on a subset of the trace edges on which tree node 825 depends. Thus, a flow from node 811 through tree node 825 always requires more resources than a flow through tree node 821. Therefore, including a matching edge connecting net node 811 and tree node 825 would not improve the trace assignment solution, in the presence of matching edge 861. Thus, some matching edges can be excluded from the flow graph to simplify the graph and reduce the computation time for maximizing the flow in the graph (e.g., without degrading the quality of the solution.
Although flow conservation is preserved at each net node and at each trace node, a tree node that depends on two or more trace nodes in general does not have equal inflow and outflow. The inflow on each tree node is pushed to all the outgoing tree edges of the tree node, since all the trace nodes of the tree node are relied upon for each net (connection) assigned to the tree node. For example, one net assigned to tree node 821 requires one trace from each of trace nodes 831 and 833. Thus, an amount of flow into tree node 821 causes the same amount of flow onto each of tree edges 871 and 873. A tree node generates flow according to the amount of inflow. Therefore, the inflow and the outflow are not equal for the tree nodes; and, a typical maximum flow algorithm known in the art does not apply to such a flow graph with a tree node. Since the tree nodes generate additional flow, the outflow from the source node is also not equal to the inflow into the target node.
In one embodiment of the present invention, no matching edge is used to connect a net node to a trace node directly. Instead, a matching edge connects the net node to a tree node that depends only on the trace node. Thus, matching edges connects only the net nodes and tree nodes in the graph. In searching for an augmenting path from the source node to the target node, the additional flow in the augmenting path may go through multiple net nodes, tree nodes and matching edges until reach a tree node that depends on a set of trace nodes each of which allows additional flow. For example, since tree node 821 depends on trace nodes 831 and 833, inflow into tree node 821 reach target node 803 only if both trace edges 853 and 851 allow additional flow; and, the additional flow is limited by the least amount of addition flow allowed in trace edges 853 and 851 (and by other capacity restrictions on the path).
From this description, a person skilled in the art understands various modifications to the graph in
In one embodiment of the present invention, the cost function for trace assignment is evaluated to find the best solution by minimizing the trace cost during finding alternative maximum solutions.
In one embodiment of the present invention, finding a solution to the following maximization problem solves the trace assignment.
Where Mij represents the number of traces assigned from the ith net group to the jth tree group; Mij≧0 if the ith net group matches the jth tree group; Mij=0 if the ith net group does not match the jth tree group;
Ni represents the number of nets in the ith net group;
Dkl=0 if the kth tree node does not depend on lth trace group; Dkl=1 if the kth tree node depend on lth trace group; and, Tl represents the number of nets in the lth trace group.
Alternatively, the trace cost can be minimized to assign the nets to traces. For example,
where CT is the total trace cost function.
The combined area-trace cost function can be used with any partitioning technique.
There are many techniques to modify a partition solution. One technique is to move one or more blocks at a time between the partition containers in order to reduce the cost function (or improve the design goal indicator). Various methods for moving blocks in conventional partitioning methods, such as those in the Fidducia Mattheyses algorithm, can also be used with various embodiments of the present invention.
After computing the cost of the partition, it is attempted to move a logic block from one partition to another to minimize the partition cost. The logic block ‘m’ to be moved is chosen on the basis of a quantity called ‘gain’ which is defined as the aggregate partition cost improvement when logic block ‘m’ is moved from one container to another. If the initial partition cost is F(CT, CA), where CT is the trace cost, and CA is the area cost, and if the partition cost after the move is F(CTn, CAn), where CTn is the new trace cost and CAn is the new area cost, the gain for moving block ‘m’ from the current partition to the specific partition can be computed from the difference between F(CT, CA) and F(CTn, CAn). Operation 1049 computes gains for move candidates (e.g., all moves of any single block of circuit from the container it is currently in to any other containers). For example, a move candidate represents a move of a block from its current partition to other partitions. A block can be moved from a current partition to any other partitions. Operation 1051 sorts the move candidates according to their gains to generate a list of moves. For example, the move candidates can be bucket sorted according to the gains. Operation 1053 determines whether or not there is a move to be performed. Performed moves will be locked in the iteration until a new list of move is generated in operation 1049. If moves in the list have been performed, operation 1055 retrieves the best design as the current design and the best indicator as the current design goal indicator. If operation 1057 determines the design acceptable (e.g., when all the area constraints, trace constraints are met, or the design goal indicator can not be improved through an iteration process), the partitioning process ends. Otherwise, operation 1049 is performed to generate a new list of move candidates.
If operation 1053 determines there is a move to be performed, operation 1059 performs the move (e.g., with the largest gain among the moves in the list that has not been performed) to modify the partition solution. Often the gain can have a non-positive value indicating an increase in the partition cost if the block is moved. The block is still moved with the expectation that the move allows the algorithm to “climb out of local minima”. After the move, operation 1061 updates the trace assignment according to the modified partition solution; and, operation 1063 computes the gains for the remaining move candidates that are affected by the move. Depending on the cost function, moving a block from one container to another may affect the gain of any related moves. Related moves could be moves of blocks connected to the moved block, move of blocks in the source or destination partition of the move etc. Operation 1065 evaluates the current design goal indicator (e.g., cost) based on the modified partition solution and the updated traces assignment. If operation 1067 determines that the current design goal indicator is better than the saved best indicator (e.g., is C<Cbest), operation 1069 saves the current design as the best design and the current design goal indicator as the best indicator (e.g., Cbest=C); otherwise, operation 1053 checks again to determine if there is a move to be performed.
From this description, it is understood that a similar method as shown in
Moving a block from one container to another during partitioning changes the cost of the partition. The trace cost changes due to the change in connectivity of the logic blocks assigned to various containers; and, the area cost changes due to the change in area of the source and destination containers. In one embodiment of the present invention, the cost is updated incrementally to improve run-time efficiency.
Moving a block from one container to another changes the set of partitions connected to the net, for some nets that are connected to the moved block. Therefore, a net connected to a block may move to a different net group after the move of that block. To quickly compute the new set of partitions that a net connects to, a distribution of the net is maintained, which is defined as the number of blocks the net has in each container for a given partition. The distribution is computed for all the nets in the beginning. After a block is moved, the distribution of all the nets connected to the block changes. The net distribution is updated by decrementing the number of blocks in the source container by one and incrementing the number of blocks in the destination container by one. If the number of blocks in a partition change from “0” to non-zero (e.g., “1”), in the distribution of the net, the partition is added to the set of partitions that the net connects, and if the number of blocks changes from non-zero (e.g., “1”) to “0”, the partition is removed from the set of partitions that the net connects. Thus, by maintaining the distribution of the net, the net can be quickly moved from one net group to another when the connectivity of the net changes. The capacity of the net groups can be updated accordingly. The capacity of the net edges in the flow graph can be quickly updated from the capacity of the net groups after a move is performed. A move also affects the gain of other moves. To compute the trace gain of a move, the capacity of the net edges are updated, and then incremental flow is run to generate a net to trace assignment. The trace cost improvement is computed from the new trace assignment solution. In one embodiment of the invention, for each move, the change in capacity of each net group or net edge that the move will cause, is maintained as an array. After a move is performed, the net distribution of the nets connected to the moved block may change. The array of net group capacity changes needs to be updated for moves of blocks connected to the moved block. The array can be updated incrementally from the distribution of the net. From the array, the flow graph can be updated and incremental flow can be run to compute the new gain values. The array of net group capacity changes will not change for blocks that are not connected to the moved block. However, the flow graph changes after a move and therefore the trace gain needs to be recomputed for all the affected moves by updating the capacities of the net edges in the flow graph. Similarly, the area gains need to be recomputed for all the affected moves (For the given cost function, all the moves into or from the source or destination partition of the performed move need to be updated). The capacity of the trace edges typically remains fixed. After the net edge capacities are updated, the flow on some edges becomes invalid as some edges have a flow larger than the capacity. Excess flow on the edges is removed or redirected first and then the incremental flow is run to compute the matching cost.
For example,
While most embodiments of the present invention are intended for use in an HDL design synthesis software, the invention is not necessarily limited to such use. Although use of other languages and computer programs is possible (e.g. a computer program may be written to describe hardware and thus be considered an expression in an HDL and may be compiled or the invention, in some embodiments, may allocate and reallocate a logic representation, e.g. a netlist, which was created without the use of an HDL), embodiments of the present invention will be described in the context of use in HDL synthesis systems, and particularly those designed for use with integrated circuits which have vendor-specific technology/architectures. As is well known, the target architecture is typically determined by a supplier of programmable ICs. An example of a target architecture is the programmable lookup tables (LUTs) and associated logic of the integrated circuits which are field programmable gate arrays from Xilinx, Inc. of San Jose, Calif. Other examples of target architecture/technology include those well known architectures in field programmable gate arrays and complex programmable logic devices from vendors such as Altera, Lucent Technology, Advanced Micro Devices, and Lattice Semiconductor. For certain embodiments, the present invention may also be employed with application-specific integrated circuits (ASICs).
In one embodiment of the present invention, the cost function is a combined function of both the partition solution as well as the trace assignment solution. The combined cost function takes into consideration both the area of the circuits in a partition as well as the assignment of the nets to traces between the partitions, allowing a trade-off between area and traces. To improve the cost function (e.g., limit the usage of area and traces), blocks of circuits are moved among partitions and the trace assignment is updated accordingly. If the area limit of any partition is not met, the partitioning solution cannot be realized and is an infeasible solution. However, if there is an insufficient number of traces to assign the nets connecting different partitions, signals for multiple nets can be time multiplexed to share one or more traces to realize the connectivity.
In one embodiment of the present invention, to find a feasible partitioning solution, a multiplexing ratio is determined. Given an initial multiplexing ratio, the trace limits can be relaxed accordingly and partitioning can be performed with the relaxed trace constraint. The partitioner may arrive at a feasible solution with the relaxed trace constraints based on the initial multiplexing ratio. The multiplexing ratio can then be lowered to tighten the trace constraints and the partitioner can try to find a new partitioning solution. Partitioning can be performed several times by lowering the multiplexing ratio until no feasible partitioning solution can be found. The successful partition with the least multiplexing ratio can be used as the final partition solution.
A starting multiplexing ratio can be determined by first finding an initial partition that satisfies the area cost. Then, a net-to-trace assignment can be performed for the crossing nets and an estimate of the required multiplexing ratio to completely assign all the nets can be determined. The estimate can be used as a starting multiplexing ratio. Additional logic elements and control signals are needed in corresponding partitions to allow signals across the partition boundaries to share the traces that connect the partitions. The area of the overhead logic for implementing time multiplexing can be estimated and the overhead area can be considered in area constraint calculations. Further, multiplexing circuitry requires control and clock signals that cannot be multiplexed. Therefore, some traces are reserved for these control and clock signals. The area of the overhead logic and the number of overhead traces (e.g., for time multiplexing control and clock signals) can be determined based on the specific implementation of the multiplexing circuitry used. The overhead traces for control signals and clock signals are reserved and the number of remaining traces is multiplied by the multiplexing ratio to get the new trace constraint. The partitioner computes the partition cost based on the new constraints and tries to find a solution. If a feasible partition solution is found, the multiplexing ratio is reduced to tighten the trace constraints so that partitioning is performed with the new constraints.
In one embodiment of the present invention, the partition solution is modified through selectively moving blocks among partitions to reduce the cost function which is a function of both the partition solution and the trace assignment solution. During the process of minimizing the cost function, the multiplexing ratio is reduced when not all available trace resources across a partition boundary are used in the trace assignment solution. In one embodiment, a single multiplexing ratio is used to compute the equivalent number of traces available for the nets crossing all partition boundaries. Alternatively, different multiplexing ratios are used to compute the equivalent number of traces available for the nets crossing different partition boundaries. For example, time multiplexing at individual partition boundaries can be individually controlled by different multiplexing ratios. Further, in one embodiment of the present invention, the cost function further includes the consideration of multiplexing ratios (e.g., a function of one or more multiplexing ratios). For example, a higher multiplexing ratio contributes to a higher value of the cost function.
In the foregoing specification, the invention has been described with reference to specific exemplary embodiments thereof. It will be evident that various modifications may be made thereto without departing from the broader spirit and scope of the invention as set forth in the following claims. The specification and drawings are, accordingly, to be regarded in an illustrative sense rather than a restrictive sense.
This application is a divisional of U.S. application Ser. No. 13/465,930, filed on May 7, 2012, to issue as U.S. Pat. No. 8,458,639 on Jun. 4, 2013, which is a divisional of U.S. application Ser. No. 12/942,961, filed on Nov. 9, 2010, now U.S. Pat. No. 8,176,452 issued on May 8, 2012, which is a divisional of U.S. application Ser. No. 11/762,024, filed on Jun. 12, 2007, now U.S. Pat. No. 7,844,930, issued on Nov. 30, 2010, which is a divisional of U.S. application Ser. No. 10/792,933, filed on Mar. 3, 2004, now U.S. Pat. No. 7,237,214, issued on Jun. 26, 2007, which claimed the benefit of the filing date of Provisional Application No. 60/452,314, filed on Mar. 4, 2003, and entitled “Method and Apparatus for Circuit Partitioning and Trace Assignment In Circuit Design.” All of the above are incorporated in their entirety herein by reference.
Number | Date | Country | |
---|---|---|---|
60452314 | Mar 2003 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 13465930 | May 2012 | US |
Child | 13908732 | US | |
Parent | 12942961 | Nov 2010 | US |
Child | 13465930 | US | |
Parent | 11762024 | Jun 2007 | US |
Child | 12942961 | US | |
Parent | 10792933 | Mar 2004 | US |
Child | 11762024 | US |