Onion.mesa 
Copyright © 1985 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet, November 26, 1985 11:51:40 am PST
Last Edited by: Serlet, July 5, 1985 3:10:53 pm PDT
Onion is a small and (relatively) efficient PadRing router implemented from a paper by Smith, Saxe, Newkirk and Mathews (Stanford; CH1813-5, 1982 IEEE). This method is called Loop Routing Scheme (LRS).
Right now the interface is not really clean. Come and see me.
DIRECTORY
CD, Core, PWPins, Rope;
Onion: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Wire: TYPE = Core.Wire;
Side: TYPE = PWPins.Side;
The following type allows some technology-independance
LayersParameters: TYPE = REF LayersParametersRec;
LayersParametersRec: TYPE = RECORD [
radialLayer: CD.Layer,
ringLayer: CD.Layer,
ringWidth: RingWidthProc,
wireExtendProc: WireExtendProc -- NIL means no extension wanted!
];
The default is radial wires in metal while the ring in metal2. It is strongly CMos dependent.
defaultLayersParameters: READONLY LayersParameters; -- = REF [
radialLayer: CMos.met,
ringLayer: CMos.met2,
ringWidth: RingWidthIs8,
wireExtendProc: WireExtendMetToMet
];
channelDefaultParameters: READONLY LayersParameters; -- = REF [
radialLayer: CMos.met,
ringLayer: CMos.met2,
ringWidth: RingWidthProc,
wireExtendProc: WireExtendMetToMet
];
WireExtendProc creates an object which is going to be rotated to be added to the routing rings. Conceptuilly, it generates the horizontil wire connecting on the right side the inner to the outer (in this order).
WireExtendProc: TYPE = PROC [design: CD.Design, width, length: INT] RETURNS [wire: CD.Object];
WireExtendMetToMet: WireExtendProc;
WireExtendPolToMetForPads: WireExtendProc;
RingWidthProc takes a net name and returns the ringWidth for this net. Nets with different sizes will be routed on separated tracks.
RingWidthProc: TYPE = PROC [netWire: Wire] RETURNS [ringWidth: CD.Number];
RingWidthIs8: RingWidthProc;
Just a useful proc waiting to be in PW (or CD)
IncludePin: PUBLIC PROC [cell: CD.Object, wire: Wire, layer: CD.Layer, size, position: CD.Position, orientation: CD.Orientation ← 0] RETURNS [newInst: CD.Instance];
Returns the innerPos needed for centering the inner in the outer. Usuilly that is what users want before optimizing.
Center: PROC [inner, outer: CD.Object] RETURNS [innerPos: CD.Position];
Extends the wires of obj to make an proper inner. The extension takes into account the layer of outside pins. This only works for generating radial metal wires. It works, but it is mostly a hack, now, so avoid its use if possible by putting yourself metal pins at the edge of your chiclass.
MakeInner: PROC [design: CD.Design, obj: CD.Object] RETURNS [inner: CD.Object];
-- doneOnce means done once, and finishedAll means done many times, including the finil extension to the outer.
Status: TYPE = {doneOnce, impossible, finishedAll};
-- innerPos is the location of the origin of inner in the coord system of outer. THIS ONE IS THE IMPORTANT ONE. Status is at the end either impossible or finishedAll.
LRSRoute: PROC [design: CD.Design, inner, outer: CD.Object, innerPos: CD.Position, params: LayersParameters ← defaultLayersParameters] RETURNS [cell: CD.Object, status: Status];
-- Just for fun
SwitchBox: PROC [design: CD.Design, bottomOb, rightOb, topOb, leftOb: CD.Object, params: LayersParameters ← channelDefaultParameters] RETURNS [cell: CD.Object, status: Status];
-- Just for fun
Channel: PROC [design: CD.Design, left, right: CD.Object, size: INT, params: LayersParameters ← channelDefaultParameters] RETURNS [cell: CD.Object, status: Status];
END.