rename the simple cpu's multiplier parameter. call it width.

it makes more sense and is less confusing.

cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
    width is a better name than multiplier

--HG--
extra : convert_revision : ea2fa4faa160f5657aece41df469bbc9f7244b21
This commit is contained in:
Nathan Binkert 2005-02-17 14:02:03 -05:00
parent cfe6ed7c48
commit dd4220ec10
2 changed files with 19 additions and 24 deletions

View file

@ -75,15 +75,15 @@
using namespace std; using namespace std;
SimpleCPU::TickEvent::TickEvent(SimpleCPU *c) SimpleCPU::TickEvent::TickEvent(SimpleCPU *c, int w)
: Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), multiplier(1) : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), width(w)
{ {
} }
void void
SimpleCPU::TickEvent::process() SimpleCPU::TickEvent::process()
{ {
int count = multiplier; int count = width;
do { do {
cpu->tick(); cpu->tick();
} while (--count > 0 && cpu->status() == Running); } while (--count > 0 && cpu->status() == Running);
@ -97,8 +97,7 @@ SimpleCPU::TickEvent::description()
SimpleCPU::CacheCompletionEvent::CacheCompletionEvent(SimpleCPU *_cpu) SimpleCPU::CacheCompletionEvent::CacheCompletionEvent(SimpleCPU *_cpu)
: Event(&mainEventQueue), : Event(&mainEventQueue), cpu(_cpu)
cpu(_cpu)
{ {
} }
@ -125,7 +124,8 @@ SimpleCPU::SimpleCPU(const string &_name,
MemInterface *icache_interface, MemInterface *icache_interface,
MemInterface *dcache_interface, MemInterface *dcache_interface,
bool _def_reg, Tick freq, bool _def_reg, Tick freq,
bool _function_trace, Tick _function_trace_start) bool _function_trace, Tick _function_trace_start,
int width)
: BaseCPU(_name, /* number_of_threads */ 1, _def_reg, : BaseCPU(_name, /* number_of_threads */ 1, _def_reg,
max_insts_any_thread, max_insts_all_threads, max_insts_any_thread, max_insts_all_threads,
max_loads_any_thread, max_loads_all_threads, max_loads_any_thread, max_loads_all_threads,
@ -139,13 +139,14 @@ SimpleCPU::SimpleCPU(const string &_name, Process *_process,
MemInterface *icache_interface, MemInterface *icache_interface,
MemInterface *dcache_interface, MemInterface *dcache_interface,
bool _def_reg, bool _def_reg,
bool _function_trace, Tick _function_trace_start) bool _function_trace, Tick _function_trace_start,
int width)
: BaseCPU(_name, /* number_of_threads */ 1, _def_reg, : BaseCPU(_name, /* number_of_threads */ 1, _def_reg,
max_insts_any_thread, max_insts_all_threads, max_insts_any_thread, max_insts_all_threads,
max_loads_any_thread, max_loads_all_threads, max_loads_any_thread, max_loads_all_threads,
_function_trace, _function_trace_start), _function_trace, _function_trace_start),
#endif #endif
tickEvent(this), xc(NULL), cacheCompletionEvent(this) tickEvent(this, width), xc(NULL), cacheCompletionEvent(this)
{ {
_status = Idle; _status = Idle;
#ifdef FULL_SYSTEM #ifdef FULL_SYSTEM
@ -841,7 +842,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU)
SimObjectParam<BaseMem *> dcache; SimObjectParam<BaseMem *> dcache;
Param<bool> defer_registration; Param<bool> defer_registration;
Param<int> multiplier; Param<int> width;
Param<bool> function_trace; Param<bool> function_trace;
Param<Tick> function_trace_start; Param<Tick> function_trace_start;
@ -877,7 +878,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(SimpleCPU)
INIT_PARAM_DFLT(defer_registration, "defer registration with system " INIT_PARAM_DFLT(defer_registration, "defer registration with system "
"(for sampling)", false), "(for sampling)", false),
INIT_PARAM_DFLT(multiplier, "clock multiplier", 1), INIT_PARAM_DFLT(width, "cpu width", 1),
INIT_PARAM_DFLT(function_trace, "Enable function trace", false), INIT_PARAM_DFLT(function_trace, "Enable function trace", false),
INIT_PARAM_DFLT(function_trace_start, "Cycle to start function trace", 0) INIT_PARAM_DFLT(function_trace_start, "Cycle to start function trace", 0)
@ -899,7 +900,8 @@ CREATE_SIM_OBJECT(SimpleCPU)
(dcache) ? dcache->getInterface() : NULL, (dcache) ? dcache->getInterface() : NULL,
defer_registration, defer_registration,
ticksPerSecond * mult, ticksPerSecond * mult,
function_trace, function_trace_start); function_trace, function_trace_start,
width);
#else #else
cpu = new SimpleCPU(getInstanceName(), workload, cpu = new SimpleCPU(getInstanceName(), workload,
@ -908,12 +910,11 @@ CREATE_SIM_OBJECT(SimpleCPU)
(icache) ? icache->getInterface() : NULL, (icache) ? icache->getInterface() : NULL,
(dcache) ? dcache->getInterface() : NULL, (dcache) ? dcache->getInterface() : NULL,
defer_registration, defer_registration,
function_trace, function_trace_start); function_trace, function_trace_start,
width);
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
cpu->setTickMultiplier(multiplier);
return cpu; return cpu;
} }

View file

@ -69,9 +69,9 @@ class SimpleCPU : public BaseCPU
struct TickEvent : public Event struct TickEvent : public Event
{ {
SimpleCPU *cpu; SimpleCPU *cpu;
int multiplier; int width;
TickEvent(SimpleCPU *c); TickEvent(SimpleCPU *c, int w);
void process(); void process();
const char *description(); const char *description();
}; };
@ -94,12 +94,6 @@ class SimpleCPU : public BaseCPU
tickEvent.squash(); tickEvent.squash();
} }
public:
void setTickMultiplier(int multiplier)
{
tickEvent.multiplier = multiplier;
}
private: private:
Trace::InstRecord *traceData; Trace::InstRecord *traceData;
@ -137,7 +131,7 @@ class SimpleCPU : public BaseCPU
AlphaITB *itb, AlphaDTB *dtb, FunctionalMemory *mem, AlphaITB *itb, AlphaDTB *dtb, FunctionalMemory *mem,
MemInterface *icache_interface, MemInterface *dcache_interface, MemInterface *icache_interface, MemInterface *dcache_interface,
bool _def_reg, Tick freq, bool _def_reg, Tick freq,
bool _function_trace, Tick _function_trace_start); bool _function_trace, Tick _function_trace_start, int width);
#else #else
@ -148,7 +142,7 @@ class SimpleCPU : public BaseCPU
Counter max_loads_all_threads, Counter max_loads_all_threads,
MemInterface *icache_interface, MemInterface *dcache_interface, MemInterface *icache_interface, MemInterface *dcache_interface,
bool _def_reg, bool _def_reg,
bool _function_trace, Tick _function_trace_start); bool _function_trace, Tick _function_trace_start, int width);
#endif #endif