MLIR-AIE 1.4.5.dev
AIECoreSymbols.h
Go to the documentation of this file.
1//===- AIECoreSymbols.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// Name that the dialect and the aiecc driver share for a compiled core: the
9// symbol of its outlined body. One definition keeps the two in step.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef AIE_DIALECT_AIE_IR_AIECORESYMBOLS_H
14#define AIE_DIALECT_AIE_IR_AIECORESYMBOLS_H
15
16#include "llvm/Support/raw_ostream.h"
17
18#include <string>
19
20namespace xilinx::AIE {
21
22// Name that AIECoreToStandard gives the function it outlines a CoreOp's body
23// into. Every reader of a compiled core object resolves the body through it.
24inline std::string coreFrameSymbolName(int col, int row) {
25 std::string name;
26 llvm::raw_string_ostream(name) << "core_" << col << "_" << row;
27 return name;
28}
29
30// Section a kernel puts a static in to pin it to a memory bank, and the linker
31// script region that section lands in. A kernel writes the section name and the
32// script emitter writes the region, so both come from here.
33inline std::string bankSectionName(int bank) {
34 return ".aie.bank" + std::to_string(bank);
35}
36
37inline std::string bankRegionName(int bank) {
38 return "bank" + std::to_string(bank);
39}
40
41// The letter chess spells the same bank with, in `chess_storage(DM_bank<L>)`.
42inline char bankLetter(int bank) { return static_cast<char>('A' + bank); }
43
44} // namespace xilinx::AIE
45
46#endif // AIE_DIALECT_AIE_IR_AIECORESYMBOLS_H
char bankLetter(int bank)
std::string coreFrameSymbolName(int col, int row)
std::string bankSectionName(int bank)
std::string bankRegionName(int bank)