From d8c487c40112590b541dc1e74b435ecb8fe8cef8 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 1 Jun 2007 13:44:24 -0400 Subject: don't generate trace data unless tracing is on --HG-- extra : convert_revision : 3953ace8d481d758d6e0d89183c0a7e7bebcf681 --- src/cpu/o3/fetch_impl.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index e16f97558..895b4a46c 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1151,10 +1151,14 @@ DefaultFetch::fetch(bool &status_change) DPRINTF(Fetch, "[tid:%i]: Instruction is: %s\n", tid, instruction->staticInst->disassemble(fetch_PC)); +#if TRACING_ON instruction->traceData = Trace::getInstRecord(curTick, cpu->tcBase(tid), instruction->staticInst, instruction->readPC()); +#elif + instruction->traceData = NULL; +#endif ///FIXME This needs to be more robust in dealing with delay slots #if !ISA_HAS_DELAY_SLOT -- cgit v1.2.3 From d8f676996222dfc2d2666bdc88499c58f1c1246c Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 1 Jun 2007 14:16:58 -0400 Subject: cast sizeof(MachInst) to Addr before generating a mask --HG-- extra : convert_revision : 1ae34a069bbd997a8f888f69415fbeaaf4ade0b3 --- src/cpu/simple/base.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 5e078c502..da50a3eb0 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -329,7 +329,7 @@ BaseSimpleCPU::checkForInterrupts() Fault BaseSimpleCPU::setupFetchRequest(Request *req) { - uint64_t threadPC = thread->readPC(); + Addr threadPC = thread->readPC(); // set up memory request for instruction fetch #if ISA_HAS_DELAY_SLOT @@ -340,9 +340,9 @@ BaseSimpleCPU::setupFetchRequest(Request *req) thread->readNextPC()); #endif - const Addr PCMask = ~(sizeof(MachInst) - 1); - Addr fetchPC = thread->readPC() + fetchOffset; - req->setVirt(0, fetchPC & PCMask, sizeof(MachInst), 0, threadPC()); + const Addr PCMask = ~((Addr)sizeof(MachInst) - 1); + Addr fetchPC = threadPC + fetchOffset; + req->setVirt(0, fetchPC & PCMask, sizeof(MachInst), 0, threadPC); Fault fault = thread->translateInstReq(req); @@ -380,7 +380,7 @@ BaseSimpleCPU::preExecute() //This should go away once the constructor can be set up properly predecoder.setTC(thread->getTC()); //If more fetch data is needed, pass it in. - const Addr PCMask = ~(sizeof(MachInst) - 1); + const Addr PCMask = ~((Addr)sizeof(MachInst) - 1); if(predecoder.needMoreBytes()) predecoder.moreBytes((thread->readPC() & PCMask) + fetchOffset, 0, inst); -- cgit v1.2.3