RouteTest5.mesa
Copyright Ó 1985, 1987 by Xerox Corporation. All rights reserved.
Last Edited by: Preas, November 16, 1987 6:20:57 pm PST
Christian Le Cocq December 2, 1987 12:47:10 pm PST
DIRECTORY
CD, CDCells, CDIO, CDOps, Convert, DABasics, Rope, Route, RoutePrivate;
RouteTest5: CEDAR PROGRAM
IMPORTS CD, CDCells, CDIO, CDOps, Convert, Rope, Route
= BEGIN
EnumerateChannelNets: Route.EnumerateChannelNetsProc ~ {
PROC [channelData: REF, eachNet: EachChannelNetProc];
nets: LIST OF NetDef ← NARROW[channelData];
UNTIL nets = NIL DO
net: NetDef ← nets.first;
eachNet[net.name, EnumerateChannelPins, net.exitLeftOrBottom, net.exitRightOrTop, net.mayExit, net.trunkSize, NIL, net.netData];
nets ← nets.rest;
ENDLOOP};
EnumerateChannelPins: Route.EnumerateChannelPinsProc ~ {
PROC [channelData, netData: REF, eachPin: EachChannelPinProc];
pins: LIST OF Route.Pin ← NARROW[netData];
UNTIL pins = NIL DO
pin: Route.Pin ← pins.first;
bottomOrLeft: BOOL ← pin.side = bottom;
eachPin[bottomOrLeft, pin.min, pin.max, pin.depth, pin.layer];
pins ← pins.rest;
ENDLOOP};
BrokenNet: Route.BrokenNetProc ~ {
[channelData, netData: REF, sourceNet: Label, regionNumber, numberOfRegions: NAT] RETURNS [newLabel: Label]
newLabel ← Rope.Cat[sourceNet, "-", Convert.RopeFromInt[regionNumber], "/", Convert.RopeFromInt[numberOfRegions]]};
NetDef: TYPE = REF NetDefRec;
NetDefRec: TYPE = RECORD [
name: Rope.ROPE,
exitLeftOrBottom, exitRightOrTop: BOOLFALSE,
mayExit: BOOLTRUE,
trunkSize: CD.Number ← 0,
netData: LIST OF Route.Pin ← NIL];
name: Rope.ROPE ← "RouteTest5";
technology: CD.Technology ← CD.FetchTechnology[$cmosB];
metal: CD.Layer ← CD.FetchLayer[technology, $met];
metal2: CD.Layer ← CD.FetchLayer[technology, $met2];
rules: Route.DesignRulesParameters ← Route.DefaultDesignRulesParameters[technology, metal2, metal, horizontal];
a1: Route.Pin ← NEW[Route.PinRec ← [40, 72, 0, metal, bottom]];
a2: Route.Pin ← NEW[Route.PinRec ← [120, 132, 0, metal, top]];
a3: Route.Pin ← NEW[Route.PinRec ← [176, 208, 0, metal, top]];
a: NetDef ← NEW[NetDefRec ← ["a", TRUE, FALSE, FALSE, 0, LIST[a1, a2, a3]]];
b1: Route.Pin ← NEW[Route.PinRec ← [232, 264, 0, metal, bottom]];
b2: Route.Pin ← NEW[Route.PinRec ← [460, 492, 0, metal, top]];
b3: Route.Pin ← NEW[Route.PinRec ← [360, 392, 0, metal, top]];
b: NetDef ← NEW[NetDefRec ← ["b", FALSE, FALSE, TRUE, 0, LIST[b1, b2, b3]]];
nets: LIST OF NetDef ← LIST[a, b];
object: CD.Object ← Route.Channel[EnumerateChannelNets, 0, 540, rules, name, BrokenNet, NIL, nets].object;
design: CD.Design ← CDOps.CreateDesign[technology];
[ ] ← CDCells.IncludeOb[design: design, ob: object];
[ ] ← CDIO.WriteDesign[design, name];
END.