DP.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Curry, December 1, 1986 4:15:07 pm PST
Don Curry May 1, 1987 11:14:42 am PDT
DIRECTORY CD, CDRoutingObjects, Core, CoreClasses, CoreCreate, CoreGeometry, CoreXform, Sisyph, CMosB, RefTab;
DP: CEDAR DEFINITIONS = BEGIN
DataPath:  TYPE = REF RowSeqRec;
RowSeqRec: TYPE = RECORD[
schIR:   CD.Rect,    -- schematics ir not including public wire tails
layIR:   CD.Rect,    -- layout ir
obj:   Object,
cell:   CellType,
wpo:   RefTab.Ref,
spec:   DPSpec,
seq:   SEQUENCE size: CARDINAL OF ColSeq];
ColSeq:  TYPE = REF ColSeqRec;
ColSeqRec: TYPE = RECORD[
schIR:   CD.Rect,    -- schematics row ir not including public wire tails
obj:   Object,    -- eg. switchbox;
layY:   Interval,
sb:    RefTab.Ref ← NIL,
seq:   SEQUENCE size: CARDINAL OF Section];
Section:  TYPE = RECORD[
schIR:   CD.Rect,    -- schematics section ir
schInst:  CellInstance,   -- schematics cell instance
wpo:   RefTab.Ref, -- wire to PObjs (Layout)
devCOff:  INT   ← 0, -- device channel offset (=0 for muxes, # chans otherwise)
devCells:  CellTypeSeq ← NIL ];
Interval:  TYPE = RECORD[loc, size: INT ← 0];
Intervals:  TYPE = LIST OF Interval ← NIL;
LayoutCoord: TYPE = RECORD [
hor:       BOOL,
inBody:      BOOL,
sides:       Sides,
horSize:      NAT ← 0,
horLayBot, horLayTop: CD.Layer,
rowBot,  rowTop:  NAT ← 0,
yBot,   yTop:   NAT ← 0,
colLt,   colRt:   NAT ← 0,
chanLt,  chanRt:  NAT ← 0 ];
DPSpec:  TYPE = REF DPSpecRec;
DPSpecRec: TYPE = RECORD
[n, chans, cols: NAT ← 0, xforms: Xforms ← NIL, sbPolyBits: INT ← -1, dChans: NAT ← 9];
CellType:   TYPE = Core.CellType;
CellTypeSeq:  TYPE = REF CellTypeSeqRec;
CellTypeSeqRec: TYPE = RECORD[SEQUENCE size: CARDINAL OF CellType];
Object:   TYPE = CD.Object;
ObjectSeq:  TYPE = REF ObjectSeqRec;
ObjectSeqRec: TYPE = RECORD[SEQUENCE size: CARDINAL OF Object];
PObj:    TYPE = CDRoutingObjects.PlacedObject;
PObjs:    TYPE = LIST OF PObj ← NIL;
PObjSeq:   TYPE = REF PObjSeqRec;
PObjSeqRec:  TYPE = RECORD[SEQUENCE size: CARDINAL OF PObjs];
ROPE:    TYPE = Core.ROPE;
Wire:    TYPE = Core.Wire;
Wires:    TYPE = Core.Wires;
CellInstance:  TYPE = CoreClasses.CellInstance;
Side:    TYPE = CoreGeometry.Side;
Sides:    TYPE = CoreGeometry.Sides;
Context:   TYPE = Sisyph.Context;
Xforms:   TYPE = CoreXform.Xforms;
WIProc:   TYPE = PROC[cx: Context ← NIL] RETURNS[wire: Wire  ← NIL];
CIProc:   TYPE = PROC[cx: Context ← NIL] RETURNS[cell: CellType ← NIL];
GetWI:   WIProc;
GetCI:   CIProc;
RegisterWI:  PROC [nm: ROPE, wiProc: WIProc];
RegisterCI:  PROC [nm: ROPE, ciProc: CIProc];
Set:    PROC [cx: Context,    dpSpecRec: DPSpecRec] RETURNS[layout: ATOM];
GetCXDPSpec: PROC [cx: Context] RETURNS[dpSpec: DPSpec];
GetCTDPSpec: PROC [ct: CellType] RETURNS[dpSpec: DPSpec];
Loads import if neccessary
GetSchCT:    PROC[cx: Context, name: ROPE] RETURNS [cellType: CellType];
GetSortedCT:   PROC[cx: Context, name: ROPE] RETURNS [cellType: CellType];
GetCharCode:   PROC[wire: Wire] RETURNS[charCode: ROPE];
SetCharCode:   PROC[wire: Wire, charCode: ROPE];
Interleave:    PROC[a, b: NAT]       RETURNS [wire: Wire];
ColumnCompose:  PROC[n, cols, chans: NAT]    RETURNS [wire: Wire];
BitPosX:     PROC[dp: DataPath, col, bit: NAT] RETURNS[pos: INT];
SchHalfChan:   PROC[pos: INT] RETURNS[chan: INT];
BitWidth:    PROC[dp: DataPath] RETURNS[bitWidth: INT];
GetMuxCellTypes: PROC[dp: DataPath, inst: CellInstance]
RETURNS[cells: CellTypeSeq];
GetSBY:     PROC[sb: RefTab.Ref, wire: Wire]
RETURNS[loc: INT, layer: CD.Layer];
AddSBNode:  PROC[dp: DataPath, row: INT, wire: Wire, lc: LayoutCoord];
BuildSB:    PROC[dp: DataPath, row: INT];
schDeco:     CoreGeometry.Decoration;
layDeco:     CoreGeometry.Decoration;
lambda:   INT = CMosB.lambda;
pwrW:   INT = 5*lambda;
metW:    INT = 3*lambda;
met2W:   INT = 4*lambda;
polW:    INT = 2*lambda;
difW:    INT = 2*lambda;
pinSize:   INT = 2*lambda;
initialYSize:  INT = 20;   -- for switchbox use (=>top
topTail:   INT = 2*lambda;
leftTail:   INT = 6*lambda; -- to center of 0th channel
rightTail:   INT = 2*lambda; -- metPitch-leftTail
botTail:   INT = 1*lambda;
cnctSize:    INT = 4*lambda;
layChanW:   INT = 8*lambda;
schChanW:   INT = 4*lambda;
metPitch:   INT = layChanW;
met2Pitch:   INT = layChanW;
END.