Skip to content

Commit

Permalink
Adding connection to a Xilinx license server.
Browse files Browse the repository at this point in the history
Enables generation of database for larger Kintex parts.

Signed-off-by: Tim 'mithro' Ansell <[email protected]>
  • Loading branch information
mithro committed Dec 21, 2021
1 parent 4c15749 commit 2f357e8
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/kokoro/continuous-db-kintex7.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 74045
keyname: "foss-fpga-tools_xilinx-license"
}
}
}
9 changes: 9 additions & 0 deletions .github/kokoro/presubmit-db-kintex7.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 74045
keyname: "foss-fpga-tools_xilinx-license"
}
}
}
1 change: 1 addition & 0 deletions .github/kokoro/steps/hostsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ sudo apt-get install -y \
fontconfig \
git \
jq \
lsb \
nodejs \
psmisc \
python3.8 \
Expand Down
90 changes: 89 additions & 1 deletion .github/kokoro/steps/xilinx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,97 @@
#
# SPDX-License-Identifier: ISC

# Fix up things related to Xilinx tool chain.
echo
echo "========================================"
echo "Xilinx proprietary toolchain setup."
echo "----------------------------------------"

echo
echo "Fix up the Xilinx configuration directory"
echo "----------------------------------------"
ls -l ~/.Xilinx
sudo chown -R $USER ~/.Xilinx

export XILINX_LOCAL_USER_DATA=no
echo "----------------------------------------"

echo
echo "Select Xilinx Vivado version"
echo "----------------------------------------"
(
set -e
cd /opt
if [ x"$XRAY_SETTINGS" = x"kintex7" ]; then
echo "Using Xilinx Vivado Design Edition for $XRAY_SETTINGS build."
echo
echo "Making /opt mount rw"
sudo mount -o remount,rw /opt
echo
echo "Replacing /opt/Xilinx link."
sudo rm -f Xilinx
sudo ln -s Xilinx-design Xilinx
ls -l Xilinx
echo
echo "Making /opt mount ro"
sudo mount -o remount,ro /opt
echo
else
echo "Using Xilinx Vivado WebPack Edition for $XRAY_SETTINGS build."
ls -l Xilinx
fi
)
echo "----------------------------------------"


echo
echo "List /opt directory"
echo "----------------------------------------"
ls -l /opt
echo "----------------------------------------"

# Create a tunnel to the server which has the Xilinx licenses and port forward
# them.
echo
echo "Setting up license server tunnel"
echo "----------------------------------------"

LICENSE_TUNNEL_KEY=$KOKORO_KEYSTORE_DIR/74045_foss-fpga-tools_xilinx-license
echo "SSH Key for license server tunnel should be found @ $LICENSE_TUNNEL_KEY"
ls -l $LICENSE_TUNNEL_KEY || true

if [ -f $LICENSE_TUNNEL_KEY ]; then
echo
echo "Xilinx license server ssh key found, setting up tunnel"

chmod 600 $LICENSE_TUNNEL_KEY
cat <<EOF > ssh_config
Host xilinx-license
HostName 10.128.15.194
User kokoro
IdentityFile $LICENSE_TUNNEL_KEY
StrictHostKeyChecking no
ExitOnForwardFailure yes
# SessionType none
LocalForward localhost:2100 172.18.0.3:2100
LocalForward localhost:2101 172.18.0.3:2101
EOF
echo "127.0.0.1 xlic.int" | sudo tee -a /etc/hosts

export GIT_SSH_COMMAND="ssh -F $(pwd)/ssh_config -f -N"
${GIT_SSH_COMMAND} xilinx-license

(
source /opt/Xilinx/Vivado/2017.2/settings64.sh
export PATH=/opt/Xilinx/Vivado/2017.2/bin/unwrapped/lnx64.o:$PATH
echo "-----"
lmutil lmstat -a -c 2100@localhost -i || true
echo "-----"
)

export XILINXD_LICENSE_FILE=2100@localhost

else
echo
echo "**No** Xilinx license server ssh key found."
fi
echo "----------------------------------------"

0 comments on commit 2f357e8

Please sign in to comment.