Who calls this and what is the input?
Where does it go?
dCache.put(req);
, see DCache.bsvReference 1
file cheri/trunk/Memory.bsv
module mkMIPSMemory#(Bit#(16) coreId, CP0Ifc tlb)(MIPSMemory);
MIPSMemory
Server#(CoProMemAccess, CoProRegs)
// cheri/trunk/Memory.bsv
interface MIPSMemory;
interface DataMemory dataMemory;
interface InstructionMemory instructionMemory;
interface MemConfiguration configuration;
`ifdef COP1
interface Server#(CoProMemAccess, CoProReg) cop1Memory;
`endif
`ifdef MULTI
method Action invalidateICache(PhyAddress addr);
method Action invalidateDCache(PhyAddress addr);
method ActionValue#(Bool) getInvalidateDone;
interface Master#(CheriMemRequest, CheriMemResponse) dmemory;
interface Master#(CheriMemRequest, CheriMemResponse) imemory;
`else
interface Master#(CheriMemRequest, CheriMemResponse) memory; // the generic main memory interface as a client.
`endif
method Action nextWillCommit(Bool commiting);
`ifdef STATCOUNTERS
interface StatCounters statCounters;
`endif
endinterface
input
output
states
Steps:
mkConnection(iCache.memory, theMemMerge.slave[0]); mkConnection(dCache.memory, theMemMerge.slave1); mkConnection(theMemMerge.merged, l2Cache.cache); mkConnection(l2CacheMemory, tagController.cache);
called in MemoryAccess.bsv:157: m.startMem(mi.mem, addr, er.cop, er.storeData, er.memSize, er.test==LL, cap, er.id, er.epoch, er.fromDebug, storeConditional);
Interface decl:
interface DataMemory;
method Action startMem(MemOp mop, Bit#(64) addr, CacheOperation cop, SizedWord sizedData, MemSize size, Bool ll, Bool cap, InstId instId, Epoch epoch, Bool fromDebug, Bool storeConditional);
method ActionValue#(MemResponseDataT) getResponse(MIPSReg oldReg, Bool signExtend, Bit#(8) addr, MemSize size, Bool exception, Bool cacheOpResponse);
endinterface
startMem
Overview: request tlb, get tlb result, then put mem request to DCache
Condition: !dCacheDelayed
Input:
Output:
get result from TLB, (vaddr -> paddr), assign to req.tr
.
dCache.put(req);
States:
CacheRequestDataT req, contains:
TlbRequest tlbReq = TlbRequest{addr, …};
pftch, global prefetch module.
Steps: request tlb, then put request to D/ICache
check mop: Read, Write, ICacheOp, DCacheOp, None. Compose the req
accordingly.
if Read:
byteMask
(1,2,4,8) according to the requested size.req = CacheRequestDataT{cap, ..., size, byteMask, ...}
if Write:
if ICacheOp, DCacheOp:
if None: exception.
invoke TLB query:
put TLB result to dCache
: dCache.put(req);
interface DataMemory dataMemory;
method Action startMem(MemOp mop,
Bit#(64) addr,
CacheOperation cop,
SizedWord sizedData,
MemSize size,
Bool ll,
Bool cap,
InstId instId,
Epoch epoch,
Bool fromDebug,
Bool storeConditional
) if (!dCacheDelayed);
TlbRequest tlbReq = TlbRequest{
addr: alignAddress(addr,size),
write: mop==Write,
ll: ll,
fromDebug: fromDebug,
exception: None,
instId: instId
};
Overview: request tlb, get tlb result, then put request to ICache
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?