summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags
diff options
context:
space:
mode:
authorMiles Kaufmann <milesck@eecs.umich.edu>2007-08-30 15:16:59 -0400
committerMiles Kaufmann <milesck@eecs.umich.edu>2007-08-30 15:16:59 -0400
commit54cc0053f0a6822e47a49771976af6daaabc24bb (patch)
tree72e6c7879de698347832e1e1475afbb9c1be2b70 /src/mem/cache/tags
parent9cb49ab9e0ff8917d20fd7dc81be3ce5ecc81bd8 (diff)
downloadgem5-54cc0053f0a6822e47a49771976af6daaabc24bb.tar.xz
params: Deprecate old-style constructors; update most SimObject constructors.
SimObjects not yet updated: - Process and subclasses - BaseCPU and subclasses The SimObject(const std::string &name) constructor was removed. Subclasses that still rely on that behavior must call the parent initializer as : SimObject(makeParams(name)) --HG-- extra : convert_revision : d6faddde76e7c3361ebdbd0a7b372a40941c12ed
Diffstat (limited to 'src/mem/cache/tags')
-rw-r--r--src/mem/cache/tags/repl/gen.cc18
-rw-r--r--src/mem/cache/tags/repl/gen.hh16
-rw-r--r--src/mem/cache/tags/repl/repl.hh8
3 files changed, 12 insertions, 30 deletions
diff --git a/src/mem/cache/tags/repl/gen.cc b/src/mem/cache/tags/repl/gen.cc
index 7d1566300..bc4e6b86a 100644
--- a/src/mem/cache/tags/repl/gen.cc
+++ b/src/mem/cache/tags/repl/gen.cc
@@ -44,19 +44,11 @@
using namespace std;
-GenRepl::GenRepl(const string &_name,
- int _num_pools,
- int _fresh_res,
- int _pool_res) // fix this, should be set by cache
- : Repl(_name)
+GenRepl::GenRepl(const Params *p) // fix this, should be set by cache
+ : Repl(p), num_pools(p->num_pools), fresh_res(p->fresh_res),
+ pool_res(p->pool_res), num_entries(0), num_pool_entries(0), misses(0),
+ pools(pools = new GenPool[num_pools+1])
{
- num_pools = _num_pools;
- fresh_res = _fresh_res;
- pool_res = _pool_res;
- num_entries = 0;
- num_pool_entries = 0;
- misses = 0;
- pools = new GenPool[num_pools+1];
}
GenRepl::~GenRepl()
@@ -250,5 +242,5 @@ GenRepl::findTagPtr(unsigned long index)
GenRepl *
GenReplParams::create()
{
- return new GenRepl(name, num_pools, fresh_res, pool_res);
+ return new GenRepl(this);
}
diff --git a/src/mem/cache/tags/repl/gen.hh b/src/mem/cache/tags/repl/gen.hh
index c1ceb3f4e..09a8d5995 100644
--- a/src/mem/cache/tags/repl/gen.hh
+++ b/src/mem/cache/tags/repl/gen.hh
@@ -40,6 +40,7 @@
#include "base/statistics.hh"
#include "mem/cache/tags/repl/repl.hh"
+#include "params/GenRepl.hh"
/**
* Generational Replacement entry.
@@ -139,8 +140,6 @@ class GenPool
class GenRepl : public Repl
{
public:
- /** The array of pools. */
- GenPool *pools;
/** The number of pools. */
int num_pools;
/** The amount of time to stay in the fresh pool. */
@@ -153,6 +152,8 @@ class GenRepl : public Repl
int num_pool_entries;
/** The number of misses. Used as the internal time. */
Tick misses;
+ /** The array of pools. */
+ GenPool *pools;
// Statistics
@@ -170,15 +171,8 @@ class GenRepl : public Repl
* @}
*/
- /**
- * Constructs and initializes this replacement policy.
- * @param name The name of the policy.
- * @param num_pools The number of pools to use.
- * @param fresh_res The amount of time to wait in the fresh pool.
- * @param pool_res The amount of time to wait in the normal pools.
- */
- GenRepl(const std::string &name, int num_pools,
- int fresh_res, int pool_res);
+ typedef GenReplParams Params;
+ GenRepl(const Params *p);
/**
* Destructor.
diff --git a/src/mem/cache/tags/repl/repl.hh b/src/mem/cache/tags/repl/repl.hh
index 7c289a5c1..cdb5ae4b8 100644
--- a/src/mem/cache/tags/repl/repl.hh
+++ b/src/mem/cache/tags/repl/repl.hh
@@ -58,12 +58,8 @@ class Repl : public SimObject
/** Pointer to the IIC using this policy. */
IIC *iic;
- /**
- * Construct and initialize this polixy.
- * @param name The instance name of this policy.
- */
- Repl (const std::string &name)
- : SimObject(name)
+ Repl (const Params *params)
+ : SimObject(params)
{
iic = NULL;
}