gem5
|
The InputStream encapsulates a trace file and the internal buffers and populates TraceElements based on the input. More...
Public Member Functions | |
InputStream (const std::string &filename) | |
Create a trace input stream for a given file name. More... | |
void | reset () |
Reset the stream such that it can be played once again. More... | |
void | init () |
Check the trace header to make sure that it is of the right format. More... | |
bool | read (TraceElement &element) |
Attempt to read a trace element from the stream, and also notify the caller if the end of the file was reached. More... | |
Private Attributes | |
ProtoInputStream | trace |
Input file stream for the protobuf trace. More... | |
The InputStream encapsulates a trace file and the internal buffers and populates TraceElements based on the input.
Definition at line 544 of file generators.hh.
TraceGen::InputStream::InputStream | ( | const std::string & | filename | ) |
Create a trace input stream for a given file name.
filename | Path to the file to read from |
Definition at line 412 of file generators.cc.
References init().
void TraceGen::InputStream::init | ( | ) |
Check the trace header to make sure that it is of the right format.
Definition at line 419 of file generators.cc.
References SimClock::Frequency, panic, read(), and TraceGen::trace.
Referenced by InputStream().
bool TraceGen::InputStream::read | ( | TraceElement & | element | ) |
Attempt to read a trace element from the stream, and also notify the caller if the end of the file was reached.
element | Trace element to populate |
Definition at line 439 of file generators.cc.
References TraceGen::TraceElement::addr, TraceGen::TraceElement::blocksize, MemCmd::cmd, TraceGen::TraceElement::cmd, TraceGen::TraceElement::flags, read(), TraceGen::TraceElement::tick, and TraceGen::trace.
Referenced by TraceGen::enter(), TraceGen::getNextPacket(), init(), and read().
void TraceGen::InputStream::reset | ( | ) |
Reset the stream such that it can be played once again.
Definition at line 432 of file generators.cc.
References Stats::init, reset(), and TraceGen::trace.
Referenced by TraceGen::exit(), and reset().
|
private |
Input file stream for the protobuf trace.
Definition at line 550 of file generators.hh.