Onion.mesa 
Copyright © 1985 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet, May 5, 1985 9:21:32 pm PDT
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, Rope;
Onion: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
The following type allows some technology-independance
LayersParameters: TYPE = REF LayersParametersRec;
LayersParametersRec: TYPE = RECORD [
radialLayer: CD.Layer,
ringLayer: CD.Layer,
ringWidth: RingWidthProc,
contact: CD.ObPtr,
ringRingDist: CD.Number,
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,
contact: CMosContacts.CreateMmCon[10],
ringRingDist: 8,
wireExtendProc: WireExtendMetToMet
];
channelDefaultParameters: READONLY LayersParameters; -- = REF [
radialLayer: CMos.met,
ringLayer: CMos.met2,
ringWidth: RingWidthProc,
contact: CMosContacts.CreateMmCon[10],
ringRingDist: 8,
wireExtendProc: WireExtendMetToMet
];
WireExtendProc creates an object which is going to be rotated to be added to the routing rings. Conceptually, it generates the horizontal 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.ObPtr];
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 [netName: ROPE] RETURNS [ringWidth: CD.Number];
RingWidthIs8: RingWidthProc;
Just a useful proc waiting to be in PW (or CD)
IncludeOb: PROC [cell, ob: CD.ObPtr, position: CD.Position ← [0, 0], orientation: CD.Orientation ← 0] RETURNS [newApp: CD.ApplicationPtr];
Just a useful proc waiting to be in PW (or CD)
IncludePin: PUBLIC PROC [cell: CD.ObPtr, name: ROPE, layer: CD.Layer, size, position: CD.Position, orientation: CD.Orientation ← 0] RETURNS [newApp: CD.ApplicationPtr];
Returns the innerPos needed for centering the inner in the outer. Usually that is what users want before optimizing.
Center: PROC [inner, outer: CD.ObPtr] 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 chip.
MakeInner: PROC [design: CD.Design, obj: CD.ObPtr] RETURNS [inner: CD.ObPtr];
-- doneOnce means done once, and finishedAll means done many times, including the final 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.ObPtr, innerPos: CD.Position, params: LayersParameters ← defaultLayersParameters] RETURNS [cell: CD.ObPtr, status: Status];
-- Just for fun
SwitchBox: PROC [design: CD.Design, bottomOb, rightOb, topOb, leftOb: CD.ObPtr, params: LayersParameters ← channelDefaultParameters] RETURNS [cell: CD.ObPtr, status: Status];
-- Just for fun
Channel: PROC [design: CD.Design, left, right: CD.ObPtr, size: INT, params: LayersParameters ← channelDefaultParameters] RETURNS [cell: CD.ObPtr, status: Status];
END.