Skip to content

Commit

Permalink
fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield committed Sep 11, 2024
1 parent a610174 commit 2e8ffac
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
6 changes: 3 additions & 3 deletions lib/Conversion/AIEToConfiguration/AIEToConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -186,7 +186,7 @@ parseTransactionBinary(const std::vector<uint8_t> &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<CoreOp>().empty() &&
failed(ctl.addAieElfs(targetOp, workDirPath, aieSim)))
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/AIEToConfiguration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ add_mlir_conversion_library(MLIRAIEToConfiguration
Core

LINK_LIBS PUBLIC
AIERTX
AIERT
)
14 changes: 1 addition & 13 deletions lib/Targets/AIETargets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 10 additions & 9 deletions python/compiler/aiecc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/npu-xrt/add_one_two_txn/run.lit
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit 2e8ffac

Please sign in to comment.