diff options
Diffstat (limited to 'src/cpu/simple')
-rw-r--r-- | src/cpu/simple/atomic.cc | 23 | ||||
-rw-r--r-- | src/cpu/simple/atomic.hh | 11 |
2 files changed, 5 insertions, 29 deletions
diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 6c31f1ddd..c47686abc 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -64,24 +64,6 @@ using namespace std; using namespace TheISA; -AtomicSimpleCPU::TickEvent::TickEvent(AtomicSimpleCPU *c) - : Event(CPU_Tick_Pri), cpu(c) -{ -} - - -void -AtomicSimpleCPU::TickEvent::process() -{ - cpu->tick(); -} - -const char * -AtomicSimpleCPU::TickEvent::description() const -{ - return "AtomicSimpleCPU tick"; -} - void AtomicSimpleCPU::init() { @@ -94,7 +76,10 @@ AtomicSimpleCPU::init() } AtomicSimpleCPU::AtomicSimpleCPU(AtomicSimpleCPUParams *p) - : BaseSimpleCPU(p), tickEvent(this), width(p->width), locked(false), + : BaseSimpleCPU(p), + tickEvent([this]{ tick(); }, "AtomicSimpleCPU tick", + false, Event::CPU_Tick_Pri), + width(p->width), locked(false), simulate_data_stalls(p->simulate_data_stalls), simulate_inst_stalls(p->simulate_inst_stalls), icachePort(name() + ".icache_port", this), diff --git a/src/cpu/simple/atomic.hh b/src/cpu/simple/atomic.hh index cdc1890de..c9dd954bb 100644 --- a/src/cpu/simple/atomic.hh +++ b/src/cpu/simple/atomic.hh @@ -60,16 +60,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU private: - struct TickEvent : public Event - { - AtomicSimpleCPU *cpu; - - TickEvent(AtomicSimpleCPU *c); - void process(); - const char *description() const; - }; - - TickEvent tickEvent; + EventFunctionWrapper tickEvent; const int width; bool locked; |