summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-01-09 18:08:20 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2012-01-09 18:08:20 -0600
commitd2c26f402cfdb9a7fd34e98e3fc7aaa48c56c99b (patch)
tree3a9e1d5f4afad20dd459da19970ae2d48568fbc2
parentbcb71963ebb3c226f4f36f6d5907c6fb3bc10b64 (diff)
downloadgem5-d2c26f402cfdb9a7fd34e98e3fc7aaa48c56c99b.tar.xz
O3: Add support of function tracing with O3 CPU.
-rw-r--r--src/cpu/base.hh9
-rw-r--r--src/cpu/o3/commit_impl.hh3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index ce02889f3..638556deb 100644
--- a/src/cpu/base.hh
+++ b/src/cpu/base.hh
@@ -291,17 +291,16 @@ class BaseCPU : public MemObject
void enableFunctionTrace();
void traceFunctionsInternal(Addr pc);
- protected:
+ private:
+ static std::vector<BaseCPU *> cpuList; //!< Static global cpu list
+
+ public:
void traceFunctions(Addr pc)
{
if (functionTracingEnabled)
traceFunctionsInternal(pc);
}
- private:
- static std::vector<BaseCPU *> cpuList; //!< Static global cpu list
-
- public:
static int numSimulatedCPUs() { return cpuList.size(); }
static Counter numSimulatedInstructions()
{
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index 75ae87c75..9ff31a622 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -52,6 +52,7 @@
#include "config/use_checker.hh"
#include "cpu/o3/commit.hh"
#include "cpu/o3/thread_state.hh"
+#include "cpu/base.hh"
#include "cpu/exetrace.hh"
#include "cpu/timebuf.hh"
#include "debug/Activity.hh"
@@ -992,6 +993,8 @@ DefaultCommit<Impl>::commitInsts()
// Updates misc. registers.
head_inst->updateMiscRegs();
+ cpu->traceFunctions(pc[tid].instAddr());
+
TheISA::advancePC(pc[tid], head_inst->staticInst);
// Keep track of the last sequence number commited