--CacheMCAMDriver.Mesa
--created by RoseTranslate from CacheMCAMDriver.Rose of April 30, 1984 4:13:02 pm PDT for Barth.pa at May 3, 1984 9:26:47 pm PDT
DIRECTORY
RoseTypes, RoseCreate, BitOps, BitSwOps, Dragon, SwitchTypes;
CacheMCAMDriver: CEDAR PROGRAM
IMPORTS RoseCreate, BitOps, BitSwOps, Dragon =
BEGIN OPEN
RoseTypes, BitOps, BitSwOps, Dragon;
RegisterCells: PROC =
BEGIN
CreateMCAMDriverPorts[];
[] ← RoseCreate.RegisterCellClass[className: "MCAMDriver",
expandProc: NIL,
ioCreator: CreateMCAMDriverIO, initializer: InitializeMCAMDriver,
evals: [EvalSimple: MCAMDriverEvalSimple],
blackBox: NIL, stateToo: NIL,
ports: MCAMDriverPorts,
drivePrototype: NEW [MCAMDriverDrive]];
END;
CreateMCAMDriverPorts: PROC = {MCAMDriverPorts ← RoseCreate.PortsFromFile["CacheMCAMDriver.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],
LatchBias(2:15..15): BOOLEAN,
VirtualPage(3:0..31): ARRAY [0..2) OF CARDINAL,
fill4(5:0..9): [0..1023],
VirtualBlock(5:10..15): [0..63],
RealPage(6:0..31): ARRAY [0..2) OF CARDINAL,
nRealPage(8:0..31): ARRAY [0..2) OF CARDINAL,
fill7(10:0..9): [0..1023],
RealBlock(10:10..15): [0..63],
fill8(11:0..9): [0..1023],
nRealBlock(11:10..15): [0..63],
CAMPageAccess(12:0..383): PACKED ARRAY [0 .. 23] OF SwitchTypes.SwitchVal,
nCAMPageAccess(36:0..383): PACKED ARRAY [0 .. 23] OF SwitchTypes.SwitchVal,
CAMBlockAccess(60:0..95): PACKED ARRAY [0 .. 5] OF SwitchTypes.SwitchVal,
nCAMBlockAccess(66:0..95): PACKED ARRAY [0 .. 5] OF SwitchTypes.SwitchVal,
fill13(72:0..14): [0..32767],
ShiftDataToPCAM(72:15..15): BOOLEAN,
MDataI(73:0..31): ARRAY [0..2) OF CARDINAL,
fill15(75:0..14): [0..32767],
ShiftDataToMCAM(75:15..15): BOOLEAN,
fill16(76:0..14): [0..32767],
ShiftEqual(76:15..15): BOOLEAN,
fill17(77:0..14): [0..32767],
nShiftEqual(77:15..15): BOOLEAN,
fill18(78:0..14): [0..32767],
ShiftFeedBack(78:15..15): BOOLEAN,
fill19(79:0..14): [0..32767],
nShiftFeedBack(79:15..15): BOOLEAN,
fill20(80:0..14): [0..32767],
ShiftShift(80:15..15): BOOLEAN,
fill21(81:0..14): [0..32767],
nShiftShift(81:15..15): BOOLEAN,
fill22(82:0..14): [0..32767],
PageAccessToAccess(82:15..15): BOOLEAN,
fill23(83:0..14): [0..32767],
BlockAccessToAccess(83:15..15): BOOLEAN,
fill24(84:0..14): [0..32767],
PageVirtualToAccess(84:15..15): BOOLEAN,
fill25(85:0..14): [0..32767],
BlockVirtualToAccess(85:15..15): BOOLEAN,
fill26(86:0..14): [0..32767],
MatchToAccess(86:15..15): BOOLEAN,
fill27(87:0..14): [0..32767],
MDataToMatch(87:15..15): BOOLEAN,
fill28(88:0..14): [0..32767],
AccessToMatch(88:15..15): BOOLEAN,
fill29(89:0..14): [0..32767],
PageAccessToMData(89:15..15): BOOLEAN,
fill30(90:0..14): [0..32767],
nPageAccessToMData(90:15..15): BOOLEAN,
fill31(91:0..14): [0..32767],
BlockAccessToMData(91:15..15): BOOLEAN,
fill32(92:0..14): [0..32767],
nBlockAccessToMData(92:15..15): BOOLEAN,
fill33(93:0..14): [0..32767],
AccessToPageBlockAccess(93:15..15): BOOLEAN,
fill34(94:0..14): [0..32767],
nAccessToPageBlockAccess(94:15..15): BOOLEAN,
fill35(95:0..14): [0..32767],
ShiftToPageBlockAccess(95:15..15): BOOLEAN,
fill36(96:0..14): [0..32767],
nShiftToPageBlockAccess(96:15..15): BOOLEAN,
fill37(97:0..14): [0..32767],
AccessDrive(97:15..15): BOOLEAN,
fill38(98:0..14): [0..32767],
nAccessDrive(98:15..15): BOOLEAN,
fill39(99:0..14): [0..32767],
PageBlockAccessToShift(99:15..15): BOOLEAN,
fill40(100:0..14): [0..32767],
nPageBlockAccessToShift(100:15..15): BOOLEAN,
fill41(101:0..14): [0..32767],
nCAMAccessPrecharge(101:15..15): BOOLEAN];
-- port indices:
MCAMDriverCAMPageAccessPortIndex: CARDINAL = 9;
MCAMDriverNCAMPageAccessPortIndex: CARDINAL = 10;
MCAMDriverCAMBlockAccessPortIndex: CARDINAL = 11;
MCAMDriverNCAMBlockAccessPortIndex: CARDINAL = 12;
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),
LatchBias(2:15..15): BOOLEAN,
fill3(3:0..14): [0 .. 32768),
VirtualPage(3:15..15): BOOLEAN,
fill4(4:0..14): [0 .. 32768),
VirtualBlock(4:15..15): BOOLEAN,
fill5(5:0..14): [0 .. 32768),
RealPage(5:15..15): BOOLEAN,
fill6(6:0..14): [0 .. 32768),
nRealPage(6:15..15): BOOLEAN,
fill7(7:0..14): [0 .. 32768),
RealBlock(7:15..15): BOOLEAN,
fill8(8:0..14): [0 .. 32768),
nRealBlock(8:15..15): BOOLEAN,
fill9(9:0..14): [0 .. 32768),
CAMPageAccess(9:15..15): BOOLEAN,
fill10(10:0..14): [0 .. 32768),
nCAMPageAccess(10:15..15): BOOLEAN,
fill11(11:0..14): [0 .. 32768),
CAMBlockAccess(11:15..15): BOOLEAN,
fill12(12:0..14): [0 .. 32768),
nCAMBlockAccess(12:15..15): BOOLEAN,
fill13(13:0..14): [0 .. 32768),
ShiftDataToPCAM(13:15..15): BOOLEAN,
fill14(14:0..14): [0 .. 32768),
MDataI(14:15..15): BOOLEAN,
fill15(15:0..14): [0 .. 32768),
ShiftDataToMCAM(15:15..15): BOOLEAN,
fill16(16:0..14): [0 .. 32768),
ShiftEqual(16:15..15): BOOLEAN,
fill17(17:0..14): [0 .. 32768),
nShiftEqual(17:15..15): BOOLEAN,
fill18(18:0..14): [0 .. 32768),
ShiftFeedBack(18:15..15): BOOLEAN,
fill19(19:0..14): [0 .. 32768),
nShiftFeedBack(19:15..15): BOOLEAN,
fill20(20:0..14): [0 .. 32768),
ShiftShift(20:15..15): BOOLEAN,
fill21(21:0..14): [0 .. 32768),
nShiftShift(21:15..15): BOOLEAN,
fill22(22:0..14): [0 .. 32768),
PageAccessToAccess(22:15..15): BOOLEAN,
fill23(23:0..14): [0 .. 32768),
BlockAccessToAccess(23:15..15): BOOLEAN,
fill24(24:0..14): [0 .. 32768),
PageVirtualToAccess(24:15..15): BOOLEAN,
fill25(25:0..14): [0 .. 32768),
BlockVirtualToAccess(25:15..15): BOOLEAN,
fill26(26:0..14): [0 .. 32768),
MatchToAccess(26:15..15): BOOLEAN,
fill27(27:0..14): [0 .. 32768),
MDataToMatch(27:15..15): BOOLEAN,
fill28(28:0..14): [0 .. 32768),
AccessToMatch(28:15..15): BOOLEAN,
fill29(29:0..14): [0 .. 32768),
PageAccessToMData(29:15..15): BOOLEAN,
fill30(30:0..14): [0 .. 32768),
nPageAccessToMData(30:15..15): BOOLEAN,
fill31(31:0..14): [0 .. 32768),
BlockAccessToMData(31:15..15): BOOLEAN,
fill32(32:0..14): [0 .. 32768),
nBlockAccessToMData(32:15..15): BOOLEAN,
fill33(33:0..14): [0 .. 32768),
AccessToPageBlockAccess(33:15..15): BOOLEAN,
fill34(34:0..14): [0 .. 32768),
nAccessToPageBlockAccess(34:15..15): BOOLEAN,
fill35(35:0..14): [0 .. 32768),
ShiftToPageBlockAccess(35:15..15): BOOLEAN,
fill36(36:0..14): [0 .. 32768),
nShiftToPageBlockAccess(36:15..15): BOOLEAN,
fill37(37:0..14): [0 .. 32768),
AccessDrive(37:15..15): BOOLEAN,
fill38(38:0..14): [0 .. 32768),
nAccessDrive(38:15..15): BOOLEAN,
fill39(39:0..14): [0 .. 32768),
PageBlockAccessToShift(39:15..15): BOOLEAN,
fill40(40:0..14): [0 .. 32768),
nPageBlockAccessToShift(40:15..15): BOOLEAN,
fill41(41:0..14): [0 .. 32768),
nCAMAccessPrecharge(41:15..15): BOOLEAN];
MCAMDriverStateRef: TYPE = REF MCAMDriverStateRec;
MCAMDriverStateRec: TYPE = RECORD [
pageAccess, pageMatch: BitDWord,
blockAccess, blockMatch: BitWord,
shiftData, nShiftData: BitDWord
];
CreateMCAMDriverIO: IOCreator = {
cell.realCellStuff.switchIO ← NEW [MCAMDriverIORec];
cell.realCellStuff.newIO ← NEW [MCAMDriverIORec];
cell.realCellStuff.oldIO ← NEW [MCAMDriverIORec];
};
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;
Assert[NOT MoreThanOneOf[ShiftFeedBack, nShiftFeedBack]];
Assert[NOT MoreThanOneOf[ShiftEqual, nShiftEqual]];
Assert[NOT MoreThanOneOf[ShiftShift, nShiftShift]];
Assert[NOT MoreThanOneOf[BlockAccessToAccess, BlockVirtualToAccess, MatchToAccess]];
Assert[NOT MoreThanOneOf[PageAccessToAccess, PageVirtualToAccess, MatchToAccess]];
Assert[NOT MoreThanOneOf[MDataToMatch, AccessToMatch]];
Assert[NOT MoreThanOneOf[PageAccessToMData, nPageAccessToMData]];
Assert[NOT MoreThanOneOf[BlockAccessToMData, nBlockAccessToMData]];
Assert[NOT MoreThanOneOf[AccessToPageBlockAccess, nAccessToPageBlockAccess]];
Assert[NOT MoreThanOneOf[ShiftToPageBlockAccess, nShiftToPageBlockAccess]];
Assert[NOT MoreThanOneOf[AccessDrive, nAccessDrive]];
Assert[NOT MoreThanOneOf[AccessToPageBlockAccess, ShiftToPageBlockAccess]];
Assert[NOT MoreThanOneOf[PageBlockAccessToShift, nPageBlockAccessToShift]];
Assert[NOT MoreThanOneOf[NOT nCAMAccessPrecharge, AccessDrive]];
Assert[NOT AccessDrive OR (AccessToPageBlockAccess OR ShiftToPageBlockAccess)];
IF MatchToAccess THEN {
pageAccess ← pageMatch;
blockAccess ← blockMatch;
};
IF MDataToMatch THEN {
pageMatch ← MDTD[MDataI, 32, 0, 24, pageMatch, 24, 0, 24];
blockMatch ← MDTW[MDataI, 32, 24, 6, blockMatch, 6, 0, 6];
};
IF PageVirtualToAccess THEN pageAccess ← VirtualPage;
IF BlockVirtualToAccess THEN blockAccess ← VirtualBlock;
TRUSTED {
cpd: SwitchMWord ← DESCRIPTOR[CAMPageAccess];
ncpd: SwitchMWord ← DESCRIPTOR[nCAMPageAccess];
cbd: SwitchMWord ← DESCRIPTOR[CAMBlockAccess];
ncbd: SwitchMWord ← DESCRIPTOR[nCAMBlockAccess];
s: SwitchTypes.Strength ← IF AccessDrive THEN driveStrong ELSE none;
pData: BitDWord;
bData: BitWord;
IF PageAccessToAccess THEN pageAccess ← CSTD[cpd, 24, 0, 24, pageAccess, 24, 0, 24];
IF BlockAccessToAccess THEN blockAccess ← CSTW[cbd, 6, 0, 6, blockAccess, 6, 0, 6];
IF AccessToPageBlockAccess THEN {
pData ← pageAccess;
bData ← blockAccess;
}
ELSE { -- assume that ShiftToPageBlockAccess is asserted
pData ← MDTD[shiftData, 30, 0, 24, pData, 24, 0, 24];
bData ← MDTW[shiftData, 30, 24, 6, bData, 6, 0, 6];
};
SCDTS[pData, 24, 0, 24, cpd, 24, 0, 24, [[s, L], [s, H]]];
SCDTS[pData, 24, 0, 24, ncpd, 24, 0, 24, [[s, H], [s, L]]];
SCWTS[bData, 6, 0, 6, cbd, 6, 0, 6, [[s, L], [s, H]]];
SCWTS[bData, 6, 0, 6, ncbd, 6, 0, 6, [[s, H], [s, L]]];
IF PageBlockAccessToShift THEN {
sData: BitDWord ← CSTD[cpd, 24, 0, 24, BitDWordZero, 30, 0, 24];
sData ← CSTD[cbd, 6, 0, 6, sData, 30, 24, 6];
nShiftData ← DNOT[sData, 30];
};
IF NOT nCAMAccessPrecharge 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, 6, 0, 6, cbd, 6, 0, 6, [[none, X], [drive, H]]];
SCWTS[BitWordOnes, 6, 0, 6, ncbd, 6, 0, 6, [[none, X], [drive, H]]];
};
};
IF PageAccessToMData THEN MDataI ← MDTD[pageAccess, 24, 0, 24, MDataI, 32, 0, 24];
IF BlockAccessToMData THEN MDataI ← MWTD[blockAccess, 6, 0, 6, MDataI, 32, 24, 6];
IF AccessToMatch THEN {
pageMatch ← pageAccess;
blockMatch ← blockAccess;
};
RealPage ← pageMatch;
nRealPage ← DNOT[pageMatch, 24];
RealBlock ← blockMatch;
nRealBlock ← WNOT[blockMatch, 6];
IF ShiftShift THEN {
nShiftData ← MDTD[DNOT[shiftData, 30], 30, 1, 29, nShiftData, 30, 0, 29];
nShiftData ← IBID[NOT ShiftDataToMCAM, nShiftData, 30, 29];
};
IF ShiftFeedBack THEN {
nShiftData ← MDTD[DNOT[shiftData, 30], 30, 0, 30, nShiftData, 30, 0, 30];
};
IF ShiftEqual THEN {
shiftData ← MDTD[DNOT[nShiftData, 30], 30, 0, 30, shiftData, 30, 0, 30];
ShiftDataToPCAM ← EBFD[shiftData, 30, 0];
};
END;
END;
MCAMDriverPorts: Ports ← NEW [PortsRep[42]];
RegisterCells[];
END.