|
MLIR-AIE 1.4.5.dev
|
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. | |
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.
| 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.
| using xilinx::AIEX::DmaQueueModel::State = std::map<ChannelKey, ChannelState> |
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.
|
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().
|
inline |
Definition at line 111 of file DmaQueueModel.h.
References awaitToken().
|
inlinestatic |
Definition at line 46 of file DmaQueueModel.h.
|
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().
|
inline |
Definition at line 116 of file DmaQueueModel.h.
References noteSpaceGuaranteed().
|
inline |
Outstanding pushes on key, for diagnostics.
Definition at line 128 of file DmaQueueModel.h.
Referenced by xilinx::AIEX::guardQueueOverflow().
|
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().
|
inline |
Definition at line 107 of file DmaQueueModel.h.
References push().
|
inline |
Definition at line 138 of file DmaQueueModel.h.
Referenced by xilinx::AIEX::guardSequenceQueueDepth().
|
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().
|
inline |
Definition at line 137 of file DmaQueueModel.h.
Referenced by xilinx::AIEX::guardSequenceQueueDepth().
|
inline |
Definition at line 102 of file DmaQueueModel.h.
References wouldOverflow().
|
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().