MLIR-AIE
|
Public Member Functions | |
bool | isSharedMemory (TileOp a, TileOp b, int *share_direction) |
Function that returns true if two tiles in the AIE array share a memory module. | |
bool | requiresDMAs (ObjectFifoCreateOp createOp, int &share_direction) |
void | checkAndApplyViaSharedMemAttribute (ObjectFifoCreateOp createOp, int &share_direction) |
std::optional< ObjectFifoLinkOp > | getOptionalLinkOp (ObjectFifoCreateOp op) |
Function to retrieve ObjectFifoLinkOp of ObjectFifoCreateOp, if it belongs to one. | |
ObjectFifoCreateOp | createObjectFifo (OpBuilder &builder, AIEObjectFifoType datatype, std::string name, Value prodTile, Value consTile, Attribute depth, BDDimLayoutArrayAttr dimensionsToStream, BDDimLayoutArrayArrayAttr dimensionsFromStreamPerConsumer) |
std::vector< LockOp > | createObjectFifoLocks (OpBuilder &builder, LockAnalysis &lockAnalysis, ObjectFifoCreateOp op, int numElem, int joinDistribFactor, TileOp creation_tile, int repeatCount) |
Function used to create objectFifo locks based on target architecture. | |
void | createObjectFifoElements (OpBuilder &builder, LockAnalysis &lockAnalysis, ObjectFifoCreateOp op, int share_direction) |
Function used to create objectFifo elements and their locks. | |
Block * | findEndOpBlock (Region &r) |
Function that returns a pointer to the block of a Region that contains the AIEEndOp. | |
template<typename MyOp > | |
void | createBd (OpBuilder &builder, LockOp acqLock, int acqMode, LockAction acqLockAction, LockOp relLock, int relMode, MyOp buff, int offset, int len, Block *succ, BDDimLayoutArrayAttr dims, BDPadLayoutArrayAttr padDimensions) |
Function used to create a Bd block. | |
template<typename MyOp > | |
void | createBdBlock (OpBuilder &builder, ObjectFifoCreateOp op, int lockMode, int acqNum, int relNum, MyOp buff, int offset, int len, DMAChannelDir channelDir, size_t lockIndex, Block *succ, BDDimLayoutArrayAttr dims, BDPadLayoutArrayAttr padDimensions, bool distribOrJoin=false) |
Function used to create a Bd block. | |
void | createDMA (DeviceOp &device, OpBuilder &builder, ObjectFifoCreateOp op, DMAChannelDir channelDir, int channelIndex, int lockMode, BDDimLayoutArrayAttr dims, BDPadLayoutArrayAttr pad_dims) |
Function that either calls createAIETileDMA(), createShimDMA() or createMemTileDMA() based on op tile row value. | |
void | createAIETileDMA (DeviceOp &device, OpBuilder &builder, ObjectFifoCreateOp op, DMAChannelDir channelDir, int channelIndex, int lockMode, BDDimLayoutArrayAttr dims) |
Function used to create a MemOp region with a DMA channel. | |
void | createShimDMA (DeviceOp &device, OpBuilder &builder, ObjectFifoCreateOp op, DMAChannelDir channelDir, int channelIndex, int lockMode, BDDimLayoutArrayAttr dims) |
Function used to create a ShimDMAOp region with a DMA channel. | |
void | createMemTileDMA (DeviceOp &device, OpBuilder &builder, ObjectFifoCreateOp op, DMAChannelDir channelDir, int channelIndex, int lockMode, BDDimLayoutArrayAttr dims, BDPadLayoutArrayAttr padDimensions) |
Function used to create a MemTileDMAOp region with a DMA channel. | |
int | computeLCM (std::set< int > values) |
LogicalResult | unrollForLoops (DeviceOp &device, OpBuilder &builder, std::set< TileOp > objectFifoTiles) |
void | updateGlobalNextIndex (OpBuilder &builder, ObjectFifoReleaseOp relOp, BufferOp globalNextIndex, arith::ConstantOp index, arith::ConstantOp size) |
LogicalResult | dynamicGlobalObjectFifos (DeviceOp &device, OpBuilder &builder, std::set< TileOp > objectFifoTiles) |
void | createUseLocks (OpBuilder &builder, ObjectFifoCreateOp op, ObjectFifoPort port, DenseMap< std::pair< ObjectFifoCreateOp, int >, int > &acc, int numLocks, LockAction lockAction) |
Function used to create a UseLockOp based on input parameters. | |
int | updateAndReturnIndex (DenseMap< std::pair< ObjectFifoCreateOp, int >, int > &map, std::pair< ObjectFifoCreateOp, int > pair) |
Function used to check whether op is already contained in map. | |
void | addExternalBuffer (ObjectFifoCreateOp fifo, ExternalBufferOp buff) |
Function used to add an external buffer to the externalBuffersPerFifo map. | |
void | detectExternalBuffers (DeviceOp &device, ObjectFifoCreateOp parent, ObjectFifoCreateOp child, Value tile) |
Function used to detect all external buffers associated with parent objectFifo and tile then map them to child objectFifo. | |
void | replaceSplitFifo (ObjectFifoCreateOp originalOp, ObjectFifoCreateOp newOp, TileOp tile) |
Function used to replace uses of split objectFifos. | |
int | findObjectFifoSize (DeviceOp &device, Value tile, ObjectFifoCreateOp objFifo) |
Function used to find the size of an objectFifo after split based on the maximum number of elements (of the original objectFifo) acquired by a process running on given tile. | |
void | createObjectFifoAllocationInfo (OpBuilder &builder, MLIRContext *ctx, FlatSymbolRefAttr obj_fifo, int colIndex, DMAChannelDir channelDir, int channelIndex, bool plio) |
Function used to generate, from an objectFifo with a shimTile endpoint, a shimDMAAllocationOp containing the channelDir, channelIndex and shimTile col assigned by the objectFifo lowering. | |
void | verifyObjectFifoLinks (DeviceOp &device) |
Function used to verify that an objectfifo is present in at most one ObjectFifoLinkOp. | |
void | runOnOperation () override |
Public Attributes | |
DenseMap< ObjectFifoCreateOp, std::vector< BufferOp > > | buffersPerFifo |
DenseMap< ObjectFifoCreateOp, std::vector< ExternalBufferOp > > | externalBuffersPerFifo |
DenseMap< ObjectFifoCreateOp, std::vector< LockOp > > | locksPerFifo |
std::vector< std::pair< ObjectFifoCreateOp, std::vector< ObjectFifoCreateOp > > > | splitFifos |
DenseMap< ObjectFifoLinkOp, ObjectFifoCreateOp > | objFifoLinks |
std::vector< ObjectFifoCreateOp > | splitBecauseLink |
Definition at line 132 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to add an external buffer to the externalBuffersPerFifo map.
Definition at line 1336 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 281 of file AIEObjectFifoStatefulTransform.cpp.
References isSharedMemory().
Referenced by requiresDMAs().
|
inline |
Definition at line 969 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by unrollForLoops().
|
inline |
Function used to create a MemOp region with a DMA channel.
It uses creatBdBlock(), see there for lockMode input.
Definition at line 621 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and objFifoLinks.
Referenced by createDMA().
|
inline |
Function used to create a Bd block.
Definition at line 532 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createBdBlock().
|
inline |
Function used to create a Bd block.
If lockMode is 0 we create a consumerDMA (i.e. on producer tile) else a producerDMA (i.e. on consumer tile).
Definition at line 558 of file AIEObjectFifoStatefulTransform.cpp.
References createBd(), and locksPerFifo.
|
inline |
Function that either calls createAIETileDMA(), createShimDMA() or createMemTileDMA() based on op tile row value.
Definition at line 601 of file AIEObjectFifoStatefulTransform.cpp.
References createAIETileDMA(), createMemTileDMA(), and createShimDMA().
|
inline |
Function used to create a MemTileDMAOp region with a DMA channel.
It uses creatBdBlock(), see there for lockMode input.
Definition at line 794 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and objFifoLinks.
Referenced by createDMA().
|
inline |
Definition at line 330 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to generate, from an objectFifo with a shimTile endpoint, a shimDMAAllocationOp containing the channelDir, channelIndex and shimTile col assigned by the objectFifo lowering.
Definition at line 1413 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to create objectFifo elements and their locks.
It maps the input objectFifo to associated buffers and locks.
Definition at line 409 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, createObjectFifoLocks(), getOptionalLinkOp(), locksPerFifo, and objFifoLinks.
|
inline |
Function used to create objectFifo locks based on target architecture.
Called by createObjectFifoElements().
Definition at line 343 of file AIEObjectFifoStatefulTransform.cpp.
References externalBuffersPerFifo, and LockAnalysis::getLockID().
Referenced by createObjectFifoElements().
|
inline |
Function used to create a ShimDMAOp region with a DMA channel.
It uses creatBdBlock(), see there for lockMode input.
Definition at line 720 of file AIEObjectFifoStatefulTransform.cpp.
References externalBuffersPerFifo, and findEndOpBlock().
Referenced by createDMA().
|
inline |
Function used to create a UseLockOp based on input parameters.
acc is an accumulator map that tracks the indices of the next locks to acquire (or release). Uses op to find index of acc for next lockID. Updates acc.
Definition at line 1255 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::port, and xilinx::AIE::AIETargetModel::UsesSemaphoreLocks.
|
inline |
Function used to detect all external buffers associated with parent objectFifo and tile then map them to child objectFifo.
Definition at line 1346 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1114 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::port.
|
inline |
Function that returns a pointer to the block of a Region that contains the AIEEndOp.
Definition at line 522 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createAIETileDMA(), createMemTileDMA(), and createShimDMA().
|
inline |
Function used to find the size of an objectFifo after split based on the maximum number of elements (of the original objectFifo) acquired by a process running on given tile.
If no CoreOp exists for this tile return 0.
Definition at line 1374 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function to retrieve ObjectFifoLinkOp of ObjectFifoCreateOp, if it belongs to one.
Definition at line 316 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createAIETileDMA(), createMemTileDMA(), createObjectFifoElements(), and requiresDMAs().
|
inline |
Function that returns true if two tiles in the AIE array share a memory module.
share_direction is equal to:
Definition at line 156 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::getTargetModel().
Referenced by checkAndApplyViaSharedMemAttribute(), and requiresDMAs().
|
inline |
Function used to replace uses of split objectFifos.
Definition at line 1356 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 193 of file AIEObjectFifoStatefulTransform.cpp.
References checkAndApplyViaSharedMemAttribute(), getOptionalLinkOp(), isSharedMemory(), and splitBecauseLink.
|
inlineoverride |
Definition at line 1444 of file AIEObjectFifoStatefulTransform.cpp.
References DMAChannelAnalysis::getDMAChannelIndex(), and xilinx::AIE::port.
|
inline |
Definition at line 977 of file AIEObjectFifoStatefulTransform.cpp.
References computeLCM().
|
inline |
Function used to check whether op is already contained in map.
If it is then return the associated int, if not create new entry and return 0.
Definition at line 1325 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1093 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to verify that an objectfifo is present in at most one ObjectFifoLinkOp.
Definition at line 1426 of file AIEObjectFifoStatefulTransform.cpp.
DenseMap<ObjectFifoCreateOp, std::vector<BufferOp> > AIEObjectFifoStatefulTransformPass::buffersPerFifo |
Definition at line 135 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createAIETileDMA(), createMemTileDMA(), and createObjectFifoElements().
DenseMap<ObjectFifoCreateOp, std::vector<ExternalBufferOp> > AIEObjectFifoStatefulTransformPass::externalBuffersPerFifo |
Definition at line 137 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createObjectFifoLocks(), and createShimDMA().
DenseMap<ObjectFifoCreateOp, std::vector<LockOp> > AIEObjectFifoStatefulTransformPass::locksPerFifo |
Definition at line 140 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createBdBlock(), and createObjectFifoElements().
DenseMap<ObjectFifoLinkOp, ObjectFifoCreateOp> AIEObjectFifoStatefulTransformPass::objFifoLinks |
Definition at line 145 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createAIETileDMA(), createMemTileDMA(), and createObjectFifoElements().
std::vector<ObjectFifoCreateOp> AIEObjectFifoStatefulTransformPass::splitBecauseLink |
Definition at line 148 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by requiresDMAs().
std::vector<std::pair<ObjectFifoCreateOp, std::vector<ObjectFifoCreateOp> > > AIEObjectFifoStatefulTransformPass::splitFifos |
Definition at line 142 of file AIEObjectFifoStatefulTransform.cpp.