From 136ee73a58651f5e656a1245de9cdb716926cccd Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 2 Nov 2003 20:52:40 -0500 Subject: [PATCH] Add the option to ignore some of the pseudo instructions --HG-- extra : convert_revision : 2010782749ca9c5dd029f71480956b8a1fa96394 --- arch/alpha/pseudo_inst.cc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/alpha/pseudo_inst.cc b/arch/alpha/pseudo_inst.cc index 1f24a07f5..d5d00bb18 100644 --- a/arch/alpha/pseudo_inst.cc +++ b/arch/alpha/pseudo_inst.cc @@ -26,16 +26,23 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #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 §ion) : ParamContext(section) {} + void checkParams(); + }; + + Context context("PseudoInsts"); + + Param __statistics(&context, "statistics", "yes"); + Param __checkpoint(&context, "checkpoint", "yes"); + + void + Context::checkParams() + { + doStatisticsInsts = __statistics; + doCheckpointInsts = __checkpoint; + } } -- 2.30.2