gem5
v20.0.0.3
|
Generator to read protobuf trace containing memory requests at fixed timestamps, perform flow control and issue memory requests. More...
#include <trace_cpu.hh>
Classes | |
class | InputStream |
The InputStream encapsulates a trace file and the internal buffers and populates TraceElements based on the input. More... | |
struct | TraceElement |
This struct stores a line in the trace file. More... | |
Public Member Functions | |
FixedRetryGen (TraceCPU &_owner, const std::string &_name, MasterPort &_port, MasterID master_id, const std::string &trace_file) | |
Tick | init () |
Called from TraceCPU init(). More... | |
bool | tryNext () |
This tries to send current or retry packet and returns true if successfull. More... | |
const std::string & | name () const |
Returns name of the FixedRetryGen instance. More... | |
bool | send (Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags, Addr pc) |
Creates a new request assigning the request parameters passed by the arguments. More... | |
void | exit () |
Exit the FixedRetryGen. More... | |
bool | nextExecute () |
Reads a line of the trace file. More... | |
bool | isTraceComplete () |
Returns the traceComplete variable which is set when end of the input trace file is reached. More... | |
int64_t | tickDelta () |
void | regStats () |
Private Attributes | |
TraceCPU & | owner |
Reference of the TraceCPU. More... | |
MasterPort & | port |
Reference of the port to be used to issue memory requests. More... | |
const MasterID | masterID |
MasterID used for the requests being sent. More... | |
InputStream | trace |
Input stream used for reading the input trace file. More... | |
std::string | genName |
String to store the name of the FixedRetryGen. More... | |
PacketPtr | retryPkt |
PacketPtr used to store the packet to retry. More... | |
int64_t | delta |
Stores the difference in the send ticks of the current and last packets. More... | |
bool | traceComplete |
Set to true when end of trace is reached. More... | |
TraceElement | currElement |
Store an element read from the trace to send as the next packet. More... | |
Stats::Scalar | numSendAttempted |
Stats for instruction accesses replayed. More... | |
Stats::Scalar | numSendSucceeded |
Stats::Scalar | numSendFailed |
Stats::Scalar | numRetrySucceeded |
Stats::Scalar | instLastTick |
Last simulated tick by the FixedRetryGen. More... | |
Generator to read protobuf trace containing memory requests at fixed timestamps, perform flow control and issue memory requests.
If L1 cache port sends packet succesfully, determine the tick to send the next packet else wait for retry from cache.
Definition at line 339 of file trace_cpu.hh.
|
inline |
Definition at line 425 of file trace_cpu.hh.
References TraceCPU::init().
void TraceCPU::FixedRetryGen::exit | ( | ) |
Exit the FixedRetryGen.
Definition at line 1107 of file trace_cpu.cc.
References TraceCPU::ElasticDataGen::InputStream::reset(), and TraceCPU::ElasticDataGen::trace.
Tick TraceCPU::FixedRetryGen::init | ( | ) |
Reads the first message from the input trace file and returns the send tick.
Definition at line 1043 of file trace_cpu.cc.
References DPRINTF, MaxTick, and panic.
Referenced by TraceCPU::init().
|
inline |
Returns the traceComplete variable which is set when end of the input trace file is reached.
Definition at line 492 of file trace_cpu.hh.
Referenced by TraceCPU::schedIcacheNext().
|
inline |
Returns name of the FixedRetryGen instance.
Definition at line 456 of file trace_cpu.hh.
References addr, X86ISA::exit, MipsISA::pc, and AtomicRequestProtocol::send().
bool TraceCPU::FixedRetryGen::nextExecute | ( | ) |
Reads a line of the trace file.
Returns the tick when the next request should be generated. If the end of the file has been reached, it returns false.
Definition at line 1113 of file trace_cpu.cc.
References curTick(), DPRINTF, TraceCPU::ElasticDataGen::InputStream::read(), TraceCPU::ElasticDataGen::trace, and TraceCPU::ElasticDataGen::traceComplete.
void TraceCPU::FixedRetryGen::regStats | ( | ) |
Definition at line 1012 of file trace_cpu.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), Stats::DataWrap< Derived, InfoProxyType >::name(), TraceCPU::ElasticDataGen::name(), TraceCPU::ElasticDataGen::numRetrySucceeded, TraceCPU::ElasticDataGen::numSendAttempted, TraceCPU::ElasticDataGen::numSendFailed, and TraceCPU::ElasticDataGen::numSendSucceeded.
Referenced by TraceCPU::regStats().
bool TraceCPU::FixedRetryGen::send | ( | Addr | addr, |
unsigned | size, | ||
const MemCmd & | cmd, | ||
Request::FlagsType | flags, | ||
Addr | pc | ||
) |
Creates a new request assigning the request parameters passed by the arguments.
Calls the port's sendTimingReq() and returns true if the packet was sent succesfully. It is called by tryNext()
addr | address of request |
size | size of request |
cmd | if it is a read or write request |
flags | associated request flags |
pc | instruction PC that generated the request |
Definition at line 1144 of file trace_cpu.cc.
References addr, Packet::dataDynamic(), MemCmd::isWrite(), TraceCPU::ElasticDataGen::masterID, TraceCPU::ElasticDataGen::port, TraceCPU::ElasticDataGen::retryPkt, and MasterPort::sendTimingReq().
|
inline |
Definition at line 494 of file trace_cpu.hh.
References TraceCPU::regStats().
Referenced by TraceCPU::schedIcacheNext().
bool TraceCPU::FixedRetryGen::tryNext | ( | ) |
This tries to send current or retry packet and returns true if successfull.
It calls nextExecute() to read next message.
Definition at line 1058 of file trace_cpu.cc.
References DPRINTF, TraceCPU::ElasticDataGen::numRetrySucceeded, TraceCPU::ElasticDataGen::numSendAttempted, TraceCPU::ElasticDataGen::numSendFailed, TraceCPU::ElasticDataGen::numSendSucceeded, TraceCPU::ElasticDataGen::port, TraceCPU::ElasticDataGen::retryPkt, MasterPort::sendTimingReq(), and TraceCPU::ElasticDataGen::traceComplete.
Referenced by TraceCPU::schedIcacheNext().
|
private |
Store an element read from the trace to send as the next packet.
Definition at line 531 of file trace_cpu.hh.
|
private |
Stores the difference in the send ticks of the current and last packets.
Keeping this signed to check overflow to a negative value which will be caught by assert(delta > 0)
Definition at line 523 of file trace_cpu.hh.
|
private |
String to store the name of the FixedRetryGen.
Definition at line 513 of file trace_cpu.hh.
|
private |
Last simulated tick by the FixedRetryGen.
Definition at line 539 of file trace_cpu.hh.
|
private |
MasterID used for the requests being sent.
Definition at line 507 of file trace_cpu.hh.
|
private |
Definition at line 537 of file trace_cpu.hh.
|
private |
Stats for instruction accesses replayed.
Definition at line 534 of file trace_cpu.hh.
|
private |
Definition at line 536 of file trace_cpu.hh.
|
private |
Definition at line 535 of file trace_cpu.hh.
|
private |
Reference of the TraceCPU.
Definition at line 501 of file trace_cpu.hh.
|
private |
Reference of the port to be used to issue memory requests.
Definition at line 504 of file trace_cpu.hh.
|
private |
PacketPtr used to store the packet to retry.
Definition at line 516 of file trace_cpu.hh.
|
private |
Input stream used for reading the input trace file.
Definition at line 510 of file trace_cpu.hh.
|
private |
Set to true when end of trace is reached.
Definition at line 528 of file trace_cpu.hh.