diff options
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r-- | src/cpu/base.cc | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 0722f319d..5d5f704db 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -53,8 +53,8 @@ #include "base/misc.hh" #include "base/output.hh" #include "base/trace.hh" -#include "config/use_checker.hh" #include "cpu/base.hh" +#include "cpu/checker/cpu.hh" #include "cpu/cpuevent.hh" #include "cpu/profile.hh" #include "cpu/thread_context.hh" @@ -66,10 +66,6 @@ #include "sim/sim_exit.hh" #include "sim/system.hh" -#if USE_CHECKER -#include "cpu/checker/cpu.hh" -#endif - // Hack #include "sim/stat_control.hh" @@ -431,34 +427,33 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU) peer->setPeer(new_dtb_port); } -#if USE_CHECKER - Port *old_checker_itb_port, *old_checker_dtb_port; - Port *new_checker_itb_port, *new_checker_dtb_port; - - CheckerCPU *oldChecker = - dynamic_cast<CheckerCPU*>(oldTC->getCheckerCpuPtr()); - CheckerCPU *newChecker = - dynamic_cast<CheckerCPU*>(newTC->getCheckerCpuPtr()); - old_checker_itb_port = oldChecker->getITBPtr()->getPort(); - old_checker_dtb_port = oldChecker->getDTBPtr()->getPort(); - new_checker_itb_port = newChecker->getITBPtr()->getPort(); - new_checker_dtb_port = newChecker->getDTBPtr()->getPort(); - - // Move over any table walker ports if they exist for checker - if (new_checker_itb_port && !new_checker_itb_port->isConnected()) { - assert(old_checker_itb_port); - Port *peer = old_checker_itb_port->getPeer();; - new_checker_itb_port->setPeer(peer); - peer->setPeer(new_checker_itb_port); + // Checker whether or not we have to transfer CheckerCPU + // objects over in the switch + CheckerCPU *oldChecker = oldTC->getCheckerCpuPtr(); + CheckerCPU *newChecker = newTC->getCheckerCpuPtr(); + if (oldChecker && newChecker) { + Port *old_checker_itb_port, *old_checker_dtb_port; + Port *new_checker_itb_port, *new_checker_dtb_port; + + old_checker_itb_port = oldChecker->getITBPtr()->getPort(); + old_checker_dtb_port = oldChecker->getDTBPtr()->getPort(); + new_checker_itb_port = newChecker->getITBPtr()->getPort(); + new_checker_dtb_port = newChecker->getDTBPtr()->getPort(); + + // Move over any table walker ports if they exist for checker + if (new_checker_itb_port && !new_checker_itb_port->isConnected()) { + assert(old_checker_itb_port); + Port *peer = old_checker_itb_port->getPeer();; + new_checker_itb_port->setPeer(peer); + peer->setPeer(new_checker_itb_port); + } + if (new_checker_dtb_port && !new_checker_dtb_port->isConnected()) { + assert(old_checker_dtb_port); + Port *peer = old_checker_dtb_port->getPeer();; + new_checker_dtb_port->setPeer(peer); + peer->setPeer(new_checker_dtb_port); + } } - if (new_checker_dtb_port && !new_checker_dtb_port->isConnected()) { - assert(old_checker_dtb_port); - Port *peer = old_checker_dtb_port->getPeer();; - new_checker_dtb_port->setPeer(peer); - peer->setPeer(new_checker_dtb_port); - } -#endif - } interrupts = oldCPU->interrupts; |