RouteTest10.mesa
Copyright Ó 1985, 1987, 1989 by Xerox Corporation. All rights reserved.
Last Edited by: Preas, April 13, 1989 7:42:56 pm PDT
DIRECTORY
CD, CDCells, CDIO, CDOps, Convert, DABasics, Rope, Route, RoutePrivate;
RouteTest10:
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: BOOL ← FALSE,
mayExit: BOOL ← TRUE,
trunkSize: CD.Number ← 0,
netData: LIST OF Route.Pin ← NIL];
name: Rope.ROPE ← "RouteTest10";
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, metal, metal2, horizontal];
a1: Route.Pin ← NEW[Route.PinRec ← [88, 92, 0, metal2, top]];
a2: Route.Pin ← NEW[Route.PinRec ← [264, 268, 0, metal2, bottom]];
a: NetDef ← NEW[NetDefRec ← ["a", FALSE, FALSE, FALSE, 0, LIST[a1, a2]]];
b1: Route.Pin ← NEW[Route.PinRec ← [176, 180, 0, metal2, top]];
b2: Route.Pin ← NEW[Route.PinRec ← [352, 356, 0, metal2, bottom]];
b: NetDef ← NEW[NetDefRec ← ["b", FALSE, FALSE, FALSE, 0, LIST[b1, b2]]];
c1: Route.Pin ← NEW[Route.PinRec ← [176, 180, 0, metal2, bottom]];
c2: Route.Pin ← NEW[Route.PinRec ← [352, 356, 0, metal2, top]];
c: NetDef ← NEW[NetDefRec ← ["c", FALSE, FALSE, FALSE, 0, LIST[c1, c2]]];
d1: Route.Pin ← NEW[Route.PinRec ← [264, 268, 0, metal2, top]];
d2: Route.Pin ← NEW[Route.PinRec ← [440, 444, 0, metal2, bottom]];
d: NetDef ← NEW[NetDefRec ← ["d", FALSE, FALSE, FALSE, 0, LIST[d1, d2]]];
nets: LIST OF NetDef ← LIST[a, b, c, d];
object: CD.Object ← Route.Channel[EnumerateChannelNets, 0, 792, rules, name, BrokenNet, NIL, nets].object;
design: CD.Design ← CDOps.CreateDesign[technology];
[ ] ← CDCells.IncludeOb[design: design, ob: object];
[ ] ←
CDIO.WriteDesign[design, name];
END.