From db99ec811957310b68c5818e506c3374402dd16f Mon Sep 17 00:00:00 2001 From: johnnoel Date: Wed, 2 Aug 2023 11:13:31 +0100 Subject: [PATCH 1/2] Add support to pull in a .Xilinx directory to allow beta devices to be enabled inside docker container See https://docs.xilinx.com/r/en-US/ug835-vivado-tcl-commands/Tcl-Initialization-Scripts for information on using tcl init scripts --- docker/finn_entrypoint.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docker/finn_entrypoint.sh b/docker/finn_entrypoint.sh index 4e0266ca6b..b441c9359a 100644 --- a/docker/finn_entrypoint.sh +++ b/docker/finn_entrypoint.sh @@ -114,6 +114,27 @@ else yecho "If you need Vitis HLS, ensure HLS_PATH is set correctly and mounted into the Docker container." fi +if [ -d "$FINN_ROOT/.Xilinx" ]; then + mkdir "$HOME/.Xilinx" + if [ -f "$FINN_ROOT/.Xilinx/HLS_init.tcl" ]; then + cp "$FINN_ROOT/.Xilinx/HLS_init.tcl" "$HOME/.Xilinx/" + else + yecho "Unable to find $FINN_ROOT/.Xilinx/HLS_init.tcl" + fi + + if [ -f "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" ]; then + mkdir "$HOME/.Xilinx/Vivado/" + cp "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" "$HOME/.Xilinx/Vivado/" + else + yecho "Unable to find $FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" + fi +else + yecho "Unable to find $FINN_ROOT/.Xilinx" + yecho "Functionality dependent on beta devices will not be available." + yecho "If you need to enable a beta device, ensure .Xilinx/HLS_init.tcl and/or .Xilinx/Vivado/Vivado_init.tcl " + yecho "are set correctly and mounted into the Docker container." +fi + export PATH=$PATH:$HOME/.local/bin # execute the provided command(s) as root exec "$@" From bbda540140427aa1d43a7f78c7e79332bc4e7bbe Mon Sep 17 00:00:00 2001 From: johnnoel Date: Fri, 22 Sep 2023 16:03:46 +0100 Subject: [PATCH 2/2] Update .Xilinx messaging --- docker/finn_entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/finn_entrypoint.sh b/docker/finn_entrypoint.sh index b441c9359a..6b33a4c9bc 100644 --- a/docker/finn_entrypoint.sh +++ b/docker/finn_entrypoint.sh @@ -118,6 +118,7 @@ if [ -d "$FINN_ROOT/.Xilinx" ]; then mkdir "$HOME/.Xilinx" if [ -f "$FINN_ROOT/.Xilinx/HLS_init.tcl" ]; then cp "$FINN_ROOT/.Xilinx/HLS_init.tcl" "$HOME/.Xilinx/" + gecho "Found HLS_init.tcl and copied to $HOME/.Xilinx/HLS_init.tcl" else yecho "Unable to find $FINN_ROOT/.Xilinx/HLS_init.tcl" fi @@ -125,14 +126,13 @@ if [ -d "$FINN_ROOT/.Xilinx" ]; then if [ -f "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" ]; then mkdir "$HOME/.Xilinx/Vivado/" cp "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" "$HOME/.Xilinx/Vivado/" + gecho "Found Vivado_init.tcl and copied to $HOME/.Xilinx/Vivado/Vivado_init.tcl" else yecho "Unable to find $FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" fi else - yecho "Unable to find $FINN_ROOT/.Xilinx" - yecho "Functionality dependent on beta devices will not be available." - yecho "If you need to enable a beta device, ensure .Xilinx/HLS_init.tcl and/or .Xilinx/Vivado/Vivado_init.tcl " - yecho "are set correctly and mounted into the Docker container." + echo "If you need to enable a beta device, ensure .Xilinx/HLS_init.tcl and/or .Xilinx/Vivado/Vivado_init.tcl are set correctly and mounted" + echo "See https://docs.xilinx.com/r/en-US/ug835-vivado-tcl-commands/Tcl-Initialization-Scripts" fi export PATH=$PATH:$HOME/.local/bin