52 cuPort(
name() +
".port", this),
53 maximumSize(params->
size),
55 bankConflictPenalty(params->bankConflictPenalty),
59 "Number of LDS banks should be positive number");
60 fatal_if((params->banks & (params->banks - 1)) != 0,
61 "Number of LDS banks should be a power of 2");
63 "cannot allocate an LDS with a size less than 1");
65 "the LDS should be an even number");
72 LdsStateParams::create()
84 fatal_if(!x_parent,
"x_parent should not be nullptr");
86 "should not be setting the parent twice");
106 "did not get the right sort of sender state");
116 unsigned *numBankAccesses)
118 int bank_conflicts = 0;
127 for (
int i = 0;
i < groups;
i++) {
130 addr_array.resize(numBanks, 0);
132 bank.resize(
banks, 0);
136 for (
int j = 0;
j < numBanks;
j++) {
137 if (gpuDynInst->exec_mask[(
i*numBanks)+
j]) {
138 addr_array[
j] = gpuDynInst->addr[(
i*numBanks)+
j];
140 addr_array[
j] = std::numeric_limits<Addr>::max();
144 if (gpuDynInst->isLoad() || gpuDynInst->isStore()) {
146 for (
int j = 0;
j < numBanks; ++
j) {
147 for (
int j0 = 0; j0 <
j; j0++) {
148 if (addr_array[j] != std::numeric_limits<Addr>::max()
149 && addr_array[
j] == addr_array[j0]) {
150 addr_array[
j] = std::numeric_limits<Addr>::max();
156 for (
int j = 0;
j < numBanks; ++
j) {
157 if (addr_array[
j] != std::numeric_limits<Addr>::max()) {
158 int bankId = addr_array[
j] %
banks;
160 max_bank = std::max(max_bank, bank[bankId]);
165 (*numBankAccesses)++;
168 bank_conflicts += max_bank;
171 "Max bank conflicts should match num of work items per instr");
172 return bank_conflicts;
199 unsigned bankAccesses = 0;
214 Tick processingTime =
248 fatal(
"not implemented");
258 assert(ownerLds->isRetryResp());
259 ownerLds->setRetryResp(
false);
269 fatal(
"not implemented");
290 gpuDynInst->initiateAcc(gpuDynInst);
300 panic(
"have not handled timing responses being NACK'd when sent"
Tick ticks(int numCycles) const
GPUDynInstPtr getDynInstr(PacketPtr packet)
virtual void process()
wake up at this time and perform specified actions
const std::string & name()
std::queue< std::pair< Tick, PacketPtr > > returnQueue
void makeTimingResponse()
bool returnQueuePush(std::pair< Tick, PacketPtr > thePair)
add this to the queue of packets to be returned
panic_if(!root,"Invalid expression\n")
bool scheduled() const
Determine if the current event is scheduled.
virtual void recvFunctional(PacketPtr pkt)
receive a packet in functional mode
LdsState(const Params *params)
the default constructor that works with SWIG
bool processPacket(PacketPtr packet)
process an incoming packet, add it to the return queue
GPUDynInstPtr getMemInst() const
Stats::Distribution ldsBankConflictDist
std::shared_ptr< GPUDynInst > GPUDynInstPtr
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...
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the master port by calling its corresponding receive function...
virtual void recvRetry()
receive a retry
Tick earliestReturnTime() const
SenderState * predecessor
Tick when() const
Get the time that the event is scheduled.
uint64_t Tick
Tick count type.
unsigned countBankConflicts(PacketPtr packet, unsigned *bankAccesses)
derive the gpu mem packet from the packet and then count the bank conflicts
virtual void recvRespRetry()
receive a retry for a response
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
A virtual base opaque structure used to hold state associated with the packet (e.g., an MSHR), specific to a MemObject that sees the packet.
virtual const std::string name() const
SenderState is information carried along with the packet, esp.
SenderState * senderState
This packet's sender state.
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
Stats::Scalar ldsBankAccesses
bool process()
look for packets to return at this time
void setParent(ComputeUnit *x_parent)
set the parent and name based on the parent
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
virtual bool recvTimingReq(PacketPtr pkt)
receive the packet from the CU