Skip to content

Commit

Permalink
Merge branch 'f4pga:master' into artix7
Browse files Browse the repository at this point in the history
  • Loading branch information
marzoul authored Jul 26, 2024
2 parents f094637 + 5ec92c7 commit 0abda38
Show file tree
Hide file tree
Showing 103 changed files with 6,059 additions and 1,609 deletions.
26 changes: 0 additions & 26 deletions .github/cloudbuild.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/cloudbuild/Dockerfile

This file was deleted.

File renamed without changes.
File renamed without changes.
94 changes: 39 additions & 55 deletions .github/workflows/scripts/db.sh → .github/scripts/db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@

set -e

source $(dirname "$0")/hostinfo.sh
echo '::group::Host Environment'
export
echo '::endgroup::'

echo '::group::Host CPU'
export CORES=$(nproc --all)
echo "Cores: $CORES"
echo
echo "======================================="
echo "Creating Vivado Symbolic Link"
echo "---------------------------------------"
ln -s /mnt/aux/Xilinx /opt/Xilinx
echo "Memory"
echo "----------------------------------------"
cat /proc/meminfo
echo "----------------------------------------"
export MEM_GB=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo)/(1024*1024)))
echo "Total Memory (GB): $MEM_GB"
echo '::endgroup::'

# Approx memory per grid process
export MEM_PER_RUN=8
export MAX_GRID_CPU=$(($MEM_GB/$MEM_PER_RUN))
export MAX_VIVADO_PROCESS=$(($MEM_GB/$MEM_PER_RUN))

echo '::group::Source Vivado settings'
ls /opt/Xilinx/Vivado
source /opt/Xilinx/Vivado/2017.2/settings64.sh
vivado -version
echo '::endgroup::'

echo
echo "========================================"
echo "Downloading current database"
echo "----------------------------------------"
(
script --return --flush --command "./download-latest-db.sh" -
)
echo "----------------------------------------"
echo '::group::Downloading current database'
script --return --flush --command "./download-latest-db.sh" -
echo '::endgroup::'

echo
echo "========================================"
echo "Preparing database"
echo "----------------------------------------"
(
make db-prepare-${XRAY_SETTINGS}
)
echo "----------------------------------------"
echo '::group::Preparing database'
make db-prepare-${XRAY_SETTINGS}
echo '::endgroup::'

source settings/$XRAY_SETTINGS.sh

echo
echo "========================================"
echo "Cleaning out current database"
echo "----------------------------------------"
echo '::group::Cleaning out current database'
(
cd database
make clean-${XRAY_SETTINGS}-db
)
echo "----------------------------------------"
echo '::endgroup::'

echo
echo "========================================"
echo "Running Database build"
echo "----------------------------------------"
echo '::group::Running Database build'
(
# Output which fuzzers we are going to run
echo "make --dry-run"
Expand Down Expand Up @@ -87,18 +87,15 @@ echo "----------------------------------------"
exit $DATABASE_RET
fi
)
echo "----------------------------------------"
echo '::endgroup::'

# Format the database
make db-format-${XRAY_SETTINGS}
# Update the database/Info.md file
make db-info

# Output if the database has differences
echo
echo "========================================"
echo " Database Differences"
echo "----------------------------------------"
echo '::group::Database Differences'
(
cd database
# Update the index with any new files
Expand All @@ -110,7 +107,6 @@ echo "----------------------------------------"

# Output what git status
echo
echo "----------------------------------------"
echo " Database Status"
echo "----------------------------------------"
git status
Expand All @@ -119,14 +115,12 @@ echo "----------------------------------------"

# Output a summary of how the files have changed
echo
echo "----------------------------------------"
echo " Database Diff Summary"
echo "----------------------------------------"
git diff --stat --irreversible-delete --find-renames --find-copies --ignore-all-space origin/master

# Save the diff to be uploaded as an artifact
echo
echo "----------------------------------------"
echo " Saving diff output"
echo "----------------------------------------"
# Patch file
Expand All @@ -138,26 +132,22 @@ echo "----------------------------------------"
DIFF_LINES="$(wc -l diff.patch | sed -e's/ .*$//')"
if [ $DIFF_LINES -gt $MAX_DIFF_LINES ]; then
echo
echo "----------------------------------------"
echo " Database Diff"
echo "----------------------------------------"
echo "diff has $DIFF_LINES lines which is too large to display!"

echo
echo "----------------------------------------"
echo " Generating pretty diff output"
echo "----------------------------------------"
echo "diff has $DIFF_LINES lines which is too large for HTML output!"
else
# Output the actually diff
echo
echo "----------------------------------------"
echo " Database Diff"
echo "----------------------------------------"
git diff --color --irreversible-delete --find-renames --find-copies --ignore-all-space origin/master

echo
echo "----------------------------------------"
echo " Generating pretty diff output"
echo "----------------------------------------"
(
Expand All @@ -178,42 +168,36 @@ echo "----------------------------------------"
) || true
fi
)
echo "----------------------------------------"
echo '::endgroup::'

# Check the database and fail if it is broken.
set -x +e
make db-check-${XRAY_SETTINGS}
CHECK_RET=$?
set +x -e

echo
echo "========================================"
echo " Testing HTML generation"
echo "----------------------------------------"
echo '::group::Testing HTML generation'
(
cd htmlgen
source htmlgen.sh $XRAY_SETTINGS
)
echo '::endgroup::'

# If we get here, then all the fuzzers completed fine. Hence we are
# going to assume we don't want to keep all the build / logs / etc (as
# they are quite large). Thus do a clean to get rid of them.
echo
echo "========================================"
echo " Cleaning up after success"
echo "----------------------------------------"
echo '::group::Cleaning up after success'
(
cd fuzzers
echo
echo "Cleaning up so CI doesn't save all the excess data."
make clean_fuzzers
make clean_piplists
)
echo "----------------------------------------"
echo '::endgroup::'

echo "========================================"
echo " Final disk space after cleanup"
echo "----------------------------------------"
echo '::group::Final disk space after cleanup'
du -sh
echo '::endgroup::'

exit $CHECK_RET
File renamed without changes.
77 changes: 77 additions & 0 deletions .github/scripts/xilinx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
# Copyright (C) 2017-2022 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

echo
echo "========================================"
echo "Xilinx proprietary toolchain setup."
echo "----------------------------------------"

echo
echo "Fix up the Xilinx configuration directory"
echo "----------------------------------------"
mkdir -p ~/.Xilinx
ls -l ~/.Xilinx
mkdir ~/.ssh
echo
echo "Fixing loader to be able to run lmutils"
echo "----------------------------------------"
ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3

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
ln -s /mnt/aux/Xilinx-design /opt/Xilinx
ls -l Xilinx
echo
else
ln -s /mnt/aux/Xilinx /opt/Xilinx
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 "----------------------------------------"

echo $GHA_SSH_TUNNEL_CONFIG_SECRET_NAME
if [[ ! -z "$USE_LICENSE_SERVER" ]]; then

echo
echo "Xilinx license server ssh key found, checking the license"
echo

echo "127.0.0.1 xlic.int" | sudo tee -a /etc/hosts

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 "----------------------------------------"
6 changes: 6 additions & 0 deletions .github/workflows/Automerge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Automerge

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
Expand All @@ -13,6 +17,8 @@ jobs:
Pipeline:
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
uses: ./.github/workflows/Pipeline.yml
secrets:
LICENSE_TUNNEL_KEY_DATA: ${{ secrets.LICENSE_TUNNEL_KEY_DATA }}


Automerge:
Expand Down
Loading

0 comments on commit 0abda38

Please sign in to comment.