MLIR-AIE 1.4.5.dev
AIEAssignBufferDescriptorIDs.h
Go to the documentation of this file.
1//===- AIEAssignBufferDescriptorIDs.h ---------------------------*- C++ -*-===//
2//
3// Copyright (C) 2024 Advanced Micro Devices, Inc.
4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5//
6//===----------------------------------------------------------------------===//
7
8#ifndef AIE_ASSIGN_BUFFER_DESCRIPTOR_IDS_H
9#define AIE_ASSIGN_BUFFER_DESCRIPTOR_IDS_H
10
12
13#include <optional>
14#include <set>
15
16using namespace xilinx::AIE;
17
19 const int col;
20 const int row;
22 std::set<uint32_t> alreadyAssigned;
23
25
26 // The lowest free id `channelIndex` reaches that is a multiple of
27 // `alignment`.
28 std::optional<uint32_t> nextBdId(int channelIndex, uint32_t alignment = 1);
29
30 void assignBdId(uint32_t bdId);
31
32 bool bdIdAlreadyAssigned(uint32_t bdId);
33
34 void freeBdId(uint32_t bdId);
35};
36
37#endif
bool bdIdAlreadyAssigned(uint32_t bdId)
const AIETargetModel & targetModel
void assignBdId(uint32_t bdId)
void freeBdId(uint32_t bdId)
std::set< uint32_t > alreadyAssigned
BdIdGenerator(int col, int row, const AIETargetModel &targetModel)
std::optional< uint32_t > nextBdId(int channelIndex, uint32_t alignment=1)