Go to the documentation of this file.
36 #include "debug/HSAPacketProcessor.hh"
39 #define HWSCHDLR_EVENT_DESCRIPTION_GENERATOR(XEVENT) \
41 HWScheduler::XEVENT::description() const \
96 Addr db_offset =
sizeof(uint32_t)*queue_id;
98 panic(
"Creating an already existing queue (queueID %d)", queue_id);
102 dbMap[db_offset] = queue_id;
105 panic(
"Attempting to create a queue (queueID %d)" \
106 " beyond PIO range", queue_id);
111 hostReadIndexPointer, size);
114 QCntxt q_cntxt(q_desc, aql_buf);
119 M5_VAR_USED
bool register_q =
mapQIfSlotAvlbl(queue_id, aql_buf, q_desc);
122 "%s: offset = %p, qID = %d, is_regd = %s, AL size %d\n",
123 __FUNCTION__, db_offset, queue_id,
124 (register_q) ?
"true" :
"false",
dbMap.size());
131 "Trying to find empty HW queue, @ %s\n", __FUNCTION__);
144 panic(
"Cannot find empty queue\n");
154 "Trying to map new queue, @ %s\n", __FUNCTION__);
194 "Trying to map next queue, @ %s", __FUNCTION__);
253 uint32_t al_idx =
dbMap[db_offset];
271 "Next Active ALQ %d (current %d), max ALQ %d\n",
299 "@ %s, analyzing hw queue %d\n", __FUNCTION__, rl_idx);
321 auto dbmap_iter =
dbMap.find(db_addr);
322 if (dbmap_iter ==
dbMap.end()) {
323 panic(
"Writing to a non-existing queue (db_offset %x)", db_addr);
325 uint32_t al_idx =
dbMap[db_addr];
327 activeList[al_idx].qDesc->writeIndex = doorbell_reg;
346 Addr db_offset =
sizeof(uint32_t)*queue_id;
347 auto dbmap_iter =
dbMap.find(db_offset);
348 if (dbmap_iter ==
dbMap.end()) {
349 panic(
"Destroying a non-existing queue (db_offset %x)",
352 uint32_t al_idx =
dbMap[db_offset];
353 assert(
dbMap[db_offset] == dbmap_iter->second);
362 warn(
"Destroying a non-empty queue");
368 dbMap.erase(db_offset);
void registerNewQueue(uint64_t hostReadIndexPointer, uint64_t basePointer, uint64_t queue_id, uint32_t size)
bool mapQIfSlotAvlbl(uint32_t al_idx, AQLRingBuffer *aql_buf, HSAQueueDescriptor *q_desc)
bool scheduled() const
Determine if the current event is scheduled.
std::map< Addr, uint32_t > dbMap
void unregisterQueue(uint64_t queue_id)
void scheduleAndWakeupMappedQ()
Internal ring buffer which is used to prefetch/store copies of the in-memory HSA ring buffer.
#define HWSCHDLR_EVENT_DESCRIPTION_GENERATOR(XEVENT)
std::map< uint32_t, QCntxt > activeList
void getCommandsFromHost(int pid, uint32_t rl_idx)
void updateRRVars(uint32_t al_idx, uint32_t rl_idx)
void schedule(Event &event, Tick when)
bool isRLQIdle(uint32_t rl_idx)
std::vector< class RQLEntry * > regdQList
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
HSAQueueDescriptor * qDesc
QueueProcessEvent aqlProcessEvent
virtual const std::string name() const
class RQLEntry * getRegdListEntry(uint32_t queId)
void schedAQLProcessing(uint32_t rl_idx)
std::map< uint32_t, uint32_t > regdListMap
HSAPacketProcessor * hsaPP
void write(Addr db_addr, uint32_t doorbell_reg)
void addQCntxt(uint32_t al_idx, AQLRingBuffer *aql_buf, HSAQueueDescriptor *q_desc)
Tick curTick()
The universal simulation clock.
SchedulerWakeupEvent schedWakeupEvent
uint64_t inFlightPkts(uint32_t queId)
#define panic(...)
This implements a cprintf based panic() function.
SignalState depSignalRdState
#define MAX_ACTIVE_QUEUES
Generated on Tue Jun 22 2021 15:28:28 for gem5 by doxygen 1.8.17