void
InOrderDynInst::initVars()
{
- req = NULL;
+ fetchMemReq = NULL;
+ dataMemReq = NULL;
+
effAddr = 0;
physEffAddr = 0;
InOrderDynInst::~InOrderDynInst()
{
- if (req) {
- delete req;
+ if (fetchMemReq != 0x0) {
+ delete fetchMemReq;
+ fetchMemReq = NULL;
+ }
+
+ if (dataMemReq != 0x0) {
+ delete dataMemReq;
+ dataMemReq = NULL;
}
if (traceData) {
/** Read Effective Address from instruction & do memory access */
Fault memAccess();
- RequestPtr memReq;
+ RequestPtr fetchMemReq;
+ RequestPtr dataMemReq;
bool memAddrReady;
break;
case CompleteFetch:
+ // @TODO: MOVE Functionality of handling fetched data into 'fetch unit'
+ // let cache-unit just be responsible for transferring data.
if (cache_req->isMemAccComplete()) {
DPRINTF(InOrderCachePort,
"[tid:%i]: Completing Fetch Access for [sn:%i]\n",
inst->traceData->setPC(inst->readPC());
}
+ delete cache_req->dataPkt;
+
cache_req->done();
} else {
DPRINTF(InOrderCachePort,
cache_pkt->cacheReq->getInst()->seqNum);
cache_pkt->cacheReq->done();
+ delete cache_pkt;
return;
}
getMemData(cache_pkt));
}
+
+ delete cache_pkt;
}
cache_req->setMemAccPending(false);
: ResourceRequest(cres, inst, stage_num, res_idx, slot_num, cmd),
pktCmd(pkt_cmd), memAccComplete(false), memAccPending(false)
{
- memReq = inst->memReq;
+ if (cmd == CacheUnit::InitiateFetch ||
+ cmd == CacheUnit::CompleteFetch ||
+ cmd == CacheUnit::Fetch) {
+ memReq = inst->fetchMemReq;
+ } else {
+ memReq = inst->dataMemReq;
+ }
reqData = new uint8_t[req_size];
retryPkt = NULL;
delete retryPkt;
}
#endif
-
- if (memReq)
- delete memReq;
}
virtual PacketDataPtr getData()
aligned_addr = inst->getMemAddr();
req_size = sizeof(TheISA::MachInst);
flags = 0;
+ inst->fetchMemReq = new Request(inst->readTid(), aligned_addr, req_size,
+ flags, inst->readPC(), res->cpu->readCpuId(), inst->readTid());
+ memReq = inst->fetchMemReq;
} else {
aligned_addr = inst->getMemAddr();;
req_size = inst->getMemAccSize();
flags = inst->getMemFlags();
- }
- if (req_size == 0 && (inst->isDataPrefetch() || inst->isInstPrefetch())) {
- req_size = 8;
- }
+ if (req_size == 0 && (inst->isDataPrefetch() || inst->isInstPrefetch())) {
+ req_size = 8;
+ }
- // @TODO: Add Vaddr & Paddr functions
- inst->memReq = new Request(inst->readTid(), aligned_addr, req_size,
+ inst->dataMemReq = new Request(inst->readTid(), aligned_addr, req_size,
flags, inst->readPC(), res->cpu->readCpuId(), inst->readTid());
-
- memReq = inst->memReq;
+ memReq = inst->dataMemReq;
+ }
}
RequestPtr memReq;