minor device fixups
authorAli Saidi <saidi@eecs.umich.edu>
Sun, 18 Jun 2006 15:10:08 +0000 (11:10 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Sun, 18 Jun 2006 15:10:08 +0000 (11:10 -0400)
configs/test/SysPaths.py:
    remove some tabs and add /n/poolfs/z/dist/m5/system
src/dev/io_device.cc:
    fix since pio timing dma packts colud be nacked too
src/dev/io_device.hh:
    move DmaReqState into DmaDevie

--HG--
extra : convert_revision : 2b5300d85ab33b3753afc54bc6a04a47b6e00d20

configs/test/SysPaths.py
src/dev/io_device.cc
src/dev/io_device.hh

index 9acfedc8b169f070dcbb876d8c9b39a73a8098ef..e458d522538f3a0d3429a4b291f0dcd1a6d6f09d 100644 (file)
@@ -13,7 +13,7 @@ def load_defaults():
         try:
                 path = env['M5_PATH'].split(':')
         except KeyError:
-                path = [ '/dist/m5/system' ]
+                path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ]
 
         for systemdir in path:
             if os.path.isdir(systemdir):
index 485216874d5155bc3eb36dc2cb8334c064094e83..e769ef0372fd11a123e2180d13ff7fa939ea055c 100644 (file)
@@ -62,13 +62,14 @@ PioPort::getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop)
 void
 PioPort::recvRetry()
 {
-    Packet* pkt = transmitList.front();
-    if (Port::sendTiming(pkt)) {
-        transmitList.pop_front();
+    bool result = true;
+    while (result && transmitList.size()) {
+        result = Port::sendTiming(transmitList.front());
+        if (result)
+            transmitList.pop_front();
     }
 }
 
-
 void
 PioPort::SendEvent::process()
 {
@@ -83,10 +84,20 @@ PioPort::SendEvent::process()
 bool
 PioPort::recvTiming(Packet *pkt)
 {
-    Tick latency = device->recvAtomic(pkt);
-    // turn packet around to go back to requester
-    pkt->makeTimingResponse();
-    sendTiming(pkt, latency);
+    if (pkt->result == Packet::Nacked) {
+        pkt->reinitNacked();
+        if (transmitList.size()) {
+             transmitList.push_front(pkt);
+        } else {
+            if (!Port::sendTiming(pkt))
+                transmitList.push_front(pkt);
+        }
+    } else {
+        Tick latency = device->recvAtomic(pkt);
+        // turn packet around to go back to requester
+        pkt->makeTimingResponse();
+        sendTiming(pkt, latency);
+    }
     return true;
 }
 
index cd2c25eeb7e95ae75ac02e6bde9f8da98f6315b4..a2b61c7f4330aa074a6bb30023fe862355fc4d18 100644 (file)
@@ -119,30 +119,29 @@ class PioPort : public Port
 };
 
 
-struct DmaReqState : public Packet::SenderState
+class DmaPort : public Port
 {
-    /** Event to call on the device when this transaction (all packets)
-     * complete. */
-    Event *completionEvent;
+  protected:
+    struct DmaReqState : public Packet::SenderState
+    {
+        /** Event to call on the device when this transaction (all packets)
+         * complete. */
+        Event *completionEvent;
 
-    /** Where we came from for some sanity checking. */
-    Port *outPort;
+        /** Where we came from for some sanity checking. */
+        Port *outPort;
 
-    /** Total number of bytes that this transaction involves. */
-    Addr totBytes;
+        /** Total number of bytes that this transaction involves. */
+        Addr totBytes;
 
-    /** Number of bytes that have been acked for this transaction. */
-    Addr numBytes;
+        /** Number of bytes that have been acked for this transaction. */
+        Addr numBytes;
 
-    bool final;
-    DmaReqState(Event *ce, Port *p, Addr tb)
-        : completionEvent(ce), outPort(p), totBytes(tb), numBytes(0)
-    {}
-};
+        DmaReqState(Event *ce, Port *p, Addr tb)
+            : completionEvent(ce), outPort(p), totBytes(tb), numBytes(0)
+        {}
+    };
 
-class DmaPort : public Port
-{
-  protected:
     DmaDevice *device;
     std::list<Packet*> transmitList;