MLIR-AIE
AIETargets.h
Go to the documentation of this file.
1//===- AIETargets.h ---------------------------------------------*- C++ -*-===//
2//
3// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef AIE_TARGETS_AIETARGETS_H
10#define AIE_TARGETS_AIETARGETS_H
11
12#include "mlir/IR/BuiltinOps.h"
13#include "mlir/IR/MLIRContext.h"
14#include "mlir/Support/LogicalResult.h"
15
16#include "llvm/Support/raw_ostream.h"
17
18#include <vector>
19
20namespace xilinx {
21namespace AIE {
22
23mlir::LogicalResult AIETranslateToXAIEV2(mlir::ModuleOp module,
24 llvm::raw_ostream &output);
25mlir::LogicalResult AIETranslateToHSA(mlir::ModuleOp module,
26 llvm::raw_ostream &output);
27mlir::LogicalResult AIEFlowsToJSON(mlir::ModuleOp module,
28 llvm::raw_ostream &output);
29mlir::LogicalResult ADFGenerateCPPGraph(mlir::ModuleOp module,
30 llvm::raw_ostream &output);
31mlir::LogicalResult AIETranslateSCSimConfig(mlir::ModuleOp module,
32 llvm::raw_ostream &output);
33mlir::LogicalResult AIETranslateShimSolution(mlir::ModuleOp module,
34 llvm::raw_ostream &);
35mlir::LogicalResult AIETranslateGraphXPE(mlir::ModuleOp module,
36 llvm::raw_ostream &);
37mlir::LogicalResult AIETranslateNpuToBinary(mlir::ModuleOp,
38 std::vector<uint32_t> &,
39 llvm::StringRef sequenceName = "");
40mlir::LogicalResult
41AIETranslateControlPacketsToUI32Vec(mlir::ModuleOp, std::vector<uint32_t> &,
42 llvm::StringRef sequenceName = "");
43mlir::LogicalResult AIETranslateToLdScript(mlir::ModuleOp module,
44 llvm::raw_ostream &output,
45 int tileCol, int tileRow);
46mlir::LogicalResult AIETranslateToBCF(mlir::ModuleOp module,
47 llvm::raw_ostream &output, int tileCol,
48 int tileRow);
49mlir::LogicalResult
50AIELLVMLink(llvm::raw_ostream &output, std::vector<std::string> Files,
51 bool DisableDITypeMap = false, bool NoVerify = false,
52 bool Internalize = false, bool OnlyNeeded = false,
53 bool PreserveAssemblyUseListOrder = false, bool Verbose = false);
54
55mlir::LogicalResult
56AIETranslateToCDODirect(mlir::ModuleOp m, llvm::StringRef workDirPath,
57 bool bigEndian = false, bool emitUnified = false,
58 bool cdoDebug = false, bool aieSim = false,
59 bool xaieDebug = false, bool enableCores = true);
60
61#ifdef AIE_ENABLE_AIRBIN
62mlir::LogicalResult AIETranslateToAirbin(mlir::ModuleOp module,
63 const std::string &outputFilename,
64 const std::string &coreFilesDir,
65 bool testAirBin = false);
66#endif
67
68mlir::LogicalResult AIETranslateToTargetArch(mlir::ModuleOp module,
69 llvm::raw_ostream &output);
70
71} // namespace AIE
72
73namespace aievec {
74
75/// Translates the AIE vector dialect MLIR to C++ code.
76mlir::LogicalResult translateAIEVecToCpp(mlir::Operation *op, bool aie2,
77 mlir::raw_ostream &os);
78
79} // namespace aievec
80} // namespace xilinx
81
82#endif
mlir::LogicalResult AIETranslateToXAIEV2(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateToCDODirect(mlir::ModuleOp m, llvm::StringRef workDirPath, bool bigEndian=false, bool emitUnified=false, bool cdoDebug=false, bool aieSim=false, bool xaieDebug=false, bool enableCores=true)
mlir::LogicalResult AIELLVMLink(llvm::raw_ostream &output, std::vector< std::string > Files, bool DisableDITypeMap=false, bool NoVerify=false, bool Internalize=false, bool OnlyNeeded=false, bool PreserveAssemblyUseListOrder=false, bool Verbose=false)
mlir::LogicalResult ADFGenerateCPPGraph(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateToHSA(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateToBCF(mlir::ModuleOp module, llvm::raw_ostream &output, int tileCol, int tileRow)
mlir::LogicalResult AIETranslateToTargetArch(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateToLdScript(mlir::ModuleOp module, llvm::raw_ostream &output, int tileCol, int tileRow)
mlir::LogicalResult AIETranslateNpuToBinary(mlir::ModuleOp, std::vector< uint32_t > &, llvm::StringRef sequenceName="")
mlir::LogicalResult AIETranslateShimSolution(mlir::ModuleOp module, llvm::raw_ostream &)
mlir::LogicalResult AIEFlowsToJSON(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateToAirbin(mlir::ModuleOp module, const std::string &outputFilename, const std::string &coreFilesDir, bool testAirBin)
mlir::LogicalResult AIETranslateSCSimConfig(mlir::ModuleOp module, llvm::raw_ostream &output)
mlir::LogicalResult AIETranslateControlPacketsToUI32Vec(mlir::ModuleOp, std::vector< uint32_t > &, llvm::StringRef sequenceName="")
mlir::LogicalResult AIETranslateGraphXPE(mlir::ModuleOp module, llvm::raw_ostream &)
mlir::LogicalResult translateAIEVecToCpp(mlir::Operation *op, bool aie2, mlir::raw_ostream &os)
Translates the AIE vector dialect MLIR to C++ code.