PWTestA.mesa,
Created by Bertrand Serlet
Copyright © 1984 by Xerox Corporation. All rights reversed.
Last Edited by Bertrand Serlet, March 13, 1985 3:58:47 pm PST
Last Edited by: Monier, February 7, 1985 5:22:49 pm PST
A simple library of cells and some test programs.
DIRECTORY
CD,
CDCells USING [CreateEmptyCell],
CDPinObjects,
CDRects USING [CreateRect],
CMos,
PW,
PWBasics;
PWTestA: CEDAR PROGRAM
IMPORTS CDCells, CDPinObjects, CDRects, CMos, PW, PWBasics =
BEGIN OPEN PW, PWBasics;
CellWithFourCorners: PROC [design: CD.Design, size: CD.DesignPosition] RETURNS [cell: CD.ObPtr] =
BEGIN
cell ← CDCells.CreateEmptyCell[];
[] ← IncludeApplication[cell, CDRects.CreateRect[[4, size.y], CMos.pol], [0, 0]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 4], CMos.ndif], [0, size.y / 2]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[4, size.y], CMos.pol], [size.x / 2, 0]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 4], CMos.ndif], [0, size.y - 4]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 4], CMos.ndif], [0, size.y - 12]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 4], CMos.ndif], [0, 8]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 4], CMos.ndif], [0, 18]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[6, size.y], CMos.met], [size.x - 6, 0]];
[] ← IncludeApplication[cell, CDRects.CreateRect[[size.x, 6], CMos.met2], [0, 0]];
IncludeAndCleanNewCell[design, cell];
END;
PutPin: PROC [cell: CD.ObPtr, name: ROPE, rect: CD.DesignRect] =
BEGIN
[] ← IncludeApplication[cell, CDPinObjects.CreatePinOb[[rect.x2-rect.x1, rect.y2-rect.y1]], [rect.x1, rect.y1]];
END;
MyProc: UserProc =
BEGIN
abobj: CD.ObPtr ← CellWithFourCorners[design, [50, 120]];
ab, cd: InstName;
PutPin[abobj, "LeftPin", [0, 25, 2, 27]];
PutPin[abobj, "RightPin", [48, 15, 50, 17]];
PutPin[abobj, "TopPin", [20, 118, 22, 120]];
PutPin[abobj, "BottomPin", [12, 0, 14, 2]];
RepositionCell[design, abobj];
ab ← NameFromObj[abobj];
cd ← AbutX[ ab, FlipX[ab]];
cd ← AbutX[ ab, FlipX[ab], FlipY[ab]];
cd ← AbutX[ ab, FlipX[ab], FlipY[ab], Rot90[ab]];
cd ← AbutX[ ab, FlipX[ab], FlipY[ab], Rot90[ab], Rot180[ab], Rot270[ab]];
cd ← AbutY[ cd , FlipY[cd]];
cd ← AbutX[cd, FlipX[cd]];
cd ← Array[cd, 4 , 4];
cd ← AbutX[cd, Rot90[cd]]; -- this one should provoke an error
cd ← AbutY[ab, FlipY[ab]];
cd ← AbutX[cd, FlipX[cd]];
cd ← AbutX[ab, FlipX[AbutX[ab, ab]]];
cd ← Array[ab, 2, 1];
cd ← Rot90[Array[ab, 2, 6]];
cd ← Array[ab, 8, 4];
RETURN [AbutX[cd, "store2B" ]]; -- this one generates an error
RETURN [cd ];
END;
Register[MyProc, "PWTestA"];
END.