/*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2003-2004 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* 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"
+#include "sim/stat_control.hh"
+#include "sim/stats.hh"
-using namespace Statistics;
+using namespace std;
+using namespace Stats;
namespace AlphaPseudo
{
+ bool doStatisticsInsts;
+ bool doCheckpointInsts;
+ bool doQuiesce;
+
+ void
+ arm(ExecContext *xc)
+ {
+ xc->kernelStats.arm();
+ }
+
+ void
+ quiesce(ExecContext *xc)
+ {
+ if (!doQuiesce)
+ return;
+
+ xc->suspend();
+ xc->kernelStats.quiesce();
+ }
+
+ void
+ ivlb(ExecContext *xc)
+ {
+ xc->kernelStats.ivlb();
+ }
+
+ void
+ ivle(ExecContext *xc)
+ {
+ }
+
void
m5exit_old(ExecContext *xc)
{
void
resetstats(ExecContext *xc)
{
+ if (!doStatisticsInsts)
+ return;
+
Tick delay = xc->regs.intRegFile[16];
Tick period = xc->regs.intRegFile[17];
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
+ using namespace Stats;
SetupEvent(Reset, when, repeat);
}
void
dumpstats(ExecContext *xc)
{
+ if (!doStatisticsInsts)
+ return;
+
Tick delay = xc->regs.intRegFile[16];
Tick period = xc->regs.intRegFile[17];
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
+ using namespace Stats;
SetupEvent(Dump, when, repeat);
}
void
dumpresetstats(ExecContext *xc)
{
+ if (!doStatisticsInsts)
+ return;
+
Tick delay = xc->regs.intRegFile[16];
Tick period = xc->regs.intRegFile[17];
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
+ using namespace Stats;
SetupEvent(Dump|Reset, when, repeat);
}
void
m5checkpoint(ExecContext *xc)
{
+ if (!doCheckpointInsts)
+ return;
+
Tick delay = xc->regs.intRegFile[16];
Tick period = xc->regs.intRegFile[17];
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
- SetupCheckpoint(when, repeat);
+ Checkpoint::setup(when, repeat);
}
+ class Context : public ParamContext
+ {
+ public:
+ Context(const string §ion) : ParamContext(section) {}
+ void checkParams();
+ };
+
+ Context context("PseudoInsts");
+
+ Param<bool> __quiesce(&context, "quiesce",
+ "enable quiesce instructions",
+ true);
+ Param<bool> __statistics(&context, "statistics",
+ "enable statistics pseudo instructions",
+ true);
+ Param<bool> __checkpoint(&context, "checkpoint",
+ "enable checkpoint pseudo instructions",
+ true);
+
+ void
+ Context::checkParams()
+ {
+ doQuiesce = __quiesce;
+ doStatisticsInsts = __statistics;
+ doCheckpointInsts = __checkpoint;
+ }
}