--CachePPads.Mesa
--created by RoseTranslate from CachePPads.Rose of April 16, 1984 2:07:52 pm PST for Barth.pa at May 3, 1984 9:24:38 pm PDT
DIRECTORY
RoseTypes, RoseCreate, Dragon;
CachePPads: CEDAR PROGRAM
IMPORTS RoseCreate, Dragon =
BEGIN OPEN
RoseTypes, Dragon;
--Signal Type decls
PBusCommands: TYPE = Dragon.PBusCommands;
PBusFaults: TYPE = Dragon.PBusFaults;
RegisterCells: PROC =
BEGIN
CreatePDataPadsPorts[];
[] ← RoseCreate.RegisterCellClass[className: "PDataPads",
expandProc: NIL,
ioCreator: CreatePDataPadsIO, initializer: NIL,
evals: [EvalSimple: PDataPadsEvalSimple],
blackBox: NIL, stateToo: NIL,
ports: PDataPadsPorts,
drivePrototype: NEW [PDataPadsDrive]];
CreatePCtlPadsPorts[];
[] ← RoseCreate.RegisterCellClass[className: "PCtlPads",
expandProc: NIL,
ioCreator: CreatePCtlPadsIO, initializer: NIL,
evals: [EvalSimple: PCtlPadsEvalSimple],
blackBox: NIL, stateToo: NIL,
ports: PCtlPadsPorts,
drivePrototype: NEW [PCtlPadsDrive]];
END;
CreatePDataPadsPorts: PROC = {PDataPadsPorts ← RoseCreate.PortsFromFile["CachePPads.PDataPads.rosePorts"]};
PDataPadsIORef: TYPE = REF PDataPadsIORec;
PDataPadsIORec: TYPE = MACHINE DEPENDENT RECORD [
fill0(0:0..14): [0..32767],
Vdd(0:15..15): BOOLEAN,
fill1(1:0..14): [0..32767],
Gnd(1:15..15): BOOLEAN,
fill2(2:0..14): [0..32767],
PadVdd(2:15..15): BOOLEAN,
fill3(3:0..14): [0..32767],
PadGnd(3:15..15): BOOLEAN,
PData(4:0..31): ARRAY [0..2) OF CARDINAL,
fill5(6:0..14): [0..32767],
PParityB(6:15..15): BOOLEAN,
PDataI(7:0..31): ARRAY [0..2) OF CARDINAL,
fill7(9:0..14): [0..32767],
DrivePData(9:15..15): BOOLEAN,
fill8(10:0..14): [0..32767],
DrivePDataI(10:15..15): BOOLEAN,
fill9(11:0..14): [0..32767],
PParityI(11:15..15): BOOLEAN];
PDataPadsDrive: TYPE = MACHINE DEPENDENT RECORD [
fill0(0:0..14): [0 .. 32768),
Vdd(0:15..15): BOOLEAN,
fill1(1:0..14): [0 .. 32768),
Gnd(1:15..15): BOOLEAN,
fill2(2:0..14): [0 .. 32768),
PadVdd(2:15..15): BOOLEAN,
fill3(3:0..14): [0 .. 32768),
PadGnd(3:15..15): BOOLEAN,
fill4(4:0..14): [0 .. 32768),
PData(4:15..15): BOOLEAN,
fill5(5:0..14): [0 .. 32768),
PParityB(5:15..15): BOOLEAN,
fill6(6:0..14): [0 .. 32768),
PDataI(6:15..15): BOOLEAN,
fill7(7:0..14): [0 .. 32768),
DrivePData(7:15..15): BOOLEAN,
fill8(8:0..14): [0 .. 32768),
DrivePDataI(8:15..15): BOOLEAN,
fill9(9:0..14): [0 .. 32768),
PParityI(9:15..15): BOOLEAN];
CreatePDataPadsIO: IOCreator = {
cell.realCellStuff.newIO ← NEW [PDataPadsIORec];
cell.realCellStuff.oldIO ← NEW [PDataPadsIORec];
};
PDataPadsEvalSimple: CellProc =
BEGIN
newIO: PDataPadsIORef ← NARROW[cell.realCellStuff.newIO];
BEGIN OPEN newIO;
Assert[NOT MoreThanOneOf[DrivePData, DrivePDataI]];
IF DrivePData THEN {
PData ← PDataI;
PParityB ← PParityI;
};
IF DrivePDataI THEN {
PDataI ← PData;
PParityI ← PParityB;
};
END;
END;
PDataPadsPorts: Ports ← NEW [PortsRep[10]];
CreatePCtlPadsPorts: PROC = {PCtlPadsPorts ← RoseCreate.PortsFromFile["CachePPads.PCtlPads.rosePorts"]};
PCtlPadsIORef: TYPE = REF PCtlPadsIORec;
PCtlPadsIORec: TYPE = MACHINE DEPENDENT RECORD [
fill0(0:0..14): [0..32767],
Vdd(0:15..15): BOOLEAN,
fill1(1:0..14): [0..32767],
Gnd(1:15..15): BOOLEAN,
fill2(2:0..14): [0..32767],
PadVdd(2:15..15): BOOLEAN,
fill3(3:0..14): [0..32767],
PadGnd(3:15..15): BOOLEAN,
fill4(4:0..11): [0..4095],
PCmdA(4:12..15): PBusCommands,
fill5(5:0..14): [0..32767],
PRejectB(5:15..15): BOOLEAN,
fill6(6:0..12): [0..8191],
PFaultB(6:13..15): PBusFaults,
fill7(7:0..14): [0..32767],
PNPError(7:15..15): BOOLEAN,
fill8(8:0..11): [0..4095],
PCmdI(8:12..15): PBusCommands,
fill9(9:0..14): [0..32767],
PRejectDriveHigh(9:15..15): BOOLEAN,
fill10(10:0..14): [0..32767],
PRejectDriveLow(10:15..15): BOOLEAN,
fill11(11:0..14): [0..32767],
PFaultDrive(11:15..15): BOOLEAN,
fill12(12:0..12): [0..8191],
PFaultI(12:13..15): PBusFaults,
fill13(13:0..14): [0..32767],
PNPErrorDriveLow(13:15..15): BOOLEAN];
PCtlPadsDrive: TYPE = MACHINE DEPENDENT RECORD [
fill0(0:0..14): [0 .. 32768),
Vdd(0:15..15): BOOLEAN,
fill1(1:0..14): [0 .. 32768),
Gnd(1:15..15): BOOLEAN,
fill2(2:0..14): [0 .. 32768),
PadVdd(2:15..15): BOOLEAN,
fill3(3:0..14): [0 .. 32768),
PadGnd(3:15..15): BOOLEAN,
fill4(4:0..14): [0 .. 32768),
PCmdA(4:15..15): BOOLEAN,
fill5(5:0..14): [0 .. 32768),
PRejectB(5:15..15): BOOLEAN,
fill6(6:0..14): [0 .. 32768),
PFaultB(6:15..15): BOOLEAN,
fill7(7:0..14): [0 .. 32768),
PNPError(7:15..15): BOOLEAN,
fill8(8:0..14): [0 .. 32768),
PCmdI(8:15..15): BOOLEAN,
fill9(9:0..14): [0 .. 32768),
PRejectDriveHigh(9:15..15): BOOLEAN,
fill10(10:0..14): [0 .. 32768),
PRejectDriveLow(10:15..15): BOOLEAN,
fill11(11:0..14): [0 .. 32768),
PFaultDrive(11:15..15): BOOLEAN,
fill12(12:0..14): [0 .. 32768),
PFaultI(12:15..15): BOOLEAN,
fill13(13:0..14): [0 .. 32768),
PNPErrorDriveLow(13:15..15): BOOLEAN];
CreatePCtlPadsIO: IOCreator = {
cell.realCellStuff.newIO ← NEW [PCtlPadsIORec];
cell.realCellStuff.oldIO ← NEW [PCtlPadsIORec];
};
PCtlPadsEvalSimple: CellProc =
BEGIN
newIO: PCtlPadsIORef ← NARROW[cell.realCellStuff.newIO];
BEGIN OPEN newIO;
PCmdI ← PCmdA;
IF PRejectDriveHigh THEN PRejectB ← TRUE;
IF PRejectDriveLow THEN PRejectB ← FALSE;
IF PFaultDrive THEN PFaultB ← PFaultI;
IF PNPErrorDriveLow THEN PNPError ← FALSE;
END;
END;
PCtlPadsPorts: Ports ← NEW [PortsRep[14]];
RegisterCells[];
END.