|
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. | |
| std::optional< ObjectFifoAllocateOp > | getOptionalAllocateOp (ObjectFifoCreateOp op) |
| Function to retrieve ObjectFifoAllocateOp of ObjectFifoCreateOp, if it exists. | |
| bool | requiresDMAs (ObjectFifoCreateOp createOp, int &share_direction, ObjectFifoState &state) |
| 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, ObjectFifoState &state) |
| 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 (ObjectFifoState &state) |
| 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, ObjectFifoState &state) |
| 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, std::optional< PacketInfoAttr > bdPacket) |
| 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, std::optional< PacketInfoAttr > bdPacket, ObjectFifoState &state, 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, std::optional< PacketInfoAttr > bdPacket, ObjectFifoState &state) |
| 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, std::optional< PacketInfoAttr > bdPacket, ObjectFifoState &state) |
| 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, std::optional< PacketInfoAttr > bdPacket, ObjectFifoState &state) |
| 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, std::optional< PacketInfoAttr > bdPacket, ObjectFifoState &state) |
| 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, ObjectFifoState &state) |
| void | createUseLocks (OpBuilder &builder, ObjectFifoCreateOp op, ObjectFifoPort port, DenseMap< std::pair< ObjectFifoCreateOp, int >, int > &acc, int numLocks, LockAction lockAction, ObjectFifoState &state) |
| 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, ObjectFifoState &state) |
| Function used to add an external buffer to the externalBuffersPerFifo map. | |
| void | detectExternalBuffers (DeviceOp &device, ObjectFifoCreateOp parent, ObjectFifoCreateOp child, Value tile, ObjectFifoState &state) |
| 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, ObjectFifoCreateOp &objFifoOp, TileOp shimTile, DMAChannelDir channelDir, int channelIndex, bool plio, std::optional< PacketInfoAttr > packet) |
| Function used to generate, from an objectFifo with a shimTile endpoint, a shimDMAAllocationOp containing the channelDir, channelIndex and shimTile reference assigned by the objectFifo lowering. | |
| LogicalResult | verifyObjectFifoLinks (DeviceOp &device) |
| Function used to verify that an objectfifo is present in at most one ObjectFifoLinkOp. | |
| int | getStartPacketID (DeviceOp &device) |
| Account for already used packet IDs and return next available ID. | |
| void | assignDMAChannelIndices (DMAChannelAnalysis &dmaAnalysis, const std::map< ObjectFifoCreateOp, bool > &crossTileInfos, std::map< ObjectFifoCreateOp, int > &fifo_dma_channel_index, bool assignCrossTileOnly, ObjectFifoState &state) |
| Helper function to assign DMA channel indices for FIFOs based on cross-tile conditions. | |
| void | runOnOperation () override |
Static Public Member Functions | |
| static std::string | getShimAllocationName (llvm::StringRef objFifoName) |
Definition at line 196 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to add an external buffer to the externalBuffersPerFifo map.
Definition at line 1661 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::externalBuffersPerFifo.
|
inline |
Function to analyze cross-tile buffer allocations in splitFifos Returns a simple map of (ObjectFifoCreateOp, bool) indicating cross-tile issues.
Definition at line 491 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, getOptionalLinkOp(), ObjectFifoState::objFifoLinks, and ObjectFifoState::splitFifos.
|
inline |
Helper function to assign DMA channel indices for FIFOs based on cross-tile conditions.
Definition at line 1803 of file AIEObjectFifoStatefulTransform.cpp.
References DMAChannelAnalysis::getDMAChannelIndex(), and ObjectFifoState::splitFifos.
|
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 458 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createObjectFifoElements().
|
inline |
Definition at line 1292 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 911 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and ObjectFifoState::objFifoLinks.
Referenced by createDMA().
|
inline |
Function used to create a Bd block.
Definition at line 814 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 845 of file AIEObjectFifoStatefulTransform.cpp.
References createBd(), and ObjectFifoState::locksPerFifo.
|
inline |
Function that either calls createAIETileDMA(), createShimDMA() or createMemTileDMA() based on op tile row value.
Definition at line 889 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 1086 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, findEndOpBlock(), getOptionalLinkOp(), and ObjectFifoState::objFifoLinks.
Referenced by createDMA().
|
inline |
Definition at line 378 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to generate, from an objectFifo with a shimTile endpoint, a shimDMAAllocationOp containing the channelDir, channelIndex and shimTile reference assigned by the objectFifo lowering.
Definition at line 1742 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 586 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, calculateCurrentUsedMemory(), createObjectFifoLocks(), findOrCreateTile(), getOptionalAllocateOp(), getOptionalLinkOp(), isSharedMemory(), ObjectFifoState::locksPerFifo, and ObjectFifoState::objFifoLinks.
|
inline |
Function used to create objectFifo locks based on target architecture.
Called by createObjectFifoElements().
Definition at line 392 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::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 1011 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::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 1579 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::locksPerFifo, ObjectFifoState::objFifoLinks, 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 1673 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1435 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, and xilinx::AIE::port.
|
inline |
Function that returns a pointer to the block of a Region that contains the AIEEndOp.
Definition at line 804 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 1703 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 554 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::col, and xilinx::AIE::row.
Referenced by createObjectFifoElements().
|
inline |
Function to retrieve ObjectFifoAllocateOp of ObjectFifoCreateOp, if it exists.
Definition at line 242 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by createObjectFifoElements(), and requiresDMAs().
|
inline |
Function to retrieve ObjectFifoLinkOp of ObjectFifoCreateOp, if it belongs to one.
Definition at line 364 of file AIEObjectFifoStatefulTransform.cpp.
Referenced by analyzeCrossTileFIFOBuffers(), createAIETileDMA(), createMemTileDMA(), createObjectFifoElements(), and requiresDMAs().
|
inlinestatic |
Definition at line 1759 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Account for already used packet IDs and return next available ID.
Definition at line 1790 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function that returns true if two tiles in the AIE array share a memory module.
share_direction is equal to:
Definition at line 206 of file AIEObjectFifoStatefulTransform.cpp.
References xilinx::AIE::getTargetModel().
Referenced by createObjectFifoElements(), and requiresDMAs().
|
inline |
Function used to replace uses of split objectFifos.
Definition at line 1685 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 265 of file AIEObjectFifoStatefulTransform.cpp.
References getOptionalAllocateOp(), getOptionalLinkOp(), isSharedMemory(), and ObjectFifoState::splitBecauseLink.
|
inlineoverride |
Definition at line 1840 of file AIEObjectFifoStatefulTransform.cpp.
References ObjectFifoState::buffersPerFifo, DMAChannelAnalysis::checkAIEStreamIndex(), ObjectFifoState::objFifoLinks, xilinx::AIE::port, and ObjectFifoState::splitFifos.
|
inline |
Definition at line 1300 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 1650 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Definition at line 1413 of file AIEObjectFifoStatefulTransform.cpp.
|
inline |
Function used to verify that an objectfifo is present in at most one ObjectFifoLinkOp.
Definition at line 1765 of file AIEObjectFifoStatefulTransform.cpp.