--CacheMCtlEntryCtl.Mesa
--created by RoseTranslate from CacheMCtlEntryCtl.Rose of May 30, 1984 4:26:18 pm PDT for Barth.pa at May 30, 1984 4:28:54 pm PDT
DIRECTORY
RoseTypes, RoseCreate, BitOps, Dragon;
CacheMCtlEntryCtl: CEDAR PROGRAM
IMPORTS RoseCreate, BitOps, Dragon =
BEGIN OPEN
RoseTypes, BitOps, Dragon;
--Signal Type decls
GetAddressCommands: TYPE = {VictimReal, RefRealMap, RefRealAssemble, RefVirtual};
RegisterCells: PROC =
BEGIN
CreateMCtlEntryCtlPorts[];
[] ← RoseCreate.RegisterCellClass[className: "MCtlEntryCtl",
expandProc: NIL,
ioCreator: CreateMCtlEntryCtlIO, initializer: InitializeMCtlEntryCtl,
evals: [EvalSimple: MCtlEntryCtlEvalSimple],
blackBox: NIL, stateToo: NIL,
ports: MCtlEntryCtlPorts,
drivePrototype: NEW [MCtlEntryCtlDrive]];
END;
CreateMCtlEntryCtlPorts: PROC = {MCtlEntryCtlPorts ← RoseCreate.PortsFromFile["CacheMCtlEntryCtl.MCtlEntryCtl.rosePorts"]};
MCtlEntryCtlIORef: TYPE = REF MCtlEntryCtlIORec;
MCtlEntryCtlIORec: 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,
fill3(3:0..14): [0..32767],
PhAb(3:15..15): BOOLEAN,
fill4(4:0..14): [0..32767],
PhBb(4:15..15): BOOLEAN,
fill5(5:0..14): [0..32767],
PhAh(5:15..15): BOOLEAN,
fill6(6:0..14): [0..32767],
PhBh(6:15..15): BOOLEAN,
fill7(7:0..14): [0..32767],
Resetb(7:15..15): BOOLEAN,
fill8(8:0..7): [0..255],
CellAdr(8:8..15): [0..255],
fill9(9:0..7): [0..255],
nCellAdr(9:8..15): [0..255],
fill10(10:0..14): [0..32767],
VirtualAccess(10:15..15): BOOLEAN,
fill11(11:0..14): [0..32767],
nVirtualAccess(11:15..15): BOOLEAN,
fill12(12:0..14): [0..32767],
SelCell(12:15..15): BOOLEAN,
fill13(13:0..14): [0..32767],
SelVictimAdr(13:15..15): BOOLEAN,
fill14(14:0..14): [0..32767],
SelMapAdr(14:15..15): BOOLEAN,
fill15(15:0..14): [0..32767],
SelRealData(15:15..15): BOOLEAN,
fill16(16:0..14): [0..32767],
SelPageFlag(16:15..15): BOOLEAN,
fill17(17:0..14): [0..32767],
SelVictimData(17:15..15): BOOLEAN,
fill18(18:0..14): [0..32767],
SelRealAdr(18:15..15): BOOLEAN,
fill19(19:0..14): [0..32767],
FinishSharedStore(19:15..15): BOOLEAN,
fill20(20:0..14): [0..32767],
MAdrLow(20:15..15): BOOLEAN,
fill21(21:0..14): [0..32767],
nMAdrLow(21:15..15): BOOLEAN,
fill22(22:0..14): [0..32767],
VictimFeedback(22:15..15): BOOLEAN,
fill23(23:0..14): [0..32767],
nVictimFeedback(23:15..15): BOOLEAN,
fill24(24:0..14): [0..32767],
ShiftVictim(24:15..15): BOOLEAN,
fill25(25:0..14): [0..32767],
nShiftVictim(25:15..15): BOOLEAN,
fill26(26:0..14): [0..32767],
ForceDataSelect(26:15..15): BOOLEAN,
fill27(27:0..14): [0..32767],
PAdrHigh(27:15..15): BOOLEAN,
fill28(28:0..14): [0..32767],
PAdrLowToM(28:15..15): BOOLEAN,
fill29(29:0..14): [0..32767],
DoExecuteBA(29:15..15): BOOLEAN,
fill30(30:0..14): [0..32767],
DoHoldBA(30:15..15): BOOLEAN,
MDataI(31:0..31): ARRAY [0..2) OF CARDINAL,
fill32(33:0..14): [0..32767],
ShiftFeedBack(33:15..15): BOOLEAN,
fill33(34:0..14): [0..32767],
nShiftFeedBack(34:15..15): BOOLEAN,
fill34(35:0..14): [0..32767],
ShiftEqual(35:15..15): BOOLEAN,
fill35(36:0..14): [0..32767],
nShiftEqual(36:15..15): BOOLEAN,
fill36(37:0..14): [0..32767],
ShiftShift(37:15..15): BOOLEAN,
fill37(38:0..14): [0..32767],
nShiftShift(38:15..15): BOOLEAN,
fill38(39:0..14): [0..32767],
ShiftDataToEntryCtl(39:15..15): BOOLEAN,
fill39(40:0..14): [0..32767],
ShiftDataToCAMCtl(40:15..15): BOOLEAN,
fill40(41:0..14): [0..32767],
ReadEntry(41:15..15): BOOLEAN,
fill41(42:0..14): [0..32767],
WriteEntry(42:15..15): BOOLEAN,
fill42(43:0..14): [0..32767],
ShiftExecute(43:15..15): BOOLEAN,
fill43(44:0..14): [0..32767],
nShiftExecute(44:15..15): BOOLEAN,
fill44(45:0..14): [0..32767],
EntryMDataIToMAdrCtr(45:15..15): BOOLEAN,
fill45(46:0..14): [0..32767],
EntryGetAddress(46:15..15): BOOLEAN,
fill46(47:0..14): [0..32767],
EntryGetAdrRefresh(47:15..15): BOOLEAN,
fill47(48:0..14): [0..32767],
EntryRefresh(48:15..15): BOOLEAN,
fill48(49:0..14): [0..32767],
EntryMAdrCtrToMAdr(49:15..15): BOOLEAN,
fill49(50:0..14): [0..32767],
EntryIncMAdrCtr(50:15..15): BOOLEAN,
fill50(51:0..14): [0..32767],
EntryZeroMAdrCtr(51:15..15): BOOLEAN,
fill51(52:0..14): [0..32767],
EntryPAdrToMAdrCtr(52:15..15): BOOLEAN,
fill52(53:0..14): [0..32767],
EntryLowBitsAccessToMDataI(53:15..15): BOOLEAN,
fill53(54:0..14): [0..32767],
EntryLowBitsZeroToMDataI(54:15..15): BOOLEAN,
fill54(55:0..14): [0..32767],
EntrySelRealData(55:15..15): BOOLEAN,
fill55(56:0..14): [0..32767],
EntrySelPageFlag(56:15..15): BOOLEAN,
fill56(57:0..14): [0..32767],
EntrySelVictimData(57:15..15): BOOLEAN,
fill57(58:0..14): [0..32767],
EntrySelectVictimOrOrphan(58:15..15): BOOLEAN,
fill58(59:0..14): [0..32767],
EntryVirtualAccess(59:15..15): BOOLEAN,
fill59(60:0..14): [0..32767],
EntrynVirtualAccess(60:15..15): BOOLEAN,
fill60(61:0..14): [0..32767],
EntryShiftVictim(61:15..15): BOOLEAN,
fill61(62:0..14): [0..32767],
EntryFinishSharedStore(62:15..15): BOOLEAN,
fill62(63:0..13): [0..16383],
GetAdrCmdBA(63:14..15): GetAddressCommands,
fill63(64:0..14): [0..32767],
GetAddressDoneBA(64:15..15): BOOLEAN,
fill64(65:0..14): [0..32767],
MAdrHigh(65:15..15): BOOLEAN,
fill65(66:0..14): [0..32767],
IsNoOpBA(66:15..15): BOOLEAN,
fill66(67:0..14): [0..32767],
MatchRealBA(67:15..15): BOOLEAN];
MCtlEntryCtlDrive: 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),
PhAb(3:15..15): BOOLEAN,
fill4(4:0..14): [0 .. 32768),
PhBb(4:15..15): BOOLEAN,
fill5(5:0..14): [0 .. 32768),
PhAh(5:15..15): BOOLEAN,
fill6(6:0..14): [0 .. 32768),
PhBh(6:15..15): BOOLEAN,
fill7(7:0..14): [0 .. 32768),
Resetb(7:15..15): BOOLEAN,
fill8(8:0..14): [0 .. 32768),
CellAdr(8:15..15): BOOLEAN,
fill9(9:0..14): [0 .. 32768),
nCellAdr(9:15..15): BOOLEAN,
fill10(10:0..14): [0 .. 32768),
VirtualAccess(10:15..15): BOOLEAN,
fill11(11:0..14): [0 .. 32768),
nVirtualAccess(11:15..15): BOOLEAN,
fill12(12:0..14): [0 .. 32768),
SelCell(12:15..15): BOOLEAN,
fill13(13:0..14): [0 .. 32768),
SelVictimAdr(13:15..15): BOOLEAN,
fill14(14:0..14): [0 .. 32768),
SelMapAdr(14:15..15): BOOLEAN,
fill15(15:0..14): [0 .. 32768),
SelRealData(15:15..15): BOOLEAN,
fill16(16:0..14): [0 .. 32768),
SelPageFlag(16:15..15): BOOLEAN,
fill17(17:0..14): [0 .. 32768),
SelVictimData(17:15..15): BOOLEAN,
fill18(18:0..14): [0 .. 32768),
SelRealAdr(18:15..15): BOOLEAN,
fill19(19:0..14): [0 .. 32768),
FinishSharedStore(19:15..15): BOOLEAN,
fill20(20:0..14): [0 .. 32768),
MAdrLow(20:15..15): BOOLEAN,
fill21(21:0..14): [0 .. 32768),
nMAdrLow(21:15..15): BOOLEAN,
fill22(22:0..14): [0 .. 32768),
VictimFeedback(22:15..15): BOOLEAN,
fill23(23:0..14): [0 .. 32768),
nVictimFeedback(23:15..15): BOOLEAN,
fill24(24:0..14): [0 .. 32768),
ShiftVictim(24:15..15): BOOLEAN,
fill25(25:0..14): [0 .. 32768),
nShiftVictim(25:15..15): BOOLEAN,
fill26(26:0..14): [0 .. 32768),
ForceDataSelect(26:15..15): BOOLEAN,
fill27(27:0..14): [0 .. 32768),
PAdrHigh(27:15..15): BOOLEAN,
fill28(28:0..14): [0 .. 32768),
PAdrLowToM(28:15..15): BOOLEAN,
fill29(29:0..14): [0 .. 32768),
DoExecuteBA(29:15..15): BOOLEAN,
fill30(30:0..14): [0 .. 32768),
DoHoldBA(30:15..15): BOOLEAN,
fill31(31:0..14): [0 .. 32768),
MDataI(31:15..15): BOOLEAN,
fill32(32:0..14): [0 .. 32768),
ShiftFeedBack(32:15..15): BOOLEAN,
fill33(33:0..14): [0 .. 32768),
nShiftFeedBack(33:15..15): BOOLEAN,
fill34(34:0..14): [0 .. 32768),
ShiftEqual(34:15..15): BOOLEAN,
fill35(35:0..14): [0 .. 32768),
nShiftEqual(35:15..15): BOOLEAN,
fill36(36:0..14): [0 .. 32768),
ShiftShift(36:15..15): BOOLEAN,
fill37(37:0..14): [0 .. 32768),
nShiftShift(37:15..15): BOOLEAN,
fill38(38:0..14): [0 .. 32768),
ShiftDataToEntryCtl(38:15..15): BOOLEAN,
fill39(39:0..14): [0 .. 32768),
ShiftDataToCAMCtl(39:15..15): BOOLEAN,
fill40(40:0..14): [0 .. 32768),
ReadEntry(40:15..15): BOOLEAN,
fill41(41:0..14): [0 .. 32768),
WriteEntry(41:15..15): BOOLEAN,
fill42(42:0..14): [0 .. 32768),
ShiftExecute(42:15..15): BOOLEAN,
fill43(43:0..14): [0 .. 32768),
nShiftExecute(43:15..15): BOOLEAN,
fill44(44:0..14): [0 .. 32768),
EntryMDataIToMAdrCtr(44:15..15): BOOLEAN,
fill45(45:0..14): [0 .. 32768),
EntryGetAddress(45:15..15): BOOLEAN,
fill46(46:0..14): [0 .. 32768),
EntryGetAdrRefresh(46:15..15): BOOLEAN,
fill47(47:0..14): [0 .. 32768),
EntryRefresh(47:15..15): BOOLEAN,
fill48(48:0..14): [0 .. 32768),
EntryMAdrCtrToMAdr(48:15..15): BOOLEAN,
fill49(49:0..14): [0 .. 32768),
EntryIncMAdrCtr(49:15..15): BOOLEAN,
fill50(50:0..14): [0 .. 32768),
EntryZeroMAdrCtr(50:15..15): BOOLEAN,
fill51(51:0..14): [0 .. 32768),
EntryPAdrToMAdrCtr(51:15..15): BOOLEAN,
fill52(52:0..14): [0 .. 32768),
EntryLowBitsAccessToMDataI(52:15..15): BOOLEAN,
fill53(53:0..14): [0 .. 32768),
EntryLowBitsZeroToMDataI(53:15..15): BOOLEAN,
fill54(54:0..14): [0 .. 32768),
EntrySelRealData(54:15..15): BOOLEAN,
fill55(55:0..14): [0 .. 32768),
EntrySelPageFlag(55:15..15): BOOLEAN,
fill56(56:0..14): [0 .. 32768),
EntrySelVictimData(56:15..15): BOOLEAN,
fill57(57:0..14): [0 .. 32768),
EntrySelectVictimOrOrphan(57:15..15): BOOLEAN,
fill58(58:0..14): [0 .. 32768),
EntryVirtualAccess(58:15..15): BOOLEAN,
fill59(59:0..14): [0 .. 32768),
EntrynVirtualAccess(59:15..15): BOOLEAN,
fill60(60:0..14): [0 .. 32768),
EntryShiftVictim(60:15..15): BOOLEAN,
fill61(61:0..14): [0 .. 32768),
EntryFinishSharedStore(61:15..15): BOOLEAN,
fill62(62:0..14): [0 .. 32768),
GetAdrCmdBA(62:15..15): BOOLEAN,
fill63(63:0..14): [0 .. 32768),
GetAddressDoneBA(63:15..15): BOOLEAN,
fill64(64:0..14): [0 .. 32768),
MAdrHigh(64:15..15): BOOLEAN,
fill65(65:0..14): [0 .. 32768),
IsNoOpBA(65:15..15): BOOLEAN,
fill66(66:0..14): [0 .. 32768),
MatchRealBA(66:15..15): BOOLEAN];
MCtlEntryCtlStateRef: TYPE = REF MCtlEntryCtlStateRec;
MCtlEntryCtlStateRec: TYPE = RECORD [
mAdrCtrA, mAdrCtrB: CARDINAL, -- static on both clocks though!
requireCountA, requireCountB: CARDINAL,
refreshCountA, refreshCountB: CARDINAL,
sMAdrLow, snMAdrLow, sMAdrHigh, snMAdrHigh: BOOL,
sCellAdr, snCellAdr: BitWord,
sReadEntry, snReadEntry, sWriteEntry, snWriteEntry: BOOL,
addressCycle, refreshCycle: BOOL
];
CreateMCtlEntryCtlIO: IOCreator = {
cell.realCellStuff.newIO ← NEW [MCtlEntryCtlIORec];
cell.realCellStuff.oldIO ← NEW [MCtlEntryCtlIORec];
};
InitializeMCtlEntryCtl: Initializer = {
IF leafily THEN
BEGIN
state: MCtlEntryCtlStateRef ← NEW [MCtlEntryCtlStateRec];
cell.realCellStuff.state ← state;
END;
};
MCtlEntryCtlEvalSimple: CellProc =
BEGIN
newIO: MCtlEntryCtlIORef ← NARROW[cell.realCellStuff.newIO];
state: MCtlEntryCtlStateRef ← NARROW[cell.realCellStuff.state];
BEGIN OPEN newIO, state;
Assert[NOT MoreThanOneOf[EntryIncMAdrCtr, EntryZeroMAdrCtr, EntryPAdrToMAdrCtr]];
Assert[NOT MoreThanOneOf[ShiftFeedBack, nShiftFeedBack]];
Assert[NOT MoreThanOneOf[ShiftEqual, nShiftEqual]];
Assert[NOT MoreThanOneOf[ShiftShift, nShiftShift]];
IF PhAh THEN {
refreshCountA ← refreshCountB;
requireCountA ← requireCountB;
};
IF PhBh THEN {
refreshCycle ← EntryRefresh OR (EntryGetAdrRefresh AND (requireCountA=31 OR IsNoOpBA));
addressCycle ← EntryGetAddress OR (EntryGetAdrRefresh AND NOT refreshCycle);-- this could be made better so that GetAddress cycles that do not require the select lines to the cells also cause refresh.
IF refreshCycle THEN {
requireCountB ← 0;
refreshCountB ← (refreshCountA+1) MOD 512;
}
ELSE {
IF requireCountA<31 THEN requireCountB ← (requireCountA+1) MOD 32;
refreshCountB ← refreshCountA;
};
};
IF PhAh THEN mAdrCtrA ← IF EntryMDataIToMAdrCtr THEN ECFD[MDataI, 32, 30, 2] ELSE mAdrCtrB;
IF EntryIncMAdrCtr THEN mAdrCtrB ← (mAdrCtrA + 1) MOD 4;
IF EntryZeroMAdrCtr THEN mAdrCtrB ← 0;
IF EntryPAdrToMAdrCtr THEN {
mAdrCtrB ← IBIW[PAdrLowToM, mAdrCtrB, 2, 1];
mAdrCtrB ← IBIW[PAdrHigh, mAdrCtrB, 2, 0];
};
IF PhBh AND NOT (EntryIncMAdrCtr OR EntryZeroMAdrCtr OR EntryPAdrToMAdrCtr) THEN mAdrCtrB ← mAdrCtrA; -- really should just have another bit coming out of the ROM to handle this case
MAdrLow ← SELECT TRUE FROM
EntryMAdrCtrToMAdr => EBFW[mAdrCtrB, 2, 1],
refreshCycle => EBFW[refreshCountB, 9, 8],
ENDCASE => FALSE; -- don't really care what it is
nMAdrLow ← NOT MAdrLow;
MAdrHigh ← EBFW[mAdrCtrB, 2, 0];
IF EntryLowBitsAccessToMDataI THEN {
MDataI ← IBID[PAdrHigh, MDataI, 32, 30];
MDataI ← IBID[PAdrLowToM, MDataI, 32, 31];
};
IF EntryLowBitsZeroToMDataI THEN MDataI ← ICID[0, MDataI, 32, 30, 2];
CellAdr ← IF DoExecuteBA THEN sCellAdr ELSE MWTW[refreshCountB, 9, 0, 8, 0, 8, 0, 8];
nCellAdr ← WNOT[CellAdr, 8];
IF refreshCycle THEN VirtualAccess ← EBFW[refreshCountB, 9, 8];
IF EntryVirtualAccess THEN VirtualAccess ← TRUE;
IF addressCycle OR EntrynVirtualAccess THEN VirtualAccess ← FALSE;
nVirtualAccess ← NOT VirtualAccess;
ShiftVictim ← PhAh AND EntryShiftVictim;
nShiftVictim ← NOT ShiftVictim;
VictimFeedback ← PhAb AND (NOT EntryShiftVictim OR DoHoldBA);
nVictimFeedback ← NOT VictimFeedback;
ForceDataSelect ← PhAb AND Resetb;
GetAddressDoneBA ← addressCycle;
--
SelCell ← ShiftExecute OR (PhAb AND refreshCycle);
SelVictimAdr ← PhAh AND ((addressCycle AND GetAdrCmdBA=VictimReal) OR (EntrySelectVictimOrOrphan AND NOT MatchRealBA AND NOT addressCycle));
SelMapAdr ← PhAh AND addressCycle AND GetAdrCmdBA=RefRealAssemble;
SelRealData ← PhAh AND (EntrySelRealData OR (EntrySelectVictimOrOrphan AND MatchRealBA));
SelPageFlag ← PhAh AND EntrySelPageFlag;
SelVictimData ← PhAh AND (EntrySelVictimData OR (EntrySelectVictimOrOrphan AND NOT MatchRealBA));
SelRealAdr ← PhAh AND EntrySelectVictimOrOrphan AND MatchRealBA AND NOT addressCycle;
FinishSharedStore ← EntryFinishSharedStore;
IF ShiftShift THEN {
snMAdrLow ← NOT ShiftDataToEntryCtl;
snMAdrHigh ← NOT sMAdrLow;
snReadEntry ← NOT sMAdrHigh;
snWriteEntry ← NOT sReadEntry;
snCellAdr ← MWTW[WNOT[sCellAdr, 8], 8, 1, 7, snCellAdr, 8, 0, 7];
snCellAdr ← IBIW[NOT sWriteEntry, snCellAdr, 8, 7];
};
IF ShiftFeedBack THEN {
snMAdrLow ← NOT sMAdrLow;
snMAdrHigh ← NOT sMAdrHigh;
snReadEntry ← NOT sReadEntry;
snWriteEntry ← NOT sWriteEntry;
snCellAdr ← WNOT[sCellAdr, 8];
};
IF ShiftEqual THEN {
sMAdrLow ← NOT snMAdrLow;
sMAdrHigh ← NOT snMAdrHigh;
sReadEntry ← NOT snReadEntry;
sWriteEntry ← NOT snWriteEntry;
sCellAdr ← WNOT[snCellAdr, 8];
ShiftDataToCAMCtl ← EBFW[sCellAdr, 8, 0];
};
ReadEntry ← sReadEntry;
WriteEntry ← sWriteEntry;
END;
END;
MCtlEntryCtlPorts: Ports ← NEW [PortsRep[67]];
RegisterCells[];
END.