SCCoreUtilImpl.mesa ///StdCell/SCCoreUtilImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bryan Preas, August 26, 1985 5:47:05 pm PDT
Frank Bowers December 18, 1985 4:23:30 pm PST
SCCoreUtilImpl:
CEDAR
PROGRAM
IMPORTS CoreOps, CoreProperties, Rope, SC
EXPORTS SCCoreUtil =
BEGIN
EnumerateInstances:
PUBLIC
PROC [cellType: Core.CellType, eachInstance: SCCoreUtil.EachInstanceProc]
RETURNS [quit:
BOOL ←
FALSE] = {
May raise StructureError[MissingParameter].
parentRCT: CoreClasses.RecordCellType ← NARROW[cellType.data];
IF parentRCT =
NIL
THEN
SC.Error[callingError, Rope.Cat["Invalid Record Cell: ", NARROW[CoreProperties.GetCellTypeProp[cellType, CoreOps.nameProp]]]];
FOR in:
NAT
IN [0..parentRCT.size)
DO
instance: CoreClasses.CellInstance ← parentRCT[in];
quit ← eachInstance[instance];
ENDLOOP;
};
EnumerateFlatWires:
PUBLIC
PROC [wire: Core.Wire, eachWire: SCCoreUtil.EachWireProc]
RETURNS [quit:
BOOL ←
FALSE] = {
DoWire: CoreOps.EachWireProc = {
IF wire.size = 0 THEN [subWires, quit] ← eachWire[wire]};
quit ← CoreOps.VisitWire[wire, DoWire]};
EnumFlatInstancePins:
PUBLIC
PROC [cellInstance: CoreClasses.CellInstance, eachInstancePin: SCCoreUtil.EachInstancePinProc] = {
DoWire: CoreOps.EachWirePairProc = {
added test for actualWire = NIL - Frank Bowers January 10, 1986 11:05:46 am PST
IF actualWire #
NIL
AND actualWire.size = 0
AND publicWire.size = 0
THEN
[subWires, quit] ← eachInstancePin[actualWire, publicWire]};
[] ← CoreOps.VisitBinding[cellInstance.actual, cellInstance.type.public, DoWire]};
END.