PWRouteTest.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reversed.
Bryan Preas December 18, 1986 3:41:31 pm PST
Use with the file PWRouteTest.dale to test routing:
CDCmosB (or CDCmosA)
PWRoute.load
cdread PWRouteTest -- NOTE: PWRouteTest.dale must be in the /// directory
run PWRouteTest
middle click P in the ChipNDale viewer
select the appropriate generator
DIRECTORY CD, CDCells, Convert, PW, PWRoute, Rope, RouteUtil, RTBasic;
PWRouteTest: CEDAR PROGRAM
IMPORTS CD, CDCells, Convert, PW, PWRoute, Rope, RouteUtil, RTBasic =
BEGIN
TestChRouterX: PW.GeneratorProc =
BEGIN
routerParams: PWRoute.RouterParams ← NEW[PWRoute.RouterParamsRec ← ["metal2", "metal", design.technology.key]];
leftOrig: CD.ObjectPW.Get[design, "ChXleft"];
leftXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, leftOrig, right, 50, "metal"];
left: CD.ObjectPW.AbutX[leftOrig, leftXfer];
rightOrig: CD.ObjectPW.Get[design, "ChXright"];
rightXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, rightOrig, left, 50, "metal"];
right: CD.ObjectPW.AbutX[rightXfer, rightOrig];
topOrig: CD.ObjectPW.Get[design, "ChXtop"];
topXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, topOrig, bottom, 50, "metal2"];
top: CD.ObjectPW.AbutY[topXfer, topOrig];
bottomOrig: CD.ObjectPW.Get[design, "ChXbottom"];
bottomXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, bottomOrig, top, 50, "metal2"];
bottom: CD.ObjectPW.AbutY[bottomOrig, bottomXfer];
test: CD.Object ← PWRoute.AbutChRouteListX[LIST[left, right], LIST[bottom], LIST[top], routerParams];
RETURN[test];
END;
TestChRouterY: PW.GeneratorProc =
BEGIN
left, right, top, bottom, test: CD.Object;
left ← PW.Get[design, "ChYleft"];
right ← PW.Get[design, "ChYright"];
top ← PW.Get[design, "ChYtop"];
bottom ← PW.Get[design, "ChYbottom"];
test ← PWRoute.AbutChRouteListY[LIST[bottom, top], LIST[left], LIST[right]];
RETURN[test];
END;
TestSbRouterH: PW.GeneratorProc =
BEGIN
left, right, top, bottom, sb, column, test: CD.Object;
dx1, dx2, dy1: INT;
left ← PW.Get[design, "SbXleft"];
right ← PW.Get[design, "SbXright"];
top ← PW.Get[design, "SbXtop"];
bottom ← PW.Get[design, "SbXbottom"];
sb ← PWRoute.AbutSbRoute[bottom, right, top, left, horizontal];
column ← PW.AbutListY[LIST[bottom, sb, top]];
test ← CDCells.CreateEmptyCell[];
dy1 ← RTBasic.IRSize[bottom].y;
dx1 ← RTBasic.IRSize[left].x;
dx2 ← RTBasic.IRSize[column].x;
[] ← CDCells.IncludeOb[cell: test, ob: left, trans: [[0, dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: column, trans: [[dx1 , 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: right, trans: [[dx1 + dx2, dy1], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestSbSmlRouterH: PW.GeneratorProc =
BEGIN
left: CD.ObjectPW.Get[design, "SbXSmlLeft"];
right: CD.ObjectPW.Get[design, "SbXSmlRight"];
top: CD.ObjectPW.Get[design, "SbXSmlTop"];
bottom: CD.ObjectPW.Get[design, "SbXSmlBottom"];
h: INTMAX[RTBasic.IRSize[bottom].x, RTBasic.IRSize[top].x];
v: INTMAX[RTBasic.IRSize[left].y, RTBasic.IRSize[right].y];
dy1: INT ← RTBasic.IRSize[bottom].y;
dx1: INT ← RTBasic.IRSize[left].x;
rect: PWRoute.RefRect ← NEW[PWRoute.Rect ← [-dx1, -dy1, h + dx1, v + dy1]];
sb: CD.Object ← PWRoute.MakeChannel[bottom, top, left, right, rect, PWRoute.defaultRouterParams, FALSE, switchBox];
dx2: INT ← RTBasic.IRSize[sb].x;
dy2: INT ← RTBasic.IRSize[sb].y;
test: CD.Object ← CDCells.CreateEmptyCell[];
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[2*dx1, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: top, trans: [[2*dx1, dy1 + dy2], original]];
[] ← CDCells.IncludeOb[cell: test, ob: left, trans: [[0, 2*dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: sb, trans: [[dx1 , dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: right, trans: [[dx1 + dx2, 2*dy1], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestPinsH: PW.GeneratorProc =
BEGIN
routerParams: PWRoute.RouterParams ← NEW[PWRoute.RouterParamsRec ← ["metal", "metal2"]];
left: CD.ObjectPW.Get[design, "PinsLeft"];
right: CD.ObjectPW.Get[design, "PinsRight"];
top: CD.ObjectPW.Get[design, "PinsTop"];
bottom: CD.ObjectPW.Get[design, "PinsBottom"];
h: INTMAX[RTBasic.IRSize[bottom].x, RTBasic.IRSize[top].x];
v: INTMAX[RTBasic.IRSize[left].y, RTBasic.IRSize[right].y];
dy1: INT ← RTBasic.IRSize[bottom].y;
dx1: INT ← RTBasic.IRSize[left].x;
rect: PWRoute.RefRect ← NEW[PWRoute.Rect ← [-dx1, -dy1, h + dx1, v + dy1]];
sb: CD.Object ← PWRoute.MakeChannel[bottom, top, left, right, NIL -- rect --, routerParams, FALSE, channel];
dx2: INT ← RTBasic.IRSize[sb].x;
dy2: INT ← RTBasic.IRSize[sb].y;
test: CD.Object ← CDCells.CreateEmptyCell[];
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[dx1, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: top, trans: [[dx1, dy1 + dy2], original]];
[] ← CDCells.IncludeOb[cell: test, ob: left, trans: [[0, dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: sb, trans: [[dx1 , dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: right, trans: [[dx1 + dx2, dy1], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestVias: PW.GeneratorProc =
BEGIN
pos: CD.Position ← [0, 0];
maxY: INT ← 200;
maxX: INT ← 200;
metal: CD.Layer ← CD.FetchLayer[design.technology, $met];
metal2: CD.Layer ← CD.FetchLayer[design.technology, $met2];
test: CD.Object ← CDCells.CreateEmptyCell[];
FOR y: INT ← 48, y+16 WHILE y <= maxY DO
pos ← [0, pos.y + y];
FOR x: INT ← 48, x+16 WHILE x <= maxX DO
pos.x ← pos.x + x;
RouteUtil.AddVia[test, Rope.Cat[Convert.RopeFromInt[x], "x", Convert.RopeFromInt[y]], pos, [x,y], metal, metal2, design.technology.lambda, NIL];
ENDLOOP;
ENDLOOP;
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestMulDL: PW.GeneratorProc =
BEGIN
right, top, bottom, left, sb, row, test: CD.Object;
dx1, dy1, dy2: INT;
routerParams: PWRoute.RouterParams ← NEW[PWRoute.RouterParamsRec ← ["metal", "metal2"]];
right ← PW.Get[design, "MulDLRight"];
top ← PW.Get[design, "MulDLTop"];
bottom ← PW.Get[design, "MulDLBottom"];
left ← PW.Get[design, "MulDLLeft"];
sb ← PWRoute.AbutSbRoute[bottom, right, top, left, horizontal, routerParams];
row ← PW.AbutListX[LIST[left, sb, right]];
test ← CDCells.CreateEmptyCell[];
dx1 ← RTBasic.IRSize[left].x;
dy1 ← RTBasic.IRSize[bottom].y;
dy2 ← RTBasic.IRSize[row].y;
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[dx1, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: row, trans: [[0 , dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: top, trans: [[dx1, dy1 + dy2], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestSbRouterV: PW.GeneratorProc =
BEGIN
left, right, top, bottom, sb, row, test: CD.Object;
dx1, dy1, dy2: INT;
left ← PW.Get[design, "SbYleft"];
right ← PW.Get[design, "SbYright"];
top ← PW.Get[design, "SbYtop"];
bottom ← PW.Get[design, "SbYbottom"];
sb ← PWRoute.AbutSbRoute[bottom, right, top, left, vertical];
row ← PW.AbutListX[LIST[left, sb, right]];
test ← CDCells.CreateEmptyCell[];
dy1 ← RTBasic.IRSize[bottom].y;
dy2 ← RTBasic.IRSize[row].y;
dx1 ← RTBasic.IRSize[left].x;
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[dx1, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: row, trans: [[0 , dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: top, trans: [[dx1, dy1 + dy2], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestSbMMRouterV: PW.GeneratorProc =
BEGIN
routerParams: PWRoute.RouterParams ← NEW[PWRoute.RouterParamsRec ← ["metal2", "metal", design.technology.key]];
leftOrig: CD.ObjectPW.Get[design, "SbMMleft"];
leftXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, leftOrig, right, 50, "metal"];
left: CD.ObjectPW.AbutX[leftOrig, leftXfer];
rightOrig: CD.ObjectPW.Get[design, "SbMMright"];
rightXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, rightOrig, left, 50, "metal"];
right: CD.ObjectPW.AbutX[rightXfer, rightOrig];
topOrig: CD.ObjectPW.Get[design, "SbMMtop"];
topXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, topOrig, bottom, 50, "metal2"];
top: CD.ObjectPW.AbutY[topXfer, topOrig];
bottomOrig: CD.ObjectPW.Get[design, "SbMMbottom"];
bottomXfer: CD.Object ← PWRoute.XferPins[routerParams.technologyKey, bottomOrig, top, 50, "metal2"];
bottom: CD.ObjectPW.AbutY[bottomOrig, bottomXfer];
sb: CD.Object ← PWRoute.AbutSbRoute[bottom, right, top, left, vertical, routerParams];
row: CD.ObjectPW.AbutListX[LIST[left, sb, right]];
test: CD.Object ← CDCells.CreateEmptyCell[];
dy1: INT ← RTBasic.IRSize[bottom].y;
dy2: INT ← RTBasic.IRSize[row].y;
dx1: INT ← RTBasic.IRSize[left].x;
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[dx1, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: row, trans: [[0 , dy1], original]];
[] ← CDCells.IncludeOb[cell: test, ob: top, trans: [[dx1, dy1 + dy2], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
TestSb2Sides: PW.GeneratorProc =
BEGIN
leftOrig: CD.ObjectPW.Get[design, "Sb2left"];
leftXfer: CD.Object ← PWRoute.XferPins[design.technology.key, leftOrig, right, 0, "poly"];
left: CD.ObjectPW.AbutX[leftOrig, leftXfer];
bottomOrig: CD.ObjectPW.Get[design, "Sb2bottom"];
bottomXfer: CD.Object ← PWRoute.XferPins[design.technology.key, bottomOrig, top, 50, "metal"];
bottom: CD.ObjectPW.AbutY[bottomOrig, bottomXfer];
sb: CD.Object ← PWRoute.AbutSbRoute[bottom, NIL, NIL, left, vertical];
row: CD.ObjectPW.AbutListX[LIST[left, sb]];
test: CD.Object ← CDCells.CreateEmptyCell[];
dy: INT ← RTBasic.IRSize[bottom].y;
dx: INT ← RTBasic.IRSize[left].x;
[] ← CDCells.IncludeOb[cell: test, ob: bottom, trans: [[dx, 0], original]];
[] ← CDCells.IncludeOb[cell: test, ob: row, trans: [[0 , dy], original]];
RTBasic.RepositionCell[test];
RETURN[test];
END;
PW.RegisterGenerator[TestChRouterX, "TestChRouterX"];
PW.RegisterGenerator[TestChRouterY, "TestChRouterY"];
PW.RegisterGenerator[TestSbRouterH, "TestSbRouterH"];
PW.RegisterGenerator[TestSbSmlRouterH, "TestSbSmlRouterH"];
PW.RegisterGenerator[TestSbRouterV, "TestSbRouterV"];
PW.RegisterGenerator[TestSb2Sides, "TestSb2Sides"];
PW.RegisterGenerator[TestSbMMRouterV, "TestSbMMRouterV"];
PW.RegisterGenerator[TestPinsH, "TestPinsH"];
PW.RegisterGenerator[TestMulDL, "TestMulDL"];
PW.RegisterGenerator[TestVias, "TestVias"];
END.