cpu: Ensure the traffic generator suppresses non-memory packets
authorAndreas Hansson <andreas.hansson@arm.com>
Sun, 10 Aug 2014 09:39:04 +0000 (05:39 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Sun, 10 Aug 2014 09:39:04 +0000 (05:39 -0400)
This patch adds a check to ensure that packets which are not going to
a memory range are suppressed in the traffic generator. Thus, if a
trace is collected in full-system, the packets destined for devices
are not played back.

src/cpu/testers/traffic_gen/traffic_gen.cc

index d53c9b000e85120fa35870d7591e3dbee082d9b7..c1ce0d6d4ab6604abd80706671c233dd52669764 100644 (file)
@@ -187,10 +187,18 @@ TrafficGen::update()
         assert(curTick() >= nextPacketTick);
         // get the next packet and try to send it
         PacketPtr pkt = states[currState]->getNextPacket();
-        numPackets++;
-        if (!port.sendTimingReq(pkt)) {
-            retryPkt = pkt;
-            retryPktTick = curTick();
+
+        // suppress packets that are not destined for a memory, such as
+        // device accesses that could be part of a trace
+        if (system->isMemAddr(pkt->getAddr())) {
+            numPackets++;
+            if (!port.sendTimingReq(pkt)) {
+                retryPkt = pkt;
+                retryPktTick = curTick();
+            }
+        } else {
+            DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
+                    pkt->cmdString(), pkt->getAddr());
         }
     }