fetch.cc:
[gem5.git] / arch / alpha / pseudo_inst.cc
index 370266909231b57f9d3dbb9d02a7f07a1d497c82..22d65638b970c11c29b8f2c3de09f93ef719a90a 100644 (file)
 #include "arch/alpha/pseudo_inst.hh"
 #include "arch/alpha/vtophys.hh"
 #include "cpu/base_cpu.hh"
+#include "cpu/sampling_cpu/sampling_cpu.hh"
 #include "cpu/exec_context.hh"
+#include "kern/kernel_stats.hh"
 #include "sim/param.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_exit.hh"
 #include "sim/stat_control.hh"
 #include "sim/stats.hh"
 #include "sim/system.hh"
+#include "sim/debug.hh"
 
 using namespace std;
+
+extern SamplingCPU *SampCPU;
+
 using namespace Stats;
 
 namespace AlphaPseudo
@@ -55,7 +61,7 @@ namespace AlphaPseudo
     void
     arm(ExecContext *xc)
     {
-        xc->kernelStats.arm();
+        xc->kernelStats->arm();
     }
 
     void
@@ -65,13 +71,13 @@ namespace AlphaPseudo
             return;
 
         xc->suspend();
-        xc->kernelStats.quiesce();
+        xc->kernelStats->quiesce();
     }
 
     void
     ivlb(ExecContext *xc)
     {
-        xc->kernelStats.ivlb();
+        xc->kernelStats->ivlb();
     }
 
     void
@@ -159,7 +165,7 @@ namespace AlphaPseudo
     void
     readfile(ExecContext *xc)
     {
-        const string &file = xc->cpu->system->readfile;
+        const string &file = xc->cpu->system->params->readfile;
         if (file.empty()) {
             xc->regs.intRegFile[0] = ULL(0);
             return;
@@ -200,7 +206,7 @@ namespace AlphaPseudo
         void checkParams();
     };
 
-    Context context("PseudoInsts");
+    Context context("pseudo_inst");
 
     Param<bool> __quiesce(&context, "quiesce",
                           "enable quiesce instructions",
@@ -219,4 +225,15 @@ namespace AlphaPseudo
         doStatisticsInsts = __statistics;
         doCheckpointInsts = __checkpoint;
     }
+
+    void debugbreak(ExecContext *xc)
+    {
+        debug_break();
+    }
+
+    void switchcpu(ExecContext *xc)
+    {
+        if (SampCPU)
+            SampCPU->switchCPUs();
+    }
 }