RouteTest12.mesa
Copyright Ó 1985, 1987, 1989 by Xerox Corporation. All rights reserved.
Last Edited by: Preas, May 18, 1988 12:38:34 pm PDT
Christian Le Cocq December 2, 1987 12:47:46 pm PST
DIRECTORY
CD, CDDebug, CDIO, Commander, Convert, DABasics, Rope, Route, RoutePrivate;
RouteTest12:
CEDAR
PROGRAM
IMPORTS CD, CDDebug, CDIO, Commander, 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*8, 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;
offset: INT ← IF runType = shiftRight AND bottomOrLeft THEN +11*4 ELSE IF runType = shiftLeft AND bottomOrLeft THEN -11*4 ELSE 0;
eachPin[bottomOrLeft, pin.min*8 +offset, pin.max*8+offset, 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]]};
MakeDDENets:
PROC []
RETURNS [nets:
LIST
OF NetDef] ~ {
Net5:
PROC [ ]
RETURNS [net5: NetDef] ~ {
net5p1: Route.Pin ← NEW[Route.PinRec ← [118, 121, 0, metal, top]];
net5p6: Route.Pin ← NEW[Route.PinRec ← [52, 55, 0, metal, bottom]];
net5 ← NEW[NetDefRec ← ["net5", FALSE, FALSE, FALSE, 0, LIST[net5p1, net5p6]]]};
Net8:
PROC [ ]
RETURNS [net8: NetDef] ~ {
net8p1: Route.Pin ← NEW[Route.PinRec ← [41, 44, 0, metal, top]];
net8p6: Route.Pin ← NEW[Route.PinRec ← [162, 165, 0, metal, bottom]];
net8 ← NEW[NetDefRec ← ["net8", FALSE, FALSE, FALSE, 0, LIST[net8p1, net8p6]]]};
Net14:
PROC [ ]
RETURNS [net14: NetDef] ~ {
net14p1: Route.Pin ← NEW[Route.PinRec ← [162, 165, 0, metal, top]];
net14p4: Route.Pin ← NEW[Route.PinRec ← [118, 121, 0, metal, bottom]];
net14 ← NEW[NetDefRec ← ["net14", FALSE, FALSE, FALSE, 0, LIST[net14p1, net14p4]]]};
NetA:
PROC [ ]
RETURNS [netA: NetDef] ~ {
netAp1: Route.Pin ← NEW[Route.PinRec ← [85, 88, 0, metal, top]];
netAp2: Route.Pin ← NEW[Route.PinRec ← [69, 72, 0, metal, bottom]];
netA ← NEW[NetDefRec ← ["netA", FALSE, FALSE, FALSE, 0, LIST[netAp1, netAp2]]]};
nets ← LIST[Net5[], Net8[], Net14[], NetA[]];
};
RunType: TYPE = {base, shiftLeft, shiftRight};
runType: RunType ← shiftRight;
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 ← "RouteTest12";
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];
Route12:
Commander.
CommandProc ~{
nets: LIST OF NetDef ← MakeDDENets[];
object: CD.Object ← Route.Channel[EnumerateChannelNets, -12, 2022*8+76, rules, name, BrokenNet, NIL, nets].object;
design: CD.Design ← CDDebug.Draw[object, technology].dummyDesign;
design.mutability ← editable;
[ ] ← CDIO.WriteDesign[design, name];
};
Commander.
Register["Route12", Route12];
END.