MEBESPlaceImpl:
CEDAR
PROGRAM
IMPORTS CDBasics, CDOrient, Real =
BEGIN
ROPE: TYPE = Rope.ROPE;
Mm: TYPE = REAL;
MmPair: TYPE = RECORD [x, y: Mm];
Nm: TYPE = INT;
NmPair: TYPE = CD.Position;
NmRect: TYPE = CD.Rect;
Placement: TYPE = RECORD [x, y: Nm ← 0, orient: CDOrient.Orientation ← 0 -- CDOrient.original -- ];
MaskSpec: TYPE = REF MaskSpecRec;
MaskSpecRec: TYPE = RECORD [ maskNo: ROPE, field: FieldType, addrUnit, skewPerSide, scribeWidth, scribeOffset: Nm ];
FieldType: TYPE = {CL, DK};
dieName: Rope.ROPE ← "";
area: Mm ← 0; -- mm^2 --
dieBounds: NmRect ← [0, 0, 0, 0];
MaskSpecGen:
PROC [ ms: MaskSpecRec ]
RETURNS [ maskSpec: MaskSpec ] =
{RETURN[NEW[MaskSpecRec ← ms]]};
SetDie: PROC [name: ROPE, boundRect: NmRect] = {dieName ← name; dieBounds ← [0,0,0,0]};
Include:
PROC [ user, project:
ROPE, size: MmPair, fileName:
ROPE ←
NIL, place: Placement ← [] ]
RETURNS [ bounds: NmRect ] = {
nmSize: NmPair ← [x: Real.FixLI[1.E6*size.x], y: Real.FixLI[1.E6*size.y]];
bounds ← CDOrient.RectAt[pos: [place.x, place.y], size: nmSize, orient: place.orient];
dieBounds ← (IF CDBasics.NonEmpty[dieBounds] THEN CDBasics.Surround[dieBounds, bounds] ELSE bounds);
area ← area+1.0E-12*CDBasics.SizeOfRect[bounds].x*CDBasics.SizeOfRect[bounds].y;
};
Surround:
PROC [r1, r2:
CD.Rect]
RETURNS [
CD.Rect] =
{RETURN[CDBasics.Surround[r1,r2]]};
END.