MLIR-AIE 1.4.6.dev
xilinx::AIE::ShimTransferSpans Class Reference

Shim endpoint lifetimes, including calls to self-contained runtime sequences. More...

#include "aie/Dialect/AIE/Transforms/AIEShimSharing.h"

Classes

struct  End
 A shim end a runtime sequence transfers through. More...
struct  Gate
 A shim input gating a receiving end's senders, per its #aie.consumed_by. More...
struct  SharedChannel
 A shim allocation's channel the ends its aie.shareable_with lists may take turns on. More...
struct  Plan
 How one shim tile's unpinned ends in one direction share channels, as objectFIFO allocation shares them. More...

Public Types

using Gates = llvm::DenseMap<mlir::StringAttr, llvm::SmallVector<Gate>>

Public Member Functions

 ShimTransferSpans (DeviceOp device, llvm::function_ref< std::optional< End >(mlir::StringAttr)> endOf, std::optional< Gates > gates=std::nullopt, bool plannedOverlay=false)
 endOf maps a symbol a runtime sequence transfers through to the objectFIFO end it belongs to, or nothing when it belongs to none.
 ShimTransferSpans (mlir::ModuleOp module, llvm::function_ref< std::optional< End >(DeviceOp, mlir::StringAttr)> endOf, std::optional< Gates > gates=std::nullopt)
bool apart (mlir::StringAttr a, mlir::StringAttr b) const
 Whether both ends permit sharing: explicitly, by MM2S lifetime analysis, or, for a receiving end, by its gates.
bool isUsed (mlir::StringAttr end) const
mlir::StringAttr overlayEnd (int column) const
 The planned control overlay channel's end on column column's shim tile.
unsigned sequences () const
 The number of runtime sequences bytes indexes into.
std::optional< int64_t > bytes (unsigned seq, mlir::StringAttr end) const
 The bytes runtime sequence seq moves through end, nullopt when not static or when end is not one of its ends.
bool names (unsigned seq, mlir::StringAttr end) const
 Whether runtime sequence seq transfers through end at all, static or not; bytes alone cannot tell a dynamic end from an absent one.
llvm::SmallVector< llvm::SmallVector< unsigned > > groups (llvm::ArrayRef< mlir::StringAttr > ends) const
 Splits ends into groups whose members are pairwise apart, each group taking one channel: first fit, ordered by the ends' spans in flight.
Plan plan (llvm::ArrayRef< mlir::StringAttr > ends, llvm::ArrayRef< mlir::StringAttr > names, llvm::ArrayRef< SharedChannel > shared) const
 Plans ends (keyed as apart() takes keys); names[i] is how shared's lists name ends[i].

Static Public Member Functions

static mlir::StringAttr keyOf (RouteEndpointOp endpoint)
 How ends and gates name a shim route end: by its objectFIFO, else by its own symbol.
static std::optional< End > endOf (DeviceOp device, mlir::StringAttr symbol)
 The end a runtime sequence of device transfers through when it names symbol: a shim DMA route end, keyed by keyOf, or, before aie-objectfifo-split, an objectFIFO, sending when a shim tile produces it.
static Gates provenGates (DeviceOp device, llvm::function_ref< mlir::StringAttr(RouteEndpointOp)> keyOf)
 Each receiving end's gates, keyed by keyOf: the shim inputs whose consumption its progress proves, from the #aie.consumed_by proofs aie-objectfifo-verify leaves on split route endpoints.

Detailed Description

Shim endpoint lifetimes, including calls to self-contained runtime sequences.

MM2S transfers conservatively remain live until their sequence returns; a callee's return and a dispatch boundary are themselves taken as the end of its sends, by the aiex.run and hardware-context contracts, not by anything this analysis computes. A receiving channel writes whatever arrives into the task it runs, so a receiving end shares only by explicit permission or where the array cannot send its words outside its turn: its senders wait on a gate the host fills only after the end before it is awaited, and each sequence drains all that gate lets them send.

Definition at line 50 of file AIEShimSharing.h.

Member Typedef Documentation

◆ Gates

using xilinx::AIE::ShimTransferSpans::Gates = llvm::DenseMap<mlir::StringAttr, llvm::SmallVector<Gate>>

Definition at line 68 of file AIEShimSharing.h.

Constructor & Destructor Documentation

◆ ShimTransferSpans() [1/2]

xilinx::AIE::ShimTransferSpans::ShimTransferSpans ( DeviceOp device,
llvm::function_ref< std::optional< End >(mlir::StringAttr)> endOf,
std::optional< Gates > gates = std::nullopt,
bool plannedOverlay = false )

endOf maps a symbol a runtime sequence transfers through to the objectFIFO end it belongs to, or nothing when it belongs to none.

gates holds each receiving end's gates, keyed as endOf keys ends; without them, a receiving end shares only by explicit permission, which is all a caller running before the proofs can know. With plannedOverlay, the control overlay's channel on each column's shim tile is an end too, overlayEnd(), before aie-generate-column-control-overlay makes it: it carries the control packets to its column and every configuration load, as the overlay's own channel does once made.

References endOf().

◆ ShimTransferSpans() [2/2]

xilinx::AIE::ShimTransferSpans::ShimTransferSpans ( mlir::ModuleOp module,
llvm::function_ref< std::optional< End >(DeviceOp, mlir::StringAttr)> endOf,
std::optional< Gates > gates = std::nullopt )

References endOf(), and keyOf().

Member Function Documentation

◆ apart()

bool ShimTransferSpans::apart ( mlir::StringAttr a,
mlir::StringAttr b ) const

Whether both ends permit sharing: explicitly, by MM2S lifetime analysis, or, for a receiving end, by its gates.

Definition at line 529 of file AIEShimSharing.cpp.

References isUsed().

Referenced by groups(), and xilinx::AIE::Placer::overlayAt().

◆ bytes()

std::optional< int64_t > xilinx::AIE::ShimTransferSpans::bytes ( unsigned seq,
mlir::StringAttr end ) const
inline

The bytes runtime sequence seq moves through end, nullopt when not static or when end is not one of its ends.

Definition at line 120 of file AIEShimSharing.h.

◆ endOf()

std::optional< ShimTransferSpans::End > ShimTransferSpans::endOf ( DeviceOp device,
mlir::StringAttr symbol )
static

The end a runtime sequence of device transfers through when it names symbol: a shim DMA route end, keyed by keyOf, or, before aie-objectfifo-split, an objectFIFO, sending when a shim tile produces it.

Definition at line 485 of file AIEShimSharing.cpp.

References keyOf().

Referenced by xilinx::AIE::Placer::buildShimModel(), ShimTransferSpans(), and ShimTransferSpans().

◆ groups()

SmallVector< SmallVector< unsigned > > ShimTransferSpans::groups ( llvm::ArrayRef< mlir::StringAttr > ends) const

Splits ends into groups whose members are pairwise apart, each group taking one channel: first fit, ordered by the ends' spans in flight.

Returns indices into ends.

Definition at line 548 of file AIEShimSharing.cpp.

References apart().

Referenced by plan().

◆ isUsed()

bool ShimTransferSpans::isUsed ( mlir::StringAttr end) const

Definition at line 519 of file AIEShimSharing.cpp.

Referenced by apart().

◆ keyOf()

StringAttr ShimTransferSpans::keyOf ( RouteEndpointOp endpoint)
static

How ends and gates name a shim route end: by its objectFIFO, else by its own symbol.

Definition at line 479 of file AIEShimSharing.cpp.

Referenced by endOf(), provenGates(), xilinx::AIE::Placer::provenShimGates(), and ShimTransferSpans().

◆ names()

bool xilinx::AIE::ShimTransferSpans::names ( unsigned seq,
mlir::StringAttr end ) const
inline

Whether runtime sequence seq transfers through end at all, static or not; bytes alone cannot tell a dynamic end from an absent one.

Definition at line 126 of file AIEShimSharing.h.

Referenced by plan().

◆ overlayEnd()

StringAttr ShimTransferSpans::overlayEnd ( int column) const

The planned control overlay channel's end on column column's shim tile.

Definition at line 523 of file AIEShimSharing.cpp.

Referenced by xilinx::AIE::Placer::overlayAt().

◆ plan()

ShimTransferSpans::Plan ShimTransferSpans::plan ( llvm::ArrayRef< mlir::StringAttr > ends,
llvm::ArrayRef< mlir::StringAttr > names,
llvm::ArrayRef< SharedChannel > shared ) const

Plans ends (keyed as apart() takes keys); names[i] is how shared's lists name ends[i].

Each channel in shared, in order, takes the ends its list names that are apart from those it already took; the rest group as groups() groups them. Indices are into ends.

Definition at line 572 of file AIEShimSharing.cpp.

References groups(), xilinx::AIE::ShimTransferSpans::Plan::groups, names(), and xilinx::AIE::ShimTransferSpans::Plan::sharedChannel.

Referenced by xilinx::AIE::Placer::shimChannelsSaved().

◆ provenGates()

ShimTransferSpans::Gates ShimTransferSpans::provenGates ( DeviceOp device,
llvm::function_ref< mlir::StringAttr(RouteEndpointOp)> keyOf )
static

Each receiving end's gates, keyed by keyOf: the shim inputs whose consumption its progress proves, from the #aie.consumed_by proofs aie-objectfifo-verify leaves on split route endpoints.

Endpoints keyOf maps to null are left out.

Definition at line 502 of file AIEShimSharing.cpp.

References keyOf().

Referenced by xilinx::AIE::Placer::provenShimGates().

◆ sequences()

unsigned xilinx::AIE::ShimTransferSpans::sequences ( ) const
inline

The number of runtime sequences bytes indexes into.

Definition at line 117 of file AIEShimSharing.h.


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