summaryrefslogtreecommitdiff
path: root/src/cpu/minor
diff options
context:
space:
mode:
authorSean Wilson <spwilson2@wisc.edu>2017-06-28 08:52:08 -0500
committerSean Wilson <spwilson2@wisc.edu>2017-07-12 20:07:05 +0000
commit8c1ea47b3c2fc90378eb16f3ad92d4ae522567c5 (patch)
tree4ac53d611aaedd5728e9f1100d43d166634ab5a8 /src/cpu/minor
parent741261f10bb308cdc200c5dfd8eb68567349cf19 (diff)
downloadgem5-8c1ea47b3c2fc90378eb16f3ad92d4ae522567c5.tar.xz
cpu: Refactor some Event subclasses to lambdas
Change-Id: If765c6100d67556f157e4e61aa33c2b7eeb8d2f0 Signed-off-by: Sean Wilson <spwilson2@wisc.edu> Reviewed-on: https://gem5-review.googlesource.com/3923 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu/minor')
-rw-r--r--src/cpu/minor/lsq.cc3
-rw-r--r--src/cpu/minor/lsq.hh15
2 files changed, 3 insertions, 15 deletions
diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc
index 3b70c53aa..bf2612071 100644
--- a/src/cpu/minor/lsq.cc
+++ b/src/cpu/minor/lsq.cc
@@ -321,7 +321,8 @@ LSQ::SplitDataRequest::finish(const Fault &fault_, RequestPtr request_,
LSQ::SplitDataRequest::SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_,
bool isLoad_, PacketDataPtr data_, uint64_t *res_) :
LSQRequest(port_, inst_, isLoad_, data_, res_),
- translationEvent(*this),
+ translationEvent([this]{ sendNextFragmentToTranslation(); },
+ "translationEvent"),
numFragments(0),
numInTranslationFragments(0),
numTranslatedFragments(0),
diff --git a/src/cpu/minor/lsq.hh b/src/cpu/minor/lsq.hh
index 1a9094806..d4973f5a3 100644
--- a/src/cpu/minor/lsq.hh
+++ b/src/cpu/minor/lsq.hh
@@ -377,20 +377,7 @@ class LSQ : public Named
{
protected:
/** Event to step between translations */
- class TranslationEvent : public Event
- {
- protected:
- SplitDataRequest &owner;
-
- public:
- TranslationEvent(SplitDataRequest &owner_)
- : owner(owner_) { }
-
- void process()
- { owner.sendNextFragmentToTranslation(); }
- };
-
- TranslationEvent translationEvent;
+ EventFunctionWrapper translationEvent;
protected:
/** Number of fragments this request is split into */
unsigned int numFragments;