summaryrefslogtreecommitdiff
path: root/src/cpu/base_dyn_inst_impl.hh
diff options
context:
space:
mode:
authorClint Smullen <cws3k@cs.virginia.edu>2008-11-10 11:51:18 -0800
committerClint Smullen <cws3k@cs.virginia.edu>2008-11-10 11:51:18 -0800
commit1adfe5c7f3368c4225ff685ddcd66b6280c7599f (patch)
tree8732797923445ea09d9eac84ff371a33cef2d171 /src/cpu/base_dyn_inst_impl.hh
parent9c49bc7b00aa24b0488a83039ae8762d8f8094c5 (diff)
downloadgem5-1adfe5c7f3368c4225ff685ddcd66b6280c7599f.tar.xz
O3CPU: Make the instcount debugging stuff per-cpu.
This is to prevent the assertion from firing if you have a large multicore. Also make sure that it's not compiled in when NDEBUG is defined
Diffstat (limited to 'src/cpu/base_dyn_inst_impl.hh')
-rw-r--r--src/cpu/base_dyn_inst_impl.hh22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/cpu/base_dyn_inst_impl.hh b/src/cpu/base_dyn_inst_impl.hh
index 66075c60a..4ee7d2f2c 100644
--- a/src/cpu/base_dyn_inst_impl.hh
+++ b/src/cpu/base_dyn_inst_impl.hh
@@ -168,18 +168,21 @@ BaseDynInst<Impl>::initVars()
// Initialize the fault to be NoFault.
fault = NoFault;
- ++instcount;
+#ifndef NDEBUG
+ ++cpu->instcount;
- if (instcount > 1500) {
+ if (cpu->instcount > 1500) {
#ifdef DEBUG
cpu->dumpInsts();
dumpSNList();
#endif
- assert(instcount <= 1500);
+ assert(cpu->instcount <= 1500);
}
- DPRINTF(DynInst, "DynInst: [sn:%lli] Instruction created. Instcount=%i\n",
- seqNum, instcount);
+ DPRINTF(DynInst,
+ "DynInst: [sn:%lli] Instruction created. Instcount for %s = %i\n",
+ seqNum, cpu->name(), cpu->instcount);
+#endif
#ifdef DEBUG
cpu->snList.insert(seqNum);
@@ -199,10 +202,13 @@ BaseDynInst<Impl>::~BaseDynInst()
fault = NoFault;
- --instcount;
+#ifndef NDEBUG
+ --cpu->instcount;
- DPRINTF(DynInst, "DynInst: [sn:%lli] Instruction destroyed. Instcount=%i\n",
- seqNum, instcount);
+ DPRINTF(DynInst,
+ "DynInst: [sn:%lli] Instruction destroyed. Instcount for %s = %i\n",
+ seqNum, cpu->name(), cpu->instcount);
+#endif
#ifdef DEBUG
cpu->snList.erase(seqNum);
#endif