gem5
v20.1.0.0
|
#include <hw_scheduler.hh>
Classes | |
class | SchedulerWakeupEvent |
Public Member Functions | |
HWScheduler (HSAPacketProcessor *hsa_pp, Tick wakeup_delay) | |
void | write (Addr db_addr, uint32_t doorbell_reg) |
void | registerNewQueue (uint64_t hostReadIndexPointer, uint64_t basePointer, uint64_t queue_id, uint32_t size) |
void | unregisterQueue (uint64_t queue_id) |
void | wakeup () |
void | schedWakeup () |
bool | isRLQIdle (uint32_t rl_idx) |
bool | findNextActiveALQ () |
bool | findNextIdleRLQ () |
bool | unmapQFromRQ () |
bool | contextSwitchQ () |
bool | findEmptyHWQ () |
bool | mapQIfSlotAvlbl (uint32_t al_idx, AQLRingBuffer *aql_buf, HSAQueueDescriptor *q_desc) |
void | addQCntxt (uint32_t al_idx, AQLRingBuffer *aql_buf, HSAQueueDescriptor *q_desc) |
void | removeQCntxt () |
void | scheduleAndWakeupMappedQ () |
void | updateRRVars (uint32_t al_idx, uint32_t rl_idx) |
Private Attributes | |
std::map< uint32_t, QCntxt > | activeList |
std::map< Addr, uint32_t > | dbMap |
std::map< uint32_t, uint32_t > | regdListMap |
HSAPacketProcessor * | hsaPP |
uint32_t | nextALId |
uint32_t | nextRLId |
const Tick | wakeupDelay |
SchedulerWakeupEvent | schedWakeupEvent |
Definition at line 45 of file hw_scheduler.hh.
|
inline |
Definition at line 48 of file hw_scheduler.hh.
void HWScheduler::addQCntxt | ( | uint32_t | al_idx, |
AQLRingBuffer * | aql_buf, | ||
HSAQueueDescriptor * | q_desc | ||
) |
Definition at line 178 of file hw_scheduler.cc.
References QueueContext::aqlBuf, DPRINTF, HSAPacketProcessor::getRegdListEntry(), hsaPP, nextRLId, HSAPacketProcessor::RQLEntry::qCntxt, QueueContext::qDesc, and regdListMap.
Referenced by contextSwitchQ(), and mapQIfSlotAvlbl().
bool HWScheduler::contextSwitchQ | ( | ) |
Definition at line 193 of file hw_scheduler.cc.
References activeList, addQCntxt(), DPRINTF, findNextActiveALQ(), mapQIfSlotAvlbl(), nextALId, nextRLId, scheduleAndWakeupMappedQ(), unmapQFromRQ(), and updateRRVars().
Referenced by unregisterQueue(), and wakeup().
bool HWScheduler::findEmptyHWQ | ( | ) |
Definition at line 130 of file hw_scheduler.cc.
References DPRINTF, HSAPacketProcessor::getRegdListEntry(), hsaPP, nextRLId, HSAPacketProcessor::numHWQueues, panic, HSAPacketProcessor::RQLEntry::qCntxt, QueueContext::qDesc, and regdListMap.
Referenced by mapQIfSlotAvlbl().
bool HWScheduler::findNextActiveALQ | ( | ) |
Definition at line 262 of file hw_scheduler.cc.
References activeList, DPRINTF, MAX_ACTIVE_QUEUES, nextALId, and regdListMap.
Referenced by contextSwitchQ().
bool HWScheduler::findNextIdleRLQ | ( | ) |
Definition at line 284 of file hw_scheduler.cc.
References hsaPP, isRLQIdle(), nextRLId, and HSAPacketProcessor::numHWQueues.
Referenced by unmapQFromRQ().
bool HWScheduler::isRLQIdle | ( | uint32_t | rl_idx | ) |
Definition at line 298 of file hw_scheduler.cc.
References QueueContext::aqlBuf, AQLRingBuffer::dispIdx(), HSAQueueDescriptor::dmaInProgress, DPRINTF, HSAPacketProcessor::getRegdListEntry(), hsaPP, HSAPacketProcessor::RQLEntry::qCntxt, QueueContext::qDesc, and AQLRingBuffer::rdIdx().
Referenced by findNextIdleRLQ().
bool HWScheduler::mapQIfSlotAvlbl | ( | uint32_t | al_idx, |
AQLRingBuffer * | aql_buf, | ||
HSAQueueDescriptor * | q_desc | ||
) |
Definition at line 152 of file hw_scheduler.cc.
References addQCntxt(), DPRINTF, findEmptyHWQ(), nextRLId, scheduleAndWakeupMappedQ(), and updateRRVars().
Referenced by contextSwitchQ(), and registerNewQueue().
void HWScheduler::registerNewQueue | ( | uint64_t | hostReadIndexPointer, |
uint64_t | basePointer, | ||
uint64_t | queue_id, | ||
uint32_t | size | ||
) |
Definition at line 84 of file hw_scheduler.cc.
References activeList, dbMap, DPRINTF, hsaPP, mapQIfSlotAvlbl(), MAX_ACTIVE_QUEUES, SimObject::name(), NUM_DMA_BUFS, panic, and schedWakeup().
Referenced by HSAPacketProcessor::setDeviceQueueDesc().
void HWScheduler::removeQCntxt | ( | ) |
Definition at line 242 of file hw_scheduler.cc.
References QueueContext::aqlBuf, dbMap, HSAPacketProcessor::RQLEntry::depSignalRdState, HSAPacketProcessor::SignalState::discardRead, HSAQueueDescriptor::doorbellPointer, HSAPacketProcessor::getRegdListEntry(), hsaPP, nextRLId, HSAPacketProcessor::RQLEntry::qCntxt, QueueContext::qDesc, regdListMap, and HSAPacketProcessor::SignalState::resetSigVals().
Referenced by unmapQFromRQ().
void HWScheduler::scheduleAndWakeupMappedQ | ( | ) |
Definition at line 167 of file hw_scheduler.cc.
References HSAPacketProcessor::getCommandsFromHost(), hsaPP, nextRLId, HSAPacketProcessor::regdQList, and HSAPacketProcessor::schedAQLProcessing().
Referenced by contextSwitchQ(), and mapQIfSlotAvlbl().
void HWScheduler::schedWakeup | ( | ) |
Definition at line 71 of file hw_scheduler.cc.
References activeList, curTick(), DPRINTF, hsaPP, regdListMap, EventManager::schedule(), Event::scheduled(), schedWakeupEvent, and wakeupDelay.
Referenced by registerNewQueue(), unregisterQueue(), and wakeup().
bool HWScheduler::unmapQFromRQ | ( | ) |
Definition at line 230 of file hw_scheduler.cc.
References findNextIdleRLQ(), and removeQCntxt().
Referenced by contextSwitchQ().
void HWScheduler::unregisterQueue | ( | uint64_t | queue_id | ) |
Definition at line 339 of file hw_scheduler.cc.
References activeList, QueueContext::aqlBuf, HSAPacketProcessor::RQLEntry::aqlProcessEvent, contextSwitchQ(), dbMap, HSAPacketProcessor::RQLEntry::depSignalRdState, HSAPacketProcessor::SignalState::discardRead, HSAPacketProcessor::getRegdListEntry(), hsaPP, panic, HSAPacketProcessor::RQLEntry::qCntxt, QueueContext::qDesc, regdListMap, HSAPacketProcessor::SignalState::resetSigVals(), Event::scheduled(), schedWakeup(), and warn.
Referenced by HSAPacketProcessor::unsetDeviceQueueDesc().
void HWScheduler::updateRRVars | ( | uint32_t | al_idx, |
uint32_t | rl_idx | ||
) |
Definition at line 223 of file hw_scheduler.cc.
References hsaPP, MAX_ACTIVE_QUEUES, nextALId, nextRLId, and HSAPacketProcessor::numHWQueues.
Referenced by contextSwitchQ(), and mapQIfSlotAvlbl().
void HWScheduler::wakeup | ( | ) |
Definition at line 57 of file hw_scheduler.cc.
References contextSwitchQ(), and schedWakeup().
Referenced by HWScheduler::SchedulerWakeupEvent::process().
void HWScheduler::write | ( | Addr | db_addr, |
uint32_t | doorbell_reg | ||
) |
Definition at line 322 of file hw_scheduler.cc.
References activeList, dbMap, HSAPacketProcessor::getCommandsFromHost(), hsaPP, panic, and regdListMap.
Referenced by HSAPacketProcessor::write().
|
private |
Definition at line 85 of file hw_scheduler.hh.
Referenced by contextSwitchQ(), findNextActiveALQ(), registerNewQueue(), schedWakeup(), unregisterQueue(), and write().
|
private |
Definition at line 88 of file hw_scheduler.hh.
Referenced by registerNewQueue(), removeQCntxt(), unregisterQueue(), and write().
|
private |
Definition at line 93 of file hw_scheduler.hh.
Referenced by addQCntxt(), findEmptyHWQ(), findNextIdleRLQ(), isRLQIdle(), registerNewQueue(), removeQCntxt(), scheduleAndWakeupMappedQ(), schedWakeup(), unregisterQueue(), updateRRVars(), and write().
|
private |
Definition at line 100 of file hw_scheduler.hh.
Referenced by contextSwitchQ(), findNextActiveALQ(), and updateRRVars().
|
private |
Definition at line 101 of file hw_scheduler.hh.
Referenced by addQCntxt(), contextSwitchQ(), findEmptyHWQ(), findNextIdleRLQ(), mapQIfSlotAvlbl(), removeQCntxt(), scheduleAndWakeupMappedQ(), and updateRRVars().
|
private |
Definition at line 92 of file hw_scheduler.hh.
Referenced by addQCntxt(), findEmptyHWQ(), findNextActiveALQ(), removeQCntxt(), schedWakeup(), unregisterQueue(), and write().
|
private |
Definition at line 103 of file hw_scheduler.hh.
Referenced by schedWakeup().
|
private |
Definition at line 102 of file hw_scheduler.hh.
Referenced by schedWakeup().