diff --git a/lib/Conversion/AIEToConfiguration/AIEToConfiguration.cpp b/lib/Conversion/AIEToConfiguration/AIEToConfiguration.cpp index b4f8a9c313..fd71d028c4 100644 --- a/lib/Conversion/AIEToConfiguration/AIEToConfiguration.cpp +++ b/lib/Conversion/AIEToConfiguration/AIEToConfiguration.cpp @@ -11,7 +11,7 @@ #include "../PassDetail.h" #include "aie/Conversion/AIEToConfiguration/AIEToConfiguration.h" -#include "aie/Targets/AIERTX.h" +#include "aie/Targets/AIERT.h" #include "llvm/Support/Debug.h" @@ -186,7 +186,7 @@ parseTransactionBinary(const std::vector &data, } static LogicalResult -generateTxn(AIERTXControl &ctl, const StringRef workDirPath, DeviceOp &targetOp, +generateTxn(AIERTControl &ctl, const StringRef workDirPath, DeviceOp &targetOp, bool aieSim, bool enableElfs, bool enableInit, bool enableCores) { if (enableElfs && !targetOp.getOps().empty() && failed(ctl.addAieElfs(targetOp, workDirPath, aieSim))) @@ -216,7 +216,7 @@ struct ConvertAIEToTransactionPass bool aieSim = false; bool xaieDebug = false; - AIERTXControl ctl(targetModel); + AIERTControl ctl(targetModel); if (failed(ctl.setIOBackend(aieSim, xaieDebug))) return signalPassFailure(); diff --git a/lib/Conversion/AIEToConfiguration/CMakeLists.txt b/lib/Conversion/AIEToConfiguration/CMakeLists.txt index 46b7bd874a..f08d57a2cf 100644 --- a/lib/Conversion/AIEToConfiguration/CMakeLists.txt +++ b/lib/Conversion/AIEToConfiguration/CMakeLists.txt @@ -16,5 +16,5 @@ add_mlir_conversion_library(MLIRAIEToConfiguration Core LINK_LIBS PUBLIC - AIERTX + AIERT ) diff --git a/lib/Targets/AIETargets.cpp b/lib/Targets/AIETargets.cpp index 6180285905..9942c3a2a2 100644 --- a/lib/Targets/AIETargets.cpp +++ b/lib/Targets/AIETargets.cpp @@ -392,20 +392,8 @@ void registerAIETranslations() { registerDialects); TranslateFromMLIRRegistration registrationCDOWithCtrlpkt( "aie-generate-ctrlpkt", - "Generate control packet configuration. Use --aie-output-binary to " - "select between mlir (default) and binary output", + "Generate control packet configuration.", [](ModuleOp module, raw_ostream &output) { - SmallString<128> workDirPath_; - if (workDirPath.getNumOccurrences() == 0) { - if (llvm::sys::fs::current_path(workDirPath_)) - llvm::report_fatal_error( - "couldn't get cwd to use as work-dir-path"); - } else - workDirPath_ = workDirPath.getValue(); - LLVM_DEBUG(llvm::dbgs() << "work-dir-path: " << workDirPath_ << "\n"); - // return AIETranslateToControlPackets(module, output, workDirPath_, - // outputBinary, cdoAieSim, - // cdoXaieDebug, cdoEnableCores); return AIETranslateToControlPackets(module, output, sequenceName); }, registerDialects); diff --git a/python/compiler/aiecc/main.py b/python/compiler/aiecc/main.py index 3cae7cf9dc..35e34c22c9 100644 --- a/python/compiler/aiecc/main.py +++ b/python/compiler/aiecc/main.py @@ -576,15 +576,16 @@ async def process_txn(self): shutil.copy(elf_map, self.tmpdirname) except shutil.SameFileError: pass - await self.do_call( - None, - [ - "aie-opt", - "--convert-aie-to-transaction=elf-dir=" + self.tmpdirname + "", - self.prepend_tmp("input_physical.mlir"), - "-o", - self.prepend_tmp("input_physical_txn.mlir"), - ], + input_physical = await read_file_async( + self.prepend_tmp("input_physical.mlir") + ) + run_passes( + "builtin.module(aie.device(convert-aie-to-transaction{elf-dir=" + + self.tmpdirname + + "}))", + input_physical, + self.prepend_tmp("txn.mlir"), + self.opts.verbose, ) async def process_ctrlpkt(self): diff --git a/test/npu-xrt/add_one_two_txn/run.lit b/test/npu-xrt/add_one_two_txn/run.lit index 1d282d9861..295fca13af 100644 --- a/test/npu-xrt/add_one_two_txn/run.lit +++ b/test/npu-xrt/add_one_two_txn/run.lit @@ -6,6 +6,6 @@ // RUN: clang %S/test.cpp -o test.exe -std=c++11 -Wall %xrt_flags -lrt -lstdc++ -lboost_program_options -lboost_filesystem // RUN: %python aiecc.py --xclbin-kernel-name=ADDONE --xclbin-kernel-id=0x901 --xclbin-instance-name=ADDONEINST --no-aiesim --aie-generate-cdo --aie-generate-npu --no-compile-host --xclbin-name=add_one.xclbin --npu-insts-name=add_one_insts.txt %S/aie1.mlir // RUN: %python aiecc.py --no-aiesim --aie-generate-txn --aie-generate-npu --no-compile-host --npu-insts-name=add_two_insts.txt %S/aie2.mlir -// RUN: aie-translate -aie-npu-instgen -aie-output-binary=true -aie-sequence-name=configure aie2.mlir.prj/input_physical_txn.mlir -o add_two_cfg.bin +// RUN: aie-translate -aie-npu-instgen -aie-output-binary=true -aie-sequence-name=configure aie2.mlir.prj/txn.mlir -o add_two_cfg.bin // RUN: %run_on_npu ./test.exe -x add_one.xclbin -i add_one_insts.txt -c add_two_cfg.bin -j add_two_insts.txt | FileCheck %s // CHECK: PASS!