29#ifndef __CPU_TESTERS_TRAFFIC_GEN_GUPS_GEN_HH__
30#define __CPU_TESTERS_TRAFFIC_GEN_GUPS_GEN_HH__
41#include <unordered_map>
46#include "params/GUPSGen.hh"
125 virtual void init()
override;
127 virtual void startup()
override;
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
definition of the GenPort class which is of the type RequestPort.
void sendTimingPacket(PacketPtr pkt)
This function send a timing request to the port's peer responsePort.
GenPort(const std::string &name, GUPSGen *owner)
GUPSGen * owner
Pointer to the GUPSGen this port belongs to.
bool blocked()
Return whether the port is blocked.
PacketPtr blockedPacket
Pointer to the blocked packet in the port.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
void sendFunctionalPacket(PacketPtr pkt)
This function send a functional request to the port's peer responsePort.
bool _blocked
Boolean value to remember if the port is previously blocked and is occupied by a previous request,...
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
std::queue< PacketPtr > requestPool
A queue to store the outstanding requests whether read or write.
const uint64_t memSize
Size of the memory in bytes that will be allocated for the array.
int64_t tableSize
Number of elements in the allocated array.
void handleResponse(PacketPtr pkt)
Handles the incoming responses from the outside.
GUPSGen(const GUPSGenParams ¶ms)
EventFunctionWrapper nextSendEvent
Corresponding event to the sendNextReq function.
void wakeUp()
This function allows the port to wake its owner GUPSGen object in case it has stopped working due to ...
virtual void startup() override
startup() is the final initialization call before simulation.
gem5::GUPSGen::GUPSGenStat stats
System *const system
Pointer to the system object this GUPSGen belongs to, the system object is used to acquire a requesto...
bool doneReading
Boolean to indicate whether the generator is done creating read requests, which means number of reads...
Addr startAddr
The beginning address for allocating the array.
int updateLimit
The number of updates to do before creating an exit event.
void sendNextReq()
Send outstanding requests from requestPool to the port.
std::unordered_map< RequestPtr, Tick > exitTimes
Use an unordered map to track the time at which each request exits the GUPSGen.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
virtual void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
int readRequests
The number of read requests currently created.
GenPort port
An instance of GenPort to communicate with the outside.
const RequestorID requestorId
Used to identify each requestor in a system object.
int reqQueueSize
The maximum number of outstanding requests (i.e.
std::unordered_map< RequestPtr, uint64_t > updateTable
Use an unordered map to store future updates on current reads as the updated value depends on the ind...
const int elementSize
size of each element in the array (in bytes).
PacketPtr getReadPacket(Addr addr, unsigned int size)
Generate a read request to be sent to the outside.
Addr indexToAddr(uint64_t index)
Convert and index from array to its physical address in the memory.
void createNextReq()
Create the next request and store in the requestPool.
int onTheFlyRequests
The number of requests that have existed this GUPSGen and have no corresponding response (they are be...
PacketPtr getWritePacket(Addr addr, unsigned int size, uint8_t *data)
Generate a write request to be sent to the outside.
std::queue< PacketPtr > responsePool
A queue to store response packets from reads.
bool initMemory
Boolean value to determine whether we need to initialize the array with the right values,...
EventFunctionWrapper nextCreateEvent
Corresponding event to the createNextReq function.
int64_t numUpdates
The total number of updates (one read and one write) to do for running the benchmark to completion.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
const std::string name() const
Return port name (for DPRINTF).
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
This is a simple scalar statistic, like a counter.
ClockedObject declaration and implementation.
const Params & params() const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Declaration of Statistics objects.
statistics::Formula avgWriteBW
statistics::Scalar totalWriteLat
statistics::Scalar totalUpdates
GUPSGenStat(GUPSGen *parent)
void regStats() override
Callback to set stat parameters.
statistics::Scalar totalReadLat
statistics::Scalar totalReads
statistics::Scalar totalBytesRead
statistics::Formula avgReadBW
statistics::Scalar totalWrites
statistics::Scalar totalBytesWritten
statistics::Formula avgReadLat
statistics::Formula avgWriteLat