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].
data: CoreClasses.RecordCellType ← NARROW[cellType.data];
IF data =
NIL
THEN
SC.Error[callingError, Rope.Cat["Invalid Record Cell: ", NARROW[CoreProperties.GetCellTypeProp[cellType, CoreOps.nameProp]]]];
FOR instList: CoreClasses.CellInstanceList ← data.instances, instList.rest
WHILE instList #
NIL
AND ~quit
DO
quit ← eachInstance[instList.first];
ENDLOOP};
EnumerateFlatWires:
PUBLIC
PROC [wire: Core.WireSequence, eachWire: SCCoreUtil.EachWireProc]
RETURNS [quit:
BOOL ← FALSE] = {
DoWire: CoreOps.EachWireProc = {
IF wire.elements = NIL THEN [subWires, quit] ← eachWire[wire]};
[] ← CoreOps.VisitWireSequence[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.elements =
NIL
AND publicWire.elements =
NIL
THEN
[subWires, quit] ← eachInstancePin[actualWire, publicWire]};
[] ← CoreOps.VisitBinding[cellInstance.actual, cellInstance.type.public, DoWire]};
END.