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.
This commit is contained in:
Andreas Hansson 2013-04-22 13:20:33 -04:00
parent fe97f0e2b1
commit 99b3a12a75
2 changed files with 14 additions and 6 deletions

View file

@ -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

View file

@ -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.
*