CabbageTest.mesa
Copyright © 1986 by Xerox Corporation. All rights reversed.
Bryan Preas May 22, 1986 12:25:02 pm PDT
Use with the file CabbageTest.dale to test routing:
@CabbageTest.cm
DIRECTORY
Cabbage, CD, Connections, PW, PWPins, Rope;
CabbageTest: CEDAR PROGRAM
IMPORTS Cabbage, Connections, PW, PWPins =
BEGIN
TestBasicCabbage: PW.UserProc =
BEGIN
routerParams: Cabbage.PadRingParams ← NEW[Cabbage.PadRingParamsRec ← ["metal2", "metal", design.technology.key]];
left: Cabbage.Object ← PW.Get[design, "BasicLeft"];
right: Cabbage.Object ← PW.Get[design, "BasicRight"];
top: Cabbage.Object ← PW.Get[design, "BasicTop"];
bottom: Cabbage.Object ← PW.Get[design, "BasicBottom"];
inner: Cabbage.Object ← PW.Get[design, "BasicInner"];
innerPos: CD.Position ← Cabbage.Center[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, routerParams];
connections: Connections.Table ← GetConnections[inner, bottom, right, top, left];
test: Cabbage.Object ← Cabbage.PadRoute[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, innerPos, connections, routerParams];
RETURN[test];
END;
TestPadLimited: PW.UserProc =
BEGIN
routerParams: Cabbage.PadRingParams ← NEW[Cabbage.PadRingParamsRec ← ["metal2", "metal", design.technology.key]];
left: Cabbage.Object ← PW.Get[design, "PinLimitedLeft"];
right: Cabbage.Object ← PW.Get[design, "PinLimitedRight"];
top: Cabbage.Object ← PW.Get[design, "PinLimitedTop"];
bottom: Cabbage.Object ← PW.Get[design, "PinLimitedBottom"];
inner: Cabbage.Object ← PW.Get[design, "PinLimitedInner"];
innerPos: CD.Position ← Cabbage.Center[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, routerParams];
connections: Connections.Table ← GetConnections[inner, bottom, right, top, left];
test: Cabbage.Object ← Cabbage.PadLimitedRoute[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, innerPos, connections, routerParams];
RETURN[test];
END;
TestFSM: PW.UserProc =
BEGIN
routerParams: Cabbage.PadRingParams ← NEW[Cabbage.PadRingParamsRec ← ["metal", "metal2", design.technology.key]];
left: Cabbage.Object ← PW.Get[design, "FSMLeft"];
right: Cabbage.Object ← PW.Get[design, "FSMRight"];
top: Cabbage.Object ← PW.Get[design, "FSMTop"];
bottom: Cabbage.Object ← PW.Get[design, "FSMBottom"];
inner: Cabbage.Object ← PW.Get[design, "FSMTest"];
innerPos: CD.Position ← Cabbage.Center[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, routerParams];
connections: Connections.Table ← GetConnections[inner, bottom, right, top, left];
test: Cabbage.Object ← Cabbage.PadRoute[inner, NIL, bottom, NIL, right, NIL, top, NIL, left, innerPos, connections, routerParams];
RETURN[test];
END;
GetConnections: PROC [inner, bottom, right, top, left: Cabbage.Object] RETURNS [connections: Connections.Table] ~ {
UseAll: Connections.PinFilterProc ~ {keepIt ← TRUE};
UseTop: Connections.PinFilterProc ~ {keepIt ← PWPins.GetSide[obj, inst].side=top};
UseLeft: Connections.PinFilterProc ~ {keepIt ← PWPins.GetSide[obj, inst].side=left};
UseBottom: Connections.PinFilterProc ~ {keepIt ← PWPins.GetSide[obj, inst].side=bottom};
UseRight: Connections.PinFilterProc ~ {keepIt ← PWPins.GetSide[obj, inst].side=right};
connections ← Connections.CreateForRopes[];
Connections.InsertPins[connections, inner, UseAll];
Connections.InsertPins[connections, bottom, UseTop];
Connections.InsertPins[connections, right, UseLeft];
Connections.InsertPins[connections, top, UseBottom];
Connections.InsertPins[connections, left, UseRight];
};
PW.Register[TestFSM, "TestFSM"];
PW.Register[TestBasicCabbage, "TestBasicCabbage"];
PW.Register[TestPadLimited, "TestPadLimited"];
END.