PipalSisyph.mesa
Copyright Ó 1985, 1986, 1987, 1988 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 April 25, 1988 9:55:05 pm PDT
DIRECTORY
Core, CoreClasses,
Pipal, PipalUI, PipalSinix,
RefTab;
Extraction Convenience
VariableValue: TYPE = RECORD [variable: ATOM, value: INT];
Extract:
PROC [design: PipalUI.Design, name: Core.
ROPE, parameters:
LIST
OF VariableValue ←
NIL]
RETURNS [Core.CellType];
Extracts from design with the given (INT) parameters.
Context Handling Procedures
DesignContext:
PROC [design: PipalUI.Design]
RETURNS [context: PipalSinix.Context];
Creates a new context (with $globalNames and $design variables properly initialized).
Evaluates all design satellites or expressions in that context.
Define:
PROC [context: PipalSinix.Context, variable:
ATOM, value:
REF];
Defines variable for context, and sets its value.
Set:
PROC [context: PipalSinix.Context, variable:
ATOM, value:
REF];
Assumes that variable is a defined variable, and sets its value.
Get:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
REF];
Retrieves the value of variable.
GetInt:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
INT];
Retrieves the value of variable, and converts to INT.
GetAtom:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value:
ATOM];
Retrieves the value of variable, and converts to an ATOM.
GetRope:
PROC [context: PipalSinix.Context, variable:
ATOM]
RETURNS [value: Core.
ROPE];
Retrieves the value of variable, and converts to a ROPE.
Eval:
PROC [context: PipalSinix.Context, expr: Core.
ROPE]
RETURNS [value:
REF];
Computes the value of expr.
Expressions yielding a non-REF (such as an INT) a REFized, to allow satellites like: "Value: 2".
Might raise InterpreterError.
DefineEval:
PROC [context: PipalSinix.Context, variable:
ATOM, expr: Core.
ROPE];
Defines variable for context, and sets its value to the evaluated expression.
SetEval:
PROC [context: PipalSinix.Context, variable:
ATOM, expr: Core.
ROPE];
Assumes that variable is a defined variable, and sets its value to the evaluated expression.
GetDesign:
PROC [context: PipalSinix.Context]
RETURNS [design: PipalUI.Design];
Returns the current design.
GetGlobalNames:
PROC [context: PipalSinix.Context]
RETURNS [globalNames:
LIST
OF Core.
ROPE];
Returns the current list of global names.
Exceptions
ContextProblem:
SIGNAL [message: Core.
ROPE, variable:
ATOM];
GlobalNonAtomic:
SIGNAL [object: Pipal.Object, name: Core.
ROPE, wire: Core.Wire];
InterpreterProblem: SIGNAL [context: PipalSinix.Context, expr, errorRope: Core.ROPE];
Private Utilities for implementors of Extract Procs
Recognized satellites are:
<variable> ~ <expr> (declaration)
<variable> ← <expr> (parameter passing)
<variable> : <expr> (property)
others (for those, variable=NIL and expr=satellite)
ParseSatellite:
PRIVATE
PROC [satellite: Core.
ROPE]
RETURNS [variable:
ATOM ←
NIL, char:
CHAR, expr: Core.
ROPE];
ParsedRope: TYPE = RECORD [variable: ATOM, expr: Core.ROPE];
ParseSatellites:
PRIVATE
PROC [satellites:
LIST
OF Core.
ROPE]
RETURNS [declarations, assignments, properties:
LIST
OF ParsedRope ←
NIL, others:
LIST
OF Core.
ROPE ←
NIL];
ProcessGlobalNames:
PROC [mode: PipalSinix.Mode, objName: Core.
ROPE, context: PipalSinix.Context, fused: RefTab.Ref, instances:
LIST
OF CoreClasses.CellInstance];
Global wires for a given global name are identified as wire (named appropriately or unnamed) connected in instances to a sub public appropriately named. They are made public and fused.