CSL Notebook Entry: Title
ToFrom
TheoreticiansRick Barth
 PARC-CSL
SubjectDate
Soft Hardware Placement November 9, 1988
Copyright © 1988 by Xerox Corporation. All rights reserved.
FOR XEROX INTERNAL USE ONLY
Abstract A pithy descriptive paragraph, if appropriate
Attributes formal, draft, technical, VLSI
The Grid
Suppose that we have a rectangular grid of horizontal and vertical sticks where the sticks are numbered [0..a) horizontally and [0..b) vertically. Let's call this a minor grid.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
Now further suppose that we treat the minor grid as a primitive and form a grid of grids with the minor grids numbered [0..c) horizontally and [0..d) vertically. Let's call this a major grid.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
Now any stick can be identified with three numbers and a bit which indicates if a stick is horizontal or vertical. Let's define a position to be a tuple (x, y, t, z) where x and y determine the major grid position, thus x  [0..c), y  [0..d), t (as in transformation) indicates horizontal or vertical, thus t  {h, v}, and z determines the minor grid position, thus z  ([0..a) or [0..b)) depending upon the value of t. This is a somewhat funny numbering scheme, we could have identified sticks with a single number and an orientation bit, but this scheme helps us later.
Primitives
Combinatorial
All combinatorial logic functions in the array are computed by nand combination of an arbitrary number of inputs to produce a single output. Any input can be complemented or not. Since the true or complement form of any signal can be determined at the input of the logic function there is no point in providing both true and complement values at the outputs. Furthermore, the signal can be inverted an arbitrary number of times during routing, with the fixup occuring at the input to the next logic function. Here is a model of the primitive logic function.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
Transforming a set of equasions into a form which uses this primitive is not the subject of this note. It is assumed that some previous piece of software accomplishes that task. Nor does this note concern itself with routing a collection of these primitives once they have been placed on the surface. It is assumed that some subsequent piece of software accomplishes that task.
Initially we will restrict the number of inputs to be d min(a, b), i.e. every primitive logic function will fit inside of a minor array in both vertical and horizontal orientations. We assign the color red to input, the color green to output, and yellow squares to indicate that an input participates in forming a particular output. Here is a graphical representation of the 8 nontrivial 2-input functions (x`(y`), (x(y), (x`(y), (x(y`), (x'y), (x`'y`), (x`'y), and (x'y`). The only 2-input functions which cannot be done with this primitive are the constant functions, 0 and 1, xor, and xnor. The four functions which merely invert or buffer are unnecessary, although possible.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
There is a stitch cell between each minor grid within the major grid. The function computed by the above graphical representation depends upon which inputs are complemented as they are driven onto the red lines by the stitch cell. A combinatorial element is presented to the placement software as the tuple (o, li) where o is the output label and li is a list of input labels, i. No two combinatorial elements may have the same o. The same label may not appear twice in any single li. For each combinatorial element given as input the placement software must supply as output the tuple (o, op, lip), where o is the same output label, op is a grid position to indicate the placement of the output, and lip is a list of input positions, ip, in the same order as li. Each ip is a single number. If op.t=h then ip  [0..a) else ip  [0..b).
For convenience we define a combinatorial tuple to be the tuple (o, op, lpi), ignoring the distinction of what the placement software accepts as input and what it generates as output. lpi is simply a list of positioned inputs, pi, each represented as the tuple (i, ip) that groups the input label and its position together.
Sequential
There is a single edge-triggered flip-flop for every minor grid column and major grid row as shown below.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
Since the details of connecting the flip-flop input and output do not concern the placement algorithm they are not described here. A sequential element is presented to the placement software as the tuple (o, i) where o is the output label and i is the input label. For each sequential element given as input the placement software must supply as output the tuple (o, ffp), where o is the same label and ffp is a flip-flop position. A flip-flop position, ffp, is the tuple (ap, cp, dp), where ap  [0..a), cp  [0..c), and dp  [0..d). For convenience we define a sequential tuple to be the tuple (o, i, ffp), ignoring the distinction of what the placement software accepts as input and what it generates as output.
Placement Rules
The placement rule for sequential elements is very simple. No two sequential elements may have the same position.
sequential tuples a and b, a.o=b.o ( a.ffp`b.ffp
The rules for combinatorial elements are substantially more complicated because any stick in the grid can be both an input and an output but the choices are not independent. Here are the combinatorial element placement rules.
õ No two outputs can have the same position.
combinatorial tuples a and b, a.o=b.o ( a.op`b.op
õ No two input sticks may have the same position unless they have the same label.
combinatorial tuples a and b, a.o`b.o ' a.op.t=b.op.t ' a.op.x=b.op.x ' a.op.y=b.op.y Ò a.lpi c, and b.lpi d, c.i=d.i ( c.ip`d.ip
õ All outputs in the same minor grid but with differing t must have compatible labelings of their inputs. Compatible means wherever outputs intersect both or neither function must use the corresponding orthogonal inputs.
combinatorial tuples a and b, a.o`b.o ' a.op.t`b.op.t ' a.op.x=b.op.x ' a.op.y=b.op.y Ò ( a.lpi.pi c and b.lpi.pi d: c.ip=b.op ' d.ip=a.op) ( ( a.lpi c and b.lpi d, c.ip`b.op ' d.ip`a.op)
The First Problem
Suppose that we have a collection of elements that we wish to place on a grid in such a manner as to minimize the required size of the major grid. How do we do so? This computes the optimal placement ignoring routing.
Using a first fit method we keep a list of minor grids, with the resources already allocated in each, in order from zero spiraling out. Allow major grid coordinates to be ints rather than nats. For each primitive run through the list until you find a place where legal returns true then insert it.
The Second Problem
Given the same collection of elements that we wish to place on a major grid as in the first problem how do we minimize the sum of the areas of the bounding boxes that enclose each output or input with the same label? This describes a heurisitic approach to placement that seeks to minimize the routing which must be added by a subsequent piece of software.
The combinatorial network is a directed acyclic forest. The roots are the primary inputs and the leaves are some of the primary outputs. Som outputs may also be used internally and so are not leaves of the DAF. When sequential elements are thrown in we have a directed, potentially cyclic, forest.
Historical Primitives
This section describes a line of reasoning I abandoned.
Now any stick can be identified with a bit which indicates if a stick is horizontal or vertical and a number. Let's define a grid position to be a tuple (t, z), where t (as in transformation) indicates horizontal or vertical, thus t  {h, v}, and z determines the grid position, thus z  ([0..(a+1)*(c+1)) or [0..(b+1)*(d+1))) depending upon the value of t. z is formed by (major-grid-position * size-of-minor-grid) + minor-grid-position.
In addition to the plain black sticks which form the grid we have a set of red, green, and blue sticks which need to be layed down on top of the major grid according to a set of rules. The set of red, green, and blue sticks are grouped into subsets which are called primitives. Here is a primitive.
----------
[ Nectarine figure; type 'Artwork on' to a CommandTool ]
----------
In addition to the sticks we have the little yellow boxes. These are connection points. Their position is represented as (i, j, k, m) where i  [0..c), j  [0..d), k  [0..a), m  [0..b).
Here are the rules:
" Only one colored stick may lay on top of any black stick
" All of the colored sticks can change size in units of minor grids.
" All of the red and blue sticks of a primitive must have the same value of o.
red, blue, red.o{blue.o
" All of the green sticks of a primitive must have the opposite value of o from all of the red and blue sticks of that primitive.
red, blue, green, green.o{v é (blue ( red).o{h
red, blue, green, green.o{h é (blue ( red).o{v
" All red sticks of a primitive must be in a different minor grid than all of the blue sticks of that primitive.
red, blue : o{h Ò red.y`blue.y
red, blue : o{v Ò red.x`blue.x
" All of the red sticks which have connection points to a common green stick must all lie to one side of all the blue sticks which have connection points to that common green stick.