8#ifndef AIE_ASSIGN_BUFFER_DESCRIPTOR_IDS_H
9#define AIE_ASSIGN_BUFFER_DESCRIPTOR_IDS_H
14#include "llvm/ADT/ArrayRef.h"
15#include "llvm/ADT/SmallVector.h"
32 std::set<std::pair<uint32_t, uint32_t>>
reserved;
38 std::optional<uint32_t>
nextBdId(
int channelIndex, DMAChannelDir dir,
39 uint32_t alignment = 1);
42 void assignBdId(
int channelIndex, DMAChannelDir dir, uint32_t bdId);
44 void freeBdId(
int channelIndex, DMAChannelDir dir, uint32_t bdId);
54 void reserveBdId(
int channelIndex, DMAChannelDir dir, uint32_t bdId);
56 bool isReserved(
int channelIndex, DMAChannelDir dir, uint32_t bdId)
const;
60 bool holdsTileWide(
int channelIndex, DMAChannelDir dir, uint32_t bdId)
const;
64 llvm::SmallVector<uint32_t, 2> poolsHolding(uint32_t bdId)
const;
65 std::optional<uint32_t> poolOf(
int channelIndex, DMAChannelDir dir,
76 std::optional<std::pair<int, DMAChannelDir>>
channel;
void setReservedBdIds(TileOp tile, llvm::ArrayRef< ReservedBdId > ids)
bool isReservedBdIdsAttr(llvm::StringRef name)
llvm::SmallVector< ReservedBdId > getReservedBdIds(TileOp tile)
bool isReserved(int channelIndex, DMAChannelDir dir, uint32_t bdId) const
bool holdsTileWide(int channelIndex, DMAChannelDir dir, uint32_t bdId) const
const AIETargetModel & targetModel
std::set< std::pair< uint32_t, uint32_t > > alreadyAssigned
std::set< std::pair< uint32_t, uint32_t > > reserved
void reserveBdId(int channelIndex, DMAChannelDir dir, uint32_t bdId)
std::optional< uint32_t > nextBdId(int channelIndex, DMAChannelDir dir, uint32_t alignment=1)
void freeBdId(int channelIndex, DMAChannelDir dir, uint32_t bdId)
BdIdGenerator(int col, int row, const AIETargetModel &targetModel)
void assignBdId(int channelIndex, DMAChannelDir dir, uint32_t bdId)
bool bdIdAlreadyAssigned(int channelIndex, DMAChannelDir dir, uint32_t bdId)
std::optional< std::pair< int, DMAChannelDir > > channel