gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
TraceCPU::FixedRetryGen Class Reference

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

TraceCPUowner
 Reference of the TraceCPU. More...
 
MasterPortport
 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...
 

Detailed Description

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 343 of file trace_cpu.hh.

Constructor & Destructor Documentation

TraceCPU::FixedRetryGen::FixedRetryGen ( TraceCPU _owner,
const std::string &  _name,
MasterPort _port,
MasterID  master_id,
const std::string &  trace_file 
)
inline

Definition at line 429 of file trace_cpu.hh.

Member Function Documentation

void TraceCPU::FixedRetryGen::exit ( )
Tick TraceCPU::FixedRetryGen::init ( )

Called from TraceCPU init().

Reads the first message from the input trace file and returns the send tick.

Returns
Tick when first packet must be sent

Definition at line 1055 of file trace_cpu.cc.

References DPRINTF, MaxTick, and panic.

Referenced by TraceCPU::init().

bool TraceCPU::FixedRetryGen::isTraceComplete ( )
inline

Returns the traceComplete variable which is set when end of the input trace file is reached.

Returns
bool true if traceComplete is set, false otherwise.

Definition at line 496 of file trace_cpu.hh.

References traceComplete.

Referenced by TraceCPU::schedIcacheNext().

const std::string& TraceCPU::FixedRetryGen::name ( ) const
inline

Returns name of the FixedRetryGen instance.

Definition at line 460 of file trace_cpu.hh.

References genName.

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.

Returns
bool false id end of file has been reached

Definition at line 1125 of file trace_cpu.cc.

References curTick(), DPRINTF, TraceCPU::ElasticDataGen::InputStream::read(), TraceCPU::ElasticDataGen::trace, and TraceCPU::ElasticDataGen::traceComplete.

void TraceCPU::FixedRetryGen::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()

Parameters
addraddress of request
sizesize of request
cmdif it is a read or write request
flagsassociated request flags
pcinstruction PC that generated the request
Returns
true if packet was sent successfully

Definition at line 1156 of file trace_cpu.cc.

References Packet::dataDynamic(), Request::getSize(), MemCmd::isWrite(), TraceCPU::ElasticDataGen::masterID, TraceCPU::ElasticDataGen::port, TraceCPU::ElasticDataGen::retryPkt, MasterPort::sendTimingReq(), Request::setContext(), and Request::setPC().

int64_t TraceCPU::FixedRetryGen::tickDelta ( )
inline

Definition at line 498 of file trace_cpu.hh.

References delta.

Referenced by TraceCPU::schedIcacheNext().

bool TraceCPU::FixedRetryGen::tryNext ( )

Member Data Documentation

TraceElement TraceCPU::FixedRetryGen::currElement
private

Store an element read from the trace to send as the next packet.

Definition at line 535 of file trace_cpu.hh.

int64_t TraceCPU::FixedRetryGen::delta
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 527 of file trace_cpu.hh.

Referenced by tickDelta().

std::string TraceCPU::FixedRetryGen::genName
private

String to store the name of the FixedRetryGen.

Definition at line 517 of file trace_cpu.hh.

Referenced by name().

Stats::Scalar TraceCPU::FixedRetryGen::instLastTick
private

Last simulated tick by the FixedRetryGen.

Definition at line 543 of file trace_cpu.hh.

const MasterID TraceCPU::FixedRetryGen::masterID
private

MasterID used for the requests being sent.

Definition at line 511 of file trace_cpu.hh.

Stats::Scalar TraceCPU::FixedRetryGen::numRetrySucceeded
private

Definition at line 541 of file trace_cpu.hh.

Stats::Scalar TraceCPU::FixedRetryGen::numSendAttempted
private

Stats for instruction accesses replayed.

Definition at line 538 of file trace_cpu.hh.

Stats::Scalar TraceCPU::FixedRetryGen::numSendFailed
private

Definition at line 540 of file trace_cpu.hh.

Stats::Scalar TraceCPU::FixedRetryGen::numSendSucceeded
private

Definition at line 539 of file trace_cpu.hh.

TraceCPU& TraceCPU::FixedRetryGen::owner
private

Reference of the TraceCPU.

Definition at line 505 of file trace_cpu.hh.

MasterPort& TraceCPU::FixedRetryGen::port
private

Reference of the port to be used to issue memory requests.

Definition at line 508 of file trace_cpu.hh.

PacketPtr TraceCPU::FixedRetryGen::retryPkt
private

PacketPtr used to store the packet to retry.

Definition at line 520 of file trace_cpu.hh.

InputStream TraceCPU::FixedRetryGen::trace
private

Input stream used for reading the input trace file.

Definition at line 514 of file trace_cpu.hh.

Referenced by TraceCPU::FixedRetryGen::InputStream::read(), and TraceCPU::FixedRetryGen::InputStream::reset().

bool TraceCPU::FixedRetryGen::traceComplete
private

Set to true when end of trace is reached.

Definition at line 532 of file trace_cpu.hh.

Referenced by isTraceComplete().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:21 for gem5 by doxygen 1.8.6