DIRECTORY AMTypes USING [TV, TVEqual], AMBridge USING [SomeRefFromTV, TVForFrame, TVForReferent], AMModel USING [Context], AMModelBridge USING [ContextForFrame], CD, CDCells, CDDirectory, CDEvents, CDInstances, CDLayers, CDProperties, CDRects, CDSatellites, CDSymbolicObjects, CDTexts, Core, CoreClasses, CoreOps, CoreProperties, IO, Interpreter USING [Evaluate], List, PrincOpsUtils, PW, PWPins, Rope, RopeList, Sinix, Sisyph, SymTab, TerminalIO; SisyphImpl: CEDAR PROGRAM IMPORTS AMBridge, AMModelBridge, AMTypes, CDCells, CDDirectory, CDEvents, CDInstances, CDLayers, CDProperties, CDRects, CDSatellites, CDSymbolicObjects, CDTexts, CoreClasses, CoreOps, CoreProperties, Interpreter, IO, List, PrincOpsUtils, PW, PWPins, Rope, RopeList, Sinix, SymTab, TerminalIO EXPORTS Sisyph SHARES CDCells, CDRects, CDSymbolicObjects, CDTexts = BEGIN OPEN Sisyph; expressionsProp: PUBLIC ATOM _ PW.RegisterProp[$SisyphExpressions, TRUE]; designRope: PUBLIC ROPE _ "design"; cellIconRope: PUBLIC ROPE _ "cI"; wireIconRope: PUBLIC ROPE _ "wI"; wireRope: PUBLIC ROPE _ "wire"; nameRope: PUBLIC ROPE _ "name"; globalNamesRope: PUBLIC ROPE _ "globalNames"; corePropsRope: PUBLIC ROPE _ "coreProps"; coreInstPropsRope: PUBLIC ROPE _ "coreInstProps"; cdObjRope: PUBLIC ROPE _ "cdObj"; iconicProp: PUBLIC ATOM _ PW.RegisterProp[$SisyphIcon, TRUE]; iconicCell: PUBLIC ATOM _ $SisyphIconicCell; iconicWire: PUBLIC ATOM _ $SisyphIconicWire; ignoreMeProp: PRIVATE ATOM _ PW.RegisterProp[$SisyphIgnoreMe, TRUE]; parmNamesProp: PUBLIC ATOM _ PW.RegisterProp[$SisyphParmNames, TRUE]; cacheProp: PUBLIC ATOM _ PW.RegisterProp[$SisyphCache, FALSE, TRUE]; cachePropsProp: ATOM _ PW.RegisterProp[$SisyphCacheProps, FALSE, TRUE]; defaultGlobalNames: PUBLIC LIST OF ROPE _ LIST["Vdd", "Gnd"]; sisyphMode: PUBLIC Sinix.Mode _ NEW [Sinix.ModeRec _ [ name: "Sisyph", extractProcProp: PW.RegisterProp[$SisyphExtractProc, TRUE, TRUE], pinsProp: CoreProperties.RegisterProperty[$SisyphPins, CoreProperties.Props[[CoreProperties.propPrint, CoreProperties.PropDontPrint]]], wireGeometryProp: CoreProperties.RegisterProperty[$SisyphWireGeometry, CoreProperties.Props[[CoreProperties.propCopy, CoreProperties.PropDoCopy], [CoreProperties.propPrint, CoreProperties.PropDontPrint]]], instanceProp: CoreProperties.RegisterProperty[$SisyphInstance, CoreProperties.Props[[CoreProperties.propCopy, CoreProperties.PropDoCopy], [CoreProperties.propPrint, CoreProperties.PropDontPrint]]], equalProc: ResultEqual, cacheProp: cacheProp, cachePropsProp: cachePropsProp ]]; ExtractSchematic: Sinix.ExtractProc = BEGIN inheritedContext: Context _ NARROW [userData]; cx: Context _ Copy[inheritedContext]; coreProps: Core.Properties; resultRope: ROPE; InitLocalVariables[cx, obj]; resultRope _ EvaluateParameters[cx, obj, properties]; EvaluateResult[cx, resultRope]; coreProps _ GetCoreProps[cx]; props _ GetCoreInstProps[cx]; SELECT TRUE FROM Rope.Match["*cI*_*", resultRope] => { cellType: CellType _ ExtractCellIcon[obj, cx]; IF coreProps#NIL THEN cellType.properties _ PutCoreProps[cellType.properties, coreProps]; result _ cellType; }; Rope.Match["*wI*_*", resultRope] => { wire: Wire _ ExtractWireIcon[obj, cx]; IF coreProps#NIL THEN wire.properties _ PutCoreProps[wire.properties, coreProps]; result _ wire; }; Rope.Match["*wire*_*", resultRope] => ERROR; ENDCASE => { cellType: CellType; name: ROPE _ GetName[cx]; globalWires: Wires _ GlobalWires[cx]; [result] _ Sinix.ExtractCell[obj, sisyphMode, properties, cx]; cellType _ NARROW [result]; ProcessGlobalWires[cellType, globalWires]; IF name=NIL THEN name _ CDNameToCTName[CDDirectory.Name[obj], ".sch"]; cellType _ CoreOps.SetCellTypeName[cellType, name]; IF coreProps#NIL THEN cellType.properties _ PutCoreProps[cellType.properties, coreProps]; SortInstances[cellType, mode, obj]; }; END; ExtractWire: Sinix.ExtractProc = BEGIN wire: Wire; inheritedContext: Context _ NARROW [userData]; cx: Context _ Copy[inheritedContext]; name: ROPE; coreInstProps: Core.Properties; geometry: CD.Instance _ PWPins.NewInstance[obj]; IF obj.class#CDRects.bareRectClass THEN ERROR; IF obj.layer#CD.commentLayer THEN ERROR; InitLocalVariables[cx, obj]; EvaluateResult[cx, EvaluateParameters[cx, obj, properties]]; wire _ GetWireCore[cx]; name _ GetName[cx]; coreInstProps _ GetCoreInstProps[cx]; IF wire=NIL THEN wire _ CoreOps.CreateWire[name: name]; CDProperties.PutInstanceProp[geometry, Sinix.touchProcProp, NEW [Sinix.TouchProc _ TouchRect]]; Sinix.AddPinsProp[mode, wire, geometry]; IF coreInstProps#NIL THEN wire.properties _ PutCoreProps[wire.properties, coreInstProps]; result _ wire; END; ES, ExtractSchematicByName: PUBLIC PROC [name: ROPE, cx: Context] RETURNS [CellType] = { design: CD.Design _ GetDesign[cx]; RETURN [NARROW [Sinix.Extract[ obj: CDDirectory.Fetch[design, name].object, mode: sisyphMode, properties: NIL, userData: cx ].result]]; }; IsResultExpression: PUBLIC PROC [expr: ROPE] RETURNS [BOOL] = { RETURN [ Rope.Match["*cI*_*", expr] OR Rope.Match["*wI*_*", expr] OR Rope.Match["*wire*_*", expr] ] }; ExtractCellIcon: PROC [icon: Object, cx: Context] RETURNS [cellType: CellType] = BEGIN iconCT: CellType; name: ROPE; iconCT _ NARROW [Sinix.ExtractCell[icon, sisyphMode, NIL, cx].result]; cellType _ GetCellIconCore[cx]; name _ GetName[cx]; IF cellType=NIL THEN { IF name=NIL THEN name _ CDNameToCTName[CDDirectory.Name[icon], ".icon"]; cellType _ CoreOps.CreateCellType[class: CoreClasses.unspecifiedCellClass, public: iconCT.public, name: name]; } ELSE { IF name=NIL THEN name _ CoreOps.GetCellTypeName[cellType]; IF name=NIL THEN name _ CDNameToCTName[CDDirectory.Name[icon], ".icon"]; cellType _ CoreClasses.CreateIdentity[cellType: cellType, name: name]; }; IF ~CheckAndDecorate[iconCT.public, cellType.public, iconCT.public, GlobalWires[cx]] THEN { TerminalIO.WriteF["\n** Error: drawn public and result public for cell icon %g don't conform\n", IO.rope[CDDirectory.Name[icon]]]; TerminalIO.WriteF["Drawn public is:"]; CoreOps.PrintWire[wire: iconCT.public, out: TerminalIO.TOS[], level: LAST [NAT]]; TerminalIO.WriteF["\n\nResult public is:"]; CoreOps.PrintWire[wire: cellType.public, out: TerminalIO.TOS[], level: LAST [NAT]]; ERROR } END; ExtractWireIcon: PROC [icon: Object, cx: Context] RETURNS [result: Wire] = BEGIN iconCT: CellType; iconWire: Wire; iconCT _ NARROW [Sinix.ExtractCell[icon, sisyphMode, NIL, cx].result]; iconWire _ iconCT.public[0]; result _ GetWireIconCore[cx]; IF result=NIL THEN ERROR; IF ~CheckAndDecorate[iconWire, result, iconWire] THEN { TerminalIO.WriteF["\n** Error: drawn wire and result wire for wire icon %g don't conform\n", IO.rope[CDDirectory.Name[icon]]]; TerminalIO.WriteF["Drawn wire is:"]; CoreOps.PrintWire[wire: iconWire, out: TerminalIO.TOS[], level: LAST [NAT]]; TerminalIO.WriteF["\n\nResult wire is:"]; CoreOps.PrintWire[wire: result, out: TerminalIO.TOS[], level: LAST [NAT]]; ERROR } END; InitLocalVariables: PUBLIC PROC [cx: Context, obj: CD.Object] = BEGIN IF cx=NIL THEN ERROR; Store[cx, cellIconRope, NEW [CellType _ NIL]]; Store[cx, wireIconRope, NEW [Wire _ NIL]]; Store[cx, wireRope, NEW [Wire _ NIL]]; Store[cx, nameRope, NEW [ROPE _ NIL]]; Store[cx, corePropsRope, NEW [Core.Properties _ NIL]]; Store[cx, coreInstPropsRope, NEW [Core.Properties _ NIL]]; Store[cx, cdObjRope, NEW [CD.Object _ obj]] END; Create: PUBLIC PROC [design: CD.Design, globalNames: LIST OF ROPE _ defaultGlobalNames] RETURNS [cx: Context] = BEGIN cx _ SymTab.Create[]; Store[cx, designRope, NEW [CD.Design _ design]]; Store[cx, globalNamesRope, NEW [LIST OF ROPE _ globalNames]]; Store[cx, "&", NEW [INT _ 0]]; InitLocalVariables[cx, NIL]; END; Copy: PUBLIC PROC [cx: Context] RETURNS [newCx: Context] = BEGIN CopyItem: SymTab.EachPairAction = { [] _ SymTab.Store[newCx, key, val]; quit _ FALSE; }; IF cx=NIL THEN ERROR; newCx _ SymTab.Create[]; [] _ SymTab.Pairs[cx, CopyItem]; END; Store: PUBLIC PROC [cx: Context, var: ROPE, value: REF _ NIL] = BEGIN [] _ SymTab.Store[cx, var, TVFromRef[value]]; END; Eval: PUBLIC PROC [cx: Context, expr: ROPE, cedarCx: AMModel.Context _ NIL] = TRUSTED BEGIN result: AMTypes.TV; errorRope: ROPE; noResult: BOOL; IF cedarCx=NIL THEN cedarCx _ AMModelBridge.ContextForFrame[ AMBridge.TVForFrame[ PrincOpsUtils.GetReturnFrame[] ] ]; [result, errorRope, noResult] _ Interpreter.Evaluate[rope: expr, context: cedarCx, symTab: cx]; IF errorRope # NIL THEN ERROR; END; ContextEqual: PROC [cx1, cx2: Context, parmNames: LIST OF ROPE] RETURNS [BOOL] = { IsASubset: PROC [a, b: Context] RETURNS [isASubset: BOOL] = { CheckExistenceInb: SymTab.EachPairAction = { found: BOOL; bVal: SymTab.Val; quit _ FALSE; IF Rope.Equal[key, "&"] OR Rope.Equal[key, cellIconRope] OR Rope.Equal[key, wireIconRope] OR Rope.Equal[key, wireRope] OR Rope.Equal[key, nameRope] OR Rope.Equal[key, corePropsRope] OR Rope.Equal[key, coreInstPropsRope] THEN RETURN; IF parmNames#NIL THEN { isAParm: BOOL _ FALSE; FOR l: LIST OF ROPE _ parmNames, l.rest WHILE l#NIL DO IF Rope.Equal[key, l.first] THEN isAParm _ TRUE; ENDLOOP; IF ~isAParm THEN RETURN; }; [found, bVal] _ SymTab.Fetch[b, key]; IF ~found THEN {isASubset _ FALSE; RETURN}; IF ~AMTypes.TVEqual[bVal, val] THEN isASubset _ FALSE; }; isASubset _ TRUE; [] _ SymTab.Pairs[a, CheckExistenceInb] }; IF IsASubset[cx1, cx2] AND IsASubset[cx2, cx1] THEN RETURN [TRUE] ELSE RETURN [FALSE] }; ResultEqual: PROC [obj: CD.Object, p1: CD.PropList, ud1: REF, p2: CD.PropList, ud2: REF] RETURNS [BOOL] = { cx1: Context _ NARROW [ud1]; cx2: Context _ NARROW [ud2]; instArgs1: LIST OF ROPE _ NARROW[CDProperties.GetListProp[p1, expressionsProp]]; satArgs1: LIST OF ROPE _ CDSatellites.GetSatelliteRopes[p1]; instArgs2: LIST OF ROPE _ NARROW[CDProperties.GetListProp[p2, expressionsProp]]; satArgs2: LIST OF ROPE _ CDSatellites.GetSatelliteRopes[p2]; parmNames: LIST OF ROPE _ NARROW[CDProperties.GetObjectProp[obj, parmNamesProp]]; IF parmNames#NIL AND Rope.Equal[parmNames.first, "0"] THEN RETURN [TRUE]; IF RopeList.EqualLists[instArgs1, instArgs2] AND RopeList.EqualLists[satArgs1, satArgs2] AND ContextEqual[cx1, cx2, parmNames] THEN RETURN [TRUE] ELSE RETURN [FALSE]; }; EvaluateParameters: PROC [cx: Context, obj: CD.Object, propList: CD.PropList] RETURNS [resultRope: ROPE] = { objExprs: LIST OF ROPE _ NARROW[CDProperties.GetObjectProp[obj, expressionsProp]]; objSats: LIST OF ROPE _ CDSatellites.GetSatelliteRopes[obj]; instExprs: LIST OF ROPE _ NARROW[CDProperties.GetListProp[propList, expressionsProp]]; instSats: LIST OF ROPE _ CDSatellites.GetSatelliteRopes[propList]; EvalExprs: PROC [exprs: LIST OF ROPE, inst: BOOL] = { seenResult: BOOL _ FALSE; WHILE exprs#NIL DO expr: ROPE _ exprs.first; SELECT TRUE FROM Rope.Find[s1: expr, s2: "_"] # -1 => { SELECT TRUE FROM IsResultExpression[expr] => { IF seenResult THEN {TerminalIO.WriteRope["\n** Error: multiple result expressions encountered"]; ERROR}; seenResult _ TRUE; resultRope _ expr; }; inst AND Rope.Match["*name*_*", expr] => { expr _ Rope.Replace[expr, Rope.Find[expr, "name"], 4, "&"]; Eval[cx, expr]; Store[cx, coreInstPropsRope, NEW [Core.Properties _ CoreProperties.PutProp[GetCoreInstProps[cx], CoreOps.nameProp, NARROW[RefFromTV[SymTab.Fetch[cx, "&"].val], REF ROPE]^]]]; }; ENDCASE => Eval[cx, expr] }; Rope.Find[s1: expr, s2: ":"] # -1 => { atomRope: ROPE _ Rope.Substr[expr, 0, Rope.Find[s1: expr, s2: ":"]]; valueRope: ROPE _ Rope.Substr[expr, 1+Rope.Find[s1: expr, s2: ":"]]; IF inst THEN expr _ Rope.Cat["coreInstProps _ CoreProperties.PutProp[coreInstProps, $", atomRope, ", ", valueRope, "]"] ELSE expr _ Rope.Cat["coreProps _ CoreProperties.PutProp[coreProps, $", atomRope, ", ", valueRope, "]"]; Eval[cx, expr] }; ENDCASE => { IF inst THEN Store[cx, coreInstPropsRope, NEW [Core.Properties _ CoreProperties.PutProp[GetCoreInstProps[cx], CoreOps.nameProp, expr]]] ELSE Store[cx, nameRope, NEW [ROPE _ expr]] }; exprs _ exprs.rest; ENDLOOP; }; EvalExprs[objExprs, FALSE]; EvalExprs[objSats, FALSE]; EvalExprs[instExprs, TRUE]; EvalExprs[instSats, TRUE]; }; EvaluateResult: PROC [cx: Context, resultRope: ROPE] = { IF resultRope#NIL THEN { IF Rope.Match["cI _ ES[\"*\", cx]", resultRope] THEN { pos1: INT _ Rope.Find[s1: resultRope, s2: "\""]; pos2: INT _ Rope.Find[s1: resultRope, s2: "\"", pos1: pos1+1]; name: ROPE _ Rope.Substr[resultRope, pos1+1, pos2-pos1-1]; Store[cx, cellIconRope, NEW [CellType _ ES[name, cx]]]; RETURN }; Eval[cx, resultRope]; }; }; CheckAndDecorate: PROC [dp, rp, dpRoot: Wire, globalWires: Wires _ NIL] RETURNS [BOOL]= { dpInterfaceGeometry: LIST OF CD.Instance; WireToLORA: PROC [wire: Wire] RETURNS [lora: List.LORA] = { lora _ NIL; FOR i: NAT IN [0..wire.size) DO lora _ CONS [wire.elements[i], lora]; ENDLOOP; }; CompareWires: List.CompareProc = { w1: Wire _ NARROW [ref1]; w2: Wire _ NARROW [ref2]; RETURN [Rope.Compare[CoreOps.GetShortWireName[w1], CoreOps.GetShortWireName[w2]]] }; dpName: ROPE _ CoreOps.GetShortWireName[dp]; rpName: ROPE _ CoreOps.GetShortWireName[rp]; IF ~Rope.Equal[dpName, rpName] OR (dpName=NIL AND dp#dpRoot) THEN RETURN [FALSE]; IF dp.size > 0 THEN { dpElements: List.LORA _ List.Sort[WireToLORA[dp], CompareWires]; rpElements: List.LORA _ List.Sort[WireToLORA[rp], CompareWires]; IF rp.size= i2min) AND (i2max >= i1min)]; }; Adjoin: PROC [i1min, i1max, i2min, i2max: CD.Number] RETURNS [BOOL] = INLINE { RETURN [(i2min >= i1min AND i2min <= i1max AND i2max >= i1max) OR (i1min >= i2min AND i1min <= i2max AND i1max >= i2max)]; }; RETURN [(Intersect[r1.x1, r1.x2, r2.x1, r2.x2] AND Adjoin[r1.y1, r1.y2, r2.y1, r2.y2]) OR (Intersect[r1.y1, r1.y2, r2.y1, r2.y2] AND Adjoin[r1.x1, r1.x2, r2.x1, r2.x2])] }; GetCoreProps: PROC [cx: Context] RETURNS [Core.Properties] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, corePropsRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF Core.Properties]^] ELSE ERROR }; GetCoreInstProps: PROC [cx: Context] RETURNS [Core.Properties] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, coreInstPropsRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF Core.Properties]^] ELSE ERROR }; GetCellIconCore: PROC [cx: Context] RETURNS [Core.CellType] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, cellIconRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF Core.CellType]^] ELSE ERROR }; GetWireIconCore: PROC [cx: Context] RETURNS [Core.Wire] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, wireIconRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF Core.Wire]^] ELSE ERROR }; GetWireCore: PROC [cx: Context] RETURNS [Core.Wire] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, wireRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF Core.Wire]^] ELSE ERROR }; GetName: PROC [cx: Context] RETURNS [ROPE] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, nameRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF ROPE]^] ELSE ERROR }; GetGlobalNames: PROC [cx: Context] RETURNS [LIST OF ROPE] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, globalNamesRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF LIST OF ROPE]^] ELSE ERROR }; GetDesign: PROC [cx: Context] RETURNS [CD.Design] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, designRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF CD.Design]^] ELSE ERROR }; GetCDObj: PROC [cx: Context] RETURNS [CD.Object] = { found: BOOL; ref: SymTab.Val; [found, ref] _ SymTab.Fetch[cx, cdObjRope]; IF found THEN RETURN [NARROW [RefFromTV[ref], REF CD.Object]^] ELSE ERROR }; RefFromTV: PROC [tv: REF] RETURNS [REF] = { IF tv=NIL THEN RETURN [NIL]; IF ~ISTYPE [tv, AMTypes.TV] THEN ERROR; TRUSTED {RETURN [AMBridge.SomeRefFromTV[tv]]}; }; TVFromRef: PROC [ref: REF] RETURNS [AMTypes.TV] = TRUSTED { RETURN [AMBridge.TVForReferent[ref]]; }; PutCoreProps: PROC [onto, from: Core.Properties] RETURNS [new: Core.Properties] = { PutProp: PROC [prop: ATOM, val: REF ANY] = { new _ CoreProperties.PutProp[new, prop, val]; }; new _ onto; CoreProperties.Enumerate[from, PutProp]; }; CDNameToCTName: PROC [cdName, dropPart: ROPE] RETURNS [ctName: ROPE] = { ctName _ Rope.Substr[cdName, 0, Rope.Index[cdName, 0, dropPart]]; }; Sinix.RegisterExtractProc[$SisyphExtractSchematic, ExtractSchematic]; Sinix.RegisterExtractProc[$SisyphExtractWire, ExtractWire]; CDProperties.PutProp[CDCells.cellClass, sisyphMode.extractProcProp, $SisyphExtractSchematic]; CDProperties.PutProp[CDCells.cellClass, Sinix.touchProcProp, NEW [Sinix.TouchProc _ Sinix.TouchCell]]; CDProperties.PutProp[CDSymbolicObjects.pinClass, sisyphMode.extractProcProp, $ExtractError]; CDProperties.PutProp[CDSymbolicObjects.segmentClass, sisyphMode.extractProcProp, $ExtractError]; CDProperties.PutProp[CDSymbolicObjects.markClass, sisyphMode.extractProcProp, $ExtractError]; CDProperties.PutProp[CDRects.bareRectClass, sisyphMode.extractProcProp, $SisyphExtractWire]; CDProperties.PutProp[CDTexts.textClass, sisyphMode.extractProcProp, $ExtractNull]; CDEvents.RegisterEventProc[$AfterInput, MarkInvisibleInstances]; END. *SisyphImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Created by Pradeep Sindhu and Bertrand Serlet, June 1, 1986 9:28:41 pm PDT Pradeep Sindhu June 19, 1986 4:52:58 pm PDT Barth, January 13, 1986 3:35:49 pm PST Design A CD instance is represented by the tuple , where obj is the object corresponding to the instance, and propList is the property list of the instance. An instance may have arguments that control the result of the extraction. These arguments may appear in any one of three places: (1) as "satellites" (or text objects) attatched to the instance, (2) as text inside the instance property $SisyphArguments, or (3) as text inside the object property $SisyphArguments. Extraction begins at the top-level procedure ExtractSchematic. Extract schematic first evaluates the arguments of the object passed to it, and then calls Sinix.Extract, ExtractCellIcon, or ExtractWireIcon, depending on the Sisyph type of the object passed to it. Evaluation proceeds in an environment consisiting of a Sisyph context and an interpreter context. The Sisyph context is simply a SymTab containing pairs, while the interpreter context is the local frame of the caller of Eval. The evaluation always looks first at the Sisyph context and then at the interpreter context. Note that the interpreter context includes in it a definition of all variables that are visible (statically) from within Eval, and all global frames and interface records currently loaded in the Cedar world. During extraction certain global names are treated specially. When a wire with its full name equal to one of the global names is encountered, the wire is promoted to be a public of the cellType in which it lies. When this cellType, say A, is used within another cellType, say B, the same global name also gets promoted to be a public of B. This promotion continues till a cellType is encountered in which a piece of geometry with the global name as its name touches the interest rect of the object corresponding to the cellType. The global names are kept as a list of rope in the Sisyph variable globalNames. Global wires are restricted to be atomic. The following two invariants are checked when constructing a CellType C for an Iconic Cell IC. (1) For each symbolic object (pin) inside IC there must be a wire in C.public one of whose full names is the same as the symbolic object's name. (2) C.public must satisfy the property P(w): the wire w has a symbolic object (pin) in IC whose name is the same as one of w's full names, or each of w's sons satisfies P. The following two invariants are checked when constructing a wire W for an Iconic Wire IW. (1) For each symbolic object (pin) inside IW there must be a wire in W one of whose full names is the same as the symbolic object's name. (2) W must satisfy the property P(w): the wire w has a symbolic object (pin) in IC whose name is the same as one of w's full names, or each of w's sons satisfies P. Extraction property whose presence indicates that the instance should be ignored during extraction. Present for backward compatibility only. Use $ExtractNull instead This is the top-level extract proc. It evaluates the arguments to the schematic and then calls either ExtractCellIcon or Sinix.ExtractCell to do its job. This proc is called for cell icons. If a core definition is found then it is returned, otherwise a core cell of class Unspecified is returned. Compute core for the schematic Check public This proc is called for wire icons. If a core definition is found it is returned, otherwise an error is signalled. As for cell icons, pins provide the attatchment points to the wire. Check wire Context Handling Procedures Returns TRUE iff a is a subset of b If its a local variable then return right away If its not a parameter then return right away also It is a parameter. Check if its there in the context and equal Handle zero parameters as a special case Private Procedures The order of evaluation is: (1) expressions specified in expressionsProp property of object; (2) arguments specified in satellites of object (3) arguments specified in expressionsProp property of instance; (4) arguments specified in satellites of instance. Thus instance satellites take precedence over instance property exprs, which take precedence over object satellites, which take precedence over object property exprs. The evaluation is performed in two passes: the second pass handles result expressions while the first pass handles all others. When evaluating satellite exprs, an expression containing "_" is evaluated, an expression containing a ":" is assumed to be a property, while all other expressions are assumed to be a name. SpeedUp Hack -- avoids evaluating expressions containing ExtractSchematicByName Check that every element in dpElements has a corresponding element in rpElements This proc causes global wires to be promoted to the public of cellType. The implementation is tricky, so don't mess with it unless you know what you're doing. For each instance check if any part of its actual should be promoted Delete toBeDeleted wires from the internal Check if any part of the internal of cellType should be promoted Remove Sinix.pinsProp from all wires to be made public Returns the wire in globalWires that has name as a short name; Note that this assumes global wires are atomic. Module Initialization ส‡˜šœ™Jšœ ฯmœ1™˜>Jšœ žœ ˜Jšœ*˜*Jšžœžœžœ6˜FJšœ3˜3Jšžœ žœžœD˜YJšœ#˜#Jšœ˜——Jšžœ˜—J˜šก œž˜&J˜ Jšœžœ ˜.Jšœ%˜%Jšœžœ˜ J˜Jšœ žœ$˜0Jšžœ!žœžœ˜.Jšžœ žœžœžœ˜(J˜J˜Jšœ<˜K˜%Jšžœžœžœžœ˜+Kšžœžœ žœ˜6K˜—K˜Kšœ žœ˜Kšœ'˜'Kšœ˜—K˜Kšžœžœžœžœžœžœžœžœ˜Ušœ˜K˜——šก œžœžœ žœžœžœžœžœžœ˜kKšœžœ˜Kšœžœ˜Kš œ žœžœžœžœ0˜PKšœ žœžœžœ&˜Kšœžœ0˜:Kšœžœ žœ ˜7Kšž˜K˜——Kšœ˜K˜—K˜K˜J˜—K˜š ะbnœžœ-žœžœžœ˜YKšœžœžœžœ ˜)šก œžœžœ žœ˜;Kšœžœ˜ Kš žœžœžœžœžœžœ˜NK˜—šฃ œ˜"Kšœ žœ˜Kšœ žœ˜JšžœK˜QK˜—Kšœžœ ˜,Kšœžœ˜,K˜Kšžœžœ žœžœ žœžœžœ˜Qšžœ žœ˜Kšœžœ+˜@Kšœžœ+˜@K˜Kšžœžœžœžœ˜'KšœP™Pšžœžœžœž˜Kšœžœ˜)Kšœžœ˜)šžœ+ž˜2Kšœžœžœ˜FKš žœ#žœžœžœžœ˜=šžœž˜Kšžœžœžœ˜Kšžœ)žœ˜G—Kšžœ˜—Kšžœ+žœžœžœ˜AK˜K˜Kšžœ˜—K˜—Kšœ8˜8Kšœ7˜7Kšžœžœ˜K˜K˜—J˜šฃœ˜.šกœ!˜0šžœžœ˜Jšœ žœ žœ˜.J˜š žœžœžœžœ%žœžœž˜Dšžœ<ž˜AJšžœwžœ˜—Jšžœ˜—J˜—J˜J˜—Jš žœžœžœžœฯc˜7Jšœ4˜4Jšœ˜—J˜J˜J™Ÿšกœžœ,ž˜IJšœ)žœ˜@Jšœžœ˜Jšœžœ˜šก œžœ,žœ ž˜QJšžœ!žœžœ˜.šžœžœžœž˜%JšœD˜DJšžœ˜—J˜š žœžœžœžœ=žœžœž˜`JšœG˜Gš žœžœžœ+žœžœ˜XJšœM˜Mšžœž˜šžœ˜JšœS˜Sšžœž˜!šžœ˜Jšžœ=žœžœ.˜‡Jšœžœ˜,Jšžœ˜#Jšœ˜—šžœ˜Jšžœ;žœžœ,˜ƒJšœPžœ˜rJšœžœ˜,Jšžœ˜!Jšœ˜——J˜—šžœ˜Jšœžœ˜,Jšžœ˜!J˜——Jšœ˜—Jšžœ˜—Jšžœ ˜Jšžœ˜—šฃœž˜9š žœžœžœžœ@žœžœž˜cšžœ'žœžœ-ž˜`Jš žœžœ'žœžœžœ˜i—Jšžœ˜—Jšžœ˜—J˜J™Dšžœžœžœž˜%J˜9JšœI˜IJšžœ˜—J™*JšœD˜DJ™@JšœI˜IJ™6šžœ#žœžœž˜4Jšœ'žœ˜+Jšžœ˜—JšœY˜YJšžœ˜J˜—šก œžœ2žœ ˜SJšœ žœžœ5˜NJšœ)žœ˜?šกœžœ$žœžœ˜DJšœžœ žœ<˜VJšœžœ žœ<˜VJšœžœ žœ˜0Jšœžœ žœ˜0J˜Jšžœžœžœžœ˜_J˜—J˜Jšžœžœžœžœ˜7J˜š žœžœž œžœž˜0šžœžœžœž˜Jšžœ(žœf˜”Jšžœ˜—Jšžœ˜—J˜J˜J˜—š ก œžœžœžœžœž˜TJšœžœ˜š žœžœž œžœž˜,Jšžœ#žœ žœ˜PJšžœ˜—Jšœ'˜'Jšžœ˜—K˜J™nš กœžœžœžœ žœž˜Ršžœ žœžœž˜1Jšžœ5žœžœ ˜MJšžœ˜—Jšžœ˜—J˜š ก œžœžœžœž˜DJšœ žœžœžœ˜/š žœžœžœžœžœžœž˜DJšœžœ/˜;Jšžœ˜—Jšžœ˜—J™šฃ œ˜Jšžœ*žœžœ`˜—JšžœSžœžœ˜aJšžœ]˜cJšœ˜—J˜š ก œžœ žœžœžœžœ˜>š ก œžœžœ žœžœžœ˜QJšžœžœ˜/J˜—J˜š กœžœžœ žœžœžœ˜Nšžœžœžœž˜AJšœžœžœ˜9—J˜—J˜Jšžœ)žœ%žœ(žœ%˜ฉJšœ˜—K˜šก œžœžœ˜>Kšœžœ˜ Kšœ˜Kšœ/˜/šžœ˜Kšžœžœžœžœ˜;Kšžœž˜ —K˜—K˜šกœžœžœ˜BKšœžœ˜ Kšœ˜Kšœ3˜3šžœ˜Kšžœžœžœžœ˜;Kšžœž˜ —K˜—K˜šกœžœžœ˜?Kšœžœ˜ Kšœ˜Kšœ.˜.šžœ˜Kšžœžœžœžœ˜9Kšžœž˜ —K˜—K˜šกœžœžœ˜;Kšœžœ˜ Kšœ˜Kšœ.˜.šžœ˜Kšžœžœžœžœ ˜5Kšžœž˜ —K˜—K˜šก œžœžœ˜7Kšœžœ˜ Kšœ˜Kšœ*˜*šžœ˜Kšžœžœžœžœ ˜5Kšžœž˜ —K˜—K˜šกœžœžœžœ˜.Kšœžœ˜ Kšœ˜Kšœ*˜*šžœ˜Kš žœžœžœžœžœ˜0Kšžœž˜ —K˜—K˜š กœžœžœžœžœžœ˜=Kšœžœ˜ Kšœ˜Kšœ1˜1šžœ˜Kšžœžœžœžœžœžœžœ˜8Kšžœž˜ —K˜—K˜šก œžœžœžœ ˜5Kšœžœ˜ Kšœ˜Kšœ,˜,šžœ˜Kš žœžœžœžœžœ ˜5Kšžœž˜ —K˜K˜—šกœžœžœžœ ˜4Kšœžœ˜ Kšœ˜Kšœ+˜+šžœ˜Kš žœžœžœžœžœ ˜5Kšžœž˜ —K˜K˜—š ก œžœžœžœžœ˜+Kš žœžœžœžœžœ˜Kš žœžœžœžœžœ˜(Kšžœžœ˜.Kšœ˜—J˜š ก œžœžœžœ žœžœ˜;Kšžœ˜%Kšœ˜—K˜šก œžœžœ˜Sš กœžœžœžœžœ˜,K˜-K˜—K˜ K˜(Kšœ˜—K˜š กœžœžœžœ žœ˜HK˜AKšœ˜—K˜—™KšœE˜EKšœ;˜;K˜Kšœ]˜]Kšœ=žœ&˜fKšœ\˜\Kšœ`˜`Kšœ]˜]Kšœ\˜\KšœR˜RK˜Kšœ@˜@K˜Jšžœ˜——…—ZjŒ