From 090496bf2d4c0f55f7f5869a374b4ec3826bccbc Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Mon, 5 Jun 2006 18:14:39 -0400 Subject: Fixes to get new CPU model working for simple test case. The CPU does not yet support retrying accesses. src/cpu/base_dyn_inst.cc: Delete the allocated data in destructor. src/cpu/base_dyn_inst.hh: Only copy the addresses if the translation succeeded. src/cpu/o3/alpha_cpu.hh: Return actual translating port. Don't panic on setNextNPC() as it's always called, regardless of the architecture, when the process initializes. src/cpu/o3/alpha_cpu_impl.hh: Pass in memobject to the thread state in SE mode. src/cpu/o3/commit_impl.hh: Initialize all variables. src/cpu/o3/decode_impl.hh: Handle early resolution of branches properly. src/cpu/o3/fetch.hh: Switch structure back to requests. src/cpu/o3/fetch_impl.hh: Initialize all variables, create/delete requests properly. src/cpu/o3/lsq_unit.hh: Include sender state along with the packet. Also include a more generic writeback event that's only used for stores forwarding data to loads. src/cpu/o3/lsq_unit_impl.hh: Redo writeback code to support the response path of the memory system. src/cpu/o3/mem_dep_unit.cc: src/cpu/o3/mem_dep_unit_impl.hh: Wrap variables in #ifdefs. src/cpu/o3/store_set.cc: Include to get panic() function. src/cpu/o3/thread_state.hh: Create with MemObject as well. src/cpu/thread_state.hh: Have a translating port in the thread state object. src/python/m5/objects/AlphaFullCPU.py: Mem parameter no longer needed. --HG-- extra : convert_revision : a99381fb25cb183322882ce20935a6f3d1f2b64d --- src/cpu/o3/fetch_impl.hh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/cpu/o3/fetch_impl.hh') diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 69c43a6a2..84f2c3b7e 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -105,7 +105,8 @@ DefaultFetch::IcachePort::recvRetry() template DefaultFetch::DefaultFetch(Params *params) - : branchPred(params), + : mem(params->mem), + branchPred(params), decodeToFetchDelay(params->decodeToFetchDelay), renameToFetchDelay(params->renameToFetchDelay), iewToFetchDelay(params->iewToFetchDelay), @@ -113,7 +114,8 @@ DefaultFetch::DefaultFetch(Params *params) fetchWidth(params->fetchWidth), numThreads(params->numberOfThreads), numFetchingThreads(params->smtNumFetchingThreads), - interruptPending(false) + interruptPending(false), + switchedOut(false) { if (numThreads > Impl::MaxThreads) fatal("numThreads is not a valid value\n"); @@ -161,7 +163,7 @@ DefaultFetch::DefaultFetch(Params *params) priorityList.push_back(tid); - memPkt[tid] = NULL; + memReq[tid] = NULL; // Create space to store a cache line. cacheData[tid] = new uint8_t[cacheBlkSize]; @@ -283,6 +285,10 @@ DefaultFetch::setCPU(FullCPU *cpu_ptr) // Name is finally available, so create the port. icachePort = new IcachePort(this); + Port *mem_dport = mem->getPort(""); + icachePort->setPeer(mem_dport); + mem_dport->setPeer(icachePort); + // Fetch needs to start fetching instructions at the very beginning, // so it must start up in active state. switchToActive(); @@ -355,10 +361,12 @@ DefaultFetch::processCacheCompletion(PacketPtr pkt) // Only change the status if it's still waiting on the icache access // to return. if (fetchStatus[tid] != IcacheWaitResponse || - pkt != memPkt[tid] || + pkt->req != memReq[tid] || isSwitchedOut()) { ++fetchIcacheSquashes; + delete pkt->req; delete pkt; + memReq[tid] = NULL; return; } @@ -383,7 +391,7 @@ DefaultFetch::processCacheCompletion(PacketPtr pkt) // Reset the mem req to NULL. delete pkt->req; delete pkt; - memPkt[tid] = NULL; + memReq[tid] = NULL; } template @@ -514,7 +522,7 @@ DefaultFetch::fetchCacheLine(Addr fetch_PC, Fault &ret_fault, unsigned tid RequestPtr mem_req = new Request(tid, fetch_PC, cacheBlkSize, flags, fetch_PC, cpu->readCpuId(), tid); - memPkt[tid] = NULL; + memReq[tid] = mem_req; // Translate the instruction request. //#if FULL_SYSTEM @@ -565,6 +573,9 @@ DefaultFetch::fetchCacheLine(Addr fetch_PC, Fault &ret_fault, unsigned tid "response.\n", tid); fetchStatus[tid] = IcacheWaitResponse; + } else { + delete mem_req; + memReq[tid] = NULL; } ret_fault = fault; @@ -585,8 +596,9 @@ DefaultFetch::doSquash(const Addr &new_PC, unsigned tid) if (fetchStatus[tid] == IcacheWaitResponse) { DPRINTF(Fetch, "[tid:%i]: Squashing outstanding Icache miss.\n", tid); - delete memPkt[tid]; - memPkt[tid] = NULL; + // Should I delete this here or when it comes back from the cache? +// delete memReq[tid]; + memReq[tid] = NULL; } fetchStatus[tid] = Squashing; @@ -1083,7 +1095,7 @@ DefaultFetch::fetch(bool &status_change) warn("%lli fault (%d) detected @ PC %08p", curTick, fault, PC[tid]); #else // !FULL_SYSTEM - fatal("fault (%d) detected @ PC %08p", fault, PC[tid]); + warn("%lli fault (%d) detected @ PC %08p", curTick, fault, PC[tid]); #endif // FULL_SYSTEM } } -- cgit v1.2.3