From 365e4ac37446c0ff58b035767f8047c8a8c4fd61 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 29 May 2007 22:23:41 -0700 Subject: A little more cleanup & refactoring of SimpleTimingPort. Make it a better base class for cache ports. --HG-- extra : convert_revision : 37d6de11545a68c1a7d11ce33fe5971c51434ee4 --- src/mem/tport.hh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mem/tport.hh') diff --git a/src/mem/tport.hh b/src/mem/tport.hh index 9e8a01786..ea0f05ed1 100644 --- a/src/mem/tport.hh +++ b/src/mem/tport.hh @@ -94,15 +94,29 @@ class SimpleTimingPort : public Port * 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; } + /** Schedule a sendTiming() event to be called in the future. * @param pkt packet to send - * @param time increment from now (in ticks) to send packet + * @param absolute time (in ticks) to send packet + */ + void schedSendTiming(PacketPtr pkt, Tick when); + + /** Attempt to send the packet at the head of the deferred packet + * list. Caller must guarantee that the deferred packet list is + * non-empty and that the head packet is scheduled for curTick (or + * earlier). */ - void sendTiming(PacketPtr pkt, Tick time); + void sendDeferredPacket(); /** This function is notification that the device should attempt to send a * packet again. */ @@ -126,7 +140,8 @@ class SimpleTimingPort : public Port SimpleTimingPort(std::string pname, MemObject *_owner = NULL) : Port(pname, _owner), sendEvent(new SendEvent(this)), - drainEvent(NULL) + drainEvent(NULL), + waitingOnRetry(false) {} ~SimpleTimingPort() { delete sendEvent; } -- cgit v1.2.3