Sisyph.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created by Sindhu and Serlet, November 26, 1985 1:02:25 am PDT
Pradeep Sindhu March 18, 1987 3:43:48 pm PST
Barth, January 13, 1986 3:31:45 pm PST
Bertrand Serlet February 3, 1987 11:21:07 pm PST
DIRECTORY
AMModel USING [Context],
CD, Core,
Sinix USING [ExtractProc, Mode],
SymTab USING [Ref];
Sisyph: CEDAR DEFINITIONS = BEGIN
Types
Context: TYPE = SymTab.Ref;
CellType: TYPE = Core.CellType;
Wire: TYPE = Core.Wire;
Wires: TYPE = Core.Wires;
WireSeq: TYPE = Core.WireSeq;
ROPE: TYPE = Core.ROPE;
ROPES: TYPE = LIST OF ROPE;
Extraction
expressionsProp:
ATOM;
Property on CD objects and CD instances that holds Sisyph expressions.
cellIconRope:
ROPE;
name of Sisyph variable that holds the Core for a cell icon.
wireIconRope:
ROPE;
name of Sisyph variable that holds the Core for a wire icon.
wireRope:
ROPE;
name of Sisyph variable that holds the Core for a wire.
nameRope:
ROPE;
name of Sisyph variable that represents the name of a wire or a cellType.
corePropsRope:
ROPE;
name of Sisyph variable that represents a list of properties to be put on a CellType or Wire.
coreInstPropsRope:
ROPE;
name of Sisyph variable that represents a list of properties to be put on a CellType instance.
parmNamesProp:
ATOM;
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.
cachedResultProp:
ATOM;
property containing cached core result.
defaultGlobalNames: ROPES;
mode: Sinix.Mode;
mode record for Sinix.Extract or SinixOps.ExtractCDInstance.
ExtractSchematic: Sinix.ExtractProc;
ES, ExtractSchematicByName: PROC [name: ROPE, cx: Context] RETURNS [CellType];
Context Handling Procedures
Create:
PROC [design:
CD.Design, previousCx: Context ←
NIL]
RETURNS [cx: Context];
Creates or copies to a new context (with globalNames initialized to defaultGlobalNames), and evaluates all design satellites in that context.
Copy:
PROC [cx: Context]
RETURNS [newCx: Context];
Creates a new context and copies cx to it.
Store:
PROC [cx: Context, var:
ROPE, value:
REF ←
NIL];
Stores value into var in cx; if var didn't exist it is created; a NIL value removes var from cx.
Insert:
PROC [cx: Context, var:
ROPE, value:
REF ←
NIL];
Stores value into var in cx only if var didn't exist
FetchInt:
PROC [cx: Context, var:
ROPE]
RETURNS [found:
BOOL, value:
INT];
Fetches an integer in cx
Eval:
PROC [cx: Context, expr:
ROPE, cedarCx: AMModel.Context ←
NIL];
Computes the value of expr in <cx, cedarCx>.
GetDesign:
PROC [cx: Context]
RETURNS [
CD.Design];
Returns the current design
GetGlobalNames:
PROC [cx: Context]
RETURNS [
ROPES];
Returns the current list of global names
GetCDObj:
PROC [cx: Context]
RETURNS [
CD.Object];
Returns the current object being extracted
Icon class
An icon cell type has the same Core data structure as some other cell type but has a new property list.
iconClass: Core.CellClass;
CreateIcon: PROC [cellType: CellType, name: ROPE ← NIL, props: Core.Properties ← NIL] RETURNS [icon: CellType];
Conveniences
EqualRopes:
PROC [ropes1, ropes2:
ROPES]
RETURNS [
BOOL];
Equality of the 2 sets of ROPES.
Cons:
PROC [r:
ROPE, lor:
ROPES]
RETURNS [
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.
List:
PROC [r1, r2, r3, r4, r5, r6:
ROPE ←
NIL]
RETURNS [lor:
ROPES];
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
GlobalNonAtomic:
SIGNAL [record: CellType, name:
ROPE, wire: Wire];
InterpreterError: SIGNAL [cx: Context, expr, errorRope: ROPE];
Private Utilities for implementors of Extract Procs
IsResultExpression:
PRIVATE
PROC [expr:
ROPE]
RETURNS [
BOOL];
GetCoreProps:
PRIVATE
PROC [cx: Context]
RETURNS [Core.Properties];
GetCoreInstProps:
PRIVATE
PROC [cx: Context]
RETURNS [Core.Properties];
EvaluateParameters:
PRIVATE
PROC [userData:
REF, obj:
CD.Object, properties:
CD.PropList, isResultExpression:
PROC [
ROPE]
RETURNS [
BOOL]]
RETURNS [cx: Context, resultRope:
ROPE];
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.
ProcessGlobalNames:
PRIVATE
PROC [record: CellType, cx: Context];
Modifies in place record to fuse global wires.
Modification in place is always dangerous, so avoid using this function ...
END.