42 #ifndef __CPU_TRAFFIC_GEN_BASE_HH__ 43 #define __CPU_TRAFFIC_GEN_BASE_HH__ 47 #include <unordered_map> 50 #include "enums/AddrMap.hh" 57 struct BaseTrafficGenParams;
187 return (maxOutstandingReqs > 0) &&
252 void init()
override;
267 uint8_t read_percent,
Addr data_limit);
273 uint8_t read_percent,
Addr data_limit);
279 uint8_t read_percent,
Addr data_limit,
280 unsigned int num_seq_pkts,
unsigned int page_size,
281 unsigned int nbr_of_banks_DRAM,
unsigned int nbr_of_banks_util,
282 Enums::AddrMap addr_mapping,
283 unsigned int nbr_of_ranks);
289 uint8_t read_percent,
Addr data_limit,
290 unsigned int num_seq_pkts,
unsigned int page_size,
291 unsigned int nbr_of_banks_DRAM,
unsigned int nbr_of_banks_util,
292 Enums::AddrMap addr_mapping,
293 unsigned int nbr_of_ranks,
294 unsigned int max_seq_count_per_rank);
298 const std::string& trace_file,
Addr addr_offset);
317 #endif //__CPU_TRAFFIC_GEN_BASE_HH__ A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual std::shared_ptr< BaseGen > nextGenerator()=0
std::shared_ptr< BaseGen > createDramRot(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit, unsigned int num_seq_pkts, unsigned int page_size, unsigned int nbr_of_banks_DRAM, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks, unsigned int max_seq_count_per_rank)
Ports are used to interface objects to each other.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::shared_ptr< BaseGen > createTrace(Tick duration, const std::string &trace_file, Addr addr_offset)
void recvReqRetry()
Receive a retry from the neighbouring port and attempt to resend the waiting packet.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
std::unique_ptr< StreamGen > streamGenerator
Stream/SubStreamID Generator.
TrafficGenPort port
The instance of master port used by the traffic generator.
Stats::Scalar totalWriteLatency
Total num of ticks write reqs took to complete.
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
const PortID InvalidPortID
DrainState
Object drain/handover states.
BaseTrafficGen & trafficGen
void transition()
Transition to the next generator.
bool allocateWaitingRespSlot(PacketPtr pkt)
Puts this packet in the waitingResp list and returns true if we are above the maximum number of ousta...
std::shared_ptr< BaseGen > createRandom(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
TrafficGenPort(const std::string &name, BaseTrafficGen &traffic_gen)
std::shared_ptr< BaseGen > activeGenerator
Currently active generator.
bool blockedWaitingResp
Set when we blocked waiting for outstanding reqs.
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.
Stats::Scalar numPackets
Count the number of generated packets.
void scheduleUpdate()
Schedule the update event based on nextPacketTick and nextTransitionTick.
Stats::Scalar totalReadLatency
Total num of ticks read reqs took to complete.
std::shared_ptr< BaseGen > createExit(Tick duration)
void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the peer.
std::shared_ptr< BaseGen > createDram(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit, unsigned int num_seq_pkts, unsigned int page_size, unsigned int nbr_of_banks_DRAM, unsigned int nbr_of_banks_util, Enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
const MasterID masterID
MasterID used in generated requests.
EventFunctionWrapper noProgressEvent
Event to keep track of our progress, or lack thereof.
RequestPtr req
A pointer to the original request.
std::shared_ptr< BaseGen > createLinear(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Declaration of the queued port.
Tick retryPktTick
Tick when the stalled packet was meant to be sent.
Tick curTick()
The current simulated tick.
void update()
Schedules event for next update and generates a new packet or requests a new generatoir depending on ...
bool needsResponse() const
Stats::Scalar numSuppressed
Count the number of dropped requests.
Stats::Formula writeBW
Write bandwidth in bytes/s.
uint64_t Tick
Tick count type.
std::shared_ptr< BaseGen > createIdle(Tick duration)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Stats::Scalar totalReads
Count the number reads.
System *const system
The system used to determine which mode we are currently operating in.
ClockedObject declaration and implementation.
Stats::Scalar bytesWritten
Count the number of bytes written.
Tick nextPacketTick
Time of the next packet.
bool recvTimingResp(PacketPtr pkt)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick nextTransitionTick
Time of next transition.
PacketPtr retryPkt
Packet waiting to be sent.
Stats::Formula avgWriteLatency
Avg num of ticks each write reqs took to complete.
Stats::Scalar retryTicks
Count the time incurred from back-pressure.
std::ostream CheckpointOut
Stats::Scalar numRetries
Count the number of retries.
EventFunctionWrapper updateEvent
Event for scheduling updates.
const std::string name() const
Return port name (for DPRINTF).
Stats::Formula readBW
Read bandwidth in bytes/s.
Stats::Scalar totalWrites
Count the number writes.
void noProgress()
Method to inform the user we have made no progress.
Stats::Scalar bytesRead
Count the number of bytes read.
std::unordered_map< RequestPtr, Tick > waitingResp
Reqs waiting for response.
const int maxOutstandingReqs
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
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.
Stats::Formula avgReadLatency
Avg num of ticks each read req took to complete.
const Tick progressCheck
Time to tolerate waiting for retries (not making progress), until we declare things broken...
Base class for all generators, with the shared functionality and virtual functions for entering...
void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the peer.
BaseTrafficGen::StatGroup stats
DrainState drain() override
Notify an object that it needs to drain its state.
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Master port specialisation for the traffic generator.
Tick recvAtomicSnoop(PacketPtr pkt)
Receive an atomic snoop request packet from our peer.
BaseTrafficGen(const BaseTrafficGenParams *p)