diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-07 15:02:52 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-06-20 18:03:21 +0000 |
commit | 8421362cc23a6341e44ce59f2c4f578438fd8a55 (patch) | |
tree | e191487970e04fcf9cf4640b9ce6a1ca965ab70d /src/mem/dram_ctrl.cc | |
parent | d0b477475135f7d216fcdfa5a2c22266234801bc (diff) | |
download | gem5-8421362cc23a6341e44ce59f2c4f578438fd8a55.tar.xz |
mem: Replace EventWrapper use with EventFunctionWrapper
NOTE: With this change there is a possibility for `DRAMCtrl::Rank`s
event names to not properly match the rank they were generated by. This
could occur if the public rank member is modified after the Rank's
construction. A patch would mean refactoring Rank and `DRAMCtrl`b to
privatize many of the members of Rank behind getters.
Change-Id: I7b8bd15086f4ffdfd3f40be4aeddac5e786fd78e
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3745
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/dram_ctrl.cc')
-rw-r--r-- | src/mem/dram_ctrl.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc index 9e5c00b0e..da494a1d2 100644 --- a/src/mem/dram_ctrl.cc +++ b/src/mem/dram_ctrl.cc @@ -63,7 +63,8 @@ DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) : retryRdReq(false), retryWrReq(false), busState(READ), busStateNext(READ), - nextReqEvent(this), respondEvent(this), + nextReqEvent([this]{ processNextReqEvent(); }, name()), + respondEvent([this]{ processRespondEvent(); }, name()), deviceSize(p->device_size), deviceBusWidth(p->device_bus_width), burstLength(p->burst_length), deviceRowBufferSize(p->device_rowbuffer_size), @@ -1610,8 +1611,12 @@ DRAMCtrl::Rank::Rank(DRAMCtrl& _memory, const DRAMCtrlParams* _p, int rank) readEntries(0), writeEntries(0), outstandingEvents(0), wakeUpAllowedAt(0), power(_p, false), banks(_p->banks_per_rank), numBanksActive(0), actTicks(_p->activation_limit, 0), - writeDoneEvent(*this), activateEvent(*this), prechargeEvent(*this), - refreshEvent(*this), powerEvent(*this), wakeUpEvent(*this) + writeDoneEvent([this]{ processWriteDoneEvent(); }, name()), + activateEvent([this]{ processActivateEvent(); }, name()), + prechargeEvent([this]{ processPrechargeEvent(); }, name()), + refreshEvent([this]{ processRefreshEvent(); }, name()), + powerEvent([this]{ processPowerEvent(); }, name()), + wakeUpEvent([this]{ processWakeUpEvent(); }, name()) { for (int b = 0; b < _p->banks_per_rank; b++) { banks[b].bank = b; |