RouteTest7.mesa
Copyright Ó 1985, 1987, 1988 by Xerox Corporation. All rights reserved.
Last Edited by: Preas, May 2, 1988 2:43:22 pm PDT
DIRECTORY
CD, CDCells, CDIO, CDOps, Convert, DABasics, Rope, Route, RoutePrivate;
RouteTest7:
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 ← "RouteTest7";
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 ← [40, 44, 0, metal2, bottom]];
a2: Route.Pin ← NEW[Route.PinRec ← [40, 44, 0, metal2, top]];
a: NetDef ← NEW[NetDefRec ← ["a", FALSE, FALSE, FALSE, 0, LIST[a1, a2]]];
b1: Route.Pin ← NEW[Route.PinRec ← [120, 124, 0, metal2, bottom]];
b2: Route.Pin ← NEW[Route.PinRec ← [120, 124, 0, metal2, top]];
b: NetDef ← NEW[NetDefRec ← ["b", FALSE, FALSE, FALSE, 0, LIST[b1, b2]]];
nets: LIST OF NetDef ← LIST[a, b];
object: CD.Object ← Route.Channel[EnumerateChannelNets, 0, 250, rules, name, BrokenNet, NIL, nets].object;
design: CD.Design ← CDOps.CreateDesign[technology];
[ ] ← CDCells.IncludeOb[design: design, ob: object];
[ ] ←
CDIO.WriteDesign[design, name];
END.