Add the option to ignore some of the pseudo instructions
authorNathan Binkert <binkertn@umich.edu>
Mon, 3 Nov 2003 01:52:40 +0000 (20:52 -0500)
committerNathan Binkert <binkertn@umich.edu>
Mon, 3 Nov 2003 01:52:40 +0000 (20:52 -0500)
--HG--
extra : convert_revision : 2010782749ca9c5dd029f71480956b8a1fa96394

arch/alpha/pseudo_inst.cc

index 1f24a07f58603c4def1bb4d4db53e4372d002626..d5d00bb18043b1def74f993413429d9d90c3840b 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string>
+
 #include "arch/alpha/pseudo_inst.hh"
 #include "cpu/exec_context.hh"
+#include "sim/param.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_exit.hh"
 #include "sim/sim_stats.hh"
 
+using namespace std;
 using namespace Statistics;
 
 namespace AlphaPseudo
 {
+    bool doStatisticsInsts;
+    bool doCheckpointInsts;
+
     void
     m5exit_old(ExecContext *xc)
     {
@@ -53,6 +60,9 @@ namespace AlphaPseudo
     void
     resetstats(ExecContext *xc)
     {
+        if (!doStatisticsInsts)
+            return;
+
         Tick delay = xc->regs.intRegFile[16];
         Tick period = xc->regs.intRegFile[17];
 
@@ -65,6 +75,9 @@ namespace AlphaPseudo
     void
     dumpstats(ExecContext *xc)
     {
+        if (!doStatisticsInsts)
+            return;
+
         Tick delay = xc->regs.intRegFile[16];
         Tick period = xc->regs.intRegFile[17];
 
@@ -77,6 +90,9 @@ namespace AlphaPseudo
     void
     dumpresetstats(ExecContext *xc)
     {
+        if (!doStatisticsInsts)
+            return;
+
         Tick delay = xc->regs.intRegFile[16];
         Tick period = xc->regs.intRegFile[17];
 
@@ -89,6 +105,9 @@ namespace AlphaPseudo
     void
     m5checkpoint(ExecContext *xc)
     {
+        if (!doCheckpointInsts)
+            return;
+
         Tick delay = xc->regs.intRegFile[16];
         Tick period = xc->regs.intRegFile[17];
 
@@ -98,4 +117,22 @@ namespace AlphaPseudo
         SetupCheckpoint(when, repeat);
     }
 
+    class Context : public ParamContext
+    {
+      public:
+        Context(const string &section) : ParamContext(section) {}
+        void checkParams();
+    };
+
+    Context context("PseudoInsts");
+
+    Param<bool> __statistics(&context, "statistics", "yes");
+    Param<bool> __checkpoint(&context, "checkpoint", "yes");
+
+    void
+    Context::checkParams()
+    {
+        doStatisticsInsts = __statistics;
+        doCheckpointInsts = __checkpoint;
+    }
 }