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/base_dyn_inst.hh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/cpu/base_dyn_inst.hh') diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh index 134725f70..7715ef57f 100644 --- a/src/cpu/base_dyn_inst.hh +++ b/src/cpu/base_dyn_inst.hh @@ -54,7 +54,7 @@ #include "base/fast_alloc.hh" #include "base/trace.hh" #include "config/the_isa.hh" -#include "config/use_checker.hh" +#include "cpu/checker/cpu.hh" #include "cpu/o3/comm.hh" #include "cpu/exetrace.hh" #include "cpu/inst_seq.hh" @@ -177,10 +177,8 @@ class BaseDynInst : public FastAlloc, public RefCounted RequestPtr savedSreqLow; RequestPtr savedSreqHigh; -#if USE_CHECKER // Need a copy of main request pointer to verify on writes. RequestPtr reqToVerify; -#endif //USE_CHECKER /** @todo: Consider making this private. */ public: @@ -896,12 +894,13 @@ BaseDynInst::readMem(Addr addr, uint8_t *data, effAddr = req->getVaddr(); effSize = size; effAddrValid = true; -#if USE_CHECKER - if (reqToVerify != NULL) { - delete reqToVerify; + + if (cpu->checker) { + if (reqToVerify != NULL) { + delete reqToVerify; + } + reqToVerify = new Request(*req); } - reqToVerify = new Request(*req); -#endif //USE_CHECKER fault = cpu->read(req, sreqLow, sreqHigh, data, lqIdx); } else { // Commit will have to clean up whatever happened. Set this @@ -957,12 +956,13 @@ BaseDynInst::writeMem(uint8_t *data, unsigned size, effAddr = req->getVaddr(); effSize = size; effAddrValid = true; -#if USE_CHECKER - if (reqToVerify != NULL) { - delete reqToVerify; + + if (cpu->checker) { + if (reqToVerify != NULL) { + delete reqToVerify; + } + reqToVerify = new Request(*req); } - reqToVerify = new Request(*req); -#endif // USE_CHECKER fault = cpu->write(req, sreqLow, sreqHigh, data, sqIdx); } -- cgit v1.2.3