InverterImpl.Mesa
created by RoseTranslate 3.1.3 of September 5, 1985 12:14:34 pm PDT
created from Inverter.Rose of September 16, 1985 2:49:19 pm PDT
created for Barth.pa
created at September 16, 1985 2:49:43 pm PDT
DIRECTORY
RoseTypes, Inverter, RoseCreate, RoseConvert, SwitchTypes;
InverterImpl: CEDAR PROGRAM
IMPORTS RoseCreate, RoseConvert
EXPORTS Inverter
= BEGIN OPEN
RoseTypes, Inverter;
Signal Type decls
RegisterCells: PROC =
BEGIN
Inverter ← RoseCreate.RegisterCellType[name: "Inverter",
expandProc: InverterExpand,
ioCreator: CreateInverterIO, driveCreator: CreateInverterDrive,
evals: [],
tests: LIST[[name: "InverterTest", proc: InverterTestInverterTest, stateToo: FALSE]],
ports: CreateInverterPorts[]
];
END;
otherss: SymbolTable ← RoseCreate.GetOtherss["Inverter.partsAssertions"];
Inverter: PUBLIC CellType;
CreateInverterPorts: PROC RETURNS [ports: Ports] = {ports ← RoseCreate.PortsFromFile["Inverter.Inverter.rosePorts"]};
InverterSwitchIORef: TYPE = REF InverterSwitchIORec;
InverterSwitchIORec: TYPE = RECORD [
Vdd: SwitchTypes.SwitchVal
,Gnd: SwitchTypes.SwitchVal
,In: SwitchTypes.SwitchVal
,Out: SwitchTypes.SwitchVal
];
InverterSimpleIORef: TYPE = REF InverterSimpleIORec;
InverterSimpleIORec: TYPE = RECORD [
fill0: [0 .. 32767],
Vdd: BOOLEAN
,fill1: [0 .. 32767],
Gnd: BOOLEAN
,fill2: [0 .. 32767],
In: BOOLEAN
,fill3: [0 .. 32767],
Out: BOOLEAN
];
InverterDriveRef: TYPE = REF InverterDriveRec;
InverterDriveRec: TYPE = RECORD [driveRecordInitialPadding: DriveTagType, drive: PACKED ARRAY InverterPort OF DriveLevel];
InverterPort: TYPE = {
Vdd, Gnd, In, Out};
CreateInverterIO: PROC [ct: CellType, switch: BOOL] RETURNS [ioAsAny: REF ANY] --IOCreator-- = {
ioAsAny ← IF switch THEN NEW[InverterSwitchIORec] ELSE NEW[InverterSimpleIORec];
};
CreateInverterDrive: PROC [ct: CellType] RETURNS [driveAsAny: REF ANY] --DriveCreator-- = {
driveAsAny ← NEW[InverterDriveRec];
};
InverterExpand: PROC [thisCell: Cell, to: ExpansionReceiver] --ExpandProc-- = {
PrivateLookupNode: PROC [name: ROPE] RETURNS [node: Node] = {node ← RoseCreate.LookupNode[from: thisCell, path: LIST[name]]};
Vdd: Node ← PrivateLookupNode["Vdd"];
Gnd: Node ← PrivateLookupNode["Gnd"];
In: Node ← PrivateLookupNode["In"];
Out: Node ← PrivateLookupNode["Out"];
others: SymbolTable ← RoseCreate.GetOthers[otherss, "Inverter"];
explicitly requested CEDAR:
[] ← RoseConvert.Instantiate[thisCell: thisCell, to: to];
};
InverterTestInverterTest: CellTestProc =
BEGIN
simpleInstr: InverterSimpleIORef ← NARROW[simpleInstructions];
drive: InverterDriveRef ← NARROW[driveAsAny];
BEGIN OPEN drive, simpleInstr;
END;
END;
RegisterCells[];
END.