using namespace std;
PacketQueue::PacketQueue(EventManager& _em, const std::string& _label,
+ const std::string& _sendEventName,
bool disable_sanity_check)
- : em(_em), sendEvent(this), _disableSanityCheck(disable_sanity_check),
+ : em(_em), sendEvent([this]{ processSendEvent(); }, _sendEventName),
+ _disableSanityCheck(disable_sanity_check),
label(_label), waitingOnRetry(false)
{
}
ReqPacketQueue::ReqPacketQueue(EventManager& _em, MasterPort& _masterPort,
const std::string _label)
- : PacketQueue(_em, _label), masterPort(_masterPort)
+ : PacketQueue(_em, _label, name(_masterPort, _label)),
+ masterPort(_masterPort)
{
}
SnoopRespPacketQueue::SnoopRespPacketQueue(EventManager& _em,
MasterPort& _masterPort,
const std::string _label)
- : PacketQueue(_em, _label), masterPort(_masterPort)
+ : PacketQueue(_em, _label, name(_masterPort, _label)),
+ masterPort(_masterPort)
{
}
RespPacketQueue::RespPacketQueue(EventManager& _em, SlavePort& _slavePort,
const std::string _label)
- : PacketQueue(_em, _label), slavePort(_slavePort)
+ : PacketQueue(_em, _label, name(_slavePort, _label)),
+ slavePort(_slavePort)
{
}
void processSendEvent();
/** Event used to call processSendEvent. */
- EventWrapper<PacketQueue, &PacketQueue::processSendEvent> sendEvent;
+ EventFunctionWrapper sendEvent;
/*
* Optionally disable the sanity check
* 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);
/**
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:
/**
virtual ~ReqPacketQueue() { }
const std::string name() const
- { return masterPort.name() + "-" + label; }
+ { return name(masterPort, label); }
bool sendTiming(PacketPtr pkt);
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:
/**
virtual ~SnoopRespPacketQueue() { }
const std::string name() const
- { return masterPort.name() + "-" + label; }
+ { return name(masterPort, label); }
bool sendTiming(PacketPtr pkt);
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:
/**
virtual ~RespPacketQueue() { }
const std::string name() const
- { return slavePort.name() + "-" + label; }
+ { return name(slavePort, label); }
bool sendTiming(PacketPtr pkt);