diff options
Diffstat (limited to 'src/cpu/simple/base.cc')
-rw-r--r-- | src/cpu/simple/base.cc | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index e56dc0fbb..97ce3264a 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -41,7 +41,11 @@ */ #include "arch/faults.hh" +#include "arch/kernel_stats.hh" +#include "arch/stacktrace.hh" +#include "arch/tlb.hh" #include "arch/utility.hh" +#include "arch/vtophys.hh" #include "base/loader/symtab.hh" #include "base/cp_annotate.hh" #include "base/cprintf.hh" @@ -64,25 +68,18 @@ #include "debug/Decode.hh" #include "debug/Fetch.hh" #include "debug/Quiesce.hh" +#include "mem/mem_object.hh" #include "mem/packet.hh" #include "mem/request.hh" #include "params/BaseSimpleCPU.hh" #include "sim/byteswap.hh" #include "sim/debug.hh" +#include "sim/full_system.hh" #include "sim/sim_events.hh" #include "sim/sim_object.hh" #include "sim/stats.hh" #include "sim/system.hh" -#if FULL_SYSTEM -#include "arch/kernel_stats.hh" -#include "arch/stacktrace.hh" -#include "arch/tlb.hh" -#include "arch/vtophys.hh" -#else // !FULL_SYSTEM -#include "mem/mem_object.hh" -#endif // FULL_SYSTEM - #if USE_CHECKER #include "cpu/checker/cpu.hh" #include "cpu/checker/thread_context.hh" @@ -94,12 +91,11 @@ using namespace TheISA; BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p) : BaseCPU(p), traceData(NULL), thread(NULL), predecoder(NULL) { -#if FULL_SYSTEM - thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb); -#else - thread = new SimpleThread(this, /* thread_num */ 0, p->workload[0], - p->itb, p->dtb); -#endif // !FULL_SYSTEM + if (FullSystem) + thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb); + else + thread = new SimpleThread(this, /* thread_num */ 0, p->workload[0], + p->itb, p->dtb); thread->setStatus(ThreadContext::Halted); @@ -109,9 +105,7 @@ BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p) if (p->checker) { BaseCPU *temp_checker = p->checker; checker = dynamic_cast<CheckerCPU *>(temp_checker); -#if FULL_SYSTEM checker->setSystem(p->system); -#endif // Manipulate thread context ThreadContext *cpu_tc = tc; tc = new CheckerThreadContext<ThreadContext>(cpu_tc, this->checker); @@ -311,15 +305,12 @@ change_thread_state(ThreadID tid, int activate, int priority) { } -#if FULL_SYSTEM Addr BaseSimpleCPU::dbg_vtophys(Addr addr) { return vtophys(tc, addr); } -#endif // FULL_SYSTEM -#if FULL_SYSTEM void BaseSimpleCPU::wakeup() { @@ -329,12 +320,10 @@ BaseSimpleCPU::wakeup() DPRINTF(Quiesce,"Suspended Processor awoke\n"); thread->activate(); } -#endif // FULL_SYSTEM void BaseSimpleCPU::checkForInterrupts() { -#if FULL_SYSTEM if (checkInterrupts(tc)) { Fault interrupt = interrupts->getInterrupt(tc); @@ -345,7 +334,6 @@ BaseSimpleCPU::checkForInterrupts() predecoder.reset(); } } -#endif } @@ -443,15 +431,13 @@ BaseSimpleCPU::postExecute() TheISA::PCState pc = tc->pcState(); Addr instAddr = pc.instAddr(); -#if FULL_SYSTEM - if (thread->profile) { + if (FullSystem && thread->profile) { bool usermode = TheISA::inUserMode(tc); thread->profilePC = usermode ? 1 : instAddr; ProfileNode *node = thread->profile->consume(tc, curStaticInst); if (node) thread->profileNode = node; } -#endif if (curStaticInst->isMemRef()) { numMemRefs++; @@ -499,7 +485,8 @@ BaseSimpleCPU::postExecute() } /* End power model statistics */ - traceFunctions(instAddr); + if (FullSystem) + traceFunctions(instAddr); if (traceData) { traceData->dump(); |