Remote GDB: Turn on remote gdb in SE mode.
[gem5.git] / src / cpu / base.cc
index cf007a06b21f4d1d5f062f3fea3f80e4687b0f23..25bd3f893f56c96e3e5d5622bbfdaf85a7c2416d 100644 (file)
@@ -42,7 +42,6 @@
 #include "cpu/thread_context.hh"
 #include "cpu/profile.hh"
 #include "sim/sim_exit.hh"
-#include "sim/param.hh"
 #include "sim/process.hh"
 #include "sim/sim_events.hh"
 #include "sim/system.hh"
@@ -75,7 +74,7 @@ CPUProgressEvent::process()
 {
     Counter temp = cpu->totalInstructions();
 #ifndef NDEBUG
-    double ipc = double(temp - lastNumInst) / (interval / cpu->cycles(1));
+    double ipc = double(temp - lastNumInst) / (interval / cpu->ticks(1));
 
     DPRINTFN("%s progress event, instructions committed: %lli, IPC: %0.8d\n",
              cpu->name(), temp - lastNumInst, ipc);
@@ -96,25 +95,21 @@ CPUProgressEvent::description()
 
 #if FULL_SYSTEM
 BaseCPU::BaseCPU(Params *p)
-    : MemObject(p->name), clock(p->clock), instCnt(0),
+    : MemObject(makeParams(p->name)), clock(p->clock), instCnt(0),
       params(p), number_of_threads(p->numberOfThreads), system(p->system),
       phase(p->phase)
 #else
 BaseCPU::BaseCPU(Params *p)
-    : MemObject(p->name), clock(p->clock), params(p),
+    : MemObject(makeParams(p->name)), clock(p->clock), params(p),
       number_of_threads(p->numberOfThreads), system(p->system),
       phase(p->phase)
 #endif
 {
 //    currentTick = curTick;
-    DPRINTF(FullCPU, "BaseCPU: Creating object, mem address %#x.\n", this);
 
     // add self to global list of CPUs
     cpuList.push_back(this);
 
-    DPRINTF(FullCPU, "BaseCPU: CPU added to cpuList, mem address %#x.\n",
-            this);
-
     if (number_of_threads > maxThreadsPerCPU)
         maxThreadsPerCPU = number_of_threads;
 
@@ -189,6 +184,7 @@ BaseCPU::BaseCPU(Params *p)
     if (params->profile)
         profileEvent = new ProfileEvent(this, params->profile);
 #endif
+    tracer = params->tracer;
 }
 
 BaseCPU::Params::Params()
@@ -197,6 +193,7 @@ BaseCPU::Params::Params()
     profile = false;
 #endif
     checker = NULL;
+    tracer = NULL;
 }
 
 void
@@ -226,7 +223,7 @@ BaseCPU::startup()
 
     if (params->progress_interval) {
         new CPUProgressEvent(&mainEventQueue,
-                             cycles(params->progress_interval),
+                             ticks(params->progress_interval),
                              this);
     }
 }
@@ -346,9 +343,8 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU, Port *ic, Port *dc)
     for (int i = 0; i < threadContexts.size(); ++i)
         threadContexts[i]->profileClear();
 
-    // The Sampler must take care of this!
-//    if (profileEvent)
-//        profileEvent->schedule(curTick);
+    if (profileEvent)
+        profileEvent->schedule(curTick);
 #endif
 
     // Connect new CPU to old CPU's memory only if new CPU isn't
@@ -455,6 +451,3 @@ BaseCPU::traceFunctionsInternal(Addr pc)
         functionEntryTick = curTick;
     }
 }
-
-
-DEFINE_SIM_OBJECT_CLASS_NAME("BaseCPU", BaseCPU)