CacheDataIfc
- put() -> rule doPut() //
- getResponse() // done.
Who calls this module and what is the input?
dCache.put(req);req of type CacheRequestDataT.Where does it go?
CacheResponseDataT cr <- dCache.getResponse();Given the tlb response, how does the tagged memory being accessed? How this is connected with tag controller?
mkDCache 1
FIFOF#(CacheResponseDataT) preRsp_fifo <- mkLFIFOF;
Reg#(CacheRequestDataT) reqInWire <- mkWire;
FF#(CheriMemRequest,1) coreReq <- mkFFBypass1;
Reg#(CheriTransactionID) transactionNum <- mkReg(0);
Reg#(CacheState) state <- mkReg(Serving);
FIFOF#(CheriMemResponse) memRsps <- mkUGFIFOF();
CacheCore#(4, TSub#(Indices,1), 1) core <- mkCacheCore(cacheId,
wmb,
RespondAll,
InOrder,
DCache,
zeroExtend(memReqs.remaining()),
ff2fifof(memReqs),
memRsps
);
// cheri/trunk/MIPS.bsv
interface CacheDataIfc;
method Action put(CacheRequestDataT reqIn);
method ActionValue#(CacheResponseDataT) getResponse();
method Action invalidate(PhyAddress addr);
method ActionValue#(Bool) getInvalidateDone;
method Action nextWillCommit(Bool committing);
method L1ChCfg getConfig();
interface Master#(CheriMemRequest, CheriMemResponse) memory;
`ifdef STATCOUNTERS
interface Get#(ModuleEvents) cacheEvents;
`endif
endinterface: CacheDataIfcparse the CheriMemResponse and construct CacheResponseDataT to return.
Condition: if (putReady) // putReady is on only if coreReq preRsp_fifo not full and state==Serving, and writebacks.notFull if writeback DCache enabled.
reqInWire <= reqIn
See rule doPut
Overview: prepare a memory request in coreReq and hand it over to CacheCore core. See rule feedCore.
Data path: physical addr reqIn.tr.addr -> {CheriPhyAddr addr, CheriMemRequest mem_req, CacheResponseDataT resp} -> { coreReq.enq(mem_req), preRsp_fifo.enq(resp)}
CheriPhyAddr addr = unpack(reqIn.tr.addr), andCheriMemRequest mem_req = next_mem_req; mem_req.addr = addr;resp = {isCap, ..., data: {?,pack(addr)}, ...}check cache operation case(cop.inst), then update mem_req.operation, resp.exception , and flags state, willPutToCore.
CacheNopCachePrefetchReadWrite, StoreConditionalCacheSyncmem_req.operation defined in MemTypes.bsvput request and response struct into FIFO: coreReq.enq(mem_req); preRsp_fifo.enq(resp)
coreReq is a one size fifo contain one ele of type CheriMemRequestpreRsp_fifo is fifof# of type CacheResponseDataTincrease the transactionNum: transactionNum <= transactionNum + 1;
pick the request from fifo coreReq and put it into fifo core
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?