-- AddAlignMarksAndMirror.mesa
-- Last Edited by: Kimr, September 13, 1984 5:15:22 pm PDT
DIRECTORY
AlignmentMarks,
CD,
CDApplications,
CDCells,
CDDirectory,
CDOrient,
CDRects,
CDSequencer,
Rope,
TerminalIO;
AddAlignMarksAndMirror: CEDAR PROGRAM
IMPORTS CD, CDApplications, AlignmentMarks, CDCells, CDDirectory, CDRects, CDSequencer, TerminalIO =
BEGIN
design: CD.Design;
metal: CD.Level;
PlaceAlignMarks: CDDirectory.EachEntryAction =
-- PROC [name: Rope.ROPE, ob: CD.ObPtr] RETURNS [quit: BOOL�LSE];
BEGIN
cell: CD.CellPtr;
x, y: INT;
rect: CD.ObPtr ← CDRects.CreateRect[ size: [x: 1, y: 1], l: metal];
ap, aptr: CD.ApplicationPtr;
mark: AlignmentMarks.Mark;
[x, y] ← ob.size;
IF ISTYPE[ob.specificRef, CD.CellPtr] THEN {
cell ← NARROW[ob.specificRef, CD.CellPtr];
aptr ← CDApplications.NewApplicationI[ob: rect, location: [x: 0, y: 0]];
[] ← CDCells.IncludeApplication[design: design, cell: ob, aptr: aptr, draw: FALSE];
FOR aplist: CD.ApplicationList ← cell.contents, aplist.rest WHILE aplist # NIL DO
ap ← aplist.first;
IF ISTYPE[ap.ob.specificRef, CD.RectPtr] THEN {
ap.location.y ← 2*x - ap.location.y;
IF CD.LevelKey[ap.ob.level] = $pol THEN {
TerminalIO.WriteRope["found one\n "];
mark.pos ← [x: ap.location.x, y: ap.location.y+1];
mark.name ← "left";
[] ← CDCells.IncludeApplication[design: design, cell: ob, aptr: AlignmentMarks.MakeMarkAptr[mark: mark]];
mark.pos ← [x: ap.location.x+ap.ob.size.y, y: ap.location.y+1];
mark.name ← "right";
[] ← CDCells.IncludeApplication[design: design, cell: ob, aptr: AlignmentMarks.MakeMarkAptr[mark: mark]];
[] ← CDCells.RemoveApplication[design: design, cell: ob, aptr: ap, draw: FALSE];
};
};
ENDLOOP
}
ELSE
TerminalIO.WriteRope["directory object not a cell\n"];
[] ← CDCells.RemoveApplication[design: design, cell: ob, aptr: aptr, draw: FALSE];
END;
AddMarks: PROC[ comm: CDSequencer.Command] =
BEGIN
design ← comm.design;
metal ← CD.FetchLevel[t: design.technology, uniqueKey: $met];
TerminalIO.WriteRope["Adding marks to poly lines in cells \n"];
[] ← CDDirectory.Enumerate[design: design, action: PlaceAlignMarks];
TerminalIO.WriteRope["Done adding marks\n"];
END;
-- module initialization
CDSequencer.ImplementCommand[$MirrorS, AddMarks];
END.