summaryrefslogtreecommitdiff
path: root/src/cpu/checker
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/checker')
-rw-r--r--src/cpu/checker/cpu.cc37
-rw-r--r--src/cpu/checker/cpu.hh5
-rw-r--r--src/cpu/checker/o3_cpu_builder.cc3
-rw-r--r--src/cpu/checker/thread_context.hh11
4 files changed, 22 insertions, 34 deletions
diff --git a/src/cpu/checker/cpu.cc b/src/cpu/checker/cpu.cc
index b328a66c4..ebc02f7be 100644
--- a/src/cpu/checker/cpu.cc
+++ b/src/cpu/checker/cpu.cc
@@ -81,7 +81,6 @@ CheckerCPU::CheckerCPU(Params *p)
itb = p->itb;
dtb = p->dtb;
systemPtr = NULL;
- memPtr = NULL;
#else
process = p->process;
#endif
@@ -94,44 +93,32 @@ CheckerCPU::~CheckerCPU()
void
CheckerCPU::setMemory(MemObject *mem)
{
- memPtr = mem;
#if !FULL_SYSTEM
+ memPtr = mem;
thread = new SimpleThread(this, /* thread_num */ 0, process,
/* asid */ 0, mem);
thread->setStatus(ThreadContext::Suspended);
tc = thread->getTC();
threadContexts.push_back(tc);
-#else
- if (systemPtr) {
- thread = new SimpleThread(this, 0, systemPtr, itb, dtb, memPtr, false);
-
- thread->setStatus(ThreadContext::Suspended);
- tc = thread->getTC();
- threadContexts.push_back(tc);
- delete thread->kernelStats;
- thread->kernelStats = NULL;
- }
#endif
}
-#if FULL_SYSTEM
void
CheckerCPU::setSystem(System *system)
{
+#if FULL_SYSTEM
systemPtr = system;
- if (memPtr) {
- thread = new SimpleThread(this, 0, systemPtr, itb, dtb, memPtr, false);
+ thread = new SimpleThread(this, 0, systemPtr, itb, dtb, false);
- thread->setStatus(ThreadContext::Suspended);
- tc = thread->getTC();
- threadContexts.push_back(tc);
- delete thread->kernelStats;
- thread->kernelStats = NULL;
- }
-}
+ thread->setStatus(ThreadContext::Suspended);
+ tc = thread->getTC();
+ threadContexts.push_back(tc);
+ delete thread->kernelStats;
+ thread->kernelStats = NULL;
#endif
+}
void
CheckerCPU::setIcachePort(Port *icache_port)
@@ -350,7 +337,7 @@ CheckerCPU::write(int32_t data, Addr addr, unsigned flags, uint64_t *res)
Addr
CheckerCPU::dbg_vtophys(Addr addr)
{
- return vtophys(xcProxy, addr);
+ return vtophys(tc, addr);
}
#endif // FULL_SYSTEM
@@ -601,7 +588,7 @@ Checker<DynInstPtr>::tick(DynInstPtr &completed_inst)
if (fault != NoFault) {
#if FULL_SYSTEM
- fault->invoke(xcProxy);
+ fault->invoke(tc);
willChangePC = true;
newPC = thread->readPC();
DPRINTF(Checker, "Fault, PC is now %#x\n", newPC);
@@ -630,7 +617,7 @@ Checker<DynInstPtr>::tick(DynInstPtr &completed_inst)
int count = 0;
do {
oldpc = thread->readPC();
- system->pcEventQueue.service(xcProxy);
+ system->pcEventQueue.service(tc);
count++;
} while (oldpc != thread->readPC());
if (count > 1) {
diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh
index d1a0ba684..c9986d228 100644
--- a/src/cpu/checker/cpu.hh
+++ b/src/cpu/checker/cpu.hh
@@ -99,7 +99,6 @@ class CheckerCPU : public BaseCPU
#if FULL_SYSTEM
AlphaITB *itb;
AlphaDTB *dtb;
- FunctionalMemory *mem;
#else
Process *process;
#endif
@@ -116,11 +115,9 @@ class CheckerCPU : public BaseCPU
MemObject *memPtr;
-#if FULL_SYSTEM
void setSystem(System *system);
System *systemPtr;
-#endif
void setIcachePort(Port *icache_port);
@@ -327,7 +324,7 @@ class CheckerCPU : public BaseCPU
int readIntrFlag() { return thread->readIntrFlag(); }
void setIntrFlag(int val) { thread->setIntrFlag(val); }
bool inPalMode() { return thread->inPalMode(); }
- void ev5_trap(Fault fault) { fault->invoke(xcProxy); }
+ void ev5_trap(Fault fault) { fault->invoke(tc); }
bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); }
#else
// Assume that the normal CPU's call to syscall was successful.
diff --git a/src/cpu/checker/o3_cpu_builder.cc b/src/cpu/checker/o3_cpu_builder.cc
index 5973ac58e..59a6c7158 100644
--- a/src/cpu/checker/o3_cpu_builder.cc
+++ b/src/cpu/checker/o3_cpu_builder.cc
@@ -65,7 +65,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(O3Checker)
#if FULL_SYSTEM
SimObjectParam<AlphaITB *> itb;
SimObjectParam<AlphaDTB *> dtb;
- SimObjectParam<MemObject *> mem;
SimObjectParam<System *> system;
Param<int> cpu_id;
Param<Tick> profile;
@@ -95,7 +94,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(O3Checker)
#if FULL_SYSTEM
INIT_PARAM(itb, "Instruction TLB"),
INIT_PARAM(dtb, "Data TLB"),
- INIT_PARAM(mem, "memory"),
INIT_PARAM(system, "system object"),
INIT_PARAM(cpu_id, "processor ID"),
INIT_PARAM(profile, ""),
@@ -138,7 +136,6 @@ CREATE_SIM_OBJECT(O3Checker)
#if FULL_SYSTEM
params->itb = itb;
params->dtb = dtb;
- params->mem = mem;
params->system = system;
params->cpu_id = cpu_id;
params->profile = profile;
diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh
index 4340bd516..c0ac8f01d 100644
--- a/src/cpu/checker/thread_context.hh
+++ b/src/cpu/checker/thread_context.hh
@@ -81,8 +81,6 @@ class CheckerThreadContext : public ThreadContext
int readCpuId() { return actualTC->readCpuId(); }
- TranslatingPort *getMemPort() { return actualTC->getMemPort(); }
-
#if FULL_SYSTEM
System *getSystemPtr() { return actualTC->getSystemPtr(); }
@@ -93,7 +91,16 @@ class CheckerThreadContext : public ThreadContext
AlphaDTB *getDTBPtr() { return actualTC->getDTBPtr(); }
Kernel::Statistics *getKernelStats() { return actualTC->getKernelStats(); }
+
+ FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
+
+ VirtualPort *getVirtPort(ThreadContext *tc = NULL)
+ { return actualTC->getVirtPort(); }
+
+ void delVirtPort(VirtualPort *vp) { actualTC->delVirtPort(vp); }
#else
+ TranslatingPort *getMemPort() { return actualTC->getMemPort(); }
+
Process *getProcessPtr() { return actualTC->getProcessPtr(); }
#endif