From 9f07d2ce7ecf435b9a1946f15fb3491bb4636637 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 24 Feb 2012 11:42:00 -0500 Subject: CPU: Round-two unifying instr/data CPU ports across models This patch continues the unification of how the different CPU models create and share their instruction and data ports. Most importantly, it forces every CPU to have an instruction and a data port, and gives these ports explicit getters in the BaseCPU (getDataPort and getInstPort). The patch helps in simplifying the code, make assumptions more explicit, andfurther ease future patches related to the CPU ports. The biggest changes are in the in-order model (that was not modified in the previous unification patch), which now moves the ports from the CacheUnit to the CPU. It also distinguishes the instruction fetch and load-store unit from the rest of the resources, and avoids the use of indices and casting in favour of keeping track of these two units explicitly (since they are always there anyways). The atomic, timing and O3 model simply return references to their already existing ports. --- src/cpu/o3/fetch_impl.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 3dca6e8ba..1271ea481 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -335,10 +335,10 @@ template void DefaultFetch::setIcache() { - assert(cpu->getIcachePort()->isConnected()); + assert(cpu->getInstPort().isConnected()); // Size of cache block. - cacheBlkSize = cpu->getIcachePort()->peerBlockSize(); + cacheBlkSize = cpu->getInstPort().peerBlockSize(); // Create mask to get rid of offset bits. cacheBlkMask = (cacheBlkSize - 1); @@ -623,7 +623,7 @@ DefaultFetch::finishTranslation(Fault fault, RequestPtr mem_req) fetchedCacheLines++; // Access the cache. - if (!cpu->getIcachePort()->sendTiming(data_pkt)) { + if (!cpu->getInstPort().sendTiming(data_pkt)) { assert(retryPkt == NULL); assert(retryTid == InvalidThreadID); DPRINTF(Fetch, "[tid:%i] Out of MSHRs!\n", tid); @@ -1358,7 +1358,7 @@ DefaultFetch::recvRetry() assert(retryTid != InvalidThreadID); assert(fetchStatus[retryTid] == IcacheWaitRetry); - if (cpu->getIcachePort()->sendTiming(retryPkt)) { + if (cpu->getInstPort().sendTiming(retryPkt)) { fetchStatus[retryTid] = IcacheWaitResponse; retryPkt = NULL; retryTid = InvalidThreadID; -- cgit v1.2.3