Skip to content

Commit

Permalink
configure via transaction ops (Xilinx#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield authored Aug 20, 2024
1 parent 4629dcd commit f07a0a1
Show file tree
Hide file tree
Showing 21 changed files with 901 additions and 85 deletions.
4 changes: 4 additions & 0 deletions include/aie-c/Translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ aieTranslateToCDODirect(MlirOperation moduleOp, MlirStringRef workDirPath,
bool bigEndian, bool emitUnified, bool cdoDebug,
bool aieSim, bool xaieDebug, bool enableCores);

MLIR_CAPI_EXPORTED MlirLogicalResult
aieTranslateToTxn(MlirOperation moduleOp, MlirStringRef workDirPath,
bool aieSim, bool xaieDebug, bool enableCores);

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions include/aie/Targets/AIETargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ 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 AIETranslateToTxn(mlir::ModuleOp m,
llvm::StringRef workDirPath,
bool aieSim = false,
bool xaieDebug = false,
bool enableCores = true);

#ifdef AIE_ENABLE_AIRBIN
mlir::LogicalResult AIETranslateToAirbin(mlir::ModuleOp module,
const std::string &outputFilename,
Expand Down
19 changes: 19 additions & 0 deletions lib/CAPI/Translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ MlirLogicalResult aieTranslateToCDODirect(MlirOperation moduleOp,
return wrap(status);
}

MlirLogicalResult aieTranslateToTxn(MlirOperation moduleOp,
MlirStringRef workDirPath, bool aieSim,
bool xaieDebug, bool enableCores) {
ModuleOp mod = llvm::cast<ModuleOp>(unwrap(moduleOp));
auto status = AIETranslateToTxn(
mod, llvm::StringRef(workDirPath.data, workDirPath.length), aieSim,
xaieDebug, enableCores);
std::vector<std::string> diagnostics;
ScopedDiagnosticHandler handler(mod.getContext(), [&](Diagnostic &d) {
llvm::raw_string_ostream(diagnostics.emplace_back())
<< d.getLocation() << ": " << d;
});
if (failed(status))
for (const auto &diagnostic : diagnostics)
std::cerr << diagnostic << "\n";

return wrap(status);
}

MlirStringRef aieTranslateToNPU(MlirOperation moduleOp) {
std::string npu;
llvm::raw_string_ostream os(npu);
Expand Down
Loading

0 comments on commit f07a0a1

Please sign in to comment.