DIRECTORY Basics, Core, CoreClasses, CoreFlat, RefTab, Rope, SymTab; CoreStructuralComparison: CEDAR DEFINITIONS = { ROPE: TYPE ~ Rope.ROPE; Role: TYPE ~ {A, B}; RoleNames: TYPE ~ ARRAY Role OF ROPE; CellTypePair: TYPE ~ ARRAY Role OF Core.CellType; SubtreeSpecPair: TYPE ~ ARRAY Role OF SubtreeSpec; MergeSpecPair: TYPE ~ ARRAY Role OF MergeSpec; FlattenAndCompare: PROC [ roleNames: RoleNames, cts: CellTypePair, stss: SubtreeSpecPair _ ALL[ToLeaves], mss: MergeSpecPair _ ALL[MergeNothing], GiveHints: HintsGiver _ NIL, PerPair: AssociationPairConsumer _ NIL, PerMismatch: MismatchConsumer _ NIL, PerDroppedConnection: DroppedConnectionConsumer _ NIL, PerBogusMerge: BogusMergeConsumer _ NIL, Querier: AssociationQuerier _ NIL, trace: Trace _ NIL, automorphismHack, mayQuitEarly: BOOL _ FALSE, didQuitEarly, abort: REF BOOL, ttols: TransistorTolerances, vsp: ViewStatsPair _ [NIL, NIL], data: REF ANY _ NIL ] RETURNS [isomorphic: BOOL]; ViewStatsPair: TYPE ~ ARRAY Role OF ViewStats; ViewStats: TYPE ~ REF ViewStatsPrivate; ViewStatsPrivate: TYPE; CreateViewStatsPair: PROC RETURNS [ViewStatsPair]; FmtViewStatsPair: PROC [ViewStatsPair, RoleNames] RETURNS [ROPE]; HintsGiver: TYPE = PROC [Consume: HintConsumer]; HintConsumer: TYPE = PROC [ds: ARRAY Role OF Descendant]; AssociationPairConsumer: TYPE = PROC [Pair]; AssociationQuerier: TYPE = PROC [Ans: QueryAnswerer]; QueryAnswerer: TYPE = PROC [Role, Descendant] RETURNS [Pair]; ColorElts: TYPE ~ ARRAY Role OF ElementList; ElementList: TYPE ~ LIST OF Element; Pair: TYPE ~ ARRAY Role OF Element; Element: TYPE ~ LIST OF Descendant; Descendant: TYPE = REF ANY--actually UNION [DescendantWire, DescendantCellInstance]--; DescendantWire: TYPE = REF DescendantWirePrivate; DescendantWirePrivate: TYPE = CoreFlat.FlatWireRec; DescendantCellInstance: TYPE = REF DescendantCellInstancePrivate; DescendantCellInstancePrivate: TYPE = CoreFlat.InstancePath; SubtreeSpec: TYPE = PROC [data: REF ANY, instance: CoreClasses.CellInstance, path: DescendantCellInstancePrivate, ttols: TransistorTolerances] RETURNS [SubtreeAns]; SubtreeAns: TYPE ~ RECORD [ leafType: Core.CellType, publicInvMapEnumerator: MapEnumerator, Pop: PROC [data: REF ANY] _ NIL ]; MapEnumerator: TYPE ~ RECORD [ Enumerate: PROC [data: REF ANY, Consume: MapConsumer], data: REF ANY _ NIL]; MapConsumer: TYPE ~ PROC [from: REF ANY, ProduceTos: ToProducer]; ToProducer: TYPE ~ PROC [Consume: ToConsumer]; ToConsumer: TYPE ~ PROC [to: REF ANY]; CreateParallelMapper: PROC [from, to: Core.CellType] RETURNS [MapEnumerator]; CreateIdentityMapper: PROC [ct: Core.CellType] RETURNS [MapEnumerator] ~ INLINE {RETURN CreateParallelMapper[ct, ct]}; ToLeaves: SubtreeSpec; DontFlatten: SubtreeSpec; MergeSpec: TYPE = PROC [ data: REF ANY, parent: Core.CellType, recastOfSubroot: BOOL, EnumerateInstances: PROC [Consume: PROC [ci: CoreClasses.CellInstance] RETURNS [stop: BOOL _ FALSE]], IdentifyActual: PROC [ci: CoreClasses.CellInstance, actual: Core.Wire, describe: BOOL _ FALSE] RETURNS [ActualID], Consume: MergeConsumer, Depublicize: Depublicizer]; MergeConsumer: TYPE = PROC [ds: Element]; ActualID: TYPE = RECORD [id: REF ANY, description: ROPE]; MergeNothing: MergeSpec; MismatchConsumer: TYPE = PROC [ msg: ROPE _ NIL, kind: MismatchKind, cts: CellTypePair, colorElts: ColorElts, Ans: QueryAnswerer ]; DroppedConnectionConsumer: TYPE ~ PROC [role: Role, subroot: Core.CellType, public, actual: DescendantWire]; BogusMergeConsumer: TYPE ~ PROC [role: Role, subroot: Core.CellType, w1, w2: DescendantWire, from: DescendantCellInstance]; Depublicizer: TYPE ~ PROC [Core.Wire]; MismatchKind: TYPE = {stuck, difference, transistorShape}; wideTransistorTolerances: READONLY TransistorTolerances; tightTransistorTolerances: READONLY TransistorTolerances; TransistorTolerances: TYPE ~ REF TransistorTolerancesPrivate; TransistorTolerancesPrivate: TYPE ~ ARRAY TransistorDim OF Tolerance; TransistorDim: TYPE ~ {length, width}; Tolerance: TYPE ~ RECORD [min, max: REAL--a/b--]; TransistorDimName: READONLY ARRAY TransistorDim OF ROPE; FormatTolerances: PROC [TransistorTolerances] RETURNS [ROPE]; Trace: TYPE ~ SymTab.Ref --that contains names of Descendants to be traced--; HashDescendant: PROC [ra: REF ANY] RETURNS [hash: CARDINAL]; DescendantEqual: PROC [key1, key2: REF ANY] RETURNS [equal: BOOL]; RefHash: PROC [ra: REF ANY] RETURNS [CARDINAL] = INLINE { ln: Basics.LongNumber = [lc[LOOPHOLE[ra]]]; RETURN [ln.lo + ln.hi]; }; DisplayStats: PROC; GetConstraints: PROC [subroot: Core.CellType] RETURNS [RefTab.Ref]; PushTimer: PROC [ATOM]; PopTimer: PROC [ATOM]; }. hCoreStructuralComparison.Mesa Last tweaked by Mike Spreitzer on March 7, 1989 4:26:35 pm PST ds[A], and all the stuff it merges with, is to be colored the same unique colors as ds[B] (and all the stuff it merges with). For now, ds[A] and ds[B] may only be parts of the public wires of the given cell types (not Recasts of them). Consumes the uniquely paired elements. The one the given Descendant is in, if any; [NIL, NIL] otherwise. You may want to Recast (or worse) a bit to get the CellType you use. Return NIL to get flattening. publicInvMapEnumerator enumerates the mapping from each public wire of leafType to the corresponding public wires of instance.type; the enumeration proceeds in the order of visiting the public wires of leafType. The Pop procedure, if any, is called when leaving the context pushed into by the call on the SubtreeSpec. A SubtreeSpec must be directly in a global frame and should not change its behavior over time (it is used as a key in a cache). Flattens everything that has a known expansion into something else. Never flattens. The original is the cell type handed to FlattenAndCompare, no Recasting done. The parent is reachable from the original by Recasting and visiting children. The MergeSpec will be called multiple times --- once for each subDAG in the cell composition hierarchy. Thus, you can only merge things introduced in the same cell --- sorry, we hope this is enough. A MergeSpec does not report public wire stuff for a recast of a subroot. A MergeSpec depends in no other way on the `recastOfSubroot' argument. A MergeSpec must also be directly in a global frame and not change its behavior over time (it's also used as a key in a cache). The Descendants may be any of their aliases. They are relative to parent. Consider this wire, which is part of parent.public, to not be. difference is when a color has a different number of vertices from the two graphs; stuck is when both graphs contribute the same number of vertices to a color, but that number is greater than one (we don't try picking a pair to try to resolve this). transistorSize is when there's a transistor size mismatch. Κ`– "cedar" style˜code™K™>—K˜KšΟk œ;˜DK˜šΡbnxœœ œ˜/K˜Kšœœœ˜K˜Kšœœ ˜Kš œ œœœœ˜%Kšœœœœ˜1Kšœœœœ ˜2Kšœœœœ ˜.K˜šœ˜šœ˜Kšœ˜Kšœ˜Kšœœ ˜&Kšœœ˜'KšΟn œœ˜KšŸœœ˜'KšŸ œœ˜$KšŸœœ˜6KšŸ œœ˜(KšŸœœ˜"Kšœœ˜Kšœ œœ˜-Kšœœœ˜K˜Kšœœœ˜ Kšœœœ˜Kšœ˜—Kšœœ˜—K˜K˜Kšœœœœ ˜.Kšœ œœ˜'Kšœœ˜K˜KšŸœœœ˜2KšŸœœœœ˜AK˜Kšœ œœŸœ˜0š œœœœœ ˜9K™}K™m—K˜šœœœ˜,K™&—K˜Kšœœœ˜5šœœœœ˜=KšœA™A—K˜Kšœ œœœ ˜,Kšœ œœœ ˜$Kšœœœœ ˜#Kšœ œœœ ˜#Kšœ œœΟc;œ˜VK˜Kšœœœ˜1Kšœœ˜3K˜Kšœœœ˜AKšœœ˜—K˜šœœ(˜:Kšœ΅™΅—K˜Kšœœ˜8Kšœœ˜9K˜Kšœœœ˜=Kšœœœœ ˜EKšœœ˜&Kšœ œœ  œ˜1K˜Kš Ÿœœœœœ˜8K˜KšŸœœœœ˜=K˜Kšœœ 3œ˜MK˜Kš Ÿœœœœœœ˜