summaryrefslogtreecommitdiff
path: root/src/cpu
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/cpu
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/cpu')
-rw-r--r--src/cpu/base.cc4
-rw-r--r--src/cpu/exetrace.cc3
-rw-r--r--src/cpu/exetrace.hh5
-rw-r--r--src/cpu/func_unit.cc6
-rw-r--r--src/cpu/func_unit.hh15
-rw-r--r--src/cpu/inteltrace.cc3
-rw-r--r--src/cpu/inteltrace.hh3
-rw-r--r--src/cpu/intr_control.cc7
-rw-r--r--src/cpu/intr_control.hh4
-rw-r--r--src/cpu/legiontrace.cc3
-rw-r--r--src/cpu/legiontrace.hh5
-rw-r--r--src/cpu/memtest/MemTest.py4
-rw-r--r--src/cpu/memtest/memtest.cc49
-rw-r--r--src/cpu/memtest/memtest.hh15
-rw-r--r--src/cpu/o3/fu_pool.cc8
-rw-r--r--src/cpu/o3/fu_pool.hh5
16 files changed, 56 insertions, 83 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index a54ed9349..7b31eb766 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -95,12 +95,12 @@ CPUProgressEvent::description()
#if FULL_SYSTEM
BaseCPU::BaseCPU(Params *p)
- : MemObject(p->name), clock(p->clock), instCnt(0),
+ : MemObject(makeParams(p->name)), clock(p->clock), instCnt(0),
params(p), number_of_threads(p->numberOfThreads), system(p->system),
phase(p->phase)
#else
BaseCPU::BaseCPU(Params *p)
- : MemObject(p->name), clock(p->clock), params(p),
+ : MemObject(makeParams(p->name)), clock(p->clock), params(p),
number_of_threads(p->numberOfThreads), system(p->system),
phase(p->phase)
#endif
diff --git a/src/cpu/exetrace.cc b/src/cpu/exetrace.cc
index 38c22da94..0118dbde1 100644
--- a/src/cpu/exetrace.cc
+++ b/src/cpu/exetrace.cc
@@ -39,7 +39,6 @@
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
#include "enums/OpClass.hh"
-#include "params/ExeTracer.hh"
using namespace std;
using namespace TheISA;
@@ -116,5 +115,5 @@ Trace::ExeTracerRecord::dump()
Trace::ExeTracer *
ExeTracerParams::create()
{
- return new Trace::ExeTracer(name);
+ return new Trace::ExeTracer(this);
};
diff --git a/src/cpu/exetrace.hh b/src/cpu/exetrace.hh
index 76907d955..84660432b 100644
--- a/src/cpu/exetrace.hh
+++ b/src/cpu/exetrace.hh
@@ -36,6 +36,7 @@
#include "cpu/static_inst.hh"
#include "sim/host.hh"
#include "sim/insttracer.hh"
+#include "params/ExeTracer.hh"
class ThreadContext;
@@ -57,8 +58,8 @@ class ExeTracerRecord : public InstRecord
class ExeTracer : public InstTracer
{
public:
-
- ExeTracer(const std::string & name) : InstTracer(name)
+ typedef ExeTracerParams Params;
+ ExeTracer(const Params *params) : InstTracer(params)
{}
InstRecord *
diff --git a/src/cpu/func_unit.cc b/src/cpu/func_unit.cc
index d7aeb5b37..bb7427da5 100644
--- a/src/cpu/func_unit.cc
+++ b/src/cpu/func_unit.cc
@@ -32,8 +32,6 @@
#include "base/misc.hh"
#include "cpu/func_unit.hh"
-#include "params/OpDesc.hh"
-#include "params/FUDesc.hh"
using namespace std;
@@ -120,7 +118,7 @@ FuncUnit::issueLatency(OpClass capability)
OpDesc *
OpDescParams::create()
{
- return new OpDesc(name, opClass, opLat, issueLat);
+ return new OpDesc(this);
}
//
@@ -129,5 +127,5 @@ OpDescParams::create()
FUDesc *
FUDescParams::create()
{
- return new FUDesc(name, opList, count);
+ return new FUDesc(this);
}
diff --git a/src/cpu/func_unit.hh b/src/cpu/func_unit.hh
index 780143096..e8238ba73 100644
--- a/src/cpu/func_unit.hh
+++ b/src/cpu/func_unit.hh
@@ -36,6 +36,8 @@
#include <vector>
#include "cpu/op_class.hh"
+#include "params/OpDesc.hh"
+#include "params/FUDesc.hh"
#include "sim/sim_object.hh"
////////////////////////////////////////////////////////////////////////////
@@ -51,8 +53,9 @@ struct OpDesc : public SimObject
unsigned opLat;
unsigned issueLat;
- OpDesc(std::string name, OpClass c, unsigned o, unsigned i)
- : SimObject(name), opClass(c), opLat(o), issueLat(i) {};
+ OpDesc(const OpDescParams *p)
+ : SimObject(p), opClass(p->opClass), opLat(p->opLat),
+ issueLat(p->issueLat) {};
};
struct FUDesc : public SimObject
@@ -60,12 +63,12 @@ struct FUDesc : public SimObject
std::vector<OpDesc *> opDescList;
unsigned number;
- FUDesc(std::string name, std::vector<OpDesc *> l, unsigned n)
- : SimObject(name), opDescList(l), number(n) {};
+ FUDesc(const FUDescParams *p)
+ : SimObject(p), opDescList(p->opList), number(p->count) {};
};
-typedef std::vector<OpDesc *>::iterator OPDDiterator;
-typedef std::vector<FUDesc *>::iterator FUDDiterator;
+typedef std::vector<OpDesc *>::const_iterator OPDDiterator;
+typedef std::vector<FUDesc *>::const_iterator FUDDiterator;
diff --git a/src/cpu/inteltrace.cc b/src/cpu/inteltrace.cc
index afa51b517..145075dc1 100644
--- a/src/cpu/inteltrace.cc
+++ b/src/cpu/inteltrace.cc
@@ -36,7 +36,6 @@
#include "cpu/exetrace.hh"
#include "cpu/inteltrace.hh"
#include "cpu/static_inst.hh"
-#include "params/IntelTrace.hh"
using namespace std;
using namespace TheISA;
@@ -66,5 +65,5 @@ Trace::IntelTraceRecord::dump()
Trace::IntelTrace *
IntelTraceParams::create()
{
- return new Trace::IntelTrace(name);
+ return new Trace::IntelTrace(this);
};
diff --git a/src/cpu/inteltrace.hh b/src/cpu/inteltrace.hh
index 21afe0fc0..5d5bcda8e 100644
--- a/src/cpu/inteltrace.hh
+++ b/src/cpu/inteltrace.hh
@@ -34,6 +34,7 @@
#include "base/trace.hh"
#include "cpu/static_inst.hh"
+#include "params/IntelTrace.hh"
#include "sim/host.hh"
#include "sim/insttracer.hh"
@@ -58,7 +59,7 @@ class IntelTrace : public InstTracer
{
public:
- IntelTrace(const std::string & name) : InstTracer(name)
+ IntelTrace(const IntelTraceParams *p) : InstTracer(p)
{}
IntelTraceRecord *
diff --git a/src/cpu/intr_control.cc b/src/cpu/intr_control.cc
index e9f27e9ed..018ae1886 100644
--- a/src/cpu/intr_control.cc
+++ b/src/cpu/intr_control.cc
@@ -35,13 +35,12 @@
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "cpu/intr_control.hh"
-#include "params/IntrControl.hh"
#include "sim/sim_object.hh"
using namespace std;
-IntrControl::IntrControl(const string &name, System *s)
- : SimObject(name), sys(s)
+IntrControl::IntrControl(const Params *p)
+ : SimObject(p), sys(p->sys)
{}
void
@@ -79,5 +78,5 @@ IntrControl::clear(int cpu_id, int int_num, int index)
IntrControl *
IntrControlParams::create()
{
- return new IntrControl(name, sys);
+ return new IntrControl(this);
}
diff --git a/src/cpu/intr_control.hh b/src/cpu/intr_control.hh
index c6f75abf0..746859fab 100644
--- a/src/cpu/intr_control.hh
+++ b/src/cpu/intr_control.hh
@@ -35,6 +35,7 @@
#include <vector>
#include "base/misc.hh"
#include "cpu/base.hh"
+#include "params/IntrControl.hh"
#include "sim/sim_object.hh"
#include "sim/system.hh"
@@ -43,7 +44,8 @@ class IntrControl : public SimObject
{
public:
System *sys;
- IntrControl(const std::string &name, System *s);
+ typedef IntrControlParams Params;
+ IntrControl(const Params *p);
void clear(int int_num, int index = 0);
void post(int int_num, int index = 0);
diff --git a/src/cpu/legiontrace.cc b/src/cpu/legiontrace.cc
index 58181cb88..d30343025 100644
--- a/src/cpu/legiontrace.cc
+++ b/src/cpu/legiontrace.cc
@@ -53,7 +53,6 @@
#include "cpu/legiontrace.hh"
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
-#include "params/LegionTrace.hh"
#include "sim/system.hh"
#if FULL_SYSTEM
@@ -596,5 +595,5 @@ Trace::LegionTraceRecord::dump()
Trace::LegionTrace *
LegionTraceParams::create()
{
- return new Trace::LegionTrace(name);
+ return new Trace::LegionTrace(this);
};
diff --git a/src/cpu/legiontrace.hh b/src/cpu/legiontrace.hh
index 55c05e7ae..97193ff1a 100644
--- a/src/cpu/legiontrace.hh
+++ b/src/cpu/legiontrace.hh
@@ -34,6 +34,7 @@
#include "base/trace.hh"
#include "cpu/static_inst.hh"
+#include "params/LegionTrace.hh"
#include "sim/host.hh"
#include "sim/insttracer.hh"
@@ -56,8 +57,8 @@ class LegionTraceRecord : public InstRecord
class LegionTrace : public InstTracer
{
public:
-
- LegionTrace(const std::string & name) : InstTracer(name)
+ typedef LegionTraceParams Params;
+ LegionTrace(const Params *p) : InstTracer(p)
{}
LegionTraceRecord *
diff --git a/src/cpu/memtest/MemTest.py b/src/cpu/memtest/MemTest.py
index a328f4734..629fd4877 100644
--- a/src/cpu/memtest/MemTest.py
+++ b/src/cpu/memtest/MemTest.py
@@ -26,12 +26,12 @@
#
# Authors: Nathan Binkert
-from m5.SimObject import SimObject
+from MemObject import MemObject
from m5.params import *
from m5.proxy import *
from m5 import build_env
-class MemTest(SimObject):
+class MemTest(MemObject):
type = 'MemTest'
max_loads = Param.Counter(0, "number of loads to execute")
atomic = Param.Bool(False, "Execute tester in atomic mode? (or timing)\n")
diff --git a/src/cpu/memtest/memtest.cc b/src/cpu/memtest/memtest.cc
index 83417c514..583fd5f8d 100644
--- a/src/cpu/memtest/memtest.cc
+++ b/src/cpu/memtest/memtest.cc
@@ -46,7 +46,6 @@
#include "mem/packet.hh"
//#include "mem/physical.hh"
#include "mem/request.hh"
-#include "params/MemTest.hh"
#include "sim/sim_events.hh"
#include "sim/stats.hh"
@@ -119,37 +118,24 @@ MemTest::sendPkt(PacketPtr pkt) {
}
-MemTest::MemTest(const string &name,
-// MemInterface *_cache_interface,
-// PhysicalMemory *main_mem,
-// PhysicalMemory *check_mem,
- unsigned _memorySize,
- unsigned _percentReads,
- unsigned _percentFunctional,
- unsigned _percentUncacheable,
- unsigned _progressInterval,
- unsigned _percentSourceUnaligned,
- unsigned _percentDestUnaligned,
- Addr _traceAddr,
- Counter _max_loads,
- bool _atomic)
- : MemObject(name),
+MemTest::MemTest(const Params *p)
+ : MemObject(p),
tickEvent(this),
cachePort("test", this),
funcPort("functional", this),
retryPkt(NULL),
// mainMem(main_mem),
// checkMem(check_mem),
- size(_memorySize),
- percentReads(_percentReads),
- percentFunctional(_percentFunctional),
- percentUncacheable(_percentUncacheable),
- progressInterval(_progressInterval),
- nextProgressMessage(_progressInterval),
- percentSourceUnaligned(_percentSourceUnaligned),
- percentDestUnaligned(percentDestUnaligned),
- maxLoads(_max_loads),
- atomic(_atomic)
+ size(p->memory_size),
+ percentReads(p->percent_reads),
+ percentFunctional(p->percent_functional),
+ percentUncacheable(p->percent_uncacheable),
+ progressInterval(p->progress_interval),
+ nextProgressMessage(p->progress_interval),
+ percentSourceUnaligned(p->percent_source_unaligned),
+ percentDestUnaligned(p->percent_dest_unaligned),
+ maxLoads(p->max_loads),
+ atomic(p->atomic)
{
vector<string> cmd;
cmd.push_back("/bin/ls");
@@ -161,7 +147,7 @@ MemTest::MemTest(const string &name,
funcPort.snoopRangeSent = true;
// Needs to be masked off once we know the block size.
- traceBlockAddr = _traceAddr;
+ traceBlockAddr = p->trace_addr;
baseAddr1 = 0x100000;
baseAddr2 = 0x400000;
uncacheAddr = 0x800000;
@@ -411,12 +397,5 @@ MemTest::doRetry()
MemTest *
MemTestParams::create()
{
- return new MemTest(name,
-#if 0
- cache->getInterface(), main_mem, check_mem,
-#endif
- memory_size, percent_reads, percent_functional,
- percent_uncacheable, progress_interval,
- percent_source_unaligned, percent_dest_unaligned,
- trace_addr, max_loads, atomic);
+ return new MemTest(this);
}
diff --git a/src/cpu/memtest/memtest.hh b/src/cpu/memtest/memtest.hh
index f4713709a..fa168c70b 100644
--- a/src/cpu/memtest/memtest.hh
+++ b/src/cpu/memtest/memtest.hh
@@ -35,6 +35,7 @@
#include <set>
#include "base/statistics.hh"
+#include "params/MemTest.hh"
#include "sim/eventq.hh"
#include "sim/sim_exit.hh"
#include "sim/sim_object.hh"
@@ -46,18 +47,8 @@ class Packet;
class MemTest : public MemObject
{
public:
-
- MemTest(const std::string &name,
- unsigned _memorySize,
- unsigned _percentReads,
- unsigned _percentFunctional,
- unsigned _percentUncacheable,
- unsigned _progressInterval,
- unsigned _percentSourceUnaligned,
- unsigned _percentDestUnaligned,
- Addr _traceAddr,
- Counter _max_loads,
- bool _atomic);
+ typedef MemTestParams Params;
+ MemTest(const Params *p);
virtual void init();
diff --git a/src/cpu/o3/fu_pool.cc b/src/cpu/o3/fu_pool.cc
index 09d271b10..b7c972b09 100644
--- a/src/cpu/o3/fu_pool.cc
+++ b/src/cpu/o3/fu_pool.cc
@@ -32,7 +32,6 @@
#include "cpu/o3/fu_pool.hh"
#include "cpu/func_unit.hh"
-#include "params/FUPool.hh"
using namespace std;
@@ -69,8 +68,8 @@ FUPool::~FUPool()
// Constructor
-FUPool::FUPool(string name, vector<FUDesc *> paramList)
- : SimObject(name)
+FUPool::FUPool(const Params *p)
+ : SimObject(p)
{
numFU = 0;
@@ -84,6 +83,7 @@ FUPool::FUPool(string name, vector<FUDesc *> paramList)
//
// Iterate through the list of FUDescData structures
//
+ const vector<FUDesc *> &paramList = p->FUList;
for (FUDDiterator i = paramList.begin(); i != paramList.end(); ++i) {
//
@@ -278,5 +278,5 @@ FUPool::takeOverFrom()
FUPool *
FUPoolParams::create()
{
- return new FUPool(name, FUList);
+ return new FUPool(this);
}
diff --git a/src/cpu/o3/fu_pool.hh b/src/cpu/o3/fu_pool.hh
index 52d83f056..48037324c 100644
--- a/src/cpu/o3/fu_pool.hh
+++ b/src/cpu/o3/fu_pool.hh
@@ -38,6 +38,7 @@
#include "base/sched_list.hh"
#include "cpu/op_class.hh"
+#include "params/FUPool.hh"
#include "sim/sim_object.hh"
class FUDesc;
@@ -116,9 +117,9 @@ class FUPool : public SimObject
typedef std::vector<FuncUnit *>::iterator fuListIterator;
public:
-
+ typedef FUPoolParams Params;
/** Constructs a FU pool. */
- FUPool(std::string name, std::vector<FUDesc *> l);
+ FUPool(const Params *p);
~FUPool();
/** Annotates units that provide memory operations. Included only because