summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-04-22 13:20:33 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-04-22 13:20:33 -0400
commit99b3a12a75d6f1826a3a127a6171724069caf0f2 (patch)
tree7ee9e967187baa6a23ef6f1b0961747e80d2708a
parentfe97f0e2b1474490d9201f42f35dd78eac04fa74 (diff)
downloadgem5-99b3a12a75d6f1826a3a127a6171724069caf0f2.tar.xz
cpu: Use request flags in trace playback
This patch changes the TraceGen such that it uses the optional request flags from the protobuf trace if they are present.
-rw-r--r--src/cpu/testers/traffic_gen/generators.cc13
-rw-r--r--src/cpu/testers/traffic_gen/generators.hh7
2 files changed, 14 insertions, 6 deletions
diff --git a/src/cpu/testers/traffic_gen/generators.cc b/src/cpu/testers/traffic_gen/generators.cc
index 5cf40b2e6..7fec2a34a 100644
--- a/src/cpu/testers/traffic_gen/generators.cc
+++ b/src/cpu/testers/traffic_gen/generators.cc
@@ -50,10 +50,10 @@ BaseGen::BaseGen(QueuedMasterPort& _port, MasterID master_id, Tick _duration)
}
void
-BaseGen::send(Addr addr, unsigned size, const MemCmd& cmd)
+BaseGen::send(Addr addr, unsigned size, const MemCmd& cmd,
+ Request::FlagsType flags)
{
// Create new request
- Request::Flags flags;
Request *req = new Request(addr, size, flags, masterID);
// Embed it in a packet
@@ -215,6 +215,8 @@ TraceGen::InputStream::read(TraceElement& element)
element.addr = pkt_msg.addr();
element.blocksize = pkt_msg.size();
element.tick = pkt_msg.tick();
+ if (pkt_msg.has_flags())
+ element.flags = pkt_msg.flags();
return true;
}
@@ -280,14 +282,15 @@ TraceGen::execute()
// state graph from executing the state if it should not
assert(currElement.isValid());
- DPRINTF(TrafficGen, "TraceGen::execute: %c %d %d %d\n",
+ DPRINTF(TrafficGen, "TraceGen::execute: %c %d %d %d 0x%x\n",
currElement.cmd.isRead() ? 'r' : 'w',
currElement.addr,
currElement.blocksize,
- currElement.tick);
+ currElement.tick,
+ currElement.flags);
send(currElement.addr + addrOffset, currElement.blocksize,
- currElement.cmd);
+ currElement.cmd, currElement.flags);
}
void
diff --git a/src/cpu/testers/traffic_gen/generators.hh b/src/cpu/testers/traffic_gen/generators.hh
index 899a3c078..b6c70037a 100644
--- a/src/cpu/testers/traffic_gen/generators.hh
+++ b/src/cpu/testers/traffic_gen/generators.hh
@@ -75,8 +75,10 @@ class BaseGen
* @param addr Physical address to use
* @param size Size of the request
* @param cmd Memory command to send
+ * @param flags Optional request flags
*/
- void send(Addr addr, unsigned size, const MemCmd& cmd);
+ void send(Addr addr, unsigned size, const MemCmd& cmd,
+ Request::FlagsType flags = 0);
public:
@@ -328,6 +330,9 @@ class TraceGen : public BaseGen
/** The time at which the request should be sent */
Tick tick;
+ /** Potential request flags to use */
+ Request::FlagsType flags;
+
/**
* Check validity of this element.
*