From 043709fdfab3b6c46f6ef95d1f642cd3c06ee20a Mon Sep 17 00:00:00 2001 From: Geoffrey Blake Date: Fri, 9 Mar 2012 09:59:27 -0500 Subject: CheckerCPU: Make CheckerCPU runtime selectable instead of compile selectable Enables the CheckerCPU to be selected at runtime with the --checker option from the configs/example/fs.py and configs/example/se.py configuration files. Also merges with the SE/FS changes. --- src/cpu/o3/lsq_unit_impl.hh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/cpu/o3/lsq_unit_impl.hh') diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index facd88597..d0a630f6d 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -45,6 +45,7 @@ #include "arch/locked_mem.hh" #include "base/str.hh" #include "config/the_isa.hh" +#include "cpu/checker/cpu.hh" #include "cpu/o3/lsq.hh" #include "cpu/o3/lsq_unit.hh" #include "debug/Activity.hh" @@ -53,10 +54,6 @@ #include "mem/packet.hh" #include "mem/request.hh" -#if USE_CHECKER -#include "cpu/checker/cpu.hh" -#endif - template LSQUnit::WritebackEvent::WritebackEvent(DynInstPtr &_inst, PacketPtr _pkt, LSQUnit *lsq_ptr) @@ -871,11 +868,12 @@ LSQUnit::writebackStores() inst->seqNum); WritebackEvent *wb = new WritebackEvent(inst, data_pkt, this); cpu->schedule(wb, curTick() + 1); -#if USE_CHECKER - // Make sure to set the LLSC data for verification - inst->reqToVerify->setExtraData(0); - inst->completeAcc(data_pkt); -#endif + if (cpu->checker) { + // Make sure to set the LLSC data for verification + // if checker is loaded + inst->reqToVerify->setExtraData(0); + inst->completeAcc(data_pkt); + } completeStore(storeWBIdx); incrStIdx(storeWBIdx); continue; @@ -1083,11 +1081,10 @@ LSQUnit::storePostSend(PacketPtr pkt) // only works so long as the checker doesn't try to // verify the value in memory for stores. storeQueue[storeWBIdx].inst->setCompleted(); -#if USE_CHECKER + if (cpu->checker) { cpu->checker->verify(storeQueue[storeWBIdx].inst); } -#endif } if (needsTSO) { @@ -1174,11 +1171,9 @@ LSQUnit::completeStore(int store_idx) // Tell the checker we've completed this instruction. Some stores // may get reported twice to the checker, but the checker can // handle that case. -#if USE_CHECKER if (cpu->checker) { cpu->checker->verify(storeQueue[store_idx].inst); } -#endif } template -- cgit v1.2.3