diff options
Diffstat (limited to 'src/cpu/simple')
-rw-r--r-- | src/cpu/simple/atomic.cc | 19 | ||||
-rw-r--r-- | src/cpu/simple/atomic.hh | 2 | ||||
-rw-r--r-- | src/cpu/simple/timing.cc | 19 | ||||
-rw-r--r-- | src/cpu/simple/timing.hh | 2 |
4 files changed, 22 insertions, 20 deletions
diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 7255469a0..7a0778961 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -84,12 +84,6 @@ AtomicSimpleCPU::init() { BaseCPU::init(); - if (!params()->switched_out && - system->getMemoryMode() != Enums::atomic) { - fatal("The atomic CPU requires the memory system to be in " - "'atomic' mode.\n"); - } - // Initialise the ThreadContext's memory proxies tcBase()->initMemProxies(tcBase()); @@ -157,10 +151,7 @@ AtomicSimpleCPU::drainResume() return; DPRINTF(SimpleCPU, "Resume\n"); - if (system->getMemoryMode() != Enums::atomic) { - fatal("The atomic CPU requires the memory system to be in " - "'atomic' mode.\n"); - } + verifyMemoryMode(); assert(!threadContexts.empty()); if (threadContexts.size() > 1) @@ -218,6 +209,14 @@ AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU) data_write_req.setThreadContext(_cpuId, 0); // Add thread ID here too } +void +AtomicSimpleCPU::verifyMemoryMode() const +{ + if (system->getMemoryMode() != Enums::atomic) { + fatal("The atomic CPU requires the memory system to be in " + "'atomic' mode.\n"); + } +} void AtomicSimpleCPU::activateContext(ThreadID thread_num, Cycles delay) diff --git a/src/cpu/simple/atomic.hh b/src/cpu/simple/atomic.hh index 684125106..e3eafe8e0 100644 --- a/src/cpu/simple/atomic.hh +++ b/src/cpu/simple/atomic.hh @@ -164,6 +164,8 @@ class AtomicSimpleCPU : public BaseSimpleCPU void switchOut(); void takeOverFrom(BaseCPU *oldCPU); + void verifyMemoryMode() const; + virtual void activateContext(ThreadID thread_num, Cycles delay); virtual void suspendContext(ThreadID thread_num); diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index f6dc1fbf6..7423d082c 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -66,12 +66,6 @@ TimingSimpleCPU::init() { BaseCPU::init(); - if (!params()->switched_out && - system->getMemoryMode() != Enums::timing) { - fatal("The timing CPU requires the memory system to be in " - "'timing' mode.\n"); - } - // Initialise the ThreadContext's memory proxies tcBase()->initMemProxies(tcBase()); @@ -141,10 +135,7 @@ TimingSimpleCPU::drainResume() return; DPRINTF(SimpleCPU, "Resume\n"); - if (system->getMemoryMode() != Enums::timing) { - fatal("The timing CPU requires the memory system to be in " - "'timing' mode.\n"); - } + verifyMemoryMode(); assert(!threadContexts.empty()); if (threadContexts.size() > 1) @@ -197,6 +188,14 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU) previousCycle = curCycle(); } +void +TimingSimpleCPU::verifyMemoryMode() const +{ + if (system->getMemoryMode() != Enums::timing) { + fatal("The timing CPU requires the memory system to be in " + "'timing' mode.\n"); + } +} void TimingSimpleCPU::activateContext(ThreadID thread_num, Cycles delay) diff --git a/src/cpu/simple/timing.hh b/src/cpu/simple/timing.hh index af780265f..348129150 100644 --- a/src/cpu/simple/timing.hh +++ b/src/cpu/simple/timing.hh @@ -261,6 +261,8 @@ class TimingSimpleCPU : public BaseSimpleCPU void switchOut(); void takeOverFrom(BaseCPU *oldCPU); + void verifyMemoryMode() const; + virtual void activateContext(ThreadID thread_num, Cycles delay); virtual void suspendContext(ThreadID thread_num); |