Merge remote-tracking branch 'upstream/master' into update_from_upstream

This commit is contained in:
nadeemyaseen-rs 2021-10-20 20:13:46 +05:00
commit 274252438a
4 changed files with 52 additions and 23 deletions

View File

@ -13,6 +13,8 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release BUILD_TYPE: Release
MAKEFLAGS: "-j8" MAKEFLAGS: "-j8"
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
REPO_OWNER: ${{ github.repository_owner }}
# Multiple job to tests # Multiple job to tests
jobs: jobs:
@ -24,6 +26,7 @@ jobs:
source_modified: ${{ steps.changes.outputs.status_code == '1' }} source_modified: ${{ steps.changes.outputs.status_code == '1' }}
force_upload: false force_upload: false
sha_short: ${{ steps.changes.outputs.sha_short }} sha_short: ${{ steps.changes.outputs.sha_short }}
docker_repo: ${{ steps.changes.outputs.docker_repo }}
steps: steps:
- name: Checkout OpenFPGA repo - name: Checkout OpenFPGA repo
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -43,14 +46,22 @@ jobs:
echo "Current brnach is master forcing source_modified" echo "Current brnach is master forcing source_modified"
echo "::set-output name=status_code::1" echo "::set-output name=status_code::1"
fi fi
if [[ -n "${DOCKER_REPO}" ]]; then
echo "name=docker_repo::$REPO_OWNER"
echo "::set-output name=docker_repo::$REPO_OWNER"
else
echo "name=docker_repo::lnis-uofu"
echo "::set-output name=docker_repo::lnis-uofu"
fi
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
# Test the compilation compatibility # Test the compilation compatibility
linux_build: linux_build:
needs: change_detect needs: change_detect
if: ${{ fromJSON(needs.change_detect.outputs.source_modified) }} if: ${{ fromJSON(needs.change_detect.outputs.source_modified) }}
name: ${{ matrix.config.name }} name: ${{ matrix.config.name }}
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.config.cc}}
# Branch on different OS and settings # Branch on different OS and settings
strategy: strategy:
fail-fast: false fail-fast: false
@ -181,7 +192,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
if: ${{ (github.ref == 'refs/heads/master') || (needs.change_detect.outputs.force_upload == true) }} if: ${{ (github.ref == 'refs/heads/master' && (env.DOCKER_REPO)) || (needs.change_detect.outputs.force_upload == true) }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
@ -192,15 +203,15 @@ jobs:
with: with:
context: . context: .
file: ./docker/Dockerfile.master file: ./docker/Dockerfile.master
push: ${{ github.ref == 'refs/heads/master' || needs.change_detect.outputs.force_upload }} push: ${{ (github.ref == 'refs/heads/master' && (env.DOCKER_REPO)) || needs.change_detect.outputs.force_upload }}
tags: | tags: |
ghcr.io/lnis-uofu/openfpga-master:latest ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:latest
ghcr.io/lnis-uofu/openfpga-master:${{ needs.change_detect.outputs.sha_short }} ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:${{ needs.change_detect.outputs.sha_short }}
linux_regression_tests: linux_regression_tests:
name: linux_regression_tests name: linux_regression_tests
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
container: ghcr.io/lnis-uofu/openfpga-env needs: [linux_build, change_detect]
needs: linux_build container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -248,7 +259,7 @@ jobs:
if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }}
name: docker_regression_tests name: docker_regression_tests
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
container: ghcr.io/lnis-uofu/openfpga-master:latest container: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-master:latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@ -1,13 +1,30 @@
name: Build docker CI images name: Build docker CI images
on: on:
- workflow_dispatch - workflow_dispatch
# Environment variables
env:
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
REPO_OWNER: ${{ github.repository_owner }}
jobs: jobs:
base_images: base_images:
name: Push Docker images name: Push Docker images
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ secrets.DOCKER_REPO }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Check for source code changes
id: changes
run: |
if [[ -n "${DOCKER_REPO}" ]]; then
echo "name=docker_repo::$REPO_OWNER"
echo "::set-output name=docker_repo::$REPO_OWNER"
else
echo "name=docker_repo::lnis-uofu"
echo "::set-output name=docker_repo::lnis-uofu"
fi
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx
@ -16,7 +33,7 @@ jobs:
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ needs.change_detect.outputs.docker_repo }}
password: ${{ secrets.CR_PAT }} password: ${{ secrets.CR_PAT }}
- name: Build base - name: Build base
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
@ -24,14 +41,14 @@ jobs:
context: . context: .
file: ./docker/Dockerfile.base file: ./docker/Dockerfile.base
push: true push: true
tags: ghcr.io/lnis-uofu/openfpga-build-base:latest tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-base:latest
- name: Build environment image - name: Build environment image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: ./docker/Dockerfile.env file: ./docker/Dockerfile.env
push: true push: true
tags: ghcr.io/lnis-uofu/openfpga-env:latest tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env:latest
compiler_images: compiler_images:
name: Build ${{ matrix.compiler }} compiler image name: Build ${{ matrix.compiler }} compiler image
needs: base_images needs: base_images
@ -57,7 +74,7 @@ jobs:
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ needs.change_detect.outputs.docker_repo }}
password: ${{ secrets.CR_PAT }} password: ${{ secrets.CR_PAT }}
- name: Build ${{ matrix.compiler }} image - name: Build ${{ matrix.compiler }} image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
@ -65,4 +82,4 @@ jobs:
context: . context: .
file: ./docker/Dockerfile.${{ matrix.compiler }} file: ./docker/Dockerfile.${{ matrix.compiler }}
push: true push: true
tags: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.compiler }}:latest tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.compiler }}:latest

View File

@ -21,7 +21,7 @@ if [ -z $PYTHON_EXEC ]; then export PYTHON_EXEC="python3"; fi
# inside current OpendFPGA folder # inside current OpendFPGA folder
check_execution_path (){ check_execution_path (){
if [[ $1 != *"${OPENFPGA_PATH}"* ]]; then if [[ $1 != *"${OPENFPGA_PATH}"* ]]; then
echo -e "\e[33mCommand is not executed from configured OPNEFPGA directory\e[0m" echo -e "\e[33mCommand is not executed from configured OPENFPGA directory\e[0m"
fi fi
} }

View File

@ -271,7 +271,7 @@ def main():
if (args.fpga_flow == "vpr_blif"): if (args.fpga_flow == "vpr_blif"):
collect_files_for_vpr() collect_files_for_vpr()
logger.info("Runing OpenFPGA Shell Engine ") logger.info("Running OpenFPGA Shell Engine ")
run_openfpga_shell() run_openfpga_shell()
if args.end_flow_with_test: if args.end_flow_with_test:
run_netlists_verification() run_netlists_verification()
@ -304,7 +304,7 @@ def check_required_file():
} }
for filename, filepath in files_dict.items(): for filename, filepath in files_dict.items():
if not os.path.isfile(filepath): if not os.path.isfile(filepath):
clean_up_and_exit("Not able to locate deafult file " + filename) clean_up_and_exit("Not able to locate default file " + filename)
def read_script_config(): def read_script_config():
@ -347,7 +347,7 @@ def validate_command_line_arguments():
- Activity file - Activity file
- Base verilog file - Base verilog file
''' '''
logger.info("Validating commnad line arguments") logger.info("Validating command line arguments")
if args.debug: if args.debug:
logger.info("Setting loggger in debug mode") logger.info("Setting loggger in debug mode")
@ -363,19 +363,19 @@ def validate_command_line_arguments():
dependent = dependent.split(",") dependent = dependent.split(",")
for eachdep in dependent: for eachdep in dependent:
if not any([getattr(args, i, 0) for i in eachdep.split("|")]): if not any([getattr(args, i, 0) for i in eachdep.split("|")]):
clean_up_and_exit("'%s' argument depends on (%s) argumets" % clean_up_and_exit("'%s' argument depends on (%s) arguments" %
(eacharg, ", ".join(dependent).replace("|", " or "))) (eacharg, ", ".join(dependent).replace("|", " or ")))
# Check if architecrue files exists # Check if architecrue files exists
args.arch_file = os.path.abspath(args.arch_file) args.arch_file = os.path.abspath(args.arch_file)
if not os.path.isfile(args.arch_file): if not os.path.isfile(args.arch_file):
clean_up_and_exit( clean_up_and_exit(
"VPR architecture file not found. -%s", "VPR architecture file not found. -%s"%
args.arch_file) args.arch_file)
args.openfpga_arch_file = os.path.abspath(args.openfpga_arch_file) args.openfpga_arch_file = os.path.abspath(args.openfpga_arch_file)
if not os.path.isfile(args.openfpga_arch_file): if not os.path.isfile(args.openfpga_arch_file):
clean_up_and_exit( clean_up_and_exit(
"OpenFPGA architecture file not found. -%s", "OpenFPGA architecture file not found. -%s"%
args.openfpga_arch_file) args.openfpga_arch_file)
# Filter provided benchmark files # Filter provided benchmark files
@ -389,14 +389,14 @@ def validate_command_line_arguments():
for everyfile in glob.glob(args.benchmark_files[index]): for everyfile in glob.glob(args.benchmark_files[index]):
if not os.path.isfile(everyfile): if not os.path.isfile(everyfile):
clean_up_and_exit( clean_up_and_exit(
"Failed to copy benchmark file-%s", args.arch_file) "Failed to copy benchmark file -%s" % args.arch_file)
# Filter provided powertech files # Filter provided powertech files
if args.power_tech: if args.power_tech:
args.power_tech = os.path.abspath(args.power_tech) args.power_tech = os.path.abspath(args.power_tech)
if not os.path.isfile(args.power_tech): if not os.path.isfile(args.power_tech):
clean_up_and_exit( clean_up_and_exit(
"Power Tech file not found. -%s", args.power_tech) "Power Tech file not found. -%s" % args.power_tech)
# Expand run directory to absolute path # Expand run directory to absolute path
args.run_dir = os.path.abspath(args.run_dir) args.run_dir = os.path.abspath(args.run_dir)
@ -805,7 +805,8 @@ def filter_openfpga_output(vpr_output):
def filter_failed_process_output(vpr_output): def filter_failed_process_output(vpr_output):
for line in vpr_output.split("\n"): for line in vpr_output.split("\n"):
if "error" in line.lower(): elements_to_log = ["error", "what()"]
if any(match in line.lower() for match in elements_to_log):
logger.error("-->>" + line) logger.error("-->>" + line)