Static.mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Barth, October 22, 1986 11:48:09 am PDT
Bertrand Serlet March 30, 1987 9:59:59 pm PST
DIRECTORY Core, CoreFlat;
Static: CEDAR DEFINITIONS = BEGIN
Theory
This interface does interesting static checks.
Practice
staticCutSetProp: ATOM; -- $StaticCutSet
UnconnectedOK: PROC [wire: Core.Wire] RETURNS [same: Core.Wire];
Marks the wire with a property which suppresses the bad connection count error message. The property is not propagated across cell boundaries by public actual bindings. It is propagated from a parent wire to its children.
New Practice
ConnectionCheckProc: TYPE = PROC [root: Core.CellType, flatWire: CoreFlat.FlatWireRec, count: INT, unconnectedOK: BOOL] RETURNS [quit: BOOLFALSE];
ConnectionCheck: ConnectionCheckProc;
Checks that every internal wire has at least two connections and that every public wire has at least one connection. Reports any wire which doesn't with TerminalIO. Wires marked with UnconnectedOK do not have error messages generated.
CountFlatConnections: PROC [root: Core.CellType, eachWireCount: ConnectionCheckProc, cutSet: CoreFlat.CutSet ← NIL] RETURNS [quit: BOOLFALSE];
Counts the connections to each atomic wire reachable from root. Calls eachWireCount with the number of leaf connections on a wire. If cutSet is NIL then checks the root for staticCutSetProp.
CountHierarchicalConnections: PROC [root: Core.CellType, eachWireCount: ConnectionCheckProc, cutSet: CoreFlat.CutSet ← NIL] RETURNS [quit: BOOLFALSE];
Counts the connections to each atomic wire reachable from root. Calls eachWireCount with the number of direct connections on a wire. If cutSet is NIL then checks the root for staticCutSetProp.
Old Practice
ConnectionCountProc: TYPE = PROC [count: INT, wireRoot: Core.Wire, wire: Core.Wire, public: BOOL, cellType: Core.CellType, unconnectedOK: BOOL];
IF public THEN
wire is a public of root
cellType is root
ELSE cellType is the record cell parent of wire
CheckCount: ConnectionCountProc;
Checks that every internal wire has at least two connections and that every public wire has at least one connection. Reports any wire which doesn't with TerminalIO. Wires marked with UnconnectedOK do not have error messages generated.
CountLeafConnections: PROC [root: Core.CellType, eachWireCount: ConnectionCountProc, cutSet: CoreFlat.CutSet ← NIL];
Counts the connections to each atomic wire reachable from root. Calls eachWireCount with the number of leaf connections on a wire. If cutSet is NIL then checks the root for staticCutSetProp.
CountDirectConnections: PROC [root: Core.CellType, eachWireCount: ConnectionCountProc, cutSet: CoreFlat.CutSet ← NIL];
Counts the connections to each atomic wire reachable from root. Calls eachWireCount with the number of direct connections on a wire. If cutSet is NIL then checks the root for staticCutSetProp.
END.