CacheMInterfaceMCAMDriver.Mesa
created by RoseTranslate from CacheMInterfaceMCAMDriver.Rose of January 29, 1985 10:14:50 pm PST for curry.pa at January 29, 1985 10:15:19 pm PST
DIRECTORY
RoseTypes, RoseCreate, BitOps, BitSwOps, SwitchTypes, CacheOps;
CacheMInterfaceMCAMDriver: CEDAR PROGRAM
IMPORTS RoseCreate, BitOps, BitSwOps =
BEGIN OPEN
RoseTypes, BitOps, BitSwOps;
Signal Type decls
PreFetchAdrCmd: TYPE = CacheOps.PreFetchAdrCmd;
RegisterCells: PROC =
BEGIN
[] ← RoseCreate.RegisterCellType[name: "MCAMDriver",
expandProc: NIL,
ioCreator: CreateMCAMDriverIO, initializer: InitializeMCAMDriver,
evals: [EvalSimple: MCAMDriverEvalSimple],
blackBox: NIL, stateToo: NIL,
ports: CreateMCAMDriverPorts[],
drivePrototype: NEW [MCAMDriverDrive]];
END;
otherss: SymbolTable ← RoseCreate.GetOtherss["CacheMInterfaceMCAMDriver.pass"];
CreateMCAMDriverPorts: PROC RETURNS [ports: Ports] = {ports ← RoseCreate.PortsFromFile["CacheMInterfaceMCAMDriver.MCAMDriver.rosePorts"]};
MCAMDriverIORef: TYPE = REF MCAMDriverIORec;
MCAMDriverIORec: 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],
PhAb(2:15..15): BOOLEAN,
fill3(3:0..14): [0..32767],
PhBb(3:15..15): BOOLEAN,
CAMPage(4:0..383): PACKED ARRAY [0 .. 23] OF SwitchTypes.SwitchVal,
nCAMPage(28:0..383): PACKED ARRAY [0 .. 23] OF SwitchTypes.SwitchVal,
CAMBlock(52:0..63): PACKED ARRAY [0 .. 3] OF SwitchTypes.SwitchVal,
nCAMBlock(56:0..63): PACKED ARRAY [0 .. 3] OF SwitchTypes.SwitchVal,
MDataI(60:0..31): ARRAY [0..2) OF CARDINAL,
fill9(62:0..14): [0..32767],
CAMRegSenseMDataIB(62:15..15): BOOLEAN,
fill10(63:0..14): [0..32767],
ACAMRegDriveCAMBitsA(63:15..15): BOOLEAN,
fill11(64:0..14): [0..32767],
BCAMRegDriveCAMBitsAB(64:15..15): BOOLEAN,
fill12(65:0..14): [0..32767],
FormAddressBA(65:15..15): BOOLEAN,
fill13(66:0..14): [0..32767],
PageDriveMDataIA(66:15..15): BOOLEAN,
fill14(67:0..14): [0..32767],
BlockDriveMDataIA(67:15..15): BOOLEAN,
fill15(68:0..13): [0..16383],
GetAdrCmdBA(68:14..15): PreFetchAdrCmd,
fill16(69:0..14): [0..32767],
MasterBA(69:15..15): BOOLEAN];
port indices:
MCAMDriverCAMPagePortIndex: CARDINAL = 4;
MCAMDriverNCAMPagePortIndex: CARDINAL = 5;
MCAMDriverCAMBlockPortIndex: CARDINAL = 6;
MCAMDriverNCAMBlockPortIndex: CARDINAL = 7;
MCAMDriverDrive: 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),
PhAb(2:15..15): BOOLEAN,
fill3(3:0..14): [0 .. 32768),
PhBb(3:15..15): BOOLEAN,
fill4(4:0..14): [0 .. 32768),
CAMPage(4:15..15): BOOLEAN,
fill5(5:0..14): [0 .. 32768),
nCAMPage(5:15..15): BOOLEAN,
fill6(6:0..14): [0 .. 32768),
CAMBlock(6:15..15): BOOLEAN,
fill7(7:0..14): [0 .. 32768),
nCAMBlock(7:15..15): BOOLEAN,
fill8(8:0..14): [0 .. 32768),
MDataI(8:15..15): BOOLEAN,
fill9(9:0..14): [0 .. 32768),
CAMRegSenseMDataIB(9:15..15): BOOLEAN,
fill10(10:0..14): [0 .. 32768),
ACAMRegDriveCAMBitsA(10:15..15): BOOLEAN,
fill11(11:0..14): [0 .. 32768),
BCAMRegDriveCAMBitsAB(11:15..15): BOOLEAN,
fill12(12:0..14): [0 .. 32768),
FormAddressBA(12:15..15): BOOLEAN,
fill13(13:0..14): [0 .. 32768),
PageDriveMDataIA(13:15..15): BOOLEAN,
fill14(14:0..14): [0 .. 32768),
BlockDriveMDataIA(14:15..15): BOOLEAN,
fill15(15:0..14): [0 .. 32768),
GetAdrCmdBA(15:15..15): BOOLEAN,
fill16(16:0..14): [0 .. 32768),
MasterBA(16:15..15): BOOLEAN];
CreateMCAMDriverIO: PROC [cell: Cell] --IOCreator-- = {
cell.realCellStuff.switchIO ← NEW [MCAMDriverIORec];
cell.realCellStuff.newIO ← NEW [MCAMDriverIORec];
cell.realCellStuff.oldIO ← NEW [MCAMDriverIORec];
};
MCAMDriverStateRef: TYPE = REF MCAMDriverStateRec;
MCAMDriverStateRec: TYPE = RECORD [
PageReg: BitDWord,
BlockReg: BitWord,
Intermediate values, not state bits
PageRegSenseCAMBitsA, BlockRegSenseCAMBitsA, PrechargeCAMBits, DriveCAMBits: BOOL
];
InitializeMCAMDriver: Initializer = {
IF leafily THEN
BEGIN
state: MCAMDriverStateRef ← NEW [MCAMDriverStateRec];
cell.realCellStuff.state ← state;
END;
};
MCAMDriverEvalSimple: CellProc =
BEGIN
sw: MCAMDriverIORef ← NARROW[cell.realCellStuff.switchIO];
newIO: MCAMDriverIORef ← NARROW[cell.realCellStuff.newIO];
state: MCAMDriverStateRef ← NARROW[cell.realCellStuff.state];
BEGIN OPEN newIO, state;
BlockRegSenseCAMBitsA ← PhAb AND FormAddressBA AND MasterBA;
PrechargeCAMBits ← PhBb AND FormAddressBA AND MasterBA;
DriveCAMBits ← (PhBb AND ((FormAddressBA AND NOT MasterBA) OR BCAMRegDriveCAMBitsAB)) OR ACAMRegDriveCAMBitsA;
PageRegSenseCAMBitsA ← BlockRegSenseCAMBitsA AND (GetAdrCmdBA=VictimReal OR GetAdrCmdBA=RefRealAssemble OR GetAdrCmdBA=RefVirtual);
IF CAMRegSenseMDataIB THEN {
PageReg ← MDTD[MDataI, 32, 0, 24, PageReg, 24, 0, 24];
BlockReg ← MDTW[MDataI, 32, 24, 4, BlockReg, 4, 0, 4];
};
TRUSTED {
cpd: SwitchMWord ← DESCRIPTOR[CAMPage];
ncpd: SwitchMWord ← DESCRIPTOR[nCAMPage];
cbd: SwitchMWord ← DESCRIPTOR[CAMBlock];
ncbd: SwitchMWord ← DESCRIPTOR[nCAMBlock];
s: SwitchTypes.Strength ← IF DriveCAMBits THEN driveStrong ELSE none;
IF PageRegSenseCAMBitsA THEN PageReg ← CSTD[cpd, 24, 0, 24, PageReg, 24, 0, 24];
IF BlockRegSenseCAMBitsA THEN BlockReg ← CSTW[cbd, 4, 0, 4, BlockReg, 4, 0, 4];
SCDTS[PageReg, 24, 0, 24, cpd, 24, 0, 24, [[s, L], [s, H]]];
SCDTS[PageReg, 24, 0, 24, ncpd, 24, 0, 24, [[s, H], [s, L]]];
SCWTS[BlockReg, 4, 0, 4, cbd, 4, 0, 4, [[s, L], [s, H]]];
SCWTS[BlockReg, 4, 0, 4, ncbd, 4, 0, 4, [[s, H], [s, L]]];
IF PrechargeCAMBits THEN {
SCDTS[BitDWordOnes, 24, 0, 24, cpd, 24, 0, 24, [[none, X], [drive, H]]];
SCDTS[BitDWordOnes, 24, 0, 24, ncpd, 24, 0, 24, [[none, X], [drive, H]]];
SCWTS[BitWordOnes, 4, 0, 4, cbd, 4, 0, 4, [[none, X], [drive, H]]];
SCWTS[BitWordOnes, 4, 0, 4, ncbd, 4, 0, 4, [[none, X], [drive, H]]];
};
};
IF PageDriveMDataIA THEN MDataI ← MDTD[PageReg, 24, 0, 24, MDataI, 32, 0, 24];
IF BlockDriveMDataIA THEN MDataI ← MWTD[BlockReg, 4, 0, 4, MDataI, 32, 24, 4];
END;
END;
RegisterCells[];
END.