Go to the documentation of this file.
50 cuPort(
name() +
".port", this),
51 maximumSize(params->size),
53 bankConflictPenalty(params->bankConflictPenalty),
57 "Number of LDS banks should be positive number");
59 "Number of LDS banks should be a power of 2");
61 "cannot allocate an LDS with a size less than 1");
63 "the LDS should be an even number");
70 LdsStateParams::create()
82 fatal_if(!x_parent,
"x_parent should not be nullptr");
84 "should not be setting the parent twice");
104 "did not get the right sort of sender state");
114 unsigned *numBankAccesses)
116 int bank_conflicts = 0;
125 for (
int i = 0;
i < groups;
i++) {
128 addr_array.resize(numBanks, 0);
130 bank.resize(
banks, 0);
134 for (
int j = 0;
j < numBanks;
j++) {
135 if (gpuDynInst->exec_mask[(
i*numBanks)+
j]) {
136 addr_array[
j] = gpuDynInst->addr[(
i*numBanks)+
j];
138 addr_array[
j] = std::numeric_limits<Addr>::max();
142 if (gpuDynInst->isLoad() || gpuDynInst->isStore()) {
144 for (
int j = 0;
j < numBanks; ++
j) {
145 for (
int j0 = 0; j0 <
j; j0++) {
146 if (addr_array[
j] != std::numeric_limits<Addr>::max()
147 && addr_array[
j] == addr_array[j0]) {
148 addr_array[
j] = std::numeric_limits<Addr>::max();
154 for (
int j = 0;
j < numBanks; ++
j) {
155 if (addr_array[
j] != std::numeric_limits<Addr>::max()) {
156 int bankId = addr_array[
j] %
banks;
158 max_bank = std::max(max_bank, bank[bankId]);
163 (*numBankAccesses)++;
166 bank_conflicts += max_bank;
169 "Max bank conflicts should match num of work items per instr");
170 return bank_conflicts;
188 return ss->getMemInst();
197 unsigned bankAccesses = 0;
212 Tick processingTime =
246 fatal(
"not implemented");
256 assert(ownerLds->isRetryResp());
257 ownerLds->setRetryResp(
false);
267 fatal(
"not implemented");
288 gpuDynInst->initiateAcc(gpuDynInst);
298 panic(
"have not handled timing responses being NACK'd when sent"
#define fatal(...)
This implements a cprintf based fatal() function.
bool scheduled() const
Determine if the current event is scheduled.
virtual void recvRetry()
receive a retry
void makeTimingResponse()
int loadBusLength() const
Stats::Distribution ldsBankConflictDist
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
Stats::Scalar ldsBankAccesses
virtual void process()
wake up at this time and perform specified actions
uint64_t Tick
Tick count type.
bool returnQueuePush(std::pair< Tick, PacketPtr > thePair)
add this to the queue of packets to be returned
virtual bool recvTimingReq(PacketPtr pkt)
receive the packet from the CU
const Params * params() const
bool process()
look for packets to return at this time
Tick when() const
Get the time that the event is scheduled.
SenderState is information carried along with the packet, esp.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Tick cyclesToTicks(Cycles c) const
A virtual base opaque structure used to hold state associated with the packet (e.g....
std::queue< std::pair< Tick, PacketPtr > > returnQueue
Tick earliestReturnTime() const
virtual void recvFunctional(PacketPtr pkt)
receive a packet in functional mode
LdsState(const Params *params)
the default constructor that works with SWIG
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
int storeBusLength() const
GPUDynInstPtr getDynInstr(PacketPtr packet)
const std::string & name()
unsigned countBankConflicts(PacketPtr packet, unsigned *bankAccesses)
derive the gpu mem packet from the packet and then count the bank conflicts
void setParent(ComputeUnit *x_parent)
set the parent and name based on the parent
virtual const std::string name() const
bool processPacket(PacketPtr packet)
process an incoming packet, add it to the return queue
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
GPUDynInstPtr getMemInst() const
std::shared_ptr< GPUDynInst > GPUDynInstPtr
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Cycles is a wrapper class for representing cycle counts, i.e.
virtual void recvRespRetry()
receive a retry for a response
SenderState * senderState
This packet's sender state.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
SenderState * predecessor
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17