DIRECTORY CD, Core, IO, Sinix USING [Mode], SymTab USING [Ref]; Sisyph: CEDAR DEFINITIONS = BEGIN Context: TYPE = SymTab.Ref; -- maps variable names to TVs CellType: TYPE = Core.CellType; Properties: TYPE = Core.Properties; Wire: TYPE = Core.Wire; Wires: TYPE = Core.Wires; WireSeq: TYPE = Core.WireSeq; ROPE: TYPE = Core.ROPE; ROPES: TYPE = LIST OF ROPE; expressionsProp: ATOM; corePropsRope: ROPE; coreInstPropsRope: ROPE; parmNamesProp: ATOM; defaultGlobalNames: ROPES; mode: Sinix.Mode; ES, ExtractSchematicByName: PROC [name: ROPE, cx: Context] RETURNS [CellType]; Create: PROC [design: CD.Design, previousCx: Context _ NIL] RETURNS [cx: Context]; Copy: PROC [oldCx: Context] RETURNS [cx: Context]; Store: PROC [cx: Context, var: ROPE, value: REF _ NIL]; Insert: PROC [cx: Context, var: ROPE, value: REF _ NIL]; FetchInt: PROC [cx: Context, var: ROPE] RETURNS [found: BOOL, value: INT]; FetchAtom: PROC [cx: Context, var: ROPE] RETURNS [found: BOOL, value: ATOM]; FetchRope: PROC [cx: Context, var: ROPE] RETURNS [found: BOOL, value: ROPE]; EvalExpr: PROC [cx: Context, var, expr: ROPE, checkDefined: BOOL _ TRUE]; AddProp: PROC [cx: Context, key: ATOM, expr: ROPE, inst: BOOL]; GetDesign: PROC [cx: Context] RETURNS [CD.Design]; GetGlobalNames: PROC [cx: Context] RETURNS [ROPES]; GetCDObj: PROC [cx: Context] RETURNS [CD.Object]; EqualRopes: PROC [ropes1, ropes2: ROPES] RETURNS [BOOL]; Cons: PROC [r: ROPE, lor: ROPES] RETURNS [ROPES]; List: PROC [r1, r2, r3, r4, r5, r6: ROPE _ NIL] RETURNS [lor: ROPES]; GlobalNonAtomic: SIGNAL [record: CellType, name: ROPE, wire: Wire]; InterpreterError: SIGNAL [cx: Context, var, expr, errorRope: ROPE]; GetCoreProps: PRIVATE PROC [cx: Context] RETURNS [Core.Properties]; GetCoreInstProps: PRIVATE PROC [cx: Context] RETURNS [Core.Properties]; ParseRope: PRIVATE PROC [rope: ROPE] RETURNS [tokenKind: IO.TokenKind, token, rest: ROPE]; IsParsedID: PRIVATE PROC [tokenKind: IO.TokenKind, token, id: ROPE] RETURNS [BOOL]; IsParsedChar: PRIVATE PROC [tokenKind: IO.TokenKind, token: ROPE, char: CHAR] RETURNS [BOOL]; EvaluateParameters: PRIVATE PROC [userData: REF, obj: CD.Object, properties: CD.PropList] RETURNS [cx: Context]; EvalToRef: PRIVATE PROC [cx: Context, expr: ROPE] RETURNS [result: REF]; ProcessGlobalNames: PRIVATE PROC [record: CellType, cx: Context]; END. tSisyph.mesa Copyright Σ 1985, 1986, 1987 by Xerox Corporation. All rights reserved. Created by Sindhu and Serlet, November 26, 1985 1:02:25 am PDT Pradeep Sindhu November 15, 1986 11:24:25 pm PST Barth, January 13, 1986 3:31:45 pm PST Bertrand Serlet September 21, 1987 11:55:51 am PDT Types Extraction Property on CD objects and CD instances that holds Sisyph expressions. name of Sisyph variable that represents a list of properties to be put on a CellType or Wire. name of Sisyph variable that represents a list of properties to be put on a CellType instance. property on icon that contains the names of the icon's parameters. A NIL value => any variable is potentially a parameter; a list with a rope="0" as its first element => 0 parameters. mode record for Sinix.Extract or SinixOps.ExtractCDInstance. Context Handling Procedures Creates or copies to a new context (with globalNames initialized to defaultGlobalNames), and evaluates all design satellites in that context. Creates a new context and copies oldCx to it. TVs are copied. Stores value into var in cx; if var didn't exist it is created; a NIL value removes var from cx. Stores value into var in cx only if var didn't exist Fetches an integer in cx. NATs are OK, and converted to INTs. Fetches an atom in cx. Fetches a rope in cx. Computes the value of expr, and stores it in var. If checkDefined, var must have been declared before (e.g. using Store) Might raise InterpreterError. Evaluates expr, that must yield a REF, and adds the result in the context variable corePropsRope or coreInstPropsRope, depending ob inst. Expressions yielding a non-REF TV (such as an INT) a REFized, to allow satellites like: "Value: 2". Returns the current design Returns the current list of global names Returns the current object being extracted Conveniences Equality of the 2 sets of ROPES. This function is useful to add a global variables to the global variables of a context. For example to have the global names be Vdd, Gnd, and Clock, just add as object satellite to the design: globalNames _ Cons["Clock", globalNames]. This function is necessary because CONS ["Clock", globalNames] would produce a LORA and not a LOR. This function is useful to set the global variables of a context. For example to have the global names be Vdd, Gnd, and Clock, just add as object satellite to the design: globalNames _ List["Vdd", "Gnd", "Clock"]. This function is necessary because LIST ["Vdd", "Gnd", "Clock"] would produce a LORA and not a LOR. Exceptions Private Utilities for implementors of Extract Procs 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, an expression containing "~" is evaluated as a declaration, while all other expressions are assumed to be names. Computes the value of expr and returns the corresponding REF. Might call InterpreterError. Expressions yielding a non-REF TV (such as an INT) a REFized, to allow satellites like: "Value: 2". Modifies in place record to fuse global wires. Modification in place is always dangerous, so avoid using this function ... ΚX˜™ JšœH™HIcodešœ;Οk™>Kšœ-™0Kšœ#™&Kšœ2™2—K˜Kš  œœœœœ˜?K˜KšΟnœœ œ˜!head™Kšœ œΟc˜9Kšœ œ˜Kšœ œ˜#Kšœœ ˜Kšœœ˜Kšœ œ˜Kšœœœ˜Kš œœœœœ˜—™ šœœ˜Kšœ œ œ*™G—šœœ˜K™]—šœœ˜K™^—šœœ˜KšœEœp™Έ—Kšœœ˜K˜šœ˜K™K™—š ž œœœœ œ œ˜LK™K™—š ž œœœœ œ œ˜LK™K™—š žœœœœœ˜IK™1KšœF™FKšœ™K™—š žœœœœœ˜?Kšœ"œd™‰K™cK™—šž œœœœ ˜2K™K˜—šžœœœœ˜3K™(K˜—šžœœœœ ˜1K™*——™ š ž œœœœœ˜8Kšœœ™ K™—š žœœœœœœ˜1KšœW™WKšœiΟb(œ™’Kšœ# ‘œœ œ™bK™—š žœœœœœœ˜EKšœA™AKšœi‘)œ™“Kšœ# ‘œœ œ™c——™ šžœœœ˜CK˜—Kšžœœ%œ˜C—™4šž œœœœ˜CK˜—šžœœœœ˜GK˜—š ž œ œœœ œœ˜ZK˜—š ž œ œ œœœœ˜SK˜—šž œ œ œœœœœ˜]K˜—šžœœœ œœœ œ˜pšœ™KšœA™AKšœ0™0KšœA™AKšœ3™3—KšœŸ™ŸK˜—š ž œœœœœ œ˜HK™=Kšœ™K™cK™—šžœœœ!˜AJ™0J™K—K˜K™—Kšœ˜J™—…— κ