diff options
Diffstat (limited to 'src/cpu/o3')
-rw-r--r-- | src/cpu/o3/fetch.hh | 5 | ||||
-rw-r--r-- | src/cpu/o3/fetch_impl.hh | 40 | ||||
-rw-r--r-- | src/cpu/o3/lsq_unit_impl.hh | 13 |
3 files changed, 13 insertions, 45 deletions
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh index 23245d496..35f58ff74 100644 --- a/src/cpu/o3/fetch.hh +++ b/src/cpu/o3/fetch.hh @@ -216,9 +216,6 @@ class DefaultFetch /** Initialize stage. */ void startupStage(); - /** Tells the fetch stage that the Icache is set. */ - void setIcache(); - /** Handles retrying the fetch access. */ void recvRetry(); @@ -464,7 +461,7 @@ class DefaultFetch ThreadID retryTid; /** Cache block size. */ - int cacheBlkSize; + unsigned int cacheBlkSize; /** Mask to get a cache block's address. */ Addr cacheBlkMask; diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 43effa9d7..0445de921 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 ARM Limited + * Copyright (c) 2010-2013 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall @@ -81,6 +81,8 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params) fetchWidth(params->fetchWidth), retryPkt(NULL), retryTid(InvalidThreadID), + cacheBlkSize(cpu->cacheLineSize()), + cacheBlkMask(cacheBlkSize - 1), numThreads(params->numThreads), numFetchingThreads(params->smtNumFetchingThreads), finishTranslationEvent(this) @@ -126,11 +128,17 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params) instSize = sizeof(TheISA::MachInst); for (int i = 0; i < Impl::MaxThreads; i++) { - cacheData[i] = NULL; decoder[i] = new TheISA::Decoder; } branchPred = params->branchPred; + + for (ThreadID tid = 0; tid < numThreads; tid++) { + // Create space to store a cache line. + cacheData[tid] = new uint8_t[cacheBlkSize]; + cacheDataPC[tid] = 0; + cacheDataValid[tid] = false; + } } template <class Impl> @@ -336,34 +344,6 @@ DefaultFetch<Impl>::resetStage() wroteToTimeBuffer = false; _status = Inactive; - - // this CPU could still be unconnected if we are restoring from a - // checkpoint and this CPU is to be switched in, thus we can only - // do this here if the instruction port is actually connected, if - // not we have to do it as part of takeOverFrom. - if (cpu->getInstPort().isConnected()) - setIcache(); -} - -template<class Impl> -void -DefaultFetch<Impl>::setIcache() -{ - assert(cpu->getInstPort().isConnected()); - - // Size of cache block. - cacheBlkSize = cpu->getInstPort().peerBlockSize(); - - // Create mask to get rid of offset bits. - cacheBlkMask = (cacheBlkSize - 1); - - for (ThreadID tid = 0; tid < numThreads; tid++) { - // Create space to store a cache line. - if (!cacheData[tid]) - cacheData[tid] = new uint8_t[cacheBlkSize]; - cacheDataPC[tid] = 0; - cacheDataValid[tid] = false; - } } template<class Impl> diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index f0b27ba41..077af1dd7 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -1,3 +1,4 @@ + /* * Copyright (c) 2010-2012 ARM Limited * All rights reserved @@ -190,7 +191,7 @@ LSQUnit<Impl>::resetState() isLoadBlocked = false; loadBlockedHandled = false; - cacheBlockMask = 0; + cacheBlockMask = ~(cpu->cacheLineSize() - 1); } template<class Impl> @@ -419,16 +420,6 @@ LSQUnit<Impl>::checkSnoop(PacketPtr pkt) { int load_idx = loadHead; - if (!cacheBlockMask) { - assert(dcachePort); - Addr bs = dcachePort->peerBlockSize(); - - // Make sure we actually got a size - assert(bs != 0); - - cacheBlockMask = ~(bs - 1); - } - // Unlock the cpu-local monitor when the CPU sees a snoop to a locked // address. The CPU can speculatively execute a LL operation after a pending // SC operation in the pipeline and that can make the cache monitor the CPU |