Go to the documentation of this file.
38 #ifndef __CPU_TRAFFIC_GEN_BASE_HH__
39 #define __CPU_TRAFFIC_GEN_BASE_HH__
43 #include <unordered_map>
46 #include "enums/AddrMap.hh"
56 struct BaseTrafficGenParams;
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,
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,
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 Addr start_addr_dram,
Addr end_addr_dram,
Addr blocksize_dram,
299 Addr start_addr_nvm,
Addr end_addr_nvm,
Addr blocksize_nvm,
301 uint8_t read_percent,
Addr data_limit,
302 unsigned int num_seq_pkts_dram,
unsigned int page_size_dram,
303 unsigned int nbr_of_banks_dram,
unsigned int nbr_of_banks_util_dram,
304 unsigned int num_seq_pkts_nvm,
unsigned int buffer_size_nvm,
305 unsigned int nbr_of_banks_nvm,
unsigned int nbr_of_banks_util_nvm,
306 enums::AddrMap addr_mapping,
307 unsigned int nbr_of_ranks_dram,
308 unsigned int nbr_of_ranks_nvm,
309 uint8_t nvm_percent);
315 uint8_t read_percent,
Addr data_limit,
316 unsigned int num_seq_pkts,
unsigned int buffer_size,
317 unsigned int nbr_of_banks,
unsigned int nbr_of_banks_util,
318 enums::AddrMap addr_mapping,
319 unsigned int nbr_of_ranks);
324 Addr stride_size,
int gen_id,
326 uint8_t read_percent,
Addr data_limit);
330 const std::string& trace_file,
Addr addr_offset);
351 #endif //__CPU_TRAFFIC_GEN_BASE_HH__
This is a simple scalar statistic, like a counter.
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)
Tick curTick()
The universal simulation clock.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const std::string name() const
Return port name (for DPRINTF).
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
statistics::Scalar retryTicks
Count the time incurred from back-pressure.
statistics::Scalar totalWriteLatency
Total num of ticks write reqs took to complete
RequestPtr req
A pointer to the original request.
PacketPtr retryPkt
Packet waiting to be sent.
statistics::Scalar bytesRead
Count the number of bytes read.
std::shared_ptr< BaseGen > createIdle(Tick duration)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EventFunctionWrapper noProgressEvent
Event to keep track of our progress, or lack thereof.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
bool blockedWaitingResp
Set when we blocked waiting for outstanding reqs.
const PortID InvalidPortID
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
statistics::Scalar totalWrites
Count the number writes.
std::shared_ptr< BaseGen > createHybrid(Tick duration, Addr start_addr_dram, Addr end_addr_dram, Addr blocksize_dram, Addr start_addr_nvm, Addr end_addr_nvm, Addr blocksize_nvm, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit, unsigned int num_seq_pkts_dram, unsigned int page_size_dram, unsigned int nbr_of_banks_dram, unsigned int nbr_of_banks_util_dram, unsigned int num_seq_pkts_nvm, unsigned int buffer_size_nvm, unsigned int nbr_of_banks_nvm, unsigned int nbr_of_banks_util_nvm, enums::AddrMap addr_mapping, unsigned int nbr_of_ranks_dram, unsigned int nbr_of_ranks_nvm, uint8_t nvm_percent)
void recvReqRetry()
Receive a retry from the neighbouring port and attempt to resend the waiting packet.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
statistics::Scalar numSuppressed
Count the number of dropped requests.
statistics::Scalar numPackets
Count the number of generated packets.
gem5::BaseTrafficGen::StatGroup stats
DrainState
Object drain/handover states.
statistics::Scalar totalReadLatency
Total num of ticks read reqs took to complete
BaseTrafficGen(const BaseTrafficGenParams &p)
void noProgress()
Method to inform the user we have made no progress.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
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, unsigned int nbr_of_banks_util, enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
std::shared_ptr< BaseGen > createNvm(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 buffer_size, unsigned int nbr_of_banks, unsigned int nbr_of_banks_util, enums::AddrMap addr_mapping, unsigned int nbr_of_ranks)
std::shared_ptr< BaseGen > createTrace(Tick duration, const std::string &trace_file, Addr addr_offset)
uint64_t Tick
Tick count type.
const RequestorID requestorId
RequestorID used in generated requests.
statistics::Formula writeBW
Write bandwidth in bytes/s
statistics::Scalar bytesWritten
Count the number of bytes written.
The traffic generator is a module that generates stimuli for the memory system, based on a collection...
void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the peer.
void transition()
Transition to the next generator.
Tick recvAtomicSnoop(PacketPtr pkt)
Receive an atomic snoop request packet from our peer.
Tick retryPktTick
Tick when the stalled packet was meant to be sent.
Tick nextTransitionTick
Time of next transition.
statistics::Formula avgWriteLatency
Avg num of ticks each write reqs took to complete
System *const system
The system used to determine which mode we are currently operating in.
void scheduleUpdate()
Schedule the update event based on nextPacketTick and nextTransitionTick.
bool needsResponse() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
StatGroup(statistics::Group *parent)
statistics::Scalar totalReads
Count the number reads.
std::shared_ptr< BaseGen > createStrided(Tick duration, Addr start_addr, Addr end_addr, Addr blocksize, Addr stride_size, int gen_id, Tick min_period, Tick max_period, uint8_t read_percent, Addr data_limit)
Base class for all generators, with the shared functionality and virtual functions for entering,...
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
const Tick progressCheck
Time to tolerate waiting for retries (not making progress), until we declare things broken.
void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the peer.
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
TrafficGenPort(const std::string &name, BaseTrafficGen &traffic_gen)
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, unsigned int nbr_of_banks_util, enums::AddrMap addr_mapping, unsigned int nbr_of_ranks, unsigned int max_seq_count_per_rank)
void update()
Schedules event for next update and generates a new packet or requests a new generatoir depending on ...
Ports are used to interface objects to each other.
const bool elasticReq
Determine whether to add elasticity in the request injection, thus responding to backpressure by slow...
statistics::Scalar numRetries
Count the number of retries.
std::shared_ptr< BaseGen > activeGenerator
Currently active generator.
EventFunctionWrapper updateEvent
Event for scheduling updates.
virtual std::shared_ptr< BaseGen > nextGenerator()=0
const int maxOutstandingReqs
Tick nextPacketTick
Time of the next packet.
std::unique_ptr< StreamGen > streamGenerator
Stream/SubstreamID Generator.
Request port specialisation for the traffic generator.
statistics::Formula avgReadLatency
Avg num of ticks each read req took to complete
std::ostream CheckpointOut
bool recvTimingResp(PacketPtr pkt)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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)
void serialize(CheckpointOut &cp) const override
Serialize an object.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
BaseTrafficGen & trafficGen
TrafficGenPort port
The instance of request port used by the traffic generator.
statistics::Formula readBW
Read bandwidth in bytes/s
std::unordered_map< RequestPtr, Tick > waitingResp
Reqs waiting for response.
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 > createExit(Tick duration)
Generated on Sun Jul 30 2023 01:56:51 for gem5 by doxygen 1.8.17