gem5
v20.1.0.1
|
#include <hsa_packet_processor.hh>
Classes | |
class | CmdQueueCmdDmaEvent |
class | DepSignalsReadDmaEvent |
struct | dma_series_ctx |
Calls getCurrentEntry once the queueEntry has been dmaRead. More... | |
class | QueueProcessEvent |
class | RQLEntry |
class | SignalState |
class | UpdateReadDispIdDmaEvent |
this event is used to update the read_disp_id field (the read pointer) of the MQD, which is how the host code knows the status of the HQD's read pointer More... | |
Public Types | |
typedef HSAPacketProcessorParams | Params |
![]() | |
typedef DmaDeviceParams | Params |
![]() | |
typedef PioDeviceParams | Params |
![]() | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
![]() | |
typedef SimObjectParams | Params |
Public Member Functions | |
HSAQueueDescriptor * | getQueueDesc (uint32_t queId) |
class RQLEntry * | getRegdListEntry (uint32_t queId) |
HSAPacketProcessor (const Params *p) | |
~HSAPacketProcessor () | |
void | setDeviceQueueDesc (uint64_t hostReadIndexPointer, uint64_t basePointer, uint64_t queue_id, uint32_t size) |
void | unsetDeviceQueueDesc (uint64_t queue_id) |
void | setDevice (HSADevice *dev) |
void | updateReadIndex (int, uint32_t) |
void | getCommandsFromHost (int pid, uint32_t rl_idx) |
virtual Tick | read (Packet *) |
virtual Tick | write (Packet *) |
virtual AddrRangeList | getAddrRanges () const |
Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to. More... | |
void | finishPkt (void *pkt, uint32_t rl_idx) |
void | finishPkt (void *pkt) |
void | schedAQLProcessing (uint32_t rl_idx) |
void | schedAQLProcessing (uint32_t rl_idx, Tick delay) |
![]() | |
DmaDevice (const Params *p) | |
virtual | ~DmaDevice () |
void | dmaWrite (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0) |
void | dmaWrite (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0) |
void | dmaRead (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0) |
void | dmaRead (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0) |
bool | dmaPending () const |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
unsigned int | cacheBlockSize () const |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. More... | |
![]() | |
PioDevice (const Params *p) | |
virtual | ~PioDevice () |
const Params * | params () const |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. More... | |
![]() | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () const |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
![]() | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
![]() | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
![]() | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
![]() | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
![]() | |
void | updateClockPeriod () |
Update the tick to the current tick. More... | |
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 caller to determine a future cycle. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More... | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Public Attributes | |
int | numHWQueues |
Addr | pioAddr |
Addr | pioSize |
Tick | pioDelay |
const Tick | pktProcessDelay |
![]() | |
PowerState * | powerState |
Protected Types | |
typedef void(DmaDevice::* | DmaFnPtr) (Addr, int, Event *, uint8_t *, Tick) |
Protected Member Functions | |
void | translateOrDie (Addr vaddr, Addr &paddr) |
void | dmaVirt (DmaFnPtr, Addr host_addr, unsigned size, Event *event, void *data, Tick delay=0) |
void | dmaReadVirt (Addr host_addr, unsigned size, Event *event, void *data, Tick delay=0) |
void | dmaWriteVirt (Addr host_addr, unsigned size, Event *event, void *data, Tick delay=0) |
Q_STATE | processPkt (void *pkt, uint32_t rl_idx, Addr host_pkt_addr) |
void | displayQueueDescriptor (int pid, uint32_t rl_idx) |
![]() | |
virtual Tick | read (PacketPtr pkt)=0 |
Pure virtual function that the device must implement. More... | |
virtual Tick | write (PacketPtr pkt)=0 |
Pure virtual function that the device must implement. More... | |
![]() | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
![]() | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
Protected Attributes | |
HSADevice * | hsa_device |
HWScheduler * | hwSchdlr |
std::vector< class RQLEntry * > | regdQList |
![]() | |
DmaPort | dmaPort |
![]() | |
System * | sys |
PioPort< PioDevice > | pioPort |
The pioPort that handles the requests for us and provides us requests that it sees. More... | |
![]() | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
![]() | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Friends | |
class | HWScheduler |
Additional Inherited Members | |
![]() | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
![]() | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Definition at line 212 of file hsa_packet_processor.hh.
|
protected |
Definition at line 216 of file hsa_packet_processor.hh.
typedef HSAPacketProcessorParams HSAPacketProcessor::Params |
Definition at line 311 of file hsa_packet_processor.hh.
HSAPacketProcessor::HSAPacketProcessor | ( | const Params * | p | ) |
Definition at line 73 of file hsa_packet_processor.cc.
References DPRINTF, ArmISA::i, and MipsISA::p.
HSAPacketProcessor::~HSAPacketProcessor | ( | ) |
Definition at line 85 of file hsa_packet_processor.cc.
References regdQList.
|
protected |
Definition at line 591 of file hsa_packet_processor.cc.
|
protected |
Definition at line 193 of file hsa_packet_processor.cc.
References data, DmaDevice::dmaRead(), dmaVirt(), DPRINTF, and MipsISA::event.
Referenced by getCommandsFromHost(), and processPkt().
|
protected |
Definition at line 166 of file hsa_packet_processor.cc.
References addr, curTick(), data, ChunkGenerator::done(), MipsISA::event, PAGE_SIZE, EventManager::schedule(), and translateOrDie().
Referenced by dmaReadVirt(), and dmaWriteVirt().
|
protected |
Definition at line 202 of file hsa_packet_processor.cc.
References data, dmaVirt(), DmaDevice::dmaWrite(), and MipsISA::event.
Referenced by processPkt(), and updateReadIndex().
|
inline |
Definition at line 328 of file hsa_packet_processor.hh.
References finishPkt().
Referenced by finishPkt().
void HSAPacketProcessor::finishPkt | ( | void * | pkt, |
uint32_t | rl_idx | ||
) |
Definition at line 667 of file hsa_packet_processor.cc.
References DPRINTF, getCommandsFromHost(), HSAQueueDescriptor::isEmpty(), HSAQueueDescriptor::numElts, panic_if, HSAQueueDescriptor::readIndex, regdQList, schedAQLProcessing(), HSAQueueDescriptor::spaceUsed(), HSAQueueDescriptor::stalledOnDmaBufAvailability, updateReadIndex(), and HSAQueueDescriptor::writeIndex.
Referenced by GPUDispatcher::notifyWgCompl(), processPkt(), and GPUCommandProcessor::submitVendorPkt().
|
virtual |
Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.
Implements PioDevice.
Definition at line 112 of file hsa_packet_processor.cc.
References pioAddr, pioSize, and RangeSize().
void HSAPacketProcessor::getCommandsFromHost | ( | int | pid, |
uint32_t | rl_idx | ||
) |
Definition at line 510 of file hsa_packet_processor.cc.
References AQLRingBuffer::allocEntry(), HSAQueueDescriptor::dmaInProgress, dmaReadVirt(), HSAQueueDescriptor::doorbellPointer, DPRINTF, HSAQueueDescriptor::numObjs(), AQLRingBuffer::numObjs(), HSAQueueDescriptor::objSize(), HSAQueueDescriptor::ptr(), AQLRingBuffer::ptr(), HSAQueueDescriptor::readIndex, regdQList, AQLRingBuffer::saveHostDispAddr(), HSAQueueDescriptor::spaceUsed(), HSAQueueDescriptor::stalledOnDmaBufAvailability, AQLRingBuffer::wrIdx(), and HSAQueueDescriptor::writeIndex.
Referenced by finishPkt(), HWScheduler::scheduleAndWakeupMappedQ(), updateReadIndex(), and HWScheduler::write().
|
inline |
Definition at line 295 of file hsa_packet_processor.hh.
References regdQList.
Referenced by GPUCommandProcessor::initABI(), and GPUCommandProcessor::ReadDispIdOffsetDmaEvent::process().
|
inline |
Definition at line 300 of file hsa_packet_processor.hh.
References regdQList.
Referenced by HWScheduler::addQCntxt(), HWScheduler::findEmptyHWQ(), HWScheduler::isRLQIdle(), HWScheduler::removeQCntxt(), and HWScheduler::unregisterQueue().
|
protected |
HACK: The semantics of the HSA signal is to decrement the current signal value. I'm going to cheat here and read out the value from main memory using functional access, and then just DMA the decremented value. The reason for this is that the DMASequencer does not support atomic operations.
Definition at line 305 of file hsa_packet_processor.cc.
References HSAPacketProcessor::SignalState::allRead, BLOCKED_BBIT, BLOCKED_BPKT, HSAPacketProcessor::SignalState::discardRead, dmaReadVirt(), dmaWriteVirt(), DPRINTF, fatal, finishPkt(), hsa_device, HSA_PACKET_TYPE_BARRIER_AND, HSA_PACKET_TYPE_BARRIER_OR, HSA_PACKET_TYPE_INVALID, HSA_PACKET_TYPE_KERNEL_DISPATCH, HSA_PACKET_TYPE_VENDOR_SPECIFIC, ArmISA::i, IS_BARRIER, NumSignalsPerBarrier, HSAPacketProcessor::SignalState::pendingReads, PKT_TYPE, regdQList, HSAPacketProcessor::SignalState::resetSigVals(), HSADevice::submitDispatchPkt(), HSADevice::submitVendorPkt(), PioDevice::sys, System::threads, UNBLOCKED, and HSAPacketProcessor::SignalState::values.
Definition at line 146 of file hsa_packet_processor.cc.
References Packet::makeAtomicResponse(), pioDelay, and Packet::setBadAddress().
void HSAPacketProcessor::schedAQLProcessing | ( | uint32_t | rl_idx | ) |
Definition at line 299 of file hsa_packet_processor.cc.
References pktProcessDelay.
Referenced by finishPkt(), and HWScheduler::scheduleAndWakeupMappedQ().
void HSAPacketProcessor::schedAQLProcessing | ( | uint32_t | rl_idx, |
Tick | delay | ||
) |
Definition at line 285 of file hsa_packet_processor.cc.
References HSAPacketProcessor::RQLEntry::aqlProcessEvent, curTick(), DPRINTF, regdQList, EventManager::schedule(), and Event::scheduled().
void HSAPacketProcessor::setDevice | ( | HSADevice * | dev | ) |
Definition at line 636 of file hsa_packet_processor.cc.
References hsa_device.
Referenced by HSADevice::HSADevice().
void HSAPacketProcessor::setDeviceQueueDesc | ( | uint64_t | hostReadIndexPointer, |
uint64_t | basePointer, | ||
uint64_t | queue_id, | ||
uint32_t | size | ||
) |
Definition at line 99 of file hsa_packet_processor.cc.
References DPRINTF, hwSchdlr, and HWScheduler::registerNewQueue().
Referenced by HSADriver::allocateQueue().
Definition at line 154 of file hsa_packet_processor.cc.
References fatal, PioDevice::sys, System::threads, and MipsISA::vaddr.
Referenced by dmaVirt().
void HSAPacketProcessor::unsetDeviceQueueDesc | ( | uint64_t | queue_id | ) |
Definition at line 93 of file hsa_packet_processor.cc.
References hwSchdlr, and HWScheduler::unregisterQueue().
Referenced by GPUComputeDriver::ioctl().
void HSAPacketProcessor::updateReadIndex | ( | int | pid, |
uint32_t | rl_idx | ||
) |
Definition at line 217 of file hsa_packet_processor.cc.
References dmaWriteVirt(), DPRINTF, getCommandsFromHost(), HSAQueueDescriptor::hostReadIndexPtr, HSAQueueDescriptor::isEmpty(), HSAQueueDescriptor::numElts, AQLRingBuffer::rdIdx(), AQLRingBuffer::rdIdxPtr(), HSAQueueDescriptor::readIndex, regdQList, HSAQueueDescriptor::spaceUsed(), AQLRingBuffer::wrIdx(), and HSAQueueDescriptor::writeIndex.
Referenced by finishPkt().
Definition at line 124 of file hsa_packet_processor.cc.
References DPRINTF, Packet::getAddr(), Packet::getLE(), Packet::getSize(), hwSchdlr, Packet::makeAtomicResponse(), pioAddr, pioDelay, pioSize, and HWScheduler::write().
|
friend |
Definition at line 214 of file hsa_packet_processor.hh.
|
protected |
Definition at line 217 of file hsa_packet_processor.hh.
Referenced by processPkt(), and setDevice().
|
protected |
Definition at line 218 of file hsa_packet_processor.hh.
Referenced by setDeviceQueueDesc(), unsetDeviceQueueDesc(), and write().
int HSAPacketProcessor::numHWQueues |
Definition at line 305 of file hsa_packet_processor.hh.
Referenced by HWScheduler::findEmptyHWQ(), HWScheduler::findNextIdleRLQ(), and HWScheduler::updateRRVars().
Addr HSAPacketProcessor::pioAddr |
Definition at line 306 of file hsa_packet_processor.hh.
Referenced by getAddrRanges(), HSADriver::mmap(), and write().
Tick HSAPacketProcessor::pioDelay |
Definition at line 308 of file hsa_packet_processor.hh.
Addr HSAPacketProcessor::pioSize |
Definition at line 307 of file hsa_packet_processor.hh.
Referenced by getAddrRanges(), and write().
const Tick HSAPacketProcessor::pktProcessDelay |
Definition at line 309 of file hsa_packet_processor.hh.
Referenced by schedAQLProcessing().
|
protected |
Definition at line 279 of file hsa_packet_processor.hh.
Referenced by displayQueueDescriptor(), finishPkt(), getCommandsFromHost(), getQueueDesc(), getRegdListEntry(), processPkt(), schedAQLProcessing(), HWScheduler::scheduleAndWakeupMappedQ(), updateReadIndex(), and ~HSAPacketProcessor().