From e4b8642ad0f6fc588048966080a3819b29d36936 Mon Sep 17 00:00:00 2001 From: Benjamin Ramhorst Date: Thu, 14 Nov 2024 09:46:45 +0100 Subject: [PATCH] Remove unused Jinja2 CMake and refractor Vivado HLS to Vitis HLS CMake. --- cmake/FindCoyoteHW.cmake | 8 ++-- cmake/FindJinja2.cmake | 41 ------------------- cmake/FindVitisHLS.cmake | 18 ++++++++ cmake/FindVivadoHLS.cmake | 38 ----------------- examples_hw/apps/tcp_iperf/hls/CMakeLists.txt | 12 +++--- examples_hw/apps/tcp_iperf/hls/make.tcl.in | 2 +- 6 files changed, 29 insertions(+), 90 deletions(-) delete mode 100644 cmake/FindJinja2.cmake create mode 100644 cmake/FindVitisHLS.cmake delete mode 100644 cmake/FindVivadoHLS.cmake diff --git a/cmake/FindCoyoteHW.cmake b/cmake/FindCoyoteHW.cmake index 9328c1c0..009f9397 100644 --- a/cmake/FindCoyoteHW.cmake +++ b/cmake/FindCoyoteHW.cmake @@ -146,9 +146,9 @@ if (NOT VIVADO_FOUND) message(FATAL_ERROR "Vivado not found.") endif() -find_package(VivadoHLS REQUIRED) -if (NOT VIVADO_HLS_FOUND) - message(FATAL_ERROR "Vivado HLS not found.") +find_package(VITIS_HLS REQUIRED) +if (NOT VITIS_HLS_FOUND) + message(FATAL_ERROR "Vitis HLS not found.") endif() if(VITIS_HLS) @@ -726,7 +726,7 @@ macro(gen_targets) endif() if(LOAD_APPS) - set(HLS_SYNTH_CMD COMMAND ${VIVADO_HLS_BINARY} -f comp_hls.tcl -tclargs ${target}) + set(HLS_SYNTH_CMD COMMAND ${VITIS_HLS_BINARY} -f comp_hls.tcl -tclargs ${target}) endif() # Shell flow diff --git a/cmake/FindJinja2.cmake b/cmake/FindJinja2.cmake deleted file mode 100644 index 8ea1cc99..00000000 --- a/cmake/FindJinja2.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright 2016 Pixar -# -# Licensed under the Apache License, Version 2.0 (the "Apache License") -# with the following modification; you may not use this file except in -# compliance with the Apache License and the following modification to it: -# Section 6. Trademarks. is deleted and replaced with: -# -# 6. Trademarks. This License does not grant permission to use the trade -# names, trademarks, service marks, or product names of the Licensor -# and its affiliates, except as required to comply with Section 4(c) of -# the License and to reproduce the content of the NOTICE file. -# -# You may obtain a copy of the Apache License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Apache License with the above modification is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the Apache License for the specific -# language governing permissions and limitations under the Apache License. -# -# Jinja2 is a python library, ensure that it is available for use with our -# specified version of Python. -# -if (NOT PYTHON_EXECUTABLE) - return() -endif() - -execute_process( - COMMAND - "${PYTHON_EXECUTABLE}" "-c" "import jinja2" - RESULT_VARIABLE - jinja2ImportResult -) -if (jinja2ImportResult EQUAL 0) - message(STATUS "Found Jinja2") - set(JINJA2_FOUND True) -endif() - diff --git a/cmake/FindVitisHLS.cmake b/cmake/FindVitisHLS.cmake new file mode 100644 index 00000000..39455d50 --- /dev/null +++ b/cmake/FindVitisHLS.cmake @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.5) + +find_path(VITIS_HLS_PATH + NAMES vitis_hls + PATHS ${VITIS_HLS_ROOT_DIR} ENV XILINX_VITIS_HLS ENV XILINX_HLS ENV VITIS_HLS + PATH_SUFFIXES bin +) + +if(NOT EXISTS ${VITIS_HLS_PATH}) + message(WARNING "Vitis HLS not found. Please install it before building Coyote.") +else() + get_filename_component(VITIS_HLS_ROOT_DIR ${VITIS_HLS_PATH} DIRECTORY) + set(VITIS_HLS 1) + set(VITIS_HLS_FOUND TRUE) + set(VITIS_HLS_BINARY ${VITIS_HLS_ROOT_DIR}/bin/vitis_hls) + set(VITIS_HLS_INCLUDE_DIRS ${VITIS_HLS_ROOT_DIR}/include/) + message(STATUS "Found Vitis HLS at ${VITIS_HLS_ROOT_DIR}.") +endif() diff --git a/cmake/FindVivadoHLS.cmake b/cmake/FindVivadoHLS.cmake deleted file mode 100644 index eb69b65f..00000000 --- a/cmake/FindVivadoHLS.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# Author: Johannes de Fine Licht (johannes.definelicht@inf.ethz.ch) -# Created: October 2016 -# -# To specify the path to the Vivado HLS installation, provide: -# -DVIVADO_HLS_ROOT_DIR= -# If successful, this script defines: -# VIVADO_HLS_FOUND -# VIVADO_HLS_BINARY -# VIVADO_HLS_INCLUDE_DIRS - -cmake_minimum_required(VERSION 3.5) - -find_path(VIVADO_HLS_PATH - NAMES vivado_hls vitis_hls - PATHS ${VIVADO_HLS_ROOT_DIR} ENV XILINX_VIVADO_HLS ENV XILINX_HLS - PATH_SUFFIXES bin -) - -if(NOT EXISTS ${VIVADO_HLS_PATH}) - - message(WARNING "Vivado/Vitis HLS not found.") - -else() - - get_filename_component(VIVADO_HLS_ROOT_DIR ${VIVADO_HLS_PATH} DIRECTORY) - - set(VIVADO_HLS_FOUND TRUE) - set(VIVADO_HLS_INCLUDE_DIRS ${VIVADO_HLS_ROOT_DIR}/include/) - if (EXISTS ${VIVADO_HLS_ROOT_DIR}/bin/vivado_hls) - set(VIVADO_HLS_BINARY ${VIVADO_HLS_ROOT_DIR}/bin/vivado_hls) - set(VITIS_HLS 0) - else() - set(VIVADO_HLS_BINARY ${VIVADO_HLS_ROOT_DIR}/bin/vitis_hls) - set(VITIS_HLS 1) - endif() - message(STATUS "Found Vivado/Vitis HLS at ${VIVADO_HLS_ROOT_DIR}.") - -endif() diff --git a/examples_hw/apps/tcp_iperf/hls/CMakeLists.txt b/examples_hw/apps/tcp_iperf/hls/CMakeLists.txt index 6fce6c2a..8e58388b 100644 --- a/examples_hw/apps/tcp_iperf/hls/CMakeLists.txt +++ b/examples_hw/apps/tcp_iperf/hls/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.0) set (PROJECT_NAME send_recv) project(${PROJECT_NAME}) -# Include custom Find.cmake scripts to enable searching for Vivado HLS +# Include custom Find.cmake scripts to enable searching for Vivado & Vitis HLS set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake) # Without this variable set, CMake will build tests when running install @@ -31,10 +31,10 @@ set(DATA_WIDTH 64 CACHE STRING "Width of data path in bytes") set(CLOCK_PERIOD 3.2 CACHE STRING "Target clock period in nanoseconds") -# Find Xilinx Vivado HLS -find_package(VivadoHLS REQUIRED) -if (NOT VIVADO_HLS_FOUND) - message(FATAL_ERROR "Vivado HLS not found.") +# Find Xilinx Vitis HLS +find_package(VitisHLS REQUIRED) +if (NOT VITIS_HLS_FOUND) + message(FATAL_ERROR "Vitis HLS not found.") endif() @@ -60,7 +60,7 @@ foreach (target ${HLS_TARGETS}) endif() add_custom_target(${target}.${PROJECT_NAME} - COMMAND ${VIVADO_HLS_BINARY} -f make.tcl -tclargs ${target} + COMMAND ${VITIS_HLS_BINARY} -f make.tcl -tclargs ${target} DEPENDS ${EXAMPLE_HLS_DEPENDS}) add_dependencies(${target} ${target}.${PROJECT_NAME}) endforeach() diff --git a/examples_hw/apps/tcp_iperf/hls/make.tcl.in b/examples_hw/apps/tcp_iperf/hls/make.tcl.in index 73a2f188..2174797d 100644 --- a/examples_hw/apps/tcp_iperf/hls/make.tcl.in +++ b/examples_hw/apps/tcp_iperf/hls/make.tcl.in @@ -27,7 +27,7 @@ if {$command == "synthesis"} { file delete -force ${IPREPO_DIR}/${PROJECT_NAME} file copy -force ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_prj/solution1/impl/ip ${IPREPO_DIR}/${PROJECT_NAME}/ } else { - puts "No valid command specified. Use vivado_hls -f make.tcl ." + puts "No valid command specified. Use vitis_hls -f make.tcl ." }