diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-13 12:26:25 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-06-20 18:03:21 +0000 |
commit | d0b477475135f7d216fcdfa5a2c22266234801bc (patch) | |
tree | 11b71b5cd3b7633a6e772f66f89c0ab93cc594db /src/mem/packet_queue.hh | |
parent | e34924b50fd3362dc51a67c51c6d7f2b2015cf30 (diff) | |
download | gem5-d0b477475135f7d216fcdfa5a2c22266234801bc.tar.xz |
mem: Replace EventWrapper in PacketQueue with EventFunctionWrapper
In order to replicate the same `name()` output with `PacketQueue`, subclasses
using EventFunctionWrapper must initialize PacketQueue with their own name so
the sendEvent holds the name of the subclass.
Change-Id: Ib091e118bab8858192e1d1370d61def42958ec29
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3744
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/packet_queue.hh')
-rw-r--r-- | src/mem/packet_queue.hh | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/mem/packet_queue.hh b/src/mem/packet_queue.hh index b1001e75d..f7379c900 100644 --- a/src/mem/packet_queue.hh +++ b/src/mem/packet_queue.hh @@ -87,7 +87,7 @@ class PacketQueue : public Drainable void processSendEvent(); /** Event used to call processSendEvent. */ - EventWrapper<PacketQueue, &PacketQueue::processSendEvent> sendEvent; + EventFunctionWrapper sendEvent; /* * Optionally disable the sanity check @@ -134,6 +134,7 @@ class PacketQueue : public Drainable * on the size of the transmitList. The check is enabled by default. */ PacketQueue(EventManager& _em, const std::string& _label, + const std::string& _sendEventName, bool disable_sanity_check = false); /** @@ -215,6 +216,12 @@ class ReqPacketQueue : public PacketQueue MasterPort& masterPort; + // Static definition so it can be called when constructing the parent + // without us being completely initialized. + static const std::string name(const MasterPort& masterPort, + const std::string& label) + { return masterPort.name() + "-" + label; } + public: /** @@ -232,7 +239,7 @@ class ReqPacketQueue : public PacketQueue virtual ~ReqPacketQueue() { } const std::string name() const - { return masterPort.name() + "-" + label; } + { return name(masterPort, label); } bool sendTiming(PacketPtr pkt); @@ -245,6 +252,12 @@ class SnoopRespPacketQueue : public PacketQueue MasterPort& masterPort; + // Static definition so it can be called when constructing the parent + // without us being completely initialized. + static const std::string name(const MasterPort& masterPort, + const std::string& label) + { return masterPort.name() + "-" + label; } + public: /** @@ -262,7 +275,7 @@ class SnoopRespPacketQueue : public PacketQueue virtual ~SnoopRespPacketQueue() { } const std::string name() const - { return masterPort.name() + "-" + label; } + { return name(masterPort, label); } bool sendTiming(PacketPtr pkt); @@ -275,6 +288,12 @@ class RespPacketQueue : public PacketQueue SlavePort& slavePort; + // Static definition so it can be called when constructing the parent + // without us being completely initialized. + static const std::string name(const SlavePort& slavePort, + const std::string& label) + { return slavePort.name() + "-" + label; } + public: /** @@ -292,7 +311,7 @@ class RespPacketQueue : public PacketQueue virtual ~RespPacketQueue() { } const std::string name() const - { return slavePort.name() + "-" + label; } + { return name(slavePort, label); } bool sendTiming(PacketPtr pkt); |