Merge with head, hopefully the last time for this batch.
[gem5.git] / src / mem / tport.hh
index 7dfe60b72385378233a8df9734dd77318fce487b..eaf5acd5d6afeefb0a181eac9cb77b90b92ba417 100644 (file)
  * Declaration of SimpleTimingPort.
  */
 
-#include "mem/port.hh"
-#include "sim/eventq.hh"
 #include <list>
 #include <string>
 
+#include "mem/port.hh"
+#include "sim/eventq.hh"
+
 /**
  * A simple port for interfacing objects that basically have only
  * functional memory behavior (e.g. I/O devices) to the memory system.
@@ -100,26 +101,19 @@ class SimpleTimingPort : public Port
 
     /** Check whether we have a packet ready to go on the transmit list. */
     bool deferredPacketReady()
-    { return !transmitList.empty() && transmitList.front().tick <= curTick; }
+    { return !transmitList.empty() && transmitList.front().tick <= curTick(); }
 
     Tick deferredPacketReadyTime()
     { return transmitList.empty() ? MaxTick : transmitList.front().tick; }
 
-    void
-    schedSendEvent(Tick when)
-    {
-        if (waitingOnRetry) {
-            assert(!sendEvent->scheduled());
-            return;
-        }
-
-        if (!sendEvent->scheduled()) {
-            schedule(sendEvent, when);
-        } else if (sendEvent->when() > when) {
-            reschedule(sendEvent, when);
-        }
-    }
-
+    /**
+     * Schedule a send even if not already waiting for a retry. If the
+     * requested time is before an already scheduled send event it
+     * will be rescheduled.
+     *
+     * @param when
+     */
+    void schedSendEvent(Tick when);
 
     /** Schedule a sendTiming() event to be called in the future.
      * @param pkt packet to send
@@ -129,7 +123,7 @@ class SimpleTimingPort : public Port
 
     /** 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
+     * non-empty and that the head packet is scheduled for curTick() (or
      * earlier).
      */
     void sendDeferredPacket();
@@ -145,10 +139,13 @@ class SimpleTimingPort : public Port
     bool recvTiming(PacketPtr pkt);
 
     /**
-     * Simple ports generally don't care about any status
-     * changes... can always override this in cases where that's not
-     * true. */
-    virtual void recvStatusChange(Status status) { }
+     * Simple ports are generally used as slave ports (i.e. the
+     * respond to requests) and thus do not expect to receive any
+     * range changes (as the neighbouring port has a master role and
+     * do not have any address ranges. A subclass can override the
+     * default behaviuor if needed.
+     */
+    virtual void recvRangeChange() { }
 
 
   public: