|
gem5
v19.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, MasterID master_id, Tick _duration) | |
| Create a base generator. More... | |
| virtual | ~BaseGen () |
| std::string | name () const |
| Get the name, useful for DPRINTFs. More... | |
| virtual void | enter ()=0 |
| Enter this generator state. More... | |
| virtual PacketPtr | getNextPacket ()=0 |
| Get the next generated packet. More... | |
| virtual void | exit () |
| Exit this generator state. More... | |
| virtual Tick | nextPacketTick (bool elastic, Tick delay) const =0 |
| Determine the tick when the next packet is available. More... | |
Public Attributes | |
| const Tick | duration |
| Time to spend in this state. More... | |
Protected Member Functions | |
| PacketPtr | getPacket (Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags=0) |
| Generate a new request and associated packet. More... | |
Protected Attributes | |
| const std::string | _name |
| Name to use for status and debug printing. More... | |
| const MasterID | masterID |
| The MasterID used for generating requests. More... | |
Base class for all generators, with the shared functionality and virtual functions for entering, executing and leaving the generator.
Definition at line 62 of file base_gen.hh.
Create a base generator.
| obj | simobject owning the generator |
| master_id | MasterID set on each request |
| _duration | duration of this state before transitioning |
Definition at line 54 of file base_gen.cc.
|
inlinevirtual |
Definition at line 98 of file base_gen.hh.
|
pure virtual |
|
inlinevirtual |
Exit this generator state.
By default do nothing.
Reimplemented in TraceGen.
Definition at line 122 of file base_gen.hh.
References nextPacketTick().
|
pure virtual |
|
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 61 of file base_gen.cc.
References addr, Packet::dataDynamic(), MemCmd::isWrite(), and masterID.
Referenced by RandomGen::getNextPacket(), DramGen::getNextPacket(), LinearGen::getNextPacket(), DramRotGen::getNextPacket(), and TraceGen::getNextPacket().
|
inline |
Get the name, useful for DPRINTFs.
Definition at line 105 of file base_gen.hh.
References _name, enter(), and getNextPacket().
Referenced by ExitGen::enter(), TraceGen::exit(), and 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 TraceGen, LinearGen, RandomGen, IdleGen, and ExitGen.
Referenced by exit().
|
protected |
Name to use for status and debug printing.
Definition at line 68 of file base_gen.hh.
Referenced by DramRotGen::DramRotGen(), and name().
| const Tick BaseGen::duration |
Time to spend in this state.
Definition at line 87 of file base_gen.hh.
|
protected |
The MasterID used for generating requests.
Definition at line 71 of file base_gen.hh.
Referenced by getPacket().