<> <> <> <> <> <> <> <<>> DIRECTORY CD USING [Design], CDOrient USING [mirrorX, mirrorY, Orientation, rotate90, rotate180, rotate270], Rope USING [ROPE]; PW: CEDAR DEFINITIONS = BEGIN <<-- Basic user types>> <<>> ObjName: TYPE = ROPE _ NIL; -- so that user only deals with names (preferred) InstName: TYPE = ObjName; -- old form ROPE: TYPE = Rope.ROPE; -- waiting for some Cedar release when it is predefined <<>> <<-- Utilities always useful>> <<>> <<-- Predicates>> ODD: PUBLIC PROC [i: INT] RETURNS [BOOL] = INLINE {RETURN [(i MOD 2 # 0)]}; EVEN: PUBLIC PROC [i: INT] RETURNS [BOOL] = INLINE {RETURN [(i MOD 2 = 0)]}; <> Log2: PROC [n: INT] RETURNS [INT]; TwoToThe: PROC [x: INT] RETURNS [INT]; TwoToTheLog2: PROC [n: INT] RETURNS [INT] = INLINE {RETURN [TwoToThe[Log2[n]]]}; <> XthBitOfN: PROC [x, n: INT] RETURNS [BOOL]; <> <<>> <<-- Simple Abuts>> <<>> AbutX: PROC [t1, t2, t3, t4, t5, t6, t7, t8: ObjName _ NIL] RETURNS [new: ObjName]; AbutY: PROC [t1, t2, t3, t4, t5, t6, t7, t8: ObjName _ NIL] RETURNS [new: ObjName]; <<-- Abutment of lists>> AbutListX: PROC [subNames: LIST OF ObjName] RETURNS [new: ObjName]; AbutListY: PROC [subNames: LIST OF ObjName] RETURNS [new: ObjName]; <<-- Parametrized cells (conditional objects)>> <<>> Inst: PUBLIC PROC [name: ObjName, conds: LIST OF ROPE, removeNamed: BOOL _ TRUE] RETURNS [ObjName]; <<>> <<-- Arrays and other repetitions of Cells>> <<>> XYFunction: TYPE = PROC [x, y: INT] RETURNS [instName: ObjName]; <=ux or ly>=uy.>> MapFunction: PROC [function: XYFunction, lx: INT _ 0, ux: INT, ly: INT _ 0, uy: INT] RETURNS [ObjName]; <> ArrayX: PROC [objName: ObjName, nx: INT _ 1] RETURNS [ObjName]; <> ArrayY: PROC [objName: ObjName, ny: INT _ 1] RETURNS [ObjName]; Array: PROC [objName: ObjName, nx, ny: INT _ 1] RETURNS [ObjName]; <<-- Rotating cells>> <<>> ChangeOrientation: PROC [dir: CDOrient.Orientation, tile: ObjName] RETURNS [ObjName]; FlipX: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [ChangeOrientation[CDOrient.mirrorX, tile]]}; FlipY: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [ChangeOrientation[CDOrient.mirrorY, tile]]}; Identity: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [tile]}; Rot90: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [ChangeOrientation[CDOrient.rotate90, tile]]}; Rot180: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [ChangeOrientation[CDOrient.rotate180, tile]]}; Rot270: PROC [tile: ObjName] RETURNS [ObjName] = INLINE {RETURN [ChangeOrientation[CDOrient.rotate270, tile]]}; <<-- Other functions>> <<>> <> ReName: PROC [oldName: ObjName, instanceName: ROPE] RETURNS [newCellName: ObjName]; <> MakeObjNonStretchable: PROC [objName: ObjName]; <<-- Facilities for client interface>> <<>> UserProc: TYPE = PROC [design: CD.Design] RETURNS [ObjName]; Register: PROC [userProc: UserProc, name: ROPE]; END.