diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..773a56d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Report a bug to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Description** +A clear and concise description of what the bug is. + +**Steps to reproduce** +1. Compile... +2. Run... + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots & Logs** +If applicable, add screenshots or logs to help explain your problem. + +**Environment:** + - OS (Ubuntu & Linux version): + - CMake version: + - gcc version: + - Vivado / Vitis version: + - Tested on hardware? Yes / No + - If tested on hardware, what FPGA (e.g. Alveo U55C, Alveo U200 etc.): + +**Additional information** +Add any other information about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..f22b8efc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Motivation** +Please tell us why this feature is important to Coyote and its user community. + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Parts of Coyote being affected** +Please describe which parts of Coyote would be affected by this feature. + +**Additional information** +Add any other information or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..9655c85e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,17 @@ +## Description +> :memo: Please include a summary of the change + +## Type of change +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update +- [ ] A new research paper code implementation +- [ ] Other + +## Tests & Results +> :memo: Please describe the tests that you ran to verify your changes. Also include any numerical results (throughput/latency etc.) relavant to the change. + +### Checklist +- [ ] I have commented my code and made corresponding changes to the documentation. +- [ ] I have added tests/results that prove my fix is effective or that my feature works. +- [ ] My changes generate no new warnings or errors & all tests successfully pass. diff --git a/README.md b/README.md index 97fe4d0e..8f18c48d 100644 --- a/README.md +++ b/README.md @@ -168,15 +168,15 @@ $ make bitgen in the original build-directory as described before. ## Deploying on the ETHZ HACC-cluster -The ETHZ HACC is a premiere cluster for research in systems, architecture and applications (https://github.com/fpgasystems/hacc/tree/main). Its hardware equipment provides the ideal environment to run Coyote-based experiments, since users can book up to 10 servers with U55C-accelerator cards connected via a fully switched 100G-network. User accounts for this platform can be obtained following the explanation on the previously cited homepage. +The ETHZ HACC is a premiere cluster for research in systems, architecture, and applications (https://github.com/fpgasystems/hacc/tree/main). Its hardware equipment provides the ideal environment to run Coyote-based experiments, since users can book up to 10 servers with U55C-accelerator cards connected via a fully switched 100G-network. User accounts for this platform can be obtained following the explanation on the previously cited homepage. -The interaction with the HACC-cluster can be simplified by using the sgutil-run time commands. They also allow to easily program the accelerator with a Coyote-bitstreamd and insert the driver. For this purpose, the script `program_coyote.sh` has been generated. Under the assumption that the hardware-project has been created in `examples_hw/build` and the driver is already compiled in `driver`, the workflow should look like this: +The interaction with the HACC-cluster can be simplified by using the sgutil-run time commands. They also allow to easily program the accelerator with a Coyote-bitstreamd and insert the driver. For this purpose, the scripts `util/program_hacc_local.sh` and `util/program_hacc_remote.sh` have been created. Under the assumption that the hardware-project has been created in `examples_hw/build` and the driver is already compiled in `driver`, the workflow should look like this: ~~~ -$ bash program_coyote.sh examples_hw/build/bitstreams/cyt_top.bit driver/coyote_drv.ko +$ bash util/program_hacc_local.sh examples_hw/build/bitstreams/cyt_top.bit driver/coyote_drv.ko ~~~ -Obviously, the paths to `cyt_top.bit` and `coyote_drv.ko` need to be adapted if a different build-structure has been chosen before. +The paths to `cyt_top.bit` and `coyote_drv.ko` need to be adapted if a different build-structure has been chosen before. A successful completion of this process can be checked via a call to ~~~ @@ -185,6 +185,8 @@ $ dmesg If the driver insertion went through, the last printed message should be `probe returning 0`. Furthermore, the dmesg-printout should contain a line `set network ip XXXXXXXX, mac YYYYYYYYYYYY`, which displays IP and MAC of the Coyote-NIC if networking has been enabled in the system configuration. +To program Coyote to a remote server, `util/program_hacc_remote.sh` may be used in the same way. Additionally, that script will ask for a list of server ids (e.g., `3, 5`). + ## Publication #### If you use Coyote, cite us : diff --git a/cmake/FindCoyoteHW.cmake b/cmake/FindCoyoteHW.cmake index 9328c1c0..779b6f42 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(VitisHLS 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 ." } diff --git a/hw/ip/SmartCamCtl.dcp b/hw/ip/SmartCamCtl.dcp deleted file mode 100644 index 8f03276a..00000000 Binary files a/hw/ip/SmartCamCtl.dcp and /dev/null differ diff --git a/hw/ip/SmartCamCtlArp.dcp b/hw/ip/SmartCamCtlArp.dcp deleted file mode 100644 index c8adb629..00000000 Binary files a/hw/ip/SmartCamCtlArp.dcp and /dev/null differ diff --git a/hw/ip/mig_7series_0.dcp b/hw/ip/mig_7series_0.dcp deleted file mode 100755 index 753b9c5c..00000000 Binary files a/hw/ip/mig_7series_0.dcp and /dev/null differ diff --git a/hw/ip/mig_axi_mm_dual.dcp b/hw/ip/mig_axi_mm_dual.dcp deleted file mode 100644 index 4513381c..00000000 Binary files a/hw/ip/mig_axi_mm_dual.dcp and /dev/null differ diff --git a/util/find.py b/util/find.py deleted file mode 100644 index 23192ad2..00000000 --- a/util/find.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os, sys - -def getOutput(cmd): - return os.popen(cmd).read() - -if (len(sys.argv) <> 2): - print "usage: %s size_in_bytes" % sys.argv[0] -else: - maxSize = int(sys.argv[1]) - - revisions = getOutput("git rev-list HEAD").split() - - bigfiles = set() - for revision in revisions: - files = getOutput("git ls-tree -zrl %s" % revision).split('\0') - for file in files: - if file == "": - continue - splitdata = file.split() - commit = splitdata[2] - if splitdata[3] == "-": - continue - size = int(splitdata[3]) - path = splitdata[4] - if (size > maxSize): - bigfiles.add("%10d %s %s" % (size, commit, path)) - - bigfiles = sorted(bigfiles, reverse=True) - - for f in bigfiles: - print f diff --git a/util/insmod_local.sh b/util/insmod_local.sh new file mode 100644 index 00000000..9bf4d530 --- /dev/null +++ b/util/insmod_local.sh @@ -0,0 +1,12 @@ +# Script to set up IP and MAC address environment variables and insert the driver because environment is not initialized when executing through ssh from a remote server (environment is only initialized when MOTD is shown). + +CLI_PATH=/opt/sgrt/cli + +IP_address=$($CLI_PATH/sgutil get network -d 1 | awk '$1 == "1:" {print $2}') +MAC_address=$($CLI_PATH/sgutil get network -d 1 | awk '$1 == "1:" {print $3}' | tr -d '()') +qsfp_ip=$($CLI_PATH/common/address_to_hex IP $IP_address) +qsfp_mac=$($CLI_PATH/common/address_to_hex MAC $MAC_address) +echo "** IP_ADDRESS: $qsfp_ip" +echo "** MAC_ADDRESS: $qsfp_mac" + +sudo insmod coyote_drv.ko ip_addr=$qsfp_ip mac_addr=$qsfp_mac \ No newline at end of file diff --git a/program_coyote.sh b/util/program_hacc_local.sh similarity index 100% rename from program_coyote.sh rename to util/program_hacc_local.sh diff --git a/util/flow_alveo.sh b/util/program_hacc_remote.sh similarity index 77% rename from util/flow_alveo.sh rename to util/program_hacc_remote.sh index 9066f064..09b80fdb 100755 --- a/util/flow_alveo.sh +++ b/util/program_hacc_remote.sh @@ -4,23 +4,32 @@ ## Args ## -if [ "$1" == "-h" ]; then - echo "Usage: $0 " >&2 +if [ "$1" == "-h" ] || [ $# -eq 0 ]; then + echo "Usage: $0 [ []]" >&2 exit 0 fi +BASE_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.. + +PROGRAM_FPGA=1 +DRV_INSERT=1 + +BIT_PATH="${1%%.bit}" # Strip .bit +DRV_PATH=driver + +if [ ! -f ${BIT_PATH}.bit ]; then + echo "Bitstream ${BIT_PATH}.bit does not exist." + exit 1 +fi + if ! [ -x "$(command -v vivado)" ]; then echo "Vivado does NOT exist in the system." exit 1 fi -BASE_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -PROGRAM_FPGA=1 -DRV_INSERT=1 - -BIT_PATH=$1 -DRV_PATH=$2 +if [ -n "$2" ]; then + DRV_PATH=$2 +fi if [ -z "$3" ]; then QSFP_PORT=0 @@ -32,7 +41,7 @@ fi ## Server IDs (u55c) ## -echo "*** Enter server IDs:" +echo "*** Enter U55C server IDs [1,10] (e.g., <3, 5>):" read -a SERVID BOARDSN=(XFL1QOQ1ATTYA XFL1O5FZSJEIA XFL1QGKZZ0HVA XFL11JYUKD4IA XFL1EN2C02C0A XFL1NMVTYXR4A XFL1WI3AMW4IA XFL1ELZXN2EGA XFL1W5OWZCXXA XFL1H2WA3T53A) @@ -53,7 +62,7 @@ alveo_program() BOARDSN=$3 DEVICENAME=$4 BITPATH=$5 - vivado -nolog -nojournal -mode batch -source program_alveo.tcl -tclargs $SERVERADDR $SERVERPORT $BOARDSN $DEVICENAME $BITPATH + vivado -nolog -nojournal -mode batch -source util/program_alveo.tcl -tclargs $SERVERADDR $SERVERPORT $BOARDSN $DEVICENAME $BITPATH } if [ $PROGRAM_FPGA -eq 1 ]; then @@ -72,7 +81,7 @@ if [ $PROGRAM_FPGA -eq 1 ]; then echo " ** " for servid in "${SERVID[@]}"; do boardidx=$(expr $servid - 1) - alveo_program alveo-u55c-$(printf "%02d" $servid) 3121 ${BOARDSN[boardidx]} xcu280_u55c_0 $BASE_PATH/../$BIT_PATH & + alveo_program alveo-u55c-$(printf "%02d" $servid) 3121 ${BOARDSN[boardidx]} xcu280_u55c_0 $BASE_PATH/$BIT_PATH & done wait @@ -97,14 +106,11 @@ if [ $DRV_INSERT -eq 1 ]; then echo "*** Compiling the driver ..." echo " ** " - parallel-ssh -H "$hostlist" "make -C $BASE_PATH/../$DRV_PATH" + parallel-ssh -H "$hostlist" "make -C $BASE_PATH/$DRV_PATH" echo "*** Loading the driver ..." echo " ** " - qsfp_ip="DEVICE_1_IP_ADDRESS_HEX_$QSFP_PORT" - qsfp_mac="DEVICE_1_MAC_ADDRESS_$QSFP_PORT" - - parallel-ssh -H "$hostlist" -x '-tt' "sudo insmod $BASE_PATH/../$DRV_PATH/coyote_drv.ko ip_addr=\$$qsfp_ip mac_addr=\$$qsfp_mac" + parallel-ssh -H "$hostlist" -x '-tt' "cd $BASE_PATH/$DRV_PATH && ../util/insmod_local.sh" echo "*** Driver loaded" echo " ** "