diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2005-02-18 13:10:37 -0500 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2005-02-18 13:10:37 -0500 |
commit | f825d103daa2eeaa26549862cd57d870aa1cb448 (patch) | |
tree | 83a825a3415ee77f81e463e960705e9880a89d3f /cpu | |
parent | 11acf20fdfe3c5aca218aa33087d765919e6a81a (diff) | |
parent | f4d3f781f1a36d07700a2af98319b67b179f9e5d (diff) | |
download | gem5-f825d103daa2eeaa26549862cd57d870aa1cb448.tar.xz |
Merge zizzer:/z/m5/Bitkeeper/m5
into zizzer.eecs.umich.edu:/.automount/zazzer/z/rdreslin/m5bk/timing_L1
--HG--
extra : convert_revision : 8fb4bbf165b8c65a54db5fea18ec5aa95172a173
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/simple_cpu/simple_cpu.cc | 29 | ||||
-rw-r--r-- | cpu/simple_cpu/simple_cpu.hh | 14 |
2 files changed, 19 insertions, 24 deletions
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 685447f44..853cfa69b 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -76,15 +76,15 @@ using namespace std; -SimpleCPU::TickEvent::TickEvent(SimpleCPU *c) - : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), multiplier(1) +SimpleCPU::TickEvent::TickEvent(SimpleCPU *c, int w) + : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), width(w) { } void SimpleCPU::TickEvent::process() { - int count = multiplier; + int count = width; do { cpu->tick(); } while (--count > 0 && cpu->status() == Running); @@ -98,8 +98,7 @@ SimpleCPU::TickEvent::description() SimpleCPU::CacheCompletionEvent::CacheCompletionEvent(SimpleCPU *_cpu) - : Event(&mainEventQueue), - cpu(_cpu) + : Event(&mainEventQueue), cpu(_cpu) { } @@ -126,7 +125,8 @@ SimpleCPU::SimpleCPU(const string &_name, MemInterface *icache_interface, MemInterface *dcache_interface, 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, max_insts_any_thread, max_insts_all_threads, max_loads_any_thread, max_loads_all_threads, @@ -140,13 +140,14 @@ SimpleCPU::SimpleCPU(const string &_name, Process *_process, MemInterface *icache_interface, MemInterface *dcache_interface, 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, max_insts_any_thread, max_insts_all_threads, max_loads_any_thread, max_loads_all_threads, _function_trace, _function_trace_start), #endif - tickEvent(this), xc(NULL), cacheCompletionEvent(this) + tickEvent(this, width), xc(NULL), cacheCompletionEvent(this) { _status = Idle; #ifdef FULL_SYSTEM @@ -878,7 +879,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU) SimObjectParam<BaseMem *> dcache; Param<bool> defer_registration; - Param<int> multiplier; + Param<int> width; Param<bool> function_trace; Param<Tick> function_trace_start; @@ -914,7 +915,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(SimpleCPU) INIT_PARAM_DFLT(defer_registration, "defer registration with system " "(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_start, "Cycle to start function trace", 0) @@ -936,7 +937,8 @@ CREATE_SIM_OBJECT(SimpleCPU) (dcache) ? dcache->getInterface() : NULL, defer_registration, ticksPerSecond * mult, - function_trace, function_trace_start); + function_trace, function_trace_start, + width); #else cpu = new SimpleCPU(getInstanceName(), workload, @@ -945,12 +947,11 @@ CREATE_SIM_OBJECT(SimpleCPU) (icache) ? icache->getInterface() : NULL, (dcache) ? dcache->getInterface() : NULL, defer_registration, - function_trace, function_trace_start); + function_trace, function_trace_start, + width); #endif // FULL_SYSTEM - cpu->setTickMultiplier(multiplier); - return cpu; } diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 59545fad4..e98557068 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -70,9 +70,9 @@ class SimpleCPU : public BaseCPU struct TickEvent : public Event { SimpleCPU *cpu; - int multiplier; + int width; - TickEvent(SimpleCPU *c); + TickEvent(SimpleCPU *c, int w); void process(); const char *description(); }; @@ -95,12 +95,6 @@ class SimpleCPU : public BaseCPU tickEvent.squash(); } - public: - void setTickMultiplier(int multiplier) - { - tickEvent.multiplier = multiplier; - } - private: Trace::InstRecord *traceData; @@ -139,7 +133,7 @@ class SimpleCPU : public BaseCPU AlphaITB *itb, AlphaDTB *dtb, FunctionalMemory *mem, MemInterface *icache_interface, MemInterface *dcache_interface, bool _def_reg, Tick freq, - bool _function_trace, Tick _function_trace_start); + bool _function_trace, Tick _function_trace_start, int width); #else @@ -150,7 +144,7 @@ class SimpleCPU : public BaseCPU Counter max_loads_all_threads, MemInterface *icache_interface, MemInterface *dcache_interface, bool _def_reg, - bool _function_trace, Tick _function_trace_start); + bool _function_trace, Tick _function_trace_start, int width); #endif |