<> <> <> <> <> <> <> <<>> DIRECTORY Core, CoreClasses, RefTab; CoreFlat: CEDAR DEFINITIONS = BEGIN <> <> <> <> <> <> <> <> <<::= = keyword on left hand side is defined by expression on right hand side>> <> <> <> <> <> <> <<>> <> <> <> <> <> <> <> PathError: ERROR [msg: ROPE _ NIL]; <> ROPE: TYPE = Core.ROPE; Wire: TYPE = Core.Wire; WireSeq: TYPE = Core.WireSeq; CellType: TYPE = Core.CellType; CellClass: TYPE = Core.CellClass; CellInstance: TYPE = CoreClasses.CellInstance; CutSet: TYPE = REF CutSetRec; CutSetRec: TYPE = RECORD [ instances, cellTypes, cellClasses, labels: LIST OF ROPE _ NIL, flatCells: FlatCellTypes _ NIL, flatten: FlatCellTypes _ NIL, change: FlatCellTypeCutSets _ NIL]; FlatCellTypeCutSets: TYPE = LIST OF FlatCellTypeCutSetRec; FlatCellTypeCutSetRec: TYPE = RECORD [ flatCell: FlatCellTypeRec, cutSet: CutSet _ NIL]; <> <> <<>> InstancePath: TYPE = RECORD [ length: InstancePathIndex _ 0, bits: PACKED ARRAY InstancePathIndex OF BOOL _ ALL[FALSE]]; InstancePathIndex: TYPE = [0..64); <> nullInstancePath: InstancePath = []; <<>> <> FlatCellTypes: TYPE = LIST OF FlatCellType; FlatCellType: TYPE = REF FlatCellTypeRec; FlatCellTypeRec: TYPE = RECORD [ path: InstancePath, recastCount: NAT _ 0]; -- do not include recasts that return the same ref rootCellType: FlatCellTypeRec = []; allFlatCells: FlatCellTypeRec = [[], LAST[NAT]]; <> WireRoot: TYPE = {internal, public, actual}; WirePath: TYPE = RECORD [ length: WirePathIndex _ 0, bits: PACKED ARRAY WirePathIndex OF BOOL _ ALL[FALSE]]; WirePathIndex: TYPE = [0..32); <<>> FlatWires: TYPE = LIST OF FlatWire; FlatWire: TYPE = REF FlatWireRec; FlatWireRec: TYPE = RECORD [ flatCell: FlatCellTypeRec _ rootCellType, instanceIndex: NAT _ 0, wireRoot: WireRoot _ internal, validPath: BOOL _ FALSE, path: WirePath, wire: Wire _ NIL]; <> Bindings: TYPE = RefTab.Ref; <> <> CellInstanceCutLabels: PROC [on: CellInstance, l1, l2, l3, l4, l5, l6: ROPE _ NIL] RETURNS [same: CellInstance]; CellInstanceCutLabelList: PROC [on: CellInstance, labels: LIST OF ROPE] RETURNS [same: CellInstance]; CellTypeCutLabels: PROC [on: CellType, l1, l2, l3, l4, l5, l6: ROPE _ NIL] RETURNS [same: CellType]; CellTypeCutLabelList: PROC [on: CellType, labels: LIST OF ROPE] RETURNS [same: CellType]; CellClassCutLabels: PROC [on: CellClass, l1, l2, l3, l4, l5, l6: ROPE _ NIL] RETURNS [same: CellClass]; CellClassCutLabelList: PROC [on: CellClass, labels: LIST OF ROPE] RETURNS [same: CellClass]; CreateCutSet: PROC [instances, cellTypes, cellClasses, labels: LIST OF ROPE _ NIL, flatCells: FlatCellTypes _ NIL, flatten: FlatCellTypes _ NIL, change: FlatCellTypeCutSets _ NIL] RETURNS [cutSet: CutSet]; <> CutSetMember: PROC [root: CellType, flatCell: FlatCellTypeRec, cutSet: CutSet] RETURNS [member: BOOL]; <> CutSetMemberResolved: PROC [flatCell: FlatCellTypeRec, instance: CellInstance, cellType: CellType, cutSet: CutSet] RETURNS [member: BOOL]; <> BelowCutSet: PROC [root: CellType, flatCell: FlatCellTypeRec, cutSet: CutSet] RETURNS [below: BOOL]; <> <> ParseInstancePath: PROC [root: CellType, pathRope: ROPE, cutSet: CutSet _ NIL] RETURNS [path: InstancePath]; InstancePathRope: PROC [root: CellType, path: InstancePath] RETURNS [pathRope: ROPE]; InstancePathEqual: PROC [one, other: InstancePath] RETURNS [equal: BOOL]; InstancePathHash: PROC [path: InstancePath] RETURNS [hash: CARDINAL]; AddInstance: PROC [currentPath: InstancePath, instance: CoreClasses.CellInstance, parent: CellType] RETURNS [newPath: InstancePath]; ExtendPath: PROC [currentPath: InstancePath, index: NAT, rct: CoreClasses.RecordCellType] RETURNS [newPath: InstancePath]; <> <<>> BindInstance: PROC [parent: FlatCellTypeRec, actual, public: WireSeq, bindings: Bindings] RETURNS [newBindings: Bindings]; <> RaiseRootOfInstancePath: PROC [by, path: InstancePath] RETURNS [raised: InstancePath]; <> <> ParseCellTypePath: PROC [root: CellType, pathRope: ROPE, cutSet: CutSet _ NIL] RETURNS [flatCell: FlatCellTypeRec]; CellTypePathRope: PROC [root: CellType, flatCell: FlatCellTypeRec] RETURNS [pathRope: ROPE]; FlatCellTypeEqual: RefTab.EqualProc; <> FlatCellTypeEqualRec: PROC [one, other: FlatCellTypeRec] RETURNS [equal: BOOL]; FlatCellTypeHash: RefTab.HashProc; <> FlatCellTypeHashRec: PROC [flatCell: FlatCellTypeRec] RETURNS [hash: CARDINAL]; ResolveFlatCellType: PROC [root: CellType, flatCell: FlatCellTypeRec] RETURNS [parent: CellType, instance: CellInstance, cellType: CellType]; <> BoundFlatCellType: PROC [root: CellType, flatCell: FlatCellTypeRec] RETURNS [bindings: Bindings, instance: CellInstance, cellType: CellType]; <> FindAnyFlatCell: PROC [root: Core.CellType, cellType: Core.CellType] RETURNS [flatCellType: CoreFlat.FlatCellTypeRec _ []]; <> RaiseRootOfFlatCell: PROC [by: InstancePath, flatCell: FlatCellTypeRec] RETURNS [raised: FlatCellTypeRec]; <> ParseWirePath: PROC [root: CellType, pathRope: ROPE, cutSet: CutSet _ NIL] RETURNS [flatWire: FlatWireRec]; WirePathRope: PROC [root: CellType, wire: FlatWireRec] RETURNS [pathRope: ROPE]; FlatWireEqual: RefTab.EqualProc; <> FlatWireEqualRec: PROC [one, other: FlatWireRec] RETURNS [equal: BOOL]; FlatWireHash: RefTab.HashProc; <> FlatWireHashRec: PROC [wire: FlatWireRec] RETURNS [hash: CARDINAL]; CanonizeWire: PROC [root: CellType, child: FlatWireRec] RETURNS [parent: FlatWireRec]; <> RaiseRootOfFlatWire: PROC [by: InstancePath, flatWire: FlatWireRec] RETURNS [raised: FlatWireRec]; <> <<>> <> <<>> <> <<>> <> <> <<-- Handle nonleaf cells here.>> <<-- Handle initialization prior to visiting children here.>> <> <<-- Handle special initialization for record cells here.>> <<};>> <> <<-- Handle cleanup after visiting children here.>> <<}>> <> <<-- Handle leaf cells here.>> <<};>> <<};>> <<>> <> <<};>> <<>> NextUnboundCellType: PROC [cell: CellType, target: FlatCellTypeRec, flatCell: FlatCellTypeRec, instance: CellInstance, index: NAT, parent: CellType, flatParent: FlatCellTypeRec, data: REF ANY, proc: UnboundFlatCellProc]; <> <<[instance, cell] = ResolveFlatCellType[root, flatCell].>> <> <<[, parent] = ResolveFlatCellType[root, flatParent].>> <> UnboundFlatCellProc: TYPE = PROC [cell: CellType, target: FlatCellTypeRec _ allFlatCells, flatCell: FlatCellTypeRec _ [], instance: CellInstance _ NIL, index: NAT _ LAST[NAT], parent: CellType _ NIL, flatParent: FlatCellTypeRec _ [], data: REF ANY _ NIL]; <> NextBoundCellType: PROC [cell: CellType, target: FlatCellTypeRec, flatCell: FlatCellTypeRec, instance: CellInstance, index: NAT, parent: CellType, flatParent: FlatCellTypeRec, data: REF ANY, bindings: Bindings, proc: BoundFlatCellProc]; BoundFlatCellProc: TYPE = PROC [cell: CellType, target: FlatCellTypeRec _ allFlatCells, flatCell: FlatCellTypeRec _ [], instance: CellInstance _ NIL, index: NAT _ LAST[NAT], parent: CellType _ NIL, flatParent: FlatCellTypeRec _ [], data: REF ANY _ NIL, bindings: Bindings _ NIL]; <> InitialBindingTable: PROC [root: CellType] RETURNS [bindings: Bindings]; <> <<>> END.