TestCoreRoute.mesa
Copyright Ó 1985, 1986, 1987 by Xerox Corporation. All rights reversed.
Bertrand Serlet August 23, 1987 7:48:54 pm PDT
DIRECTORY CD, Core, CoreCreate, CoreGeometry, CoreOps, CoreRoute, PW, PWCore, Rope, Route, Sinix, SinixOps, TerminalIO;
TestCoreRoute: CEDAR PROGRAM
IMPORTS CoreCreate, CoreGeometry, CoreOps, CoreRoute, PW, PWCore, Rope, Sinix, SinixOps, TerminalIO =
BEGIN OPEN CoreRoute;
Extension
TestExtendObject: PW.GeneratorProc = {
EnumerateSegments: PROC [eachSegment: PROC [Segment]] = {
EachWirePin: CoreGeometry.EachWirePinProc = {
IF side=chosenSide THEN eachSegment[[LabelInternal[testCT.public, wire], min, max, layer]];
};
[] ← CoreGeometry.EnumerateWireSides[mode.decoration, testCT, EachWirePin];
};
test: CD.Object ← PW.Get[design, "test.mask"];
mode: Sinix.Mode = SinixOps.GetExtractMode[$cmosB];
testCT: Core.CellType = NARROW [Sinix.Extract[test, mode].result];
chosenSide: CoreGeometry.Side = SELECT TerminalIO.RequestSelection["Side", LIST["left", "right", "top", "bottom"]] FROM 1 => left, 2 => right, 3 => top, ENDCASE => bottom;
RETURN [ExtendObject[EnumerateSegments, [320, 320], chosenSide, AllButHorizLeft]];
};
AllButHorizLeft: ExtendSegmentProc = {
IF Rope.Equal[label, "horiz"] AND side=left THEN RETURN;
RETURN [ExtendSegment[label, size, layer, side, extension]];
};
ToRouting
TrivialNaming: PROC [name: Rope.ROPE] RETURNS [label: Route.Label] = {
label ← name;
};
TestMakeRoutingCell: PROC [cell: CD.Object] RETURNS [routingCell: CD.Object] = {
routingCell ← MakeRoutingCell[cell, TrivialNaming];
};
Channel
TestX: PROC [design: CD.Design] RETURNS [channelCT: Core.CellType] = {
left: CD.Object ← PW.Get[design, "left.mask"];
right: CD.Object ← PW.Get[design, "right.mask"];
leftCT: Core.CellType ← PWCore.FromLayoutWithoutPublic[left];
rightCT: Core.CellType ← PWCore.FromLayoutWithoutPublic[right];
public: Core.Wire ← CoreCreate.Wires["middlea", "through", "bar", "left", "higha", "highb"];
onlyInternal: Core.Wire ← CoreCreate.Wires["middleb", "green", "red", "ring", "foo"];
channelCT ← CoreCreate.Cell[
public: public,
onlyInternal: onlyInternal,
instances: LIST [
CoreCreate.Instance[leftCT, ["righta", "middlea"], ["rightb", "middleb"]],
CoreCreate.Instance[rightCT, ["righta", "middlea"], ["rightb", "middleb"]]
],
name: "ChannelInX"
];
PWCore.SetLayout[channelCT, $RawChannelRoute, $ChannelInfo, NEW [ChannelInfoRec ← [
direction: vertical,
tech: design.technology,
bottomOrLeftWires: LIST [CoreOps.FindWire[public, "middlea"], CoreOps.FindWire[public, "through"], CoreOps.FindWire[public, "highb"]],
topOrRightWires: LIST[CoreOps.FindWire[public, "through"], CoreOps.FindWire[public, "highb"]],
trunk: "metal",
branch: "metal2"
]]];
};
TestY: PROC [design: CD.Design] RETURNS [channelCT: Core.CellType] = {
left: CD.Object ← PW.Get[design, "rleft.mask"];
right: CD.Object ← PW.Get[design, "rright.mask"];
leftCT: Core.CellType ← PWCore.FromLayoutWithoutPublic[left];
rightCT: Core.CellType ← PWCore.FromLayoutWithoutPublic[right];
public: Core.Wire ← CoreCreate.Wires["middlea", "x", "y", "z", "bar", "left", "higha", "highb"];
onlyInternal: Core.Wire ← CoreCreate.Wires["middleb", "green", "red", "ring", "foo"];
channelCT ← CoreCreate.Cell[
public: public,
onlyInternal: onlyInternal,
instances: LIST [
CoreCreate.Instance[rightCT, ["righta", "middlea"], ["foo", "middlea"], ["rightb", "middleb"]],
CoreCreate.Instance[leftCT, ["righta", "middlea"], ["rightb", "middleb"]]
],
name: "ChannelInY"
];
PWCore.SetLayout[channelCT, $RawChannelRoute, $ChannelInfo, NEW [ChannelInfoRec ← [
direction: horizontal,
tech: design.technology,
justifyBottomOrLeft: FALSE,
bottomOrLeftWires: LIST [public[0], public[1], public[2], public[3]],
topOrRightWires: LIST[public[0], public[1], public[2], public[3]],
trunk: "metal",
branch: "metal2"
]]];
};
Initialization
PW.RegisterGenerator[TestExtendObject, "TestExtendObject"];
END.