- /**
- * This class is used to implemented sendTiming() with a delay. When
- * a delay is requested a the event is scheduled if it isn't already.
- * When the event time expires it attempts to send the packet.
- * If it cannot, the packet sent when recvRetry() is called.
- **/
- typedef EventWrapper<SimpleTimingPort, &SimpleTimingPort::processSendEvent>
- SendEvent;
-
- Event *sendEvent;
-
- /** If we need to drain, keep the drain event around until we're done
- * here.*/
- Event *drainEvent;
-
- /** Remember whether we're awaiting a retry from the bus. */
- bool waitingOnRetry;
-
- /** Check the list of buffered packets against the supplied
- * functional request. */
- void checkFunctional(PacketPtr funcPkt);
-
- /** Check whether we have a packet ready to go on the transmit list. */
- bool deferredPacketReady()
- { return !transmitList.empty() && transmitList.front().tick <= curTick; }
-
- Tick deferredPacketReadyTick()
- { return transmitList.empty() ? MaxTick : transmitList.front().tick; }
-
- void schedSendEvent(Tick when)
- {
- if (waitingOnRetry) {
- assert(!sendEvent->scheduled());
- return;
- }
-
- if (!sendEvent->scheduled()) {
- sendEvent->schedule(when);
- } else if (sendEvent->when() > when) {
- sendEvent->reschedule(when);
- }
- }
-
-
- /** Schedule a sendTiming() event to be called in the future.
- * @param pkt packet to send
- * @param absolute time (in ticks) to send packet
- */
- void schedSendTiming(PacketPtr pkt, Tick when);