summaryrefslogtreecommitdiff
path: root/src/cpu/checker
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/checker')
-rw-r--r--src/cpu/checker/cpu.cc14
-rw-r--r--src/cpu/checker/cpu.hh16
-rw-r--r--src/cpu/checker/cpu_impl.hh40
-rw-r--r--src/cpu/checker/thread_context.hh14
4 files changed, 23 insertions, 61 deletions
diff --git a/src/cpu/checker/cpu.cc b/src/cpu/checker/cpu.cc
index 7c9e4f781..c905c62eb 100644
--- a/src/cpu/checker/cpu.cc
+++ b/src/cpu/checker/cpu.cc
@@ -44,6 +44,8 @@
#include <list>
#include <string>
+#include "arch/kernel_stats.hh"
+#include "arch/vtophys.hh"
#include "cpu/checker/cpu.hh"
#include "cpu/base.hh"
#include "cpu/simple_thread.hh"
@@ -52,11 +54,6 @@
#include "params/CheckerCPU.hh"
#include "sim/tlb.hh"
-#if FULL_SYSTEM
-#include "arch/kernel_stats.hh"
-#include "arch/vtophys.hh"
-#endif // FULL_SYSTEM
-
using namespace std;
using namespace TheISA;
@@ -84,16 +81,13 @@ CheckerCPU::CheckerCPU(Params *p)
warnOnlyOnLoadError = p->warnOnlyOnLoadError;
itb = p->itb;
dtb = p->dtb;
-#if FULL_SYSTEM
systemPtr = NULL;
-#else
workload = p->workload;
// XXX: This is a hack to get this to work some
thread = new SimpleThread(this, /* thread_num */ 0, workload[0], itb, dtb);
tc = thread->getTC();
threadContexts.push_back(tc);
-#endif
updateOnError = true;
}
@@ -105,7 +99,6 @@ CheckerCPU::~CheckerCPU()
void
CheckerCPU::setSystem(System *system)
{
-#if FULL_SYSTEM
systemPtr = system;
thread = new SimpleThread(this, 0, systemPtr, itb, dtb, false);
@@ -114,7 +107,6 @@ CheckerCPU::setSystem(System *system)
threadContexts.push_back(tc);
delete thread->kernelStats;
thread->kernelStats = NULL;
-#endif
}
void
@@ -320,13 +312,11 @@ CheckerCPU::writeMem(uint8_t *data, unsigned size,
return fault;
}
-#if FULL_SYSTEM
Addr
CheckerCPU::dbg_vtophys(Addr addr)
{
return vtophys(tc, addr);
}
-#endif // FULL_SYSTEM
/**
* Checks if the flags set by the Checker and Checkee match.
diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh
index 1419051a6..6f5125625 100644
--- a/src/cpu/checker/cpu.hh
+++ b/src/cpu/checker/cpu.hh
@@ -50,7 +50,6 @@
#include "arch/predecoder.hh"
#include "arch/types.hh"
#include "base/statistics.hh"
-#include "config/full_system.hh"
#include "cpu/base.hh"
#include "cpu/base_dyn_inst.hh"
#include "cpu/pc_event.hh"
@@ -61,24 +60,14 @@
#include "sim/eventq.hh"
// forward declarations
-#if FULL_SYSTEM
namespace TheISA
{
class TLB;
}
-class Processor;
-class PhysicalMemory;
-#else
-
-class Process;
-
-#endif // FULL_SYSTEM
template <class>
class BaseDynInst;
class ThreadContext;
-class MemInterface;
-class Checkpoint;
class Request;
/**
@@ -143,9 +132,7 @@ class CheckerCPU : public BaseCPU
TheISA::TLB *itb;
TheISA::TLB *dtb;
-#if FULL_SYSTEM
Addr dbg_vtophys(Addr addr);
-#endif
union Result {
uint64_t integer;
@@ -336,15 +323,12 @@ class CheckerCPU : public BaseCPU
{}
/////////////////////////////////////////////////////
-#if FULL_SYSTEM
Fault hwrei() { return thread->hwrei(); }
bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
void wakeup() { }
-#else
// Assume that the normal CPU's call to syscall was successful.
// The checker's state would have already been updated by the syscall.
void syscall(uint64_t callnum) { }
-#endif
void handleError()
{
diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index 8c8789cb6..7a99feb06 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -44,6 +44,7 @@
#include <list>
#include <string>
+#include "arch/vtophys.hh"
#include "base/refcnt.hh"
#include "config/the_isa.hh"
#include "cpu/base_dyn_inst.hh"
@@ -53,13 +54,10 @@
#include "cpu/thread_context.hh"
#include "cpu/checker/cpu.hh"
#include "debug/Checker.hh"
+#include "sim/full_system.hh"
#include "sim/sim_object.hh"
#include "sim/stats.hh"
-#if FULL_SYSTEM
-#include "arch/vtophys.hh"
-#endif // FULL_SYSTEM
-
using namespace std;
using namespace TheISA;
@@ -401,34 +399,32 @@ Checker<Impl>::verify(DynInstPtr &completed_inst)
// Take any faults here
if (fault != NoFault) {
-#if FULL_SYSTEM
fault->invoke(tc, curStaticInst);
willChangePC = true;
newPCState = thread->pcState();
DPRINTF(Checker, "Fault, PC is now %s\n", newPCState);
curMacroStaticInst = StaticInst::nullStaticInstPtr;
-#endif
} else {
advancePC(fault);
}
-#if FULL_SYSTEM
- // @todo: Determine if these should happen only if the
- // instruction hasn't faulted. In the SimpleCPU case this may
- // not be true, but in the O3 or Ozone case this may be true.
- Addr oldpc;
- int count = 0;
- do {
- oldpc = thread->instAddr();
- system->pcEventQueue.service(tc);
- count++;
- } while (oldpc != thread->instAddr());
- if (count > 1) {
- willChangePC = true;
- newPCState = thread->pcState();
- DPRINTF(Checker, "PC Event, PC is now %s\n", newPCState);
+ if (FullSystem) {
+ // @todo: Determine if these should happen only if the
+ // instruction hasn't faulted. In the SimpleCPU case this may
+ // not be true, but in the O3 or Ozone case this may be true.
+ Addr oldpc;
+ int count = 0;
+ do {
+ oldpc = thread->instAddr();
+ system->pcEventQueue.service(tc);
+ count++;
+ } while (oldpc != thread->instAddr());
+ if (count > 1) {
+ willChangePC = true;
+ newPCState = thread->pcState();
+ DPRINTF(Checker, "PC Event, PC is now %s\n", newPCState);
+ }
}
-#endif
// @todo: Optionally can check all registers. (Or just those
// that have been modified).
diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh
index d66854b23..d21de9f53 100644
--- a/src/cpu/checker/thread_context.hh
+++ b/src/cpu/checker/thread_context.hh
@@ -118,12 +118,13 @@ class CheckerThreadContext : public ThreadContext
System *getSystemPtr() { return actualTC->getSystemPtr(); }
-#if FULL_SYSTEM
PhysicalMemory *getPhysMemPtr() { return actualTC->getPhysMemPtr(); }
TheISA::Kernel::Statistics *getKernelStats()
{ return actualTC->getKernelStats(); }
+ Process *getProcessPtr() { return actualTC->getProcessPtr(); }
+
PortProxy* getPhysProxy() { return actualTC->getPhysProxy(); }
FSTranslatingPortProxy* getVirtProxy()
@@ -137,15 +138,12 @@ class CheckerThreadContext : public ThreadContext
{
actualTC->connectMemPorts(tc);
}
-#else
- SETranslatingPortProxy* getMemProxy() { return actualTC->getMemProxy(); }
- Process *getProcessPtr() { return actualTC->getProcessPtr(); }
+ SETranslatingPortProxy* getMemProxy() { return actualTC->getMemProxy(); }
/** Executes a syscall in SE mode. */
void syscall(int64_t callnum)
{ return actualTC->syscall(callnum); }
-#endif
Status status() const { return actualTC->status(); }
@@ -165,9 +163,7 @@ class CheckerThreadContext : public ThreadContext
/// Set the status to Halted.
void halt(int delay) { actualTC->halt(delay); }
-#if FULL_SYSTEM
void dumpFuncProfile() { actualTC->dumpFuncProfile(); }
-#endif
void takeOverFrom(ThreadContext *oldContext)
{
@@ -185,7 +181,6 @@ class CheckerThreadContext : public ThreadContext
void unserialize(Checkpoint *cp, const std::string &section)
{ actualTC->unserialize(cp, section); }
-#if FULL_SYSTEM
EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); }
Tick readLastActivate() { return actualTC->readLastActivate(); }
@@ -193,7 +188,6 @@ class CheckerThreadContext : public ThreadContext
void profileClear() { return actualTC->profileClear(); }
void profileSample() { return actualTC->profileSample(); }
-#endif
// @todo: Do I need this?
void copyArchRegs(ThreadContext *tc)
@@ -305,9 +299,7 @@ class CheckerThreadContext : public ThreadContext
// @todo: Fix this!
bool misspeculating() { return actualTC->misspeculating(); }
-#if !FULL_SYSTEM
Counter readFuncExeInst() { return actualTC->readFuncExeInst(); }
-#endif
};
#endif // __CPU_CHECKER_EXEC_CONTEXT_HH__