From 249aaff32970dac250dbee3cb3ea531e60348933 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Sat, 1 Nov 2003 18:17:46 -0500 Subject: statistics.hh: add enum to Bin::VectorBin base/statistics.hh: add enum to Bin::VectorBin --HG-- extra : convert_revision : a05aef30ca85bf5c0d1f5155e1dff3fb34fd7777 --- base/statistics.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'base') diff --git a/base/statistics.hh b/base/statistics.hh index 056adea57..db08f14f7 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -2277,6 +2277,7 @@ struct StatBin : public GenBin int _size; public: + enum { binned = true }; VectorBin() : _size(0) {} bool initialized() const { return _size > 0; } -- cgit v1.2.3 From 667cbb6690b1f4af68ab7dad8caed8cdf107a090 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 2 Nov 2003 18:02:58 -0500 Subject: Implement more m5 pseduo opcodes: resetstats dumpstats dumpresetstats m5checkpoint Lots of cleanup of serialization and stats dumping/resetting to work with these new instructions arch/alpha/isa_desc: Implement more m5 pseduo opcodes: resetstats dumpstats dumpresetstats m5checkpoint All of these functions take two optional parameters, the first is a delay, and the second is a period. The delay tells the simulator to wait the specified number of nanoseconds before triggering the event, the period tells the simulator to repeat the event with a specified frequency base/statistics.cc: base/statistics.hh: regReset RegResetCallback dev/disk_image.cc: serializeFilename -> CheckpointFile() sim/debug.cc: Move this debugging statement to sim_stats.cc sim/eventq.cc: Don't AutoDelete an event if it is scheduled since the process() function could potentially schedule the event again. sim/main.cc: DumpStatsEvent is now Statistics::SetupEvent(Dump, curTick) sim/serialize.cc: Change the serialize event so that it's possible to cause the event to repeat. Also make the priority such that the event happens just before the simulator would exit if both events were scheduled for the same cycle. get rid of the serializeFilename variable and provide a CheckpointFile() function. This function takes a basename that is set in the configuration, and appends the current cycle to the name so that multiple checkpoints can be dumped from the same simulation. Also, don't exit the simulation when a checkpoint file is dumped. sim/serialize.hh: serializeFilename -> CheckpointFile() SetupCheckpoint function to tell the simulator to prepare to checkpoint at a certain time with a certain period sim/sim_events.cc: DumpStatsEvent stuff gets move to sim_stats.(cc|hh) The context stuff gets moved into the already existing stats context in stat_context.cc sim/sim_events.hh: DumpStatsEvent stuff gets move to sim_stats.(cc|hh) sim/universe.cc: Provide some simple functions for converting times into ticks. These use floating point math to get as close as possible to the real values. Multipliers are set up ahead of time --HG-- extra : convert_revision : d06ef26a9237529a1e5060cb1ac2dcc04d4ec252 --- base/statistics.cc | 2 +- base/statistics.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/statistics.cc b/base/statistics.cc index 8b2d8e5de..c1a5b2626 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -919,7 +919,7 @@ dump(ostream &stream) CallbackQueue resetQueue; void -regReset(Callback *cb) +RegResetCallback(Callback *cb) { resetQueue.add(cb); } diff --git a/base/statistics.hh b/base/statistics.hh index db08f14f7..2fe6988b0 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -2763,7 +2763,7 @@ class Formula : public Detail::VectorStat void check(); void dump(std::ostream &stream); void reset(); -void regReset(Callback *cb); +void RegResetCallback(Callback *cb); inline Detail::Temp operator+(Detail::Temp l, Detail::Temp r) -- cgit v1.2.3 From 2ac054386d9394689e728241972dab7184ae965d Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 2 Nov 2003 21:49:15 -0800 Subject: Print a warning rather than failing if we're unserializing and there's an object in the config that was not in the checkpointed config. This code compiles, but I haven't tested it... I'm committing it so Ron can have it. Should not effect anything that currently works. base/inifile.cc: base/inifile.hh: Add sectionExists() method so you can query whether a section exists without knowing any of the entry names that would be in it. sim/serialize.cc: sim/serialize.hh: Add Checkpoint::sectionExists() (pass through to IniFile). --HG-- extra : convert_revision : 905db122afdfe55946ab8493ccac0b1e715bc7c6 --- base/inifile.cc | 8 ++++++++ base/inifile.hh | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'base') diff --git a/base/inifile.cc b/base/inifile.cc index 7e7485bcb..2717a534d 100644 --- a/base/inifile.cc +++ b/base/inifile.cc @@ -402,6 +402,14 @@ IniFile::findAppend(const string &_section, const string &entry, return ret; } + +bool +IniFile::sectionExists(const string §ionName) const +{ + return findSection(sectionName) != NULL; +} + + bool IniFile::Section::printUnreferenced(const string §ionName) { diff --git a/base/inifile.hh b/base/inifile.hh index f67fdc7be..f7229f2f2 100644 --- a/base/inifile.hh +++ b/base/inifile.hh @@ -208,6 +208,13 @@ class IniFile bool findAppend(const std::string §ion, const std::string &entry, std::string &value) const; + /// Determine whether the named section exists in the .ini file. + /// Note that the 'Section' class is (intentionally) not public, + /// so all clients can do is get a bool that says whether there + /// are any values in that section or not. + /// @return True if the section exists. + bool sectionExists(const std::string §ion) const; + /// Print unreferenced entries in object. Iteratively calls /// printUnreferend() on all the constituent sections. bool printUnreferenced(); -- cgit v1.2.3