diff --git a/.github/workflows/gitlab-ci.yml b/.github/workflows/gitlab-ci.yml index a49e802..95a3479 100644 --- a/.github/workflows/gitlab-ci.yml +++ b/.github/workflows/gitlab-ci.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check Gitlab CI - uses: pulp-platform/pulp-actions/gitlab-ci@v2 + uses: pulp-platform/pulp-actions/gitlab-ci@v2.4.4 # Skip on forks or pull requests from forks due to missing secrets. if: github.repository == 'pulp-platform/chimera' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) with: diff --git a/.gitignore b/.gitignore index 383c6ab..4319689 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ utils/verible-verilog # SIM +*trace*.log +*wave*.do target/sim/models target/sim/vsim/work target/sim/vsim/transcript diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2538140 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,90 @@ +# Copyright 2024 ETH Zurich and University of Bologna. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +# Lorenzo Leone +# Sergio Mazzola + + +variables: + # Enable colors in CI terminal + TERM: ansi + FORCE_COLOR: 1 + BINARY_DIR: ./sw/tests + +default: + before_script: + # Install python virtual environment + - source iis-env.sh + - env + +stages: + - init + - build + - test + +.base: + artifacts: + when: always + expire_in: 1 week + +init-deps: + extends: .base + stage: init + script: + # Check out the biggest bender dependencies serially + # to avoid rate limiting issues + - bender path cheshire + - bender path cva6 + - bender path axi + - bender path idma + - bender path snitch_cluster + - bender path memory_island + # Collect bender sourcess + - bender checkout + # bender checkout sometimes fails, + # due to rate limiting of github + retry: 1 + + +vsim-build: + extends: .base + stage: build + script: + # Checkout dependencies + - bender checkout + # Build hardware + - make chs-hw-init + - make sn-hw-all + # Build Chimera SW + - make chim-sw + # Build Chimera Bootrom + - make chim-bootrom-init + # Compile SoC in vsim + - make chim-sim + artifacts: + paths: [ "hw", "sw", "target/sim" ] + expire_in: 3 days + +vsim-test: + extends: .base + stage: test + needs: [ vsim-build ] + parallel: + matrix: + - TESTNAME: + - testCluster + - testClusterOffload + - testMemBypass + - testPeripheralsGating + - testHyperbusAddr + - testCfgBootAddr + script: + - make chim-run-batch BINARY=$BINARY_DIR/$TESTNAME.memisl.elf VSIM_FLAGS="-l $TESTNAME.transcript" + - ./scripts/vsim_ret_error.sh $TESTNAME.transcript + dependencies: + - vsim-build + artifacts: + paths: [ "hw", "sw", "target/sim" ] + exclude: [ "target/sim/vsim/work/**/*", "target/sim/vsim/work" ] + expire_in: 4 weeks diff --git a/.gitlab/gitlab-ci.yml b/.gitlab/gitlab-ci.yml deleted file mode 100644 index 3a35b47..0000000 --- a/.gitlab/gitlab-ci.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2024 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Author: Sergio Mazzola - -# We initialize the nonfree repo, then spawn a sub-pipeline from it - -variables: - VSIM_TESTS: '["testCluster", "testClusterOffload", "testMemBypass", "testPeripheralsGating", "testHyperbusAddr", "testCfgBootAddr"]' - -stages: - - nonfree - -init: - stage: nonfree - script: make chim-nonfree-init - artifacts: - paths: [ nonfree/ci.yml ] - -process: - stage: nonfree - needs: [ init ] - script: - - envsubst '${VSIM_TESTS}' < nonfree/ci.yml > nonfree/processed_ci.yml - artifacts: - paths: [ nonfree/processed_ci.yml ] - -subpipe: - stage: nonfree - needs: [ process ] - trigger: - include: - - artifact: nonfree/processed_ci.yml - job: process - forward: - pipeline_variables: true - strategy: depend diff --git a/chimera.mk b/chimera.mk index 5e88a5e..f524823 100644 --- a/chimera.mk +++ b/chimera.mk @@ -74,17 +74,6 @@ regenerate_soc_regs: $(CHIM_ROOT)/hw/regs/chimera_reg_pkg.sv $(CHIM_ROOT)/hw/reg $(CHIM_ROOT)/hw/regs/chimera_reg_pkg.sv $(CHIM_ROOT)/hw/regs/chimera_reg_top.sv: $(CHIM_ROOT)/hw/regs/chimera_regs.hjson python $(CHIM_ROOT)/utils/reggen/regtool.py -r $< --outdir $(dir $@) - -# Nonfree components -CHIM_NONFREE_REMOTE ?= git@iis-git.ee.ethz.ch:pulp-restricted/chimera-nonfree.git -CHIM_NONFREE_DIR ?= $(CHIM_ROOT)/nonfree -CHIM_NONFREE_COMMIT ?= lleone/main-ci # to deploy `chimera-nonfree` repo changes, push to `deploy` tag - -.PHONY: chim-nonfree-init -chim-nonfree-init: - git clone $(CHIM_NONFREE_REMOTE) $(CHIM_NONFREE_DIR) - cd $(CHIM_NONFREE_DIR) && git checkout $(CHIM_NONFREE_COMMIT) - -include $(CHIM_NONFREE_DIR)/nonfree.mk -include $(CHIM_ROOT)/bender.mk