MLIR-AIE 1.4.6.dev
AIEPoolLocks.h
Go to the documentation of this file.
1//===- AIEPoolLocks.h -------------------------------------------*- C++ -*-===//
2//
3// Copyright (C) 2026 Advanced Micro Devices, Inc.
4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5//
6//===----------------------------------------------------------------------===//
7
8#ifndef AIE_DIALECT_AIE_TRANSFORMS_AIEPOOLLOCKS_H
9#define AIE_DIALECT_AIE_TRANSFORMS_AIEPOOLLOCKS_H
10
13
14#include "llvm/ADT/DenseSet.h"
15#include "llvm/ADT/SmallVector.h"
16#include "llvm/ADT/StringMap.h"
17
18namespace xilinx::AIE {
19
20/// Which of a device's objectFIFO pools get locks, read once from its
21/// endpoints and its `aiex.dma_channel_reset_for` ops.
22class PoolLocks {
23public:
24 explicit PoolLocks(DeviceOp device);
25
26 /// Whether `pool` gets locks. One with synchronization disabled does not,
27 /// nor one that starts full, is never refilled and is not re-armed each
28 /// launch: it holds constants its readers have nothing to wait for.
29 bool needsLocks(ObjectFifoPoolOp pool) const;
30
31 /// The `aiex.dma_channel_reset_for` ops re-arming each fifo, by fifo name.
32 const llvm::StringMap<llvm::SmallVector<AIEX::DmaChannelResetForOp>> &
33 rearms() const {
34 return rearmsByFifo;
35 }
36
37private:
38 llvm::DenseSet<mlir::Operation *> filled;
39 llvm::StringMap<llvm::SmallVector<AIEX::DmaChannelResetForOp>> rearmsByFifo;
40};
41
42} // namespace xilinx::AIE
43
44#endif // AIE_DIALECT_AIE_TRANSFORMS_AIEPOOLLOCKS_H
bool needsLocks(ObjectFifoPoolOp pool) const
Whether pool gets locks.
PoolLocks(DeviceOp device)
const llvm::StringMap< llvm::SmallVector< AIEX::DmaChannelResetForOp > > & rearms() const
The aiex.dma_channel_reset_for ops re-arming each fifo, by fifo name.