gem5 v24.0.0.0
|
Base class for all generators, with the shared functionality and virtual functions for entering, executing and leaving the generator. More...
#include <base_gen.hh>
Public Member Functions | |
BaseGen (SimObject &obj, RequestorID requestor_id, Tick _duration) | |
Create a base generator. | |
virtual | ~BaseGen () |
std::string | name () const |
Get the name, useful for DPRINTFs. | |
virtual void | enter ()=0 |
Enter this generator state. | |
virtual PacketPtr | getNextPacket ()=0 |
Get the next generated packet. | |
virtual void | exit () |
Exit this generator state. | |
virtual Tick | nextPacketTick (bool elastic, Tick delay) const =0 |
Determine the tick when the next packet is available. | |
Public Attributes | |
const Tick | duration |
Time to spend in this state. | |
Protected Member Functions | |
PacketPtr | getPacket (Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0) |
Generate a new request and associated packet. | |
Protected Attributes | |
const std::string | _name |
Name to use for status and debug printing. | |
const RequestorID | requestorId |
The RequestorID used for generating requests. | |
Base class for all generators, with the shared functionality and virtual functions for entering, executing and leaving the generator.
Definition at line 64 of file base_gen.hh.
gem5::BaseGen::BaseGen | ( | SimObject & | obj, |
RequestorID | requestor_id, | ||
Tick | _duration ) |
Create a base generator.
obj | simobject owning the generator |
requestor_id | RequestorID set on each request |
_duration | duration of this state before transitioning |
Definition at line 48 of file base_gen.cc.
|
inlinevirtual |
Definition at line 100 of file base_gen.hh.
|
pure virtual |
Enter this generator state.
Implemented in gem5::ExitGen, gem5::HybridGen, gem5::IdleGen, gem5::LinearGen, gem5::RandomGen, gem5::StridedGen, and gem5::TraceGen.
|
inlinevirtual |
Exit this generator state.
By default do nothing.
Reimplemented in gem5::TraceGen.
Definition at line 124 of file base_gen.hh.
|
pure virtual |
Get the next generated packet.
Implemented in gem5::DramGen, gem5::DramRotGen, gem5::ExitGen, gem5::HybridGen, gem5::IdleGen, gem5::LinearGen, gem5::NvmGen, gem5::RandomGen, gem5::StridedGen, and gem5::TraceGen.
|
protected |
Generate a new request and associated packet.
addr | Physical address to use |
size | Size of the request |
cmd | Memory command to send |
flags | Optional request flags |
Definition at line 55 of file base_gen.cc.
References gem5::X86ISA::addr, gem5::Packet::dataDynamic(), flags, gem5::MemCmd::isWrite(), and requestorId.
Referenced by gem5::DramGen::getNextPacket(), gem5::DramRotGen::getNextPacket(), gem5::HybridGen::getNextPacket(), gem5::LinearGen::getNextPacket(), gem5::NvmGen::getNextPacket(), gem5::RandomGen::getNextPacket(), gem5::StridedGen::getNextPacket(), and gem5::TraceGen::getNextPacket().
|
inline |
Get the name, useful for DPRINTFs.
Definition at line 107 of file base_gen.hh.
References _name.
Referenced by gem5::ExitGen::enter(), gem5::TraceGen::exit(), gem5::HybridGen::HybridGen(), and gem5::StochasticGen::StochasticGen().
Determine the tick when the next packet is available.
MaxTick means that there will not be any further packets in the current activation cycle of the generator.
elastic | should the injection respond to flow control or not |
delay | time the previous packet spent waiting |
Implemented in gem5::ExitGen, gem5::HybridGen, gem5::IdleGen, gem5::LinearGen, gem5::RandomGen, gem5::StridedGen, and gem5::TraceGen.
|
protected |
Name to use for status and debug printing.
Definition at line 70 of file base_gen.hh.
Referenced by gem5::DramRotGen::DramRotGen(), and name().
const Tick gem5::BaseGen::duration |
Time to spend in this state.
Definition at line 89 of file base_gen.hh.
|
protected |
The RequestorID used for generating requests.
Definition at line 73 of file base_gen.hh.
Referenced by getPacket().