Go to the documentation of this file.
38 #include "debug/HSAPacketProcessor.hh"
41 #define HWSCHDLR_EVENT_DESCRIPTION_GENERATOR(XEVENT) \
43 HWScheduler::XEVENT::description() const \
98 Addr db_offset =
sizeof(uint32_t)*queue_id;
100 panic(
"Creating an already existing queue (queueID %d)", queue_id);
104 dbMap[db_offset] = queue_id;
107 panic(
"Attempting to create a queue (queueID %d)" \
108 " beyond PIO range", queue_id);
113 hostReadIndexPointer, size);
116 QCntxt q_cntxt(q_desc, aql_buf);
121 bool M5_VAR_USED register_q =
mapQIfSlotAvlbl(queue_id, aql_buf, q_desc);
124 "%s: offset = %p, qID = %d, is_regd = %s, AL size %d\n",
125 __FUNCTION__, db_offset, queue_id,
126 (register_q) ?
"true" :
"false",
dbMap.size());
133 "Trying to find empty HW queue, @ %s\n", __FUNCTION__);
146 panic(
"Cannot find empty queue\n");
156 "Trying to map new queue, @ %s\n", __FUNCTION__);
196 "Trying to map next queue, @ %s", __FUNCTION__);
255 uint32_t al_idx =
dbMap[db_offset];
273 "Next Active ALQ %d (current %d), max ALQ %d\n",
301 "@ %s, analyzing hw queue %d\n", __FUNCTION__, rl_idx);
324 auto dbmap_iter =
dbMap.find(db_addr);
325 if (dbmap_iter ==
dbMap.end()) {
326 panic(
"Writing to a non-existing queue (db_offset %x)", db_addr);
328 uint32_t al_idx =
dbMap[db_addr];
330 activeList[al_idx].qDesc->writeIndex = doorbell_reg;
349 Addr db_offset =
sizeof(uint32_t)*queue_id;
350 auto dbmap_iter =
dbMap.find(db_offset);
351 if (dbmap_iter ==
dbMap.end()) {
352 panic(
"Destroying a non-existing queue (db_offset %x)",
355 uint32_t al_idx =
dbMap[db_offset];
356 assert(
dbMap[db_offset] == dbmap_iter->second);
365 warn(
"Destroying a non-empty queue");
371 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)
SchedulerWakeupEvent schedWakeupEvent
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
SignalState depSignalRdState
#define MAX_ACTIVE_QUEUES
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17