gem5
v20.0.0.0
|
#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) |
![]() | |
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... | |
![]() | |
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... | |
const Params * | params () const |
SimObject (const Params *_params) | |
![]() | |
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) |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
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) |
bool | 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) |
static void | unserializeGlobals (CheckpointIn &cp) |
Definition at line 178 of file hsa_packet_processor.hh.
|
protected |
Definition at line 182 of file hsa_packet_processor.hh.
typedef HSAPacketProcessorParams HSAPacketProcessor::Params |
Definition at line 270 of file hsa_packet_processor.hh.
HSAPacketProcessor::HSAPacketProcessor | ( | const Params * | p | ) |
Definition at line 68 of file hsa_packet_processor.cc.
HSAPacketProcessor::~HSAPacketProcessor | ( | ) |
Definition at line 80 of file hsa_packet_processor.cc.
References regdQList.
|
protected |
Definition at line 555 of file hsa_packet_processor.cc.
|
protected |
Definition at line 188 of file hsa_packet_processor.cc.
References DmaDevice::dmaRead(), dmaVirt(), and DPRINTF.
Referenced by getCommandsFromHost(), and processPkt().
|
protected |
Definition at line 161 of file hsa_packet_processor.cc.
References curTick(), ChunkGenerator::done(), MipsISA::event, PAGE_SIZE, EventManager::schedule(), and translateOrDie().
Referenced by dmaReadVirt(), and dmaWriteVirt().
|
protected |
Definition at line 197 of file hsa_packet_processor.cc.
References dmaVirt(), DmaDevice::dmaWrite(), and HSAPacketProcessor::UpdateReadDispIdDmaEvent::UpdateReadDispIdDmaEvent().
Referenced by processPkt(), and updateReadIndex().
void HSAPacketProcessor::finishPkt | ( | void * | pkt, |
uint32_t | rl_idx | ||
) |
Definition at line 631 of file hsa_packet_processor.cc.
References DPRINTF, HSAQueueDescriptor::isEmpty(), HSAQueueDescriptor::numElts, HSAQueueDescriptor::readIndex, HSAQueueDescriptor::spaceUsed(), HSAQueueDescriptor::stalledOnDmaBufAvailability, and HSAQueueDescriptor::writeIndex.
Referenced by processPkt().
|
inline |
Definition at line 287 of file hsa_packet_processor.hh.
References finishPkt().
Referenced by finishPkt().
|
virtual |
Every PIO device is obliged to provide an implementation that returns the address ranges the device responds to.
Implements PioDevice.
Definition at line 107 of file hsa_packet_processor.cc.
References pioAddr, pioSize, and RangeSize().
void HSAPacketProcessor::getCommandsFromHost | ( | int | pid, |
uint32_t | rl_idx | ||
) |
Definition at line 474 of file hsa_packet_processor.cc.
References AQLRingBuffer::allocEntry(), HSAPacketProcessor::CmdQueueCmdDmaEvent::CmdQueueCmdDmaEvent(), HSAQueueDescriptor::dmaInProgress, dmaReadVirt(), HSAQueueDescriptor::doorbellPointer, DPRINTF, HSAQueueDescriptor::numObjs(), AQLRingBuffer::numObjs(), HSAQueueDescriptor::objSize(), HSAQueueDescriptor::ptr(), AQLRingBuffer::ptr(), HSAQueueDescriptor::readIndex, regdQList, AQLRingBuffer::saveHostDispAddr(), HSAPacketProcessor::CmdQueueCmdDmaEvent::series_ctx, HSAQueueDescriptor::spaceUsed(), HSAQueueDescriptor::stalledOnDmaBufAvailability, AQLRingBuffer::wrIdx(), and HSAQueueDescriptor::writeIndex.
Referenced by HWScheduler::scheduleAndWakeupMappedQ(), updateReadIndex(), and HWScheduler::write().
|
inline |
Definition at line 254 of file hsa_packet_processor.hh.
|
inline |
Definition at line 259 of file hsa_packet_processor.hh.
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 294 of file hsa_packet_processor.cc.
References HSAPacketProcessor::SignalState::allRead, BaseBufferArg::copyIn(), HSAPacketProcessor::SignalState::discardRead, dmaReadVirt(), dmaWriteVirt(), DPRINTF, fatal, finishPkt(), System::getThreadContext(), ThreadContext::getVirtProxy(), 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, NumSignalsPerBarrier, HSAPacketProcessor::SignalState::pendingReads, PKT_TYPE, regdQList, HSAPacketProcessor::SignalState::resetSigVals(), HSADevice::submitDispatchPkt(), HSADevice::submitVendorPkt(), PioDevice::sys, and HSAPacketProcessor::SignalState::values.
Referenced by HSAPacketProcessor::QueueProcessEvent::process().
Definition at line 141 of file hsa_packet_processor.cc.
References Packet::makeAtomicResponse(), pioDelay, and Packet::setBadAddress().
void HSAPacketProcessor::schedAQLProcessing | ( | uint32_t | rl_idx | ) |
Definition at line 280 of file hsa_packet_processor.cc.
References HSAPacketProcessor::RQLEntry::aqlProcessEvent, curTick(), DPRINTF, pktProcessDelay, Event::queue, regdQList, EventManager::schedule(), and Event::scheduled().
Referenced by HSAPacketProcessor::QueueProcessEvent::process(), HSAPacketProcessor::CmdQueueCmdDmaEvent::process(), and HWScheduler::scheduleAndWakeupMappedQ().
void HSAPacketProcessor::setDevice | ( | HSADevice * | dev | ) |
Definition at line 600 of file hsa_packet_processor.cc.
Referenced by HSADevice::HSADevice().
void HSAPacketProcessor::setDeviceQueueDesc | ( | uint64_t | hostReadIndexPointer, |
uint64_t | basePointer, | ||
uint64_t | queue_id, | ||
uint32_t | size | ||
) |
Definition at line 94 of file hsa_packet_processor.cc.
References DPRINTF, hwSchdlr, and HWScheduler::registerNewQueue().
Definition at line 149 of file hsa_packet_processor.cc.
References fatal, ThreadContext::getProcessPtr(), System::getThreadContext(), and PioDevice::sys.
Referenced by dmaVirt().
void HSAPacketProcessor::unsetDeviceQueueDesc | ( | uint64_t | queue_id | ) |
Definition at line 88 of file hsa_packet_processor.cc.
References hwSchdlr, and HWScheduler::unregisterQueue().
void HSAPacketProcessor::updateReadIndex | ( | int | pid, |
uint32_t | rl_idx | ||
) |
Definition at line 212 of file hsa_packet_processor.cc.
References HSAPacketProcessor::CmdQueueCmdDmaEvent::CmdQueueCmdDmaEvent(), dmaWriteVirt(), DPRINTF, getCommandsFromHost(), HSAQueueDescriptor::hostReadIndexPtr, HSAQueueDescriptor::isEmpty(), HSAQueueDescriptor::numElts, AQLRingBuffer::rdIdx(), AQLRingBuffer::rdIdxPtr(), HSAQueueDescriptor::readIndex, regdQList, HSAQueueDescriptor::spaceUsed(), HSAPacketProcessor::UpdateReadDispIdDmaEvent::UpdateReadDispIdDmaEvent(), AQLRingBuffer::wrIdx(), and HSAQueueDescriptor::writeIndex.
Definition at line 119 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 180 of file hsa_packet_processor.hh.
|
protected |
Definition at line 183 of file hsa_packet_processor.hh.
Referenced by processPkt().
|
protected |
Definition at line 184 of file hsa_packet_processor.hh.
Referenced by setDeviceQueueDesc(), unsetDeviceQueueDesc(), and write().
int HSAPacketProcessor::numHWQueues |
Definition at line 264 of file hsa_packet_processor.hh.
Referenced by HWScheduler::findEmptyHWQ(), HWScheduler::findNextIdleRLQ(), and HWScheduler::updateRRVars().
Addr HSAPacketProcessor::pioAddr |
Definition at line 265 of file hsa_packet_processor.hh.
Referenced by getAddrRanges(), HSADriver::mmap(), and write().
Tick HSAPacketProcessor::pioDelay |
Definition at line 267 of file hsa_packet_processor.hh.
Addr HSAPacketProcessor::pioSize |
Definition at line 266 of file hsa_packet_processor.hh.
Referenced by getAddrRanges(), and write().
const Tick HSAPacketProcessor::pktProcessDelay |
Definition at line 268 of file hsa_packet_processor.hh.
Referenced by schedAQLProcessing().
|
protected |
Definition at line 238 of file hsa_packet_processor.hh.
Referenced by displayQueueDescriptor(), getCommandsFromHost(), HSAPacketProcessor::QueueProcessEvent::process(), HSAPacketProcessor::CmdQueueCmdDmaEvent::process(), processPkt(), schedAQLProcessing(), HWScheduler::scheduleAndWakeupMappedQ(), updateReadIndex(), and ~HSAPacketProcessor().