summaryrefslogtreecommitdiff
path: root/sim/param.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2004-10-25 00:56:47 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2004-10-25 00:56:47 -0400
commite852f9e31a8157f109058e6f3fdb4e86cc0cb10c (patch)
treefff5b2806698b621455afc3f1c639c402008987d /sim/param.hh
parent400daa7e41057ec358691afeffe35ffa430d11b0 (diff)
downloadgem5-e852f9e31a8157f109058e6f3fdb4e86cc0cb10c.tar.xz
Add explicit phases to order ParamContext initializations.
--HG-- extra : convert_revision : c24fba2bded2493a892fa93de0c61f9674cfedbb
Diffstat (limited to 'sim/param.hh')
-rw-r--r--sim/param.hh29
1 files changed, 24 insertions, 5 deletions
diff --git a/sim/param.hh b/sim/param.hh
index fe13edc48..6706820c2 100644
--- a/sim/param.hh
+++ b/sim/param.hh
@@ -74,11 +74,30 @@ class ParamContext
public:
- // Second arg, if set to true, says don't put on paramContextList
- // (i.e. don't automatically parse params). Used by derived
- // SimObjectBuilder class, where parsing is done in
- // SimObject::create()
- ParamContext(const std::string &_iniSection, bool noAutoParse = false);
+ /// Initialization phases for ParamContext objects.
+ enum InitPhase {
+ NoAutoInit = -1, ///< Don't initialize at all... params
+ /// will be parsed later (used by
+ /// SimObjectBuilder, which parses
+ /// params in SimObject::create().
+ OutputInitPhase = 0, ///< Output stream initialization
+ TraceInitPhase = 1, ///< Trace context initialization:
+ /// depends on output streams, but
+ /// needs to come before others so we
+ /// can use tracing in other
+ /// ParamContext init code
+ StatsInitPhase = 2, ///< Stats output initialization
+ DefaultInitPhase = 3 ///< Everything else
+ };
+
+ /// Records the initialization phase for this ParamContext.
+ InitPhase initPhase;
+
+ /// Constructor.
+ /// @param _iniSection Name of .ini section corresponding to this context.
+ /// @param _initPhase Initialization phase (see InitPhase).
+ ParamContext(const std::string &_iniSection,
+ InitPhase _initPhase = DefaultInitPhase);
virtual ~ParamContext() {}