PWCTilingClass.mesa
Copyright © 1986 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet September 19, 1986 1:48:15 pm PDT
Bertrand Serlet September 26, 1986 5:14:34 pm PDT
DIRECTORY Core, CoreCreate;
PWCTilingClass: CEDAR DEFINITIONS ~ BEGIN
Conveniences
CellType : TYPE = Core.CellType;
Properties : TYPE = Core.Properties;
ROPE: TYPE = Core.ROPE;
Wire: TYPE = Core.Wire;
Wires: TYPE = Core.Wires;
PA: TYPE = CoreCreate.PA;
WR: TYPE = CoreCreate.WR;
Tiles
Tile: TYPE ~ REF TileRec;
TileRec: TYPE ~ RECORD [
type: CellType,   -- type of the tile.
renaming: LIST OF PANIL,  -- binding [public of the tile -> public of the whole array]. There is no implicit renaming (contrarily to CoreCreate).
flatten: BOOLFALSE,   -- if flatten, the tile's type should be a record cell, and is flattened once at Recast time. All the internals of the tile's type should be public.
properties: Core.Properties ← NIL  -- to store arbitrary information. implementation uses it.
];
TileRow: TYPE ~ REF TileRowRec;
TileRowRec: TYPE ~ RECORD [
tiles: SEQUENCE size: NAT OF Tile  -- tiles, from left to right.
];
TileArray: TYPE ~ REF TileArrayRec;
TileArrayRec: TYPE ~ RECORD [
tileRows: SEQUENCE size: NAT OF TileRow -- rows, from bottom to top.
];
PublicPair: TYPE = RECORD [public1, public2: WR];
public1 is a public of tile1.
public2 is a public of tile2.
NeighborProc: TYPE = PROC [cellType: CellType, tile1, tile2: Tile, userData: REFNIL] RETURNS [publicPairs: LIST OF PublicPair ← NIL];
cellType is either of class rowPWCTilingClass or of class pwcTilingClass.
For 2 tiles, abutted in X or in Y, indicates their stitches.
Tiling
The LayoutProc associated to pwcTilingClass assumes that:
there is the same number of tiles in every row,
all tiles in a given row have the same height (of the IR),
all tiles in a given column have the same width (of the IR).
pwcTilingClass: Core.CellClass;
CreateTiling: PROC [public: Wire, tileArray: TileArray, neighborX, neighborY: NeighborProc, name: ROPENIL, props: Properties ← NIL, cacheNeighbor: BOOLTRUE] RETURNS [tiling: CellType];
public is the resulting public of the whole tiling.
tileArray gives the tiles.
neighborX, neighborY are used to compute the stitches.
name, if non NIL, has precedence over props.
tiling is of class pwcTilingClass.
cacheNeighbor indicates whether the neighbor functions should be cached.
Predefined NeighborProcs
LayoutNeighborX: NeighborProc;
LayoutNeighborY: NeighborProc;
Those functions call PWCore.Layout on their Tile arguments, and use the PWCore.extractMode.decoration to compute which public is in front of which public.
SchematicsNeighborX: NeighborProc;
SchematicsNeighborY: NeighborProc;
Those functions assume that their Tile arguments are schematics cells, and use the Sisyph.mode.decoration to compute which public is in front of which public.
END.