From 91f5736fd3fe989a7d5f3db10070fdedea36e1b4 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 22 Jun 2005 09:59:13 -0400 Subject: Move max_time and progress_interval parameters to the Root object and get rid of the ParamContext that each used to have. python/m5/objects/Root.py: Add max_time and progress_interval to the Root object sim/root.cc: Add max_time and progress_interval to the Root object. These parameters used to be in their own contexts in sim_events.cc sim/sim_events.cc: Get rid of the ParamContext for max cycles and the progress event. Move the functionality to the Root object sim/sim_events.hh: Move ProgressEvent declaration to the header so that it can be used in other files. --HG-- extra : convert_revision : ff664b806855e8eb9201b8a25392aa53204464f0 --- sim/sim_events.cc | 82 ------------------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'sim/sim_events.cc') diff --git a/sim/sim_events.cc b/sim/sim_events.cc index 55bb3c305..c2bdca9df 100644 --- a/sim/sim_events.cc +++ b/sim/sim_events.cc @@ -129,60 +129,6 @@ CheckSwapEvent::description() return "check swap"; } - -/////////////////////////////////////////////////// -// -// Simulation termination parameters -// -/////////////////////////////////////////////////// - -class TermParamContext : public ParamContext -{ - public: - TermParamContext(const string &_iniSection) - : ParamContext(_iniSection) {} - void checkParams(); -}; - -TermParamContext simTerminationParams("max"); - -Param max_cycle(&simTerminationParams, "cycle", - "maximum number of cycles to execute"); - -void -TermParamContext::checkParams() -{ - // if a max cycle count was specified, put a termination event on - // the event queue at that point - if (max_cycle.isValid()) - new SimExitEvent(max_cycle, "reached maximum cycle count"); -} - -// -// Progress event: print out cycle every so often so we know we're -// making forward progress. -// -class ProgressEvent : public Event -{ - protected: - Tick interval; - - public: - ProgressEvent(EventQueue *q, Tick interval); - - void process(); // process event - virtual const char *description(); -}; - -// -// constructor: schedule at specified time -// -ProgressEvent::ProgressEvent(EventQueue *q, Tick _interval) - : Event(q), interval(_interval) -{ - schedule(curTick + interval); -} - // // handle progress event: print message and reschedule // @@ -200,31 +146,3 @@ ProgressEvent::description() { return "progress message"; } - -///////// -// -// Periodic progress message support: print out a message every n -// cycles so we know we're making forward progress. -// -///////// - -// Parameter space for execution address tracing options. Derive -// from ParamContext so we can override checkParams() function. -struct ProgressParamContext : public ParamContext -{ - ProgressParamContext(const string &_iniSection) - : ParamContext(_iniSection) {} - void startup(); -}; - -ProgressParamContext progessMessageParams("progress"); - -Param progress_interval(&progessMessageParams, "cycle", - "cycle interval for progress messages"); - -void -ProgressParamContext::startup() -{ - if (progress_interval.isValid()) - new ProgressEvent(&mainEventQueue, progress_interval); -} -- cgit v1.2.3