gem5 v24.0.0.0
|
Generator to read protobuf trace containing memory requests at fixed timestamps, perform flow control and issue memory requests. More...
#include <trace_cpu.hh>
Classes | |
struct | FixedRetryGenStatGroup |
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, RequestPort &_port, RequestorID requestor_id, const std::string &trace_file) | |
Tick | init () |
Called from TraceCPU init(). | |
bool | tryNext () |
This tries to send current or retry packet and returns true if successfull. | |
const std::string & | name () const |
Returns name of the FixedRetryGen instance. | |
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. | |
void | exit () |
Exit the FixedRetryGen. | |
bool | nextExecute () |
Reads a line of the trace file. | |
bool | isTraceComplete () |
Returns the traceComplete variable which is set when end of the input trace file is reached. | |
int64_t | tickDelta () |
Protected Attributes | |
gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup | fixedStats |
Private Attributes | |
TraceCPU & | owner |
Reference of the TraceCPU. | |
RequestPort & | port |
Reference of the port to be used to issue memory requests. | |
const RequestorID | requestorId |
RequestorID used for the requests being sent. | |
InputStream | trace |
Input stream used for reading the input trace file. | |
std::string | genName |
String to store the name of the FixedRetryGen. | |
PacketPtr | retryPkt |
PacketPtr used to store the packet to retry. | |
int64_t | delta |
Stores the difference in the send ticks of the current and last packets. | |
bool | traceComplete |
Set to true when end of trace is reached. | |
TraceElement | currElement |
Store an element read from the trace to send as the next packet. | |
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 312 of file trace_cpu.hh.
|
inline |
Definition at line 392 of file trace_cpu.hh.
void gem5::TraceCPU::FixedRetryGen::exit | ( | ) |
Exit the FixedRetryGen.
Definition at line 1045 of file trace_cpu.cc.
References gem5::TraceCPU::FixedRetryGen::InputStream::reset(), and trace.
Tick gem5::TraceCPU::FixedRetryGen::init | ( | ) |
Reads the first message from the input trace file and returns the send tick.
Definition at line 983 of file trace_cpu.cc.
References currElement, DPRINTF, gem5::MaxTick, nextExecute(), panic, and gem5::TraceCPU::FixedRetryGen::TraceElement::tick.
Referenced by gem5::TraceCPU::init().
|
inline |
Returns the traceComplete variable which is set when end of the input trace file is reached.
Definition at line 459 of file trace_cpu.hh.
References traceComplete.
Referenced by gem5::TraceCPU::schedIcacheNext().
|
inline |
Returns name of the FixedRetryGen instance.
Definition at line 423 of file trace_cpu.hh.
References genName.
bool gem5::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 1051 of file trace_cpu.cc.
References gem5::TraceCPU::FixedRetryGen::TraceElement::addr, gem5::TraceCPU::FixedRetryGen::TraceElement::blocksize, gem5::TraceCPU::FixedRetryGen::TraceElement::clear(), gem5::TraceCPU::FixedRetryGen::TraceElement::cmd, currElement, gem5::curTick(), DPRINTF, fixedStats, gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::instLastTick, gem5::MemCmd::isRead(), gem5::TraceCPU::FixedRetryGen::TraceElement::pc, gem5::TraceCPU::FixedRetryGen::InputStream::read(), gem5::TraceCPU::FixedRetryGen::TraceElement::tick, trace, and traceComplete.
bool gem5::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 1082 of file trace_cpu.cc.
References gem5::X86ISA::addr, gem5::Packet::dataDynamic(), flags, gem5::MemCmd::isWrite(), gem5::MipsISA::pc, port, requestorId, retryPkt, and gem5::RequestPort::sendTimingReq().
Referenced by tryNext().
|
inline |
Definition at line 461 of file trace_cpu.hh.
References delta.
Referenced by gem5::TraceCPU::schedIcacheNext().
bool gem5::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 998 of file trace_cpu.cc.
References gem5::TraceCPU::FixedRetryGen::TraceElement::addr, gem5::TraceCPU::FixedRetryGen::TraceElement::blocksize, gem5::TraceCPU::FixedRetryGen::TraceElement::cmd, currElement, delta, DPRINTF, fixedStats, gem5::TraceCPU::FixedRetryGen::TraceElement::flags, gem5::TraceCPU::FixedRetryGen::TraceElement::isValid(), nextExecute(), gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::numRetrySucceeded, gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::numSendAttempted, gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::numSendFailed, gem5::TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::numSendSucceeded, gem5::TraceCPU::FixedRetryGen::TraceElement::pc, port, retryPkt, send(), gem5::RequestPort::sendTimingReq(), gem5::TraceCPU::FixedRetryGen::TraceElement::tick, and traceComplete.
Referenced by gem5::TraceCPU::schedIcacheNext().
|
private |
Store an element read from the trace to send as the next packet.
Definition at line 495 of file trace_cpu.hh.
Referenced by init(), nextExecute(), and tryNext().
|
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 487 of file trace_cpu.hh.
Referenced by tickDelta(), and tryNext().
|
protected |
Referenced by nextExecute(), and tryNext().
|
private |
String to store the name of the FixedRetryGen.
Definition at line 477 of file trace_cpu.hh.
Referenced by name().
|
private |
Reference of the TraceCPU.
Definition at line 465 of file trace_cpu.hh.
Referenced by gem5::TraceCPU::DcachePort::recvReqRetry(), gem5::TraceCPU::IcachePort::recvReqRetry(), and gem5::TraceCPU::DcachePort::recvTimingResp().
|
private |
Reference of the port to be used to issue memory requests.
Definition at line 468 of file trace_cpu.hh.
|
private |
RequestorID used for the requests being sent.
Definition at line 471 of file trace_cpu.hh.
Referenced by send().
|
private |
PacketPtr used to store the packet to retry.
Definition at line 480 of file trace_cpu.hh.
|
private |
Input stream used for reading the input trace file.
Definition at line 474 of file trace_cpu.hh.
Referenced by exit(), nextExecute(), gem5::TraceCPU::FixedRetryGen::InputStream::read(), and gem5::TraceCPU::FixedRetryGen::InputStream::reset().
|
private |
Set to true when end of trace is reached.
Definition at line 492 of file trace_cpu.hh.
Referenced by isTraceComplete(), nextExecute(), and tryNext().