|
MLIR-AIE
|
Inheritance diagram for AIEObjectFifoStatefulTransformPass:
Collaboration diagram for AIEObjectFifoStatefulTransformPass: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. | |
| int | calculateCurrentUsedMemory (TileOp targetTile, DenseMap< ObjectFifoCreateOp, std::vector< BufferOp > > &buffersPerFifo, std::vector< BufferOp > &buffers) |
| Function to calculate total memory usage on a specific tile based on all buffers allocated to that tile from buffersPerFifo map. | |
| std::map< ObjectFifoCreateOp, bool > | analyzeCrossTileFIFOBuffers () |
| Function to analyze cross-tile buffer allocations in splitFifos Returns a simple map of (ObjectFifoCreateOp, bool) indicating cross-tile issues. | |
| TileOp | findOrCreateTile (OpBuilder &builder, DeviceOp &dev, TileOp hostTile, int col, int row) |
| Helper function to find a tile at specific coordinates. | |
| 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 | assignDMAChannelIndices (DMAChannelAnalysis &dmaAnalysis, const std::map< ObjectFifoCreateOp, bool > &crossTileInfos, std::map< ObjectFifoCreateOp, int > &fifo_dma_channel_index, bool assignCrossTileOnly) |
| Helper function to assign DMA channel indices for FIFOs based on cross-tile conditions. | |
| 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 144 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to add an external buffer to the externalBuffersPerFifo map.
Definition at line 1550 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function to analyze cross-tile buffer allocations in splitFifos Returns a simple map of (ObjectFifoCreateOp, bool) indicating cross-tile issues.
Definition at line 453 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, getOptionalLinkOp(), objFifoLinks, and splitFifos.
|
inline |
Helper function to assign DMA channel indices for FIFOs based on cross-tile conditions.
Definition at line 1660 of file AIEObjectFifoStatefulTransform.cpp.
References DMAChannelAnalysis::getDMAChannelIndex().
|
inline |
Function to calculate total memory usage on a specific tile based on all buffers allocated to that tile from buffersPerFifo map.
Definition at line 421 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo.
Referenced by createObjectFifoElements().
|
inline |
Definition at line 293 of file AIEObjectFifoStatefulTransform.cpp.
References isSharedMemory().
Referenced by requiresDMAs().
|
inline |
Definition at line 1183 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 832 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and objFifoLinks.
Referenced by createDMA().
|
inline |
Function used to create a Bd block.
Definition at line 743 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 769 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 812 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 1005 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and objFifoLinks.
Referenced by createDMA().
|
inline |
Definition at line 342 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 1627 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 546 of file AIEObjectFifoStatefulTransform.cpp.
References buffersPerFifo, calculateCurrentUsedMemory(), createObjectFifoLocks(), findOrCreateTile(), getOptionalLinkOp(), isSharedMemory(), locksPerFifo, and objFifoLinks.
|
inline |
Function used to create objectFifo locks based on target architecture.
Called by createObjectFifoElements().
Definition at line 355 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 931 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 1469 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 1560 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1328 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 733 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 1588 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Helper function to find a tile at specific coordinates.
If a tile is not found, it creates a new one and returns it. hostTile is the original tile from which we are searching for neighbors. we create the new tile below the hostTile
Definition at line 514 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::col, and xilinx::AIE::row.
Referenced by createObjectFifoElements().
|
inline |
Function to retrieve ObjectFifoLinkOp of ObjectFifoCreateOp, if it belongs to one.
Definition at line 328 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by analyzeCrossTileFIFOBuffers(), 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 168 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::getTargetModel().
Referenced by checkAndApplyViaSharedMemAttribute(), createObjectFifoElements(), and requiresDMAs().
|
inline |
Function used to replace uses of split objectFifos.
Definition at line 1570 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 205 of file AIEObjectFifoStatefulTransform.cpp.
References checkAndApplyViaSharedMemAttribute(), getOptionalLinkOp(), isSharedMemory(), and splitBecauseLink.
|
inlineoverride |
Definition at line 1697 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::port.
|
inline |
Definition at line 1191 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 1539 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1307 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to verify that an objectfifo is present in at most one ObjectFifoLinkOp.
Definition at line 1640 of file AIEObjectFifoStatefulTransform.cpp.
| DenseMap<ObjectFifoCreateOp, std::vector<BufferOp> > AIEObjectFifoStatefulTransformPass::buffersPerFifo |
Definition at line 147 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by analyzeCrossTileFIFOBuffers(), calculateCurrentUsedMemory(), createAIETileDMA(), createMemTileDMA(), and createObjectFifoElements().
| DenseMap<ObjectFifoCreateOp, std::vector<ExternalBufferOp> > AIEObjectFifoStatefulTransformPass::externalBuffersPerFifo |
Definition at line 149 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createObjectFifoLocks(), and createShimDMA().
| DenseMap<ObjectFifoCreateOp, std::vector<LockOp> > AIEObjectFifoStatefulTransformPass::locksPerFifo |
Definition at line 152 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createBdBlock(), and createObjectFifoElements().
| DenseMap<ObjectFifoLinkOp, ObjectFifoCreateOp> AIEObjectFifoStatefulTransformPass::objFifoLinks |
Definition at line 157 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by analyzeCrossTileFIFOBuffers(), createAIETileDMA(), createMemTileDMA(), and createObjectFifoElements().
| std::vector<ObjectFifoCreateOp> AIEObjectFifoStatefulTransformPass::splitBecauseLink |
Definition at line 160 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by requiresDMAs().
| std::vector<std::pair<ObjectFifoCreateOp, std::vector<ObjectFifoCreateOp> > > AIEObjectFifoStatefulTransformPass::splitFifos |
Definition at line 154 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by analyzeCrossTileFIFOBuffers().