Instruction TLB: a two-entry instruction TLB.s
Joint TLB: upon TLB miss, software will refill the JTLB from a page table resident in memory. This JTLB contains both data and instruction jointly. JTLB entry to be rewritten is selected at random.
TLBEntryLo: describes the format of the EntryLo 0 & 1 CP0 register in MIPS, and also the two low records of each TLB entry.
Bits: 2 + 28 + 3 + x = 34-36 bits
Elements:
cache algorithm, dirty bit, valid bit, global bit.
// file: cheri/trunk/MIPS.bsv
// The TlbEntryLo type describes the format of the EntryLo 0 & 1 CP0 register in MIPS, and also the two low records
// of each TLB entry
typedef struct {
`ifdef USECAP
Bool noCapStore; // Allow storing capabilities
Bool noCapLoad; // Allow loading capabilities
`endif
//Bit#(28) zeros;
Bit#(28) pfn; // Physical address of the page.
CacheCA c; // Cache algorithm or cache coherency attribute for multi-processor systems.
Bool d; // Dirty - True if writes are allowed. Writes will cause exception otherwise.
Bool v; // Valid - If False, attempts to use this location cause an exception.
Bool g; // Global - If True this entry will match regardless of ASID. Both "Lo(G)"s in an odd/even pair should be identical.
} TlbEntryLo deriving(Bits, Eq, FShow); // 34-36 bits
// TLB.bsv
typedef struct {
Bool valid;
Bit#(5) whichLoBit; // Bit to check for which EntryLo to use, the MSB of the page mask.
Bit#(1) oddPage; // Which page is cached.
Bool global;
Bit#(12) pageMask;
TlbEntryHi entryHi;
TlbEntryLo entryLo;
} CachedTLBEntry deriving (Bits, Eq);
module mkTLB#(Bit#(16) coreId)(TLBIfc ifc);
TLBIfc
interface TLBIfc;
interface Server#(TLBEntryT, TLBEntryT) readWrite;
interface Vector#(NumTLBLookups, TranslationIfc) lookup;
method Action debugDump;
method Action putConfig(Bit#(LogAssosTLBSize) tlbRandom, Bool largeTlb, Bit#(8) entryHiAsid);
endinterface
3? lookups interfaces, each have its request(reqIn)
and response()
method.
lookups1 is used for lookup instruction in tlb;
lookups2 is used for lookup data in tlb;
startTLB(tlbState == Serving);
initialize
doRead(tlbState == DoRead);
readWrite_fifo.first
entryLo0
and entryLo1
readOut_fifo.enq(tlbAddr)
doWrite(tlbState == DoWrite);
readWrite_fifo.first
oldEnt
. set tlbState <= WriteVictim
entryLo0
and entryLo1
writeVictimOut(tlbState == WriteVictim);
randomIndex
???readTLB(tlbState == Serving);
i = 1, 2, …, < NumTLBLookups
canPut = (req_fifo[i].notFull);
guarded by canPut
. CPU will wait until the req_fifo
has space to insert new request.
Steps:
last_hit[i][ti]
startTLB
will consume the req_fifos[i]guarded by if (rsp_fifos[i].notEmpty)
. CPU will wait here until there is a response.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?