[Indigo]<Rosemary>®>Rosemary.df=>RoseCreate.Mesa
Last Edited by: Spreitzer, May 16, 1985 4:53:30 pm PDT
Last Edited by: Gasbarro, August 16, 1984 4:03:20 pm PDT
DIRECTORY OrderedSymbolTableRef, RoseTypes;
RoseCreate: CEDAR DEFINITIONS =
BEGIN OPEN RoseTypes;
InterfaceMismatch: ERROR [cell: Cell,
index: CARDINAL,
expected, got: NodeType];
CellTestList: TYPE = LIST OF CellTestRep;
RegisterCellType: PROC
[
incrementally: BOOLFALSE,
Identification:
name: ROPE,
Structure:
expandProc: ExpandProc ← NIL,
Behavior:
ioCreator: IOCreator ← NIL,
driveCreator: DriveCreator ← NIL,
initializer: Initializer ← NIL,
evals: EvalProcs ← [],
tests: CellTestList ← NIL,
Other:
ports: Ports,
typeData: REF ANYNIL,
other: Assertions ← NIL
]
RETURNS [type: CellType];
IF NOT incrementally, THEN this call is specifying all that is known about this cell type.
IF incrementally, THEN this call adds to/changes what is previously known about this cell type.
GetCellType: PROC [name: ROPE] RETURNS [type: CellType];
CreateSim: PROC [steady: BOOL] RETURNS [sim: Simulation];
steady indicates whether this is for working on the steady-state, or initialization.
CreateTopCell: PROC [instanceName, typeName: ROPE, decider: ExpandDeciderClosure, sim: Simulation];
interfaceNodes must be empty at the top.
ExpandDeciderClosure: TYPE = REF ExpandDeciderClosureRep;
ExpandDeciderClosureRep: TYPE = RECORD [
Decide: ExpandDecider, otherData: REF ANY];
ExpandDecider: TYPE = PROC [cell: Cell, otherData: REF ANY] RETURNS [ExpandDecision];
Possible: PROC [cell: Cell, whatToDo: ExpandDecision] RETURNS [possible: BOOLEAN];
PickInOrder: PROC [--earlier=better--ExpandDecisionList] RETURNS [ExpandDeciderClosure];
ExpandDecisionList: TYPE = LIST OF ExpandDecision;
expandFirst: ExpandDeciderClosure --= PickInOrder[LIST[Expand, Leaf]]--;
leafFirst: ExpandDeciderClosure --= PickInOrder[LIST[Leaf, Expand]]--;
ByDepth: PROC [shallow: ExpandDeciderClosure, boundary: INT, deep: ExpandDeciderClosure] RETURNS [ExpandDeciderClosure];
Uses shallow when depth <= boundary, deep when depth > boundary.
Depth of root is 0.
CreateTest: PROC [rootName, typeName, testName: ROPE, decider: ExpandDeciderClosure, sim: Simulation, dual: BOOLFALSE];
If dual, make two tester&testee pairs controlled by the same instructions.
SetTest: PROC [test: CellTest, of: CellType, mayOverwriteOld: BOOLFALSE] RETURNS [old: CellTest];
GetTest: PROC [name: ROPE, from: CellType] RETURNS [CellTest];
WrapTop: PROC [rootName, typeName: ROPE, decider: ExpandDeciderClosure, clocks: ROPENIL, sim: Simulation];
Given a type with a non-empty interface, this will create (if necessary) and instantiate a type, with an empty interface, whose ExpandProc instantiates the given type, and the nodes it needs. The instance name used for the component is the type name with its first character lowercased. If clocks # NIL, a clock generator will also be instantiated, with its outputs connected to the nodes named in clocks.
XPhobicize: PROC [n: Node] RETURNS [m: Node-- = n --];
PortsFromROPE: PROC [asRope: ROPE] RETURNS [ports: Ports];
PortsFromFile: PROC [fileName: ROPE] RETURNS [ports: Ports];
PortsFromStream: PROC [stream: STREAM] RETURNS [ports: Ports];
AssertionsFromFile: PROC [fileName: ROPE] RETURNS [Assertions];
GetOtherss: PROC [fileName: ROPE] RETURNS [SymbolTable];
GetOthers: PROC [otherss: SymbolTable, cellTypeName: ROPE] RETURNS [SymbolTable];
GetOther: PROC [others: SymbolTable, partName: ROPE] RETURNS [Assertions];
DecideFromFile: PROC [fileName: ROPE] RETURNS [dff: ExpandDeciderClosure];
LookupCell: PROC [
path: LIST OF REF ANY --ROPEs or REF TEXTs--,
from: Cell ← NIL --NIL means first name names root--]
RETURNS [cell: Cell];
LookupNode: PROC [
path: LIST OF REF ANY,
from: Cell ← NIL]
RETURNS [node: Node];
LookupCellNode: PROC [cell: Cell, name: ROPE] RETURNS [node: Node];
LongNodeName: PROC [n: Node, relativeTo: Cell ← NIL] RETURNS [name: ROPE];
LongCellName: PROC [c: Cell, relativeTo: Cell ← NIL] RETURNS [name: ROPE];
LongPortName: PROC [c: REF ANY--UNION[CellType, Cell]--, pi: PortIndex ← nilPortIndex, epi: EffectivePortIndex ← nilEffectivePortIndex] RETURNS [name: ROPE];
LowestCommonAncestor: PROC [c1, c2: Cell] RETURNS [lca: Cell];
FillInInterfaceNodes: PROC [cell: Cell, interfaceNodes: ROPE];
EnumerateConnections: PROC [asRope: ROPE, to: PROC [key: Key, nodeName: ROPE]];
Key: TYPE = RECORD [variant: SELECT kind: * FROM
position => [index: NAT],
keyword => [name: ROPE],
ENDCASE];
CompareRopes, CompareNodes, CompareComponents: OrderedSymbolTableRef.CompareProc;
EnsureEnvironment: PROC [in: Cell, forType: CellType, to: ExpansionReceiver];
EqualInterfaces: PROC [a, b: Ports] RETURNS [structurally, fully: BOOL];
roots: SymbolTable;
END.