<> <> <> <> <> <<>> DIRECTORY Core, CoreClasses, HashTable; 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; WireRoot: TYPE = {internal, public, actual}; InstantiationPath: TYPE = CoreClasses.CellInstances; -- deepest first PackedPath: TYPE = RECORD [ length: PathIndex _ 0, bits: PACKED ARRAY PathIndex OF BOOL _ ALL[FALSE]]; PathIndex: TYPE = [0..32); -- caution!!!, look at the implementation of PathEqual before changing this type!!! NullPath: PackedPath = []; <> WireBind: TYPE = REF WireBindRec; WireBindRec: TYPE = RECORD [ path: PackedPath, wire: Core.Wire _ NIL, data: REF ANY _ NIL]; <> FlatWires: TYPE = LIST OF FlatWire; FlatWire: TYPE = REF FlatWireRec; FlatWireRec: TYPE = RECORD [ path: PackedPath, wire: Core.Wire _ NIL]; FlatInstance: TYPE = REF FlatInstanceRec; FlatInstanceRec: TYPE = RECORD [ path: PackedPath, instance: CoreClasses.CellInstance _ NIL]; <> GetCellType: PROC [root: Core.CellType, path: PackedPath] RETURNS [cellType: Core.CellType]; <> VisitUnboundPath: PROC [root: Core.CellType, path: PackedPath, eachInstance: EachUnboundInstanceProc]; EachUnboundInstanceProc: TYPE = PROC [instance: FlatInstanceRec, cellType: Core.CellType]; <> <> <<>> BoundCellType: PROC [root: Core.CellType, path: PackedPath] RETURNS [bindings: HashTable.Table, cellType: Core.CellType]; <> VisitBoundPath: PROC [root: Core.CellType, path: PackedPath, eachInstance: EachBoundInstanceProc] RETURNS [bindings: HashTable.Table]; EachBoundInstanceProc: TYPE = PROC [bindings: HashTable.Table, instance: FlatInstanceRec, cellType: Core.CellType]; <> <> <<>> EnumerateLeaves: PROC [root: Core.CellType, eachInstance: EachInstanceProc, rootCellType, beforeInstances, afterInstances: EachCellTypeProc _ NIL]; EachInstanceProc: TYPE = PROC [bindings: HashTable.Table, path: PackedPath, instance: CoreClasses.CellInstance] RETURNS [flatten: BOOL _ TRUE]; EachCellTypeProc: TYPE = PROC [bindings: HashTable.Table, path: PackedPath, cellType: Core.CellType]; <> <<>> EnumerateAtomicWireLeaves: PROC [root: Core.CellType, rootWire: Core.Wire, eachInternalWire: EachInternalWireProc _ NIL, eachWireInstance: EachWireInstanceProc _ NIL]; < ERROR. rootWire must be reachable from the internal of root. All internal wires bound to rootWire, including rootWire, are enumerated. The instances whose actual reaches rootWire are enumerated.>> EachInternalWireProc: TYPE = PROC [bindings: HashTable.Table, path: PackedPath, cellType: Core.CellType, wire: Core.Wire]; EachWireInstanceProc: TYPE = PROC [bindings: HashTable.Table, path: PackedPath, instance: CoreClasses.CellInstance, wire: Core.Wire] RETURNS [flatten: BOOL _ TRUE]; <> FindPath: PROC [root: Core.CellType, pathRope: ROPE] RETURNS [path: PackedPath]; PathRope: PROC [root: Core.CellType, path: PackedPath] RETURNS [pathRope: ROPE]; PathEqual: PROC [one, other: PackedPath] RETURNS [equal: BOOL]; PathHash: PROC [path: PackedPath] RETURNS [hash: CARDINAL]; ComputePackedPath: PROC [root: Core.CellType, instantiationPath: InstantiationPath] RETURNS [path: PackedPath]; <> FindInstance: PROC [root: Core.CellType, instancePathRope: ROPE] RETURNS [instance: FlatInstanceRec]; InstancePathRope: PROC [root: Core.CellType, instance: FlatInstanceRec] RETURNS [instancePathRope: ROPE]; AddInstance: PROC [currentPath: PackedPath, instance: CoreClasses.CellInstance, within: Core.CellType] RETURNS [newPath: PackedPath]; FlatInstanceEqual: PROC [one, other: REF ANY -- FlatInstance --] RETURNS [equal: BOOL]; FlatInstanceEqualRec: PROC [one, other: FlatInstanceRec] RETURNS [equal: BOOL]; FlatInstanceHash: PROC [instance: REF ANY -- FlatInstance --] RETURNS [hash: CARDINAL]; FlatInstanceHashRec: PROC [instance: FlatInstanceRec] RETURNS [hash: CARDINAL]; <> FindWire: PROC [root: Core.CellType, wirePathRope: ROPE] RETURNS [wire: FlatWireRec, wireRoot: WireRoot]; WirePathRope: PROC [root: Core.CellType, wire: FlatWireRec, wireRoot: WireRoot _ internal] RETURNS [wirePathRope: ROPE]; FlatWireEqual: PROC [one, other: REF ANY -- FlatWire --] RETURNS [equal: BOOL]; FlatWireEqualRec: PROC [one, other: FlatWireRec] RETURNS [equal: BOOL]; FlatWireHash: PROC [wire: REF ANY -- FlatWire --] RETURNS [hash: CARDINAL]; FlatWireHashRec: PROC [wire: FlatWireRec] RETURNS [hash: CARDINAL]; END.