diff --git a/python/compiler/aiecc/cl_arguments.py b/python/compiler/aiecc/cl_arguments.py index c17c2ea319..4473cb54ca 100644 --- a/python/compiler/aiecc/cl_arguments.py +++ b/python/compiler/aiecc/cl_arguments.py @@ -240,8 +240,8 @@ def parse_args(args=None): help="Generate xclbin", ) parser.add_argument( - "--xclbin-input-name", - dest="xclbin_input_name", + "--xclbin-input", + dest="xclbin_input", default=None, help="Generate kernel into existing xclbin file", ) diff --git a/python/compiler/aiecc/main.py b/python/compiler/aiecc/main.py index 3f6c8f0b5c..fce2c0b3c1 100644 --- a/python/compiler/aiecc/main.py +++ b/python/compiler/aiecc/main.py @@ -589,10 +589,10 @@ async def process_xclbin_gen(self): # fmt: off await self.do_call(task, ["bootgen", "-arch", "versal", "-image", self.prepend_tmp("design.bif"), "-o", self.prepend_tmp("design.pdi"), "-w"]) - if opts.xclbin_input_name: + if opts.xclbin_input: await self.do_call(task, ["xclbinutil", "--dump-section", "AIE_PARTITION:JSON:" + self.prepend_tmp("aie_input_partition.json"), - "--force", "--input", opts.xclbin_input_name]) + "--force", "--input", opts.xclbin_input]) with open(self.prepend_tmp("aie_input_partition.json")) as f: input_partition = json.load(f) with open(self.prepend_tmp("aie_partition.json")) as f: @@ -600,7 +600,7 @@ async def process_xclbin_gen(self): input_partition["aie_partition"]["PDIs"].append(new_partition["aie_partition"]["PDIs"][0]) with open(self.prepend_tmp("aie_partition.json"), "w") as f: json.dump(input_partition, f, indent=2) - flag = ['--input', opts.xclbin_input_name] + flag = ['--input', opts.xclbin_input] else: flag = ["--add-replace-section", "MEM_TOPOLOGY:JSON:" + self.prepend_tmp("mem_topology.json")] diff --git a/test/npu-xrt/add_one_two/CMakeLists.txt b/test/npu-xrt/add_one_two/CMakeLists.txt deleted file mode 100644 index cf966ccb55..0000000000 --- a/test/npu-xrt/add_one_two/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -# (c) Copyright 2023 Xilinx Inc. - -# parameters -# -DBOOST_ROOT: Path to Boost install -# -DXRT_INC_DIR: Full path to src/runtime_src/core/include in XRT cloned repo -# -DXRT_LIB_DIR: Path to xrt_coreutil.lib - -# cmake needs this line -cmake_minimum_required(VERSION 3.1) - - -find_program(WSL NAMES powershell.exe) - -if (NOT WSL) - set(BOOST_ROOT /usr/include/boost CACHE STRING "Path to Boost install") - set(XRT_INC_DIR /opt/xilinx/xrt/include CACHE STRING "Path to XRT cloned repo") - set(XRT_LIB_DIR /opt/xilinx/xrt/lib CACHE STRING "Path to xrt_coreutil.lib") -else() - set(BOOST_ROOT C:/Technical/thirdParty/boost_1_83_0 CACHE STRING "Path to Boost install") - set(XRT_INC_DIR C:/Technical/XRT/src/runtime_src/core/include CACHE STRING "Path to XRT cloned repo") - set(XRT_LIB_DIR C:/Technical/xrtNPUfromDLL CACHE STRING "Path to xrt_coreutil.lib") -endif() - -set(TARGET_NAME test CACHE STRING "Target to be built") - -SET (ProjectName ${TARGET_NAME}) -SET (currentTarget ${TARGET_NAME}) - -if ( WSL ) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) -endif () - -project(${ProjectName}) - -# Find packages -find_package(Boost REQUIRED) - -add_executable(${currentTarget} - ${CMAKE_CURRENT_SOURCE_DIR}/../../../runtime_lib/test_lib/test_utils.cpp - test.cpp -) - -target_compile_definitions(${currentTarget} PUBLIC DISABLE_ABI_CHECK=1) - -target_include_directories (${currentTarget} PUBLIC - ../../utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../../runtime_lib/test_lib - ${XRT_INC_DIR} - ${Boost_INCLUDE_DIRS} -) - -target_link_directories(${currentTarget} PUBLIC - ${XRT_LIB_DIR} - ${Boost_LIBRARY_DIRS} -) - -if (NOT WSL) - target_link_libraries(${currentTarget} PUBLIC - xrt_coreutil - boost_program_options - boost_filesystem - ) -else() - target_link_libraries(${currentTarget} PUBLIC - xrt_coreutil - ) -endif() diff --git a/test/npu-xrt/add_one_two/Makefile b/test/npu-xrt/add_one_two/Makefile deleted file mode 100644 index 4e4d7c763b..0000000000 --- a/test/npu-xrt/add_one_two/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -include ../makefile-common - -targetname = addOneObjfifo - -all: build2/final.xclbin addOneObjfifo.exe - -build1/first.xclbin: aie1.mlir - mkdir -p ${@D} - cd ${@D} && aiecc.py \ - --xclbin-kernel-name=ADDONE --xclbin-kernel-id=0x901 --xclbin-instance-name=ADDONEINST\ - --aie-generate-cdo --no-compile-host --xclbin-name=${@F} \ - --aie-generate-npu --npu-insts-name=insts.txt ../aie1.mlir - -build2/final.xclbin: build1/first.xclbin aie2.mlir - mkdir -p ${@D} - cd ${@D} && aiecc.py \ - --xclbin-kernel-name=ADDTWO --xclbin-kernel-id=0x902 --xclbin-instance-name=ADDTWOINST \ - --aie-generate-cdo --no-compile-host \ - --xclbin-input-name=../build1/first.xclbin --xclbin-name=${@F} \ - --aie-generate-npu --npu-insts-name=insts.txt ../aie2.mlir - -${targetname}.exe: test.cpp - rm -rf _build - mkdir -p _build - cd _build && ${powershell} cmake .. -DTARGET_NAME=${targetname} - cd _build && ${powershell} cmake --build . --config Release -ifeq "${powershell}" "powershell.exe" - cp _build/${targetname}.exe $@ -else - cp _build/${targetname} $@ -endif - -run: ${targetname}.exe build2/final.xclbin - ${powershell} ./$< -v 1 -x build2/final.xclbin -i build2/insts.txt -k ADDTWO - -run1: ${targetname}.exe build1/first.xclbin - ${powershell} ./$< -v 1 -x build1/first.xclbin -i build1/insts.txt -k ADDONE - -clean: - rm -rf build1 build2 _build ${targetname}.exe diff --git a/test/npu-xrt/add_one_two/run.lit b/test/npu-xrt/add_one_two/run.lit index cd5841a9b4..60fb9dbf43 100644 --- a/test/npu-xrt/add_one_two/run.lit +++ b/test/npu-xrt/add_one_two/run.lit @@ -4,7 +4,7 @@ // REQUIRES: ryzen_ai // // 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=insts.txt %S/aie1.mlir -// RUN: %python aiecc.py --xclbin-kernel-name=ADDTWO --xclbin-kernel-id=0x902 --xclbin-instance-name=ADDTWOINST --no-aiesim --aie-generate-cdo --aie-generate-npu --no-compile-host --xclbin-input-name=add_one.xclbin --xclbin-name=add_two.xclbin --npu-insts-name=insts.txt %S/aie2.mlir +// RUN: %python aiecc.py --xclbin-kernel-name=ADDTWO --xclbin-kernel-id=0x902 --xclbin-instance-name=ADDTWOINST --no-aiesim --aie-generate-cdo --aie-generate-npu --no-compile-host --xclbin-input=add_one.xclbin --xclbin-name=add_two.xclbin --npu-insts-name=insts.txt %S/aie2.mlir // RUN: clang %S/test.cpp -o test.exe -std=c++11 -Wall %xrt_flags -lrt -lstdc++ -lboost_program_options -lboost_filesystem // RUN: %run_on_npu ./test.exe -x add_two.xclbin -i insts.txt | FileCheck %s // CHECK: PASS!