diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-28 13:34:02 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-07-12 20:07:05 +0000 |
commit | fc575f8266149c78b29bcbe12ab86ccb7614ffbf (patch) | |
tree | 8f6ad3a6af8a5b4c529638b94ceb7a897d6192fb /src/mem/ruby/system/RubySystem.hh | |
parent | 381aa8498997f5ce93480511f7514be85356687a (diff) | |
download | gem5-fc575f8266149c78b29bcbe12ab86ccb7614ffbf.tar.xz |
ruby: Refactor some Event subclasses to lambdas
Change-Id: I9f47a20a869553515a759d9a29c05f6ce4b42d64
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3930
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/ruby/system/RubySystem.hh')
-rw-r--r-- | src/mem/ruby/system/RubySystem.hh | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/mem/ruby/system/RubySystem.hh b/src/mem/ruby/system/RubySystem.hh index 8ebd3494a..407a253f3 100644 --- a/src/mem/ruby/system/RubySystem.hh +++ b/src/mem/ruby/system/RubySystem.hh @@ -50,21 +50,6 @@ class AbstractController; class RubySystem : public ClockedObject { public: - class RubyEvent : public Event - { - public: - RubyEvent(RubySystem* _ruby_system) - { - m_ruby_system = _ruby_system; - } - private: - void process(); - - RubySystem* m_ruby_system; - }; - - friend class RubyEvent; - typedef RubySystemParams Params; RubySystem(const Params *p); ~RubySystem(); @@ -111,7 +96,8 @@ class RubySystem : public ClockedObject bool eventQueueEmpty() { return eventq->empty(); } void enqueueRubyEvent(Tick tick) { - RubyEvent* e = new RubyEvent(this); + auto e = new EventFunctionWrapper( + [this]{ processRubyEvent(); }, "RubyEvent"); schedule(e, tick); } @@ -130,6 +116,7 @@ class RubySystem : public ClockedObject static void writeCompressedTrace(uint8_t *raw_data, std::string file, uint64_t uncompressed_trace_size); + void processRubyEvent(); private: // configuration parameters static bool m_randomization; |