Floor Placements
Floor Placements
2 Placement
After completing a floorplan we can begin placement of the logic cells within
the flexible blocks. Placement is much more suited to automation than
floorplanning. Thus we shall need measurement techniques and algorithms.
After we complete floorplanning and placement, we can predict both intrablock
and interblock capacitances. This allows us to return to logic synthesis with
more accurate estimates of the capacitive loads that each logic cell must drive.
There is no standard terminology for connectors and the terms can be very
confusing. There is a difference between connectors that are joined inside the
logic cell using a high-resistance material such as polysilicon and connectors
that are joined by low-resistance metal. The high-resistance kind are really two
separate alternative connectors (that cannot be used as a feedthrough),
whereas the low-resistance kind are electrically equivalent connectors. There
may be two or more connectors to a logic cell, which are not joined inside the
cell, and which must be joined by the router ( must-join connectors ).
There are also logically equivalent connectors (or functionally equivalent
connectors, sometimes also called just equivalent connectors—which is very
confusing). The two inputs of a two-input NAND gate may be logically
equivalent connectors. The placement tool can swap these without altering the
logic (but the two inputs may have different delay properties, so it is not
always a good idea to swap them). There can also be logically equivalent
connector groups . For example, in an OAI22 (OR-AND-INVERT) gate there
are four inputs: A1, A2 are inputs to one OR gate (gate A), and B1, B2 are
inputs to the second OR gate (gate B). Then group A = (A1, A2) is logically
equivalent to group B = (B1, B2)—if we swap one input (A1 or A2) from gate
A to gate B, we must swap the other input in the group (A2 or A1).
In the case of channeled gate arrays and FPGAs, the horizontal interconnect
areas—the channels, usually on m1—have a fixed capacity (sometimes they
are calledfixed-resource ASICs for this reason). The channel capacity of
CBICs and channelless MGAs can be expanded to hold as many interconnects
as are needed. Normally we choose, as an objective, to minimize the number of
interconnects that use each channel. In the vertical interconnect direction,
usually m2, FPGAs still have fixed resources. In contrast the placement tool
can always add vertical feedthroughs to a channeled MGA, channelless MGA,
or CBIC. These problems become less important as we move to three and more
levels of interconnect.
Objectives such as these are difficult to define in a way that can be solved
with an algorithm and even harder to actually meet. Current placement tools
use more specific and achievable criteria. The most commonly used placement
objectives are one or more of the following:
FIGURE 16.21 Interconnect-length
measures. (a) Complete-graph measure.
(b) Half-perimeter measure.
The bounding box is the smallest rectangle that encloses all the terminals
(not to be confused with a logic cell bounding box, which encloses all the
layout in a logic cell). The half-perimeter measure (or bounding-box
measure) is one-half the perimeter of the bounding box ( Figure 16.21 b)
[ Schweikert, 1976]. For nets with two or three terminals (corresponding to a
fanout of one or two, which usually includes over 50 percent of all nets on a
chip), the half-perimeter measure is the same as the minimum Steiner tree. For
nets with four or five terminals, the minimum Steiner tree is between one and
two times the half-perimeter measure [ Hanan, 1966]. For a circuit with m nets,
using the half-perimeter measure corresponds to minimizing the cost function,
1 m
f = –– h i (16.5)
2 i = 1
where h i is the half-perimeter measure for net i .
It does not really matter if our approximations are inaccurate if there is a
good correlation between actual interconnect lengths (after routing) and our
approximations.Figure 16.22 shows that we can adjust the complete-graph and
half-perimeter measures using correction factors [ Goto and Matsuda, 1986].
Now our wiring length approximations are functions, not just of the terminal
positions, but also of the number of terminals, and the size of the bounding
box. One practical example adjusts a Steiner-tree approximation using the
number of terminals [ Chao, Nequist, and Vuong, 1990]. This technique is used
in the Cadence Gate Ensemble placement tool, for example.
One problem with the measurements we have described is that the MRST
may only approximate the interconnect that will be completed by the detailed
router. Some programs have a meander factor that specifies, on average, the
ratio of the interconnect created by the routing tool to the interconnect-length
estimate used by the placement tool. Another problem is that we have
concentrated on finding estimates to the MRST, but the MRST that minimizes
total net length may not minimize net delay (see Section 16.2.8 ).
There is no point in minimizing the interconnect length if we create a
placement that is too congested to route. If we use minimum interconnect
congestion as an additional placement objective, we need some way of
measuring it. What we are trying to measure is interconnect density.
Unfortunately we always use the term density to mean channel density (which
we shall discuss in Section 17.2.2, “Measurement of Channel Density”). In this
chapter, while we are discussing placement, we shall try to use the
term congestion , instead of density, to avoid any confusion.
One measure of interconnect congestion uses the maximum cut line .
Imagine a horizontal or vertical line drawn anywhere across a chip or block, as
shown inFigure 16.23 . The number of interconnects that must cross this line is
the cut size (the number of interconnects we cut). The maximum cut line has
the highest cut size.
16.2.4 Placement Algorithms
There are two classes of placement algorithms commonly used in commercial
CAD tools: constructive placement and iterative placement improvement.
A constructive placement method uses a set of rules to arrive at a constructed
placement. The most commonly used methods are variations on the min-cut
algorithm . The other commonly used constructive placement algorithm is
the eigenvalue method. As in system partitioning, placement usually starts with
a constructed solution and then improves it using an iterative algorithm. In
most tools we can specify the locations and relative placements of certain
critical logic cells as seed placements .
The min-cut placement method uses successive application of partitioning
[ Breuer, 1977]. The following steps are shown in Figure 16.24 :
1. Cut the placement area into two pieces.
2. Swap the logic cells to minimize the cut cost.
3. Repeat the process from step 1, cutting smaller pieces until all the
logic cells are placed.
FIGURE 16.24 Min-cut placement. (a) Divide the chip
into bins using a grid. (b) Merge all connections to the
center of each bin. (c) Make a cut and swap logic cells
between bins to minimize the cost of the cut. (d) Take
the cut pieces and throw out all the edges that are not
inside the piece. (e) Repeat the process with a new cut
and continue until we reach the individual bins.
Usually we divide the placement area into bins . The size of a bin can vary,
from a bin size equal to the base cell (for a gate array) to a bin size that would
hold several logic cells. We can start with a large bin size, to get a rough
placement, and then reduce the bin size to get a final placement.
The eigenvalue placement algorithm uses the cost matrix or
weighted connectivity matrix ( eigenvalue methods are also known
as spectral methods ) [Hall, 1970]. The measure we use is a cost
function f that we shall minimize, given by
1 n
f = –– c ij d ij 2 (16.6)
2 i = 1
where C = [ c ij ] is the (possibly weighted) connectivity matrix, and d ij is the
Euclidean distance between the centers of logic cell i and logic cell j . Since we
are going to minimize a cost function that is the square of the distance between
logic cells, these methods are also known as quadratic placement methods.
This type of cost function leads to a simple mathematical solution. We can
rewrite the cost function f in matrix form:
1 n
f = –– c ij ( x i – x j ) 2 + (y i – y j ) 2
2 i = 1
= x T Bx + y T By . (16.7)
In Eq. 16.7 , B is a symmetric matrix, the disconnection matrix (also called
the Laplacian).
We may express the Laplacian B in terms of the connectivity matrix C ;
and D , a diagonal matrix (known as the degree matrix), defined as follows:
B = D – C ; (16.8)
n
d ii = c ij , i = 1, ... , ni ; d ij = 0, i j
i = 1
We can simplify the problem by noticing that it is symmetric in the x -
and y -coordinates. Let us solve the simpler problem of minimizing the cost
function for the placement of logic cells along just the x -axis first. We can
then apply this solution to the more general two-dimensional placement
problem. Before we solve this simpler problem, we introduce a constraint that
the coordinates of the logic cells must correspond to valid positions (the cells
do not overlap and they are placed on-grid). We make another simplifying
assumption that all logic cells are the same size and we must place them in
fixed positions. We can define a vector p consisting of the valid positions:
p = [ p 1 , ..., p n ] . (16.9)
For a valid placement the x -coordinates of the logic cells,
x = [ x 1 , ..., x n ] . (16.10)
must be a permutation of the fixed positions, p . We can show that requiring
the logic cells to be in fixed positions in this way leads to a series
of n equations restricting the values of the logic cell coordinates [ Cheng and
Kuh, 1984]. If we impose all of these constraint equations the problem
becomes very complex. Instead we choose just one of the equations:
n n
x i 2 = p i 2 . (16.11)
i = 1 i = 1
Simplifying the problem in this way will lead to an approximate solution to
the placement problem. We can write this single constraint on the x -
coordinates in matrix form:
n
x x = P ; P = p i 2 . (16.12)
T
i = 1
where P is a constant. We can now summarize the formulation of the problem,
with the simplifications that we have made, for a one-dimensional solution. We
must minimize a cost function, g (analogous to the cost function f that we
defined for the two-dimensional problem in Eq. 16.7 ), where
g = x T Bx . (16.13)
subject to the constraint:
x T x = P . (16.14)
This is a standard problem that we can solve using a Lagrangian multiplier:
= x T Bx – [ x T x – P] . (16.15)
To find the value of x that minimizes g we differentiate L partially with
respect to x and set the result equal to zero. We get the following equation:
[ B – I ] x = 0 . (16.16)
This last equation is called the characteristic equation for the
disconnection matrix B and occurs frequently in matrix algebra (this l has
nothing to do with scaling). The solutions to this equation are
the eigenvectors and eigenvalues of B . Multiplying Eq. 16.16 by x T we get:
x T x = x T Bx . (16.17)
However, since we imposed the constraint x T x = P and x T Bx = g , then
= g /P . (16.18)
The eigenvectors of the disconnection matrix B are the solutions to our
placement problem. It turns out that (because something called the rank of
matrix B is n – 1) there is a degenerate solution with all x -coordinates equal
( = 0)—this makes some sense because putting all the logic cells on top of
one another certainly minimizes the interconnect. The smallest, nonzero,
eigenvalue and the corresponding eigenvector provides the solution that we
want. In the two-dimensional placement problem, the x - and y -coordinates are
given by the eigenvectors corresponding to the two smallest, nonzero,
eigenvalues. (In the next section a simple example illustrates this mathematical
derivation.)
C=[0 0 0 1; 0 0 1 1; 0 1 0 0; 1 1 0 0]
D=[1 0 0 0; 0 2 0 0; 0 0 1 0; 0 0 0 2]
B=D-C
[X,D] = eig(B)
Running this script, we find the eigenvalues of B are 0.5858, 0.0, 2.0, and
3.4142. The corresponding eigenvectors of B are
0.5000 0.5000 –0.2706
–0.2706 0.5000 –0.5000 –0.6533
–0.6533 0.5000 0.5000 0.2706
0.2706 0.5000 –0.5000 0.6533
(16.20)
For a one-dimensional placement ( Figure 16.25 b), we use the eigenvector
(0.6533, –0.2706, –0.6533, –0.2706) corresponding to the smallest nonzero
eigenvalue (which is 0.5858) to place the logic cells along the x -axis. The two-
dimensional placement ( Figure 16.25 c) uses these same values for the x -
coordinates and the eigenvector (0.5, –0.5, 0.5, –0.5) that corresponds to the
next largest eigenvalue (which is 2.0) for the y -coordinates. Notice that the
placement shown in Figure 16.25 (c), which shows logic-cell outlines (the
logic-cell abutment boxes), takes no account of the cell sizes, and cells may
even overlap at this stage. This is because, in Eq. 16.11 , we discarded all but
one of the constraints necessary to ensure valid solutions. Often we use the
approximate eigenvalue solution as an initial placement for one of the iterative
improvement algorithms that we shall discuss in Section 16.2.6 .
The selection criteria that decides which logic cells to try moving.
The measurement criteria that decides whether to move the selected cells.
There are several interchange or iterative exchange methods that differ in
their selection and measurement criteria:
pairwise interchange,
force-directed interchange,
force-directed relaxation, and
force-directed pairwise relaxation.
FIGURE 16.30 Placement example.
(a) An example network. (b) In this
placement, the bin size is equal to the
logic cell size and all the logic cells are
assumed equal size. (c) An alternative
placement with a lower total routing
length. (d) A layout that might result from
the placement shown in b. The channel
densities correspond to the cut-line sizes.
Notice that the logic cells are not all the
same size (which means there are errors
in the interconnect-length estimates we
made during placement).