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.hh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'sim/sim_events.hh') diff --git a/sim/sim_events.hh b/sim/sim_events.hh index 091d4db61..c93914457 100644 --- a/sim/sim_events.hh +++ b/sim/sim_events.hh @@ -26,8 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __SIM_EVENTS_HH__ -#define __SIM_EVENTS_HH__ +#ifndef __SIM_SIM_EVENTS_HH__ +#define __SIM_SIM_EVENTS_HH__ #include "sim/eventq.hh" @@ -87,7 +87,7 @@ class CountedExitEvent : public Event }; // -// Event to cause a statistics dump +// Event to check swap usage // class CheckSwapEvent : public Event { @@ -97,11 +97,30 @@ class CheckSwapEvent : public Event public: CheckSwapEvent(EventQueue *q, int ival) : Event(q), interval(ival) - { schedule(interval); } + { schedule(curTick + interval); } void process(); // process event virtual const char *description(); }; -#endif // __SIM_EVENTS_HH__ +// +// 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 ival) + : Event(q), interval(ival) + { schedule(curTick + interval); } + + void process(); // process event + + virtual const char *description(); +}; + +#endif // __SIM_SIM_EVENTS_HH__ -- cgit v1.2.3