summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-02-18 09:31:25 -0800
committerNathan Binkert <binkertn@umich.edu>2007-02-18 09:31:25 -0800
commit4e7f8c088522dbf512ae02780f53cdccadb2474a (patch)
tree8e95bb8b96c76d253a52be5b9e8d8c5a03f6096b /src/sim
parentee93b4831438be8ab4b21905c3eaaffa0aed4390 (diff)
downloadgem5-4e7f8c088522dbf512ae02780f53cdccadb2474a.tar.xz
Get rid of the stand alone ParamContext since all of the
relevant stuff has now been moved to python. --HG-- extra : convert_revision : 608e5ffd0e2b33949a2b183117216f136cfa4484
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/builder.cc2
-rw-r--r--src/sim/main.cc9
-rw-r--r--src/sim/param.cc117
-rw-r--r--src/sim/param.hh47
4 files changed, 5 insertions, 170 deletions
diff --git a/src/sim/builder.cc b/src/sim/builder.cc
index 9074cc899..8ef54ce52 100644
--- a/src/sim/builder.cc
+++ b/src/sim/builder.cc
@@ -40,7 +40,7 @@
using namespace std;
SimObjectBuilder::SimObjectBuilder(const std::string &_iniSection)
- : ParamContext(_iniSection, NoAutoInit)
+ : ParamContext(_iniSection)
{
}
diff --git a/src/sim/main.cc b/src/sim/main.cc
index 45819f880..8e47ac6a0 100644
--- a/src/sim/main.cc
+++ b/src/sim/main.cc
@@ -272,13 +272,6 @@ connectPorts(SimObject *o1, const std::string &name1, int i1,
void
finalInit()
{
- // Parse and check all non-config-hierarchy parameters.
- ParamContext::parseAllContexts(inifile);
- ParamContext::checkAllContexts();
-
- // Echo all parameter settings to stats file as well.
- ParamContext::showAllContexts(*configStream);
-
// Do a second pass to finish initializing the sim objects
SimObject::initAll();
@@ -462,8 +455,6 @@ doExitCleanup()
cout.flush();
- ParamContext::cleanupAllContexts();
-
// print simulation stats
Stats::dump();
}
diff --git a/src/sim/param.cc b/src/sim/param.cc
index 091d18f71..51d389f5a 100644
--- a/src/sim/param.cc
+++ b/src/sim/param.cc
@@ -583,30 +583,10 @@ SimObjectBaseParam::parse(const string &s, vector<SimObject *>&value)
//
////////////////////////////////////////////////////////////////////////
-list<ParamContext *> *ParamContext::ctxList = NULL;
-
-ParamContext::ParamContext(const string &_iniSection, InitPhase _initPhase)
+ParamContext::ParamContext(const string &_iniSection)
: iniFilePtr(NULL), // initialized on call to parseParams()
- iniSection(_iniSection), paramList(NULL),
- initPhase(_initPhase)
-{
- // Put this context on global list for initialization
- if (initPhase != NoAutoInit) {
- if (ctxList == NULL)
- ctxList = new list<ParamContext *>();
-
- // keep list sorted by ascending initPhase values
- list<ParamContext *>::iterator i = ctxList->begin();
- list<ParamContext *>::iterator end = ctxList->end();
- for (; i != end; ++i) {
- if (initPhase <= (*i)->initPhase) {
- // found where we want to insert
- break;
- }
- }
- // (fall through case: insert at end)
- ctxList->insert(i, this);
- }
+ iniSection(_iniSection), paramList(NULL)
+{
}
@@ -695,97 +675,6 @@ ParamContext::printErrorProlog(ostream &os)
os << "Parameter error in section [" << iniSection << "]: " << endl;
}
-//
-// static method: call parseParams() on all registered contexts
-//
-void
-ParamContext::parseAllContexts(IniFile &iniFile)
-{
- if (!ctxList)
- return;
-
- list<ParamContext *>::iterator iter;
- for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
- ParamContext *pc = *iter;
- pc->parseParams(iniFile);
- }
-}
-
-
-//
-// static method: call checkParams() on all registered contexts
-//
-void
-ParamContext::checkAllContexts()
-{
- if (!ctxList)
- return;
-
- list<ParamContext *>::iterator iter;
- for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
- ParamContext *pc = *iter;
- pc->checkParams();
- }
-}
-
-
-//
-// static method: call showParams() on all registered contexts
-//
-void
-ParamContext::showAllContexts(ostream &os)
-{
- if (!ctxList)
- return;
-
- list<ParamContext *>::iterator iter;
- for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
- ParamContext *pc = *iter;
-
- os << "[" << pc->iniSection << "]" << endl;
- pc->showParams(os);
- os << endl;
- }
-}
-
-
-//
-// static method: call cleanup() on all registered contexts
-//
-void
-ParamContext::cleanupAllContexts()
-{
- if (!ctxList)
- return;
-
- list<ParamContext *>::iterator iter;
- for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
- ParamContext *pc = *iter;
-
- pc->cleanup();
- }
-}
-
-
-//
-// static method: call describeParams() on all registered contexts
-//
-void
-ParamContext::describeAllContexts(ostream &os)
-{
- if (!ctxList)
- return;
-
- list<ParamContext *>::iterator iter;
- for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
- ParamContext *pc = *iter;
-
- os << "[" << pc->iniSection << "]\n";
- pc->describeParams(os);
- os << endl;
- }
-}
-
void
parseTime(const std::vector<int> &time, struct tm *tm)
{
diff --git a/src/sim/param.hh b/src/sim/param.hh
index 8a4670e27..dff0fa72d 100644
--- a/src/sim/param.hh
+++ b/src/sim/param.hh
@@ -50,12 +50,6 @@ class SimObject;
//
class ParamContext : protected StartupCallback
{
- private:
-
- // static list of all ParamContext objects, built as a side effect
- // of the ParamContext constructor
- static std::list<ParamContext *> *ctxList;
-
protected:
// .ini file (database) for parameter lookup... initialized on call
@@ -78,31 +72,10 @@ class ParamContext : protected StartupCallback
public:
- /// 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);
-
+ ParamContext(const std::string &_iniSection);
virtual ~ParamContext() {}
// add a parameter to the context... called from the parameter
@@ -135,24 +108,6 @@ class ParamContext : protected StartupCallback
// generate the name for this instance of this context (used as a
// prefix to create unique names in resolveSimObject()
virtual const std::string &getInstanceName() { return iniSection; }
-
- // Parse all parameters registered with all ParamContext objects.
- static void parseAllContexts(IniFile &iniFile);
-
- // Check all parameters registered with all ParamContext objects.
- // (calls checkParams() on each)
- static void checkAllContexts();
-
- // Print all parameter values on indicated ostream.
- static void showAllContexts(std::ostream &os);
-
- // Clean up all registered ParamContext objects. (calls cleanup()
- // on each)
- static void cleanupAllContexts();
-
- // print descriptions of all parameters registered with all
- // ParamContext objects
- static void describeAllContexts(std::ostream &os);
};