SCCoreUtilImpl.mesa ///StdCell/SCCoreUtilImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bryan Preas, August 26, 1985 5:47:05 pm PDT
DIRECTORY
Core,
CoreClasses,
CoreOps,
Rope,
SC,
SCCoreUtil,
SCPrivate;
SCCoreUtilImpl: CEDAR PROGRAM
IMPORTS CoreOps, Rope, SC
EXPORTS SCCoreUtil =
BEGIN
EnumerateInstances: PUBLIC PROC [cellType: Core.CellType, eachInstance: SCCoreUtil.EachInstanceProc] RETURNS [quit: BOOLFALSE] = {
May raise StructureError[MissingParameter].
data: CoreClasses.RecordCellType ← NARROW[cellType.data];
IF data = NIL THEN
SC.Error[callingError, Rope.Cat["Invalid Record Cell: ", cellType.name]];
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 = {
IF actualWire.elements = NIL AND publicWire.elements = NIL THEN
[subWires, quit] ← eachInstancePin[actualWire, publicWire]};
[] ← CoreOps.VisitBinding[cellInstance.actual, cellInstance.type.public, DoWire]};
END.