summaryrefslogtreecommitdiff
path: root/src/mem/tport.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-05-29 22:23:41 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-05-29 22:23:41 -0700
commit365e4ac37446c0ff58b035767f8047c8a8c4fd61 (patch)
tree066f7f6844290f5e767a7fd63bc4b45e34a9be08 /src/mem/tport.hh
parentcd423aa9ddf872f597e9a9fd39648025b91e72d9 (diff)
downloadgem5-365e4ac37446c0ff58b035767f8047c8a8c4fd61.tar.xz
A little more cleanup & refactoring of SimpleTimingPort.
Make it a better base class for cache ports. --HG-- extra : convert_revision : 37d6de11545a68c1a7d11ce33fe5971c51434ee4
Diffstat (limited to 'src/mem/tport.hh')
-rw-r--r--src/mem/tport.hh21
1 files changed, 18 insertions, 3 deletions
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; }