From 60adacb5716d91b9838fbb5e2b0d3e766c1cfdb1 Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Wed, 28 Jun 2017 10:44:34 -0500 Subject: testers: Refactor some Event subclasses to lambdas Change-Id: I897b6162a827216b7bad74d955c0e50e06a5a3ec Signed-off-by: Sean Wilson Reviewed-on: https://gem5-review.googlesource.com/3926 Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- src/cpu/testers/directedtest/RubyDirectedTester.cc | 4 +++- src/cpu/testers/directedtest/RubyDirectedTester.hh | 15 +-------------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'src/cpu/testers/directedtest') diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.cc b/src/cpu/testers/directedtest/RubyDirectedTester.cc index 667d50ffd..ef133379d 100644 --- a/src/cpu/testers/directedtest/RubyDirectedTester.cc +++ b/src/cpu/testers/directedtest/RubyDirectedTester.cc @@ -47,7 +47,9 @@ #include "sim/sim_exit.hh" RubyDirectedTester::RubyDirectedTester(const Params *p) - : MemObject(p), directedStartEvent(this), + : MemObject(p), + directedStartEvent([this]{ wakeup(); }, "Directed tick", + false, Event::CPU_Tick_Pri), m_requests_to_complete(p->requests_to_complete), generator(p->generator) { diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.hh b/src/cpu/testers/directedtest/RubyDirectedTester.hh index 74a891178..00278a65e 100644 --- a/src/cpu/testers/directedtest/RubyDirectedTester.hh +++ b/src/cpu/testers/directedtest/RubyDirectedTester.hh @@ -85,20 +85,7 @@ class RubyDirectedTester : public MemObject void print(std::ostream& out) const; protected: - class DirectedStartEvent : public Event - { - private: - RubyDirectedTester *tester; - - public: - DirectedStartEvent(RubyDirectedTester *_tester) - : Event(CPU_Tick_Pri), tester(_tester) - {} - void process() { tester->wakeup(); } - virtual const char *description() const { return "Directed tick"; } - }; - - DirectedStartEvent directedStartEvent; + EventFunctionWrapper directedStartEvent; private: void hitCallback(NodeID proc, Addr addr); -- cgit v1.2.3