41 #ifndef __CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__
42 #define __CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__
44 #include <unordered_map>
50 #include "params/TrafficGen.hh"
170 std::unordered_map<uint32_t, BaseGen*>
states;
231 void init()
override;
245 #endif //__CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__
EventWrapper< TrafficGen,&TrafficGen::update > updateEvent
Event for scheduling updates.
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
void recvReqRetry()
Receive a retry from the neighbouring port and attempt to resend the waiting packet.
TrafficGenPort port
The instance of master port used by the traffic generator.
PacketPtr retryPkt
Packet waiting to be sent.
Master port specialisation for the traffic generator.
Declaration of a set of generator behaviours that are used by the stand-alone traffic generator...
const PortID InvalidPortID
DrainState
Object drain/handover states.
void noProgress()
Method to inform the user we have made no progress.
void enterState(uint32_t newState)
Enter a new state.
Tick nextPacketTick
Time of the next packet.
TrafficGen(const TrafficGenParams *p)
Struct to represent a probabilistic transition during parsing.
Stats::Scalar retryTicks
Count the time incurred from back-pressure.
void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the slave port.
uint32_t currState
Index of the current state.
Stats::Scalar numPackets
Count the number of generated packets.
TrafficGenPort(const std::string &name, TrafficGen &traffic_gen)
const std::string configFile
The config file to parse.
std::vector< std::vector< double > > transitionMatrix
State transition matrix.
Declaration of Statistics objects.
Tick recvAtomicSnoop(PacketPtr pkt)
Receive an atomic snoop request packet from the slave port.
This is a simple scalar statistic, like a counter.
void parseConfig()
Parse the config file and build the state map and transition matrix.
DrainState drain() override
Notify an object that it needs to drain its state.
void recvReqRetry()
Called by the slave port if sendTimingReq was called on this master port (causing recvTimingReq to be...
Declaration of the queued port.
void regStats() override
Register statistics.
The traffic generator is a master module that generates stimuli for the memory system, based on a collection of simple generator behaviours that are either probabilistic or based on traces.
uint64_t Tick
Tick count type.
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a master port with a given name and index.
System * system
The system used to determine which mode we are currently operating in.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const bool elasticReq
Determine whether to add elasticity in the request injection, thus responding to backpressure by slow...
void serialize(CheckpointOut &cp) const override
Serialize an object.
void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the slave port.
void update()
Schedules event for next update and executes an update on the state graph, either performing a state ...
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Stats::Scalar numRetries
Count the number of retries.
Tick retryPktTick
Tick when the stalled packet was meant to be sent.
virtual const std::string name() const
std::string resolveFile(const std::string &name)
Resolve a file path in the configuration file.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
std::ostream CheckpointOut
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
Tick nextTransitionTick
Time of next transition.
MasterID masterID
MasterID used in generated requests.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
EventWrapper< TrafficGen,&TrafficGen::noProgress > noProgressEvent
Event to keep track of our progress, or lack thereof.
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the slave port.
void transition()
Determine next state and perform the transition.
const Tick progressCheck
Time to tolerate waiting for retries (not making progress), until we declare things broken...
std::unordered_map< uint32_t, BaseGen * > states
Map of generator states.