This invention concerns placement of objects in a rectangle, and particularly to placement of cells in integrated circuit designs during creation of a floorplan.
The present invention is directed to a process and apparatus for assigning N objects to M points of a rectangle, where M≧N. The invention is particularly useful in placement of cells in an integrated circuit (IC) chip, although it is also useful in other environments where a large number of object must be placed in a space.
Consider a rectangle having left and right edges a and b, where a<b, and bottom and top edges c and d, where c<d. The rectangle containing a point having coordinates (x,y) can be defined as R={(x,y)|a≦x≦b, c≦y≦d}.
Points P1(x1,y1), P2(x2,y2), . . . , PM(xM,yM), are the points of rectangle R. Objects Q1(x′1,y′1), Q2(x′2,y′2), . . . , QN(x′N,y′N) are the objects to be placed in rectangle R. T is a set of types of points and objects. ti is a type of a point Pi, where i is each member of the sequence of 1 to M (i={overscore (1,M)}). Thus, tiεT. t′i is a type of an object Qi, i={overscore (1,N)}, thus t′iεT. For any pair of types, uεT and vεT, the relation of these types TR(u,v) is such that if the object having a type v is allowed to be assigned to a point of type u, TR(u,v)=1. Otherwise, TR(u,v)=0. TR(u,u)=1 for each type uεT.
The goal of objects assignment is to assign all objects Qi, i={overscore (1,N)} to points Ps(i) (or to find the assignment s(i) for each i={overscore (1,N)}), so that:
The cost C(i,j) of assignment of an object Qi to a point Pj is denoted as follows:
One well-known technique of assigning objects is Kuhn's algorithm, which finds the optimal solution s(i) such that the sum
is the smallest possible value. However, Kuhn's algorithm requires a considerable amount of time to execute. More particularly, execution of Kuhn's algorithm requires time defined as O(N2M2). In practice, cell placement might require processing cell assignments for large values of parameters N and M (N,M>1000), and might be repeated many times during the design process. Consequently, execution of Kuhn's algorithm requires an unacceptable amount of time. Therefore, a need exists for a technique to quickly estimate objects assignment.
In a first embodiment, a process assigns objects to points of a first rectangle. An initial assignment of the objects to points of the first rectangle is created. The first rectangle is divided into a plurality of second, smaller rectangles. An object assignment procedure is applied to the initially assigned objects in each second rectangle. Preferably, each point in the first rectangle is in at least two second rectangles.
In some embodiments, the initial assignment of objects is performed by calculating a maximal cost of assignment of object to points, and selecting an assignment of objects having a minimum value of maximal cost. More particularly, a maximal matching assignment is calculated by iteratively recalculating the maximal matching assignment based on a midpoint of between the minimum and maximum costs of the assignment calculated during the prior iteration, and then recalculating the minimum and maximum costs of the recalculated assignment, iterating until the minimum cost is not smaller than the maximum cost.
In other embodiments, the object assignment procedure comprises finding objects assigned to points of each second rectangle, applying Kuhn's algorithm of object assignment to the second rectangle, and correcting the assignment. This procedure is iteratively repeated until the assignment does not change.
In accordance with another embodiment of the present invention, the process is carried out in a computer under the control of a computer readable program having computer readable code that causes the computer to carry out the process.
Step 12, shown in detail in
and where └C(i,j)┘ is the maximal integer not greater than C(i,j). For purposes of explanation, the maximal cost is designated C, C=max{overscore (C)}(i,j)≠∞ ({overscore (C)}(i,j)).
At step 30, the terms LowerBound is set to 0, UpperBound is set to the maximal cost integer (C), and middle is set to the midvalue between LowerBound and UpperBound:
At step 32, the maximal matching assignment s(i) is found for matching matrix
At step 34, if the maximal matching s(i) obtained at step 32 is determined for each i={overscore (1,N)}, such that the maximal cost is not greater than the middle (maximal cost≦middle), UpperBound is assigned to the value of middle, UpperBound=middle. Otherwise, LowerBound is assigned to the value of middle plus 1, LowerBound=middle+1.
If, at step 36, LowerBound<UpperBound, the process returns to step 32. Otherwise at step 38, the initial assignment is the maximal matching s(i) found at step 32 for the value middle=LowerBound. The assignment thus obtained is output to step 14 (
The process of step 12 calculates a maximal matching assignment by iteratively recalculating the maximal matching assignment based on a midpoint of between the minimum and maximum costs of the assignment calculated during the prior iteration, and then recalculating the minimum and maximum costs of the recalculated assignment. The process continues to iterate until the minimum cost is not smaller than the maximum cost (i.e., LowerBound≧UpperBound).
The technique of finding the maximal matching s(i) in the bipartional graph determined by the matrix d(i,j) is well-known. It is also well known that the time required for the solution of this problem is O(MN). The process of
As shown in
If Mq is the number of points, Pj, j={overscore (1,M)}, that belong to a small rectangle Rq, it is evident that more powerful splitting is obtained as the number of points of rectangle Rq becomes smaller (value of max1≦q≦k (Mq) becomes smaller). If rectangle R is uniformly split, then
At step 16, each small rectangle R1, R2 . . . . Rk, is examined using Kuhn's algorithm of assignment to correct the assignment s(i). The procedure of step 16 is more fully described in connection with
that belong to the small rectangle Rq are considered. At step 42, all objects
that are assigned to points
are located. Objects
are those objects Qi for which s(i)ε{j1, j2, . . . , jM
at points
and obtain an assignment s′(i). At step 46, the assignment achieved at step 12 (
s(i1)=s′(i1), s(i2)=s′(i2), . . . , s(iN
The time required to perform Kuhn's algorithm to each small rectangle R1, R2, . . . , Rk at step 44 is
so the time required to perform Kuhn's algorithm to all k small rectangles is
which is significantly shorter than the time required to apply Kuhn's algorithm of assignment to the entire rectangle R.
The process of
The present invention thus provides a good estimate of the placement of objects in a rectangle, such as cells in the floorplan of an integrated circuit, in a shorter period of time than required by the Kuhn's algorithm. More particularly the time of performing the process of the present invention in a computer is the sum of the initial assignment (step 12) and the final assignment (step 16) and is
Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.