RoseBehavior.mesa 
Copyright © 1985 by Xerox Corporation. All rights reversed.
Barth, July 31, 1985 3:37:03 pm PDT
Spreitzer, September 10, 1985 10:00:26 pm PDT
DIRECTORY Rope;
RoseBehavior: CEDAR DEFINITIONS = BEGIN
Theory
This interface talks about the details of writing a Rosemary behavioural description of a cell type. Rosemary implements a mixed mode simulator that has a simple selective trace algorithm and a MOSSIM II switch level simulation algorithm integrated together.
Definition File Generation
The definitions file contains simple value, switch value, and drive record definitions as well as port paths.
The base is the behavior class name.
Port path names are generated by concatenating the base followed by the name of each field or the index within a sequence from the root of the public wire.
The simple value record type name is generated by appending the string "SimpleRec" to the base. Similiarly the ref type is generated by appending the string "SimpleRef" to the base. The switch value record type has the string "SwitchRec" appended and its ref type has "SwitchRef" appended. The drive record has the string "DriveRec" appended and its ref type has "DriveRef" appended.
If a part of a behavior class's public wire has the property RoseBind.switchWire then that part participates in the full switch level algorithm. ValsChanged, PropQ and PropUD procedures must be supplied for the behavior class. InitUD, FinalUD, FindVicinity, and other low level procedures may be supplied. Parts without the RoseBind.switchPort property interact in the simple way.
The types of the fields of the simple and switch value records are derived from the public wire of the behavior class according to the following rules:
An atomic wire becomes a BOOL in the simple value record type.
An atomic wire becomes a RoseBehavior.SwitchVal in the switch value record type.
A record wire becomes a RECORD. The fields of the RECORD are generated by recursively applying these rules to each of the elements of the record wire.
A base type is the structure of any member of the elements of a sequence wire. A sequence wire which does not have identical structure for each of its elements is illegal. A sequence wire which has the property RoseBind.variableWire becomes a REF to a sequence record whose type is generated by applying these rules recursively to the base type of the sequence wire.
A basic sequence is a sequence wire which has an atomic wire as its base type. In the simple value record type a basic sequence becomes a BitOps.BitWord if 1 d size d 16; a BitOps.BitDWord if 16 ý size d 32; an ARRAY OF CARDINAL if size ý 32.
A sequence wire becomes an ARRAY of the base type.
Drive records have the following rules:
An atomic wire becomes a RoseBehavior.Drive.
A wire with the property RoseBind.simpleDrive becomes RoseBehavior.Drive.
A record wire becomes a RECORD. The fields of the RECORD are generated by recursively applying these rules to each of the elements of the record wire.
A sequence wire which has the property RoseBind.variableWire becomes a REF to a sequence record whose type is generated by applying these rules recursively to the base type of the sequence wire.
A basic sequence becomes RoseBehavior.Drive unless it has the property RoseBind.complexDrive.
A sequence wire becomes an ARRAY of the base type.
NAndSimpleRec: TYPE = RECORD[
Vdd: BOOL,
Gnd: BOOL,
Input: NAndSimpleInputRef,
nOutput: BOOL];
NAndSimpleInputRef: TYPE = REF NAndSimpleInputRec;
NAndSimpleInputRec: TYPE = RECORD[
c: SEQUENCE size: NAT OF BOOL];
Implementation Generation
Rosemary will generate a program module which implements functions necessary to running a simulation which can be derived from the Core data structure.
The simple and switch value records and the drive records allocation procedures are in this module. The module initializes the port paths.
Behavior Registration
The implementor of the details must call the Register procedure. Successive calls update the behavior of the existing cells.
Implementation
ROPE: TYPE = Rope.ROPE;
Details: TYPE = REF DetailsRec;
DetailsRec: TYPE = RECORD [
EvalSimple, ValsChanged, InitQ, PropQ, InitUD, PropUD, FinalUD: EvalProc ← NIL,
All of the simple behavior is captured in the EvalSimple.
Switch-level behavior requires at least: PropQ, PropUD, and ValsChanged.
The strengthAny and simpleAny records may only be updated in the EvalSimple or ValsChanged, which are also the only ones that can perturb.
EnumerateVicinity: VicinityEnumerator ← NIL,
CreateState: StateCreator ← NIL];
EvalProc: TYPE = PROC [argsAny, switchAny, simpleAny, strengthAny, stateAny: REF ANY, perturb: PROC [portPath: PortPath]];
VicinityEnumerator: TYPE = PROC [
argsAny, stateAny: REF ANY,
portPath: PortPath,
evenIfInput: BOOLFALSE,
consume: PROC [PortPath]
];
PortPath: TYPE = LIST OF StructureIndex;
Deeper later, because they'll be traversed forward more often than backward, and it won't make a significant storage difference.
StructureIndex: TYPE = CARDINAL;
Register: PROC [behaviorClassName: ROPE, details: Details];
StateCreator: TYPE = PROC [argsAny: REF ANYNIL] RETURNS [stateAny: REF ANYNIL];
SwitchVal: TYPE = MACHINE DEPENDENT RECORD [
s: PACKED ARRAY StrengthIndex OF Strength ← ALL[none],
val: Level ← X,
pad: [0 .. 4) ← 0];
Level: TYPE = {L, H, X};
Strength: TYPE = Drive[none .. input];
StrengthIndex: TYPE = {q, u, d};
Drive: TYPE = {
test,--for TestProcs to say "test it for me"
see,--for TestProcs to say "I'll test it"
none,--from a TestProc it means neither driven nor tested; in simulation it means no strength at all
chargeWeak, chargeMediumWeak,
charge,
chargeMediumStrong, chargeStrong, chargeVeryStrong,
driveWeak, driveMediumWeak,
drive,
driveMediumStrong, driveStrong, driveVeryStrong,
input--the strongest drive level: how circuit inputs are driven
};
Stop: SIGNAL [msg: ROPE, data: REF ANYNIL];
This signal may be raised when a behavioural proc wishes to display a string to a user and wait for a proceed or abort.
END.