MLIR-AIE 1.4.5.dev
xilinx::AIEX::DmaQueueModel Class Reference

Tracks, per DMA channel, the pushes not yet known to have completed along one execution path. More...

#include "aie/Dialect/AIEX/Utils/DmaQueueModel.h"

Classes

struct  ChannelState
 One channel's queue: its pushes not yet known to have completed, oldest first, each true when it issues a completion token. More...

Public Types

using ChannelKey = std::array<int, 4>
 {col, row, direction, channel}.
using State = std::map<ChannelKey, ChannelState>
 Every channel's queue.

Public Member Functions

bool wouldOverflow (const ChannelKey &key, uint32_t depth) const
void push (const ChannelKey &key, bool issuesToken)
void awaitToken (const ChannelKey &key)
void noteSpaceGuaranteed (const ChannelKey &key, uint32_t depth)
bool shouldReport (const ChannelKey &key)
 True the first time a channel is reported.
size_t outstanding (const ChannelKey &key) const
 Outstanding pushes on key, for diagnostics.
const State & state () const
void setState (State s)

Static Public Member Functions

static ChannelKey keyOf (AIE::TileOp tile, AIE::DMAChannelDir direction, int64_t channel)
static bool wouldOverflow (const ChannelState &q, uint32_t depth)
 True when a push would land on a full queue.
static void push (ChannelState &q, bool issuesToken)
 Record a push.
static void awaitToken (ChannelState &q)
 Retire what a task-completion-token await proves has drained.
static void noteSpaceGuaranteed (ChannelState &q, uint32_t depth)
 Record that a queue-space poll has guaranteed room.

Detailed Description

Tracks, per DMA channel, the pushes not yet known to have completed along one execution path.

The sequence analysis below joins control-flow paths.

Definition at line 39 of file DmaQueueModel.h.

Member Typedef Documentation

◆ ChannelKey

using xilinx::AIEX::DmaQueueModel::ChannelKey = std::array<int, 4>

{col, row, direction, channel}.

Queues are per channel and per direction, and shim tiles are one per column, so the same channel number in two columns is two independent queues.

Definition at line 44 of file DmaQueueModel.h.

◆ State

Every channel's queue.

reported is deliberately not part of it: it is diagnostic bookkeeping, not queue state, and folding it in would stop two otherwise identical states from comparing equal.

Definition at line 136 of file DmaQueueModel.h.

Member Function Documentation

◆ awaitToken() [1/2]

void xilinx::AIEX::DmaQueueModel::awaitToken ( ChannelState & q)
inlinestatic

Retire what a task-completion-token await proves has drained.

The sync pops whichever token the channel produces first – the oldest outstanding token-issuing push, not necessarily the task the await names – and in-order execution means everything queued ahead of it has drained too. With no token-issuing push queued, nothing can be retired.

Definition at line 79 of file DmaQueueModel.h.

References xilinx::AIEX::DmaQueueModel::ChannelState::pushes, and xilinx::AIEX::DmaQueueModel::ChannelState::unknownTokens.

Referenced by xilinx::AIEX::awaitSync(), awaitToken(), and xilinx::AIEX::guardSequenceQueueDepth().

◆ awaitToken() [2/2]

void xilinx::AIEX::DmaQueueModel::awaitToken ( const ChannelKey & key)
inline

Definition at line 111 of file DmaQueueModel.h.

References awaitToken().

◆ keyOf()

ChannelKey xilinx::AIEX::DmaQueueModel::keyOf ( AIE::TileOp tile,
AIE::DMAChannelDir direction,
int64_t channel )
inlinestatic

Definition at line 46 of file DmaQueueModel.h.

◆ noteSpaceGuaranteed() [1/2]

void xilinx::AIEX::DmaQueueModel::noteSpaceGuaranteed ( ChannelState & q,
uint32_t depth )
inlinestatic

Record that a queue-space poll has guaranteed room.

Keeps the newest depth-1 entries rather than clearing. Polling does not consume completion tokens: if it drops a token-bearing entry, later syncs cannot safely be credited to newer pushes.

Definition at line 91 of file DmaQueueModel.h.

References xilinx::AIEX::DmaQueueModel::ChannelState::pushes, and xilinx::AIEX::DmaQueueModel::ChannelState::unknownTokens.

Referenced by xilinx::AIEX::guardQueueOverflow(), xilinx::AIEX::guardSequenceQueueDepth(), and noteSpaceGuaranteed().

◆ noteSpaceGuaranteed() [2/2]

void xilinx::AIEX::DmaQueueModel::noteSpaceGuaranteed ( const ChannelKey & key,
uint32_t depth )
inline

Definition at line 116 of file DmaQueueModel.h.

References noteSpaceGuaranteed().

◆ outstanding()

size_t xilinx::AIEX::DmaQueueModel::outstanding ( const ChannelKey & key) const
inline

Outstanding pushes on key, for diagnostics.

Definition at line 128 of file DmaQueueModel.h.

Referenced by xilinx::AIEX::guardQueueOverflow().

◆ push() [1/2]

void xilinx::AIEX::DmaQueueModel::push ( ChannelState & q,
bool issuesToken )
inlinestatic

Record a push.

Every push occupies a slot, not just issue_token ones, and one push occupies exactly one whatever its repeat_count.

Definition at line 70 of file DmaQueueModel.h.

References xilinx::AIEX::DmaQueueModel::ChannelState::pushes, and xilinx::AIEX::DmaQueueModel::ChannelState::unknownTokens.

Referenced by xilinx::AIEX::guardSequenceQueueDepth(), and push().

◆ push() [2/2]

void xilinx::AIEX::DmaQueueModel::push ( const ChannelKey & key,
bool issuesToken )
inline

Definition at line 107 of file DmaQueueModel.h.

References push().

◆ setState()

void xilinx::AIEX::DmaQueueModel::setState ( State s)
inline

Definition at line 138 of file DmaQueueModel.h.

Referenced by xilinx::AIEX::guardSequenceQueueDepth().

◆ shouldReport()

bool xilinx::AIEX::DmaQueueModel::shouldReport ( const ChannelKey & key)
inline

True the first time a channel is reported.

An over-subscribed channel usually stays that way for every later push, and repeating the same diagnostic per push buries it.

Definition at line 123 of file DmaQueueModel.h.

Referenced by xilinx::AIEX::guardQueueOverflow().

◆ state()

const State & xilinx::AIEX::DmaQueueModel::state ( ) const
inline

Definition at line 137 of file DmaQueueModel.h.

Referenced by xilinx::AIEX::guardSequenceQueueDepth().

◆ wouldOverflow() [1/2]

bool xilinx::AIEX::DmaQueueModel::wouldOverflow ( const ChannelKey & key,
uint32_t depth ) const
inline

Definition at line 102 of file DmaQueueModel.h.

References wouldOverflow().

◆ wouldOverflow() [2/2]

bool xilinx::AIEX::DmaQueueModel::wouldOverflow ( const ChannelState & q,
uint32_t depth )
inlinestatic

True when a push would land on a full queue.

depth of 0 means the target has no queued-task model and nothing can overflow.

Definition at line 64 of file DmaQueueModel.h.

References xilinx::AIEX::DmaQueueModel::ChannelState::pushes.

Referenced by xilinx::AIEX::guardSequenceQueueDepth(), and wouldOverflow().


The documentation for this class was generated from the following file: