From 5213f75e5b82a62552f1ca0025eb8fe5a8f038d3 Mon Sep 17 00:00:00 2001 From: Jim Fang Date: Wed, 9 Sep 2026 13:40:13 -0700 Subject: [PATCH] init of all cicd changes --- .ctagsignore | 1 + .github/.gitignore | 1 + .github/CI_README.md | 105 -- .github/actions/cleanup-conda/action.yml | 34 - .github/actions/create-conda-env/action.yml | 24 - .github/actions/git-workaround/action.yml | 15 - .github/actions/prepare-rtl/action.yml | 38 - .github/actions/run-tests/action.yml | 36 - .../au250/config_build.yaml | 61 + .../au250/config_runtime.yaml | 105 ++ .../vcu118/config_build.yaml | 39 + .../vcu118/config_runtime.yaml | 105 ++ .github/scripts/build-default-bitstreams.py | 265 ---- .github/scripts/build-extra-tests.sh | 12 - .../scripts/build-firesim-f2-bitstreams.sh | 128 ++ .github/scripts/build-zephyr.sh | 33 +- .github/scripts/check-commit.sh | 120 -- .github/scripts/ci_variables.py | 61 - .github/scripts/clean-old-files.sh | 29 - .github/scripts/config_build_f2.yaml | 47 + .github/scripts/defaults.sh | 99 -- .github/scripts/fabric_cfg.py | 9 - .../generate-generator-release-notes.sh | 108 ++ .github/scripts/github_common.py | 14 - .github/scripts/install-conda.sh | 186 --- .../prepare-generator-test-submodules.sh | 159 ++ .github/scripts/remote-do-rtl-build.sh | 58 - .github/scripts/run-firesim-tests.sh | 149 ++ .github/scripts/run-generator-test.py | 152 ++ .github/scripts/run-linux-poweroff.py | 86 -- .github/scripts/run-metasims.py | 74 - .github/scripts/run-tests.sh | 207 --- .github/scripts/utils.py | 56 - .../workflows/build-and-publish-container.yml | 84 ++ .github/workflows/build-docs.yml | 59 + .github/workflows/build-setup-rhel.yml | 153 ++ .../workflows/build-setup-ubuntu-26.04.yml | 72 + .github/workflows/build-setup-ubuntu.yml | 72 + .github/workflows/check-ci-disable.yml | 102 ++ .github/workflows/chipyard-chisel7.yml | 44 - .github/workflows/chipyard-full-flow.yml | 207 --- .github/workflows/chipyard-run-tests.yml | 1344 ----------------- .github/workflows/config/firesim-tests.json | 9 + .github/workflows/config/generator-tests.json | 328 ++++ .github/workflows/config/release-notes.json | 56 - .github/workflows/firesim-cluster-tests.yml | 213 --- .github/workflows/pr-ci.yml | 82 + .github/workflows/release-notes.yml | 51 - .github/workflows/require-label.yml | 24 - .github/workflows/run-firesim-tests.yml | 244 +++ .github/workflows/run-generator-tests.yml | 159 ++ .github/workflows/update-circt.yml.disabled | 27 - common.mk | 101 +- dockerfiles/Dockerfile | 163 +- dockerfiles/README.md | 3 +- .../chip/src/main/makefrag/firesim/build.mk | 29 +- .../chip/src/main/makefrag/firesim/metasim.mk | 2 + .../src/test/scala/FireSimTestSuite.scala | 103 +- generators/tracegen/tracegen.mk | 21 +- scripts/check-tracegen.sh | 27 +- scripts/entrypoint.sh | 2 +- sims/firesim-staging/sample_config_hwdb.yaml | 28 +- 62 files changed, 2847 insertions(+), 3578 deletions(-) create mode 100644 .github/.gitignore delete mode 100644 .github/CI_README.md delete mode 100644 .github/actions/cleanup-conda/action.yml delete mode 100644 .github/actions/create-conda-env/action.yml delete mode 100644 .github/actions/git-workaround/action.yml delete mode 100644 .github/actions/prepare-rtl/action.yml delete mode 100644 .github/actions/run-tests/action.yml create mode 100644 .github/firesim-bitstream-templates/au250/config_build.yaml create mode 100644 .github/firesim-bitstream-templates/au250/config_runtime.yaml create mode 100644 .github/firesim-bitstream-templates/vcu118/config_build.yaml create mode 100644 .github/firesim-bitstream-templates/vcu118/config_runtime.yaml delete mode 100755 .github/scripts/build-default-bitstreams.py delete mode 100755 .github/scripts/build-extra-tests.sh create mode 100755 .github/scripts/build-firesim-f2-bitstreams.sh delete mode 100755 .github/scripts/check-commit.sh delete mode 100644 .github/scripts/ci_variables.py delete mode 100755 .github/scripts/clean-old-files.sh create mode 100644 .github/scripts/config_build_f2.yaml delete mode 100755 .github/scripts/defaults.sh delete mode 100644 .github/scripts/fabric_cfg.py create mode 100755 .github/scripts/generate-generator-release-notes.sh delete mode 100644 .github/scripts/github_common.py delete mode 100755 .github/scripts/install-conda.sh create mode 100755 .github/scripts/prepare-generator-test-submodules.sh delete mode 100755 .github/scripts/remote-do-rtl-build.sh create mode 100755 .github/scripts/run-firesim-tests.sh create mode 100644 .github/scripts/run-generator-test.py delete mode 100755 .github/scripts/run-linux-poweroff.py delete mode 100755 .github/scripts/run-metasims.py delete mode 100755 .github/scripts/run-tests.sh delete mode 100644 .github/scripts/utils.py create mode 100644 .github/workflows/build-and-publish-container.yml create mode 100644 .github/workflows/build-docs.yml create mode 100644 .github/workflows/build-setup-rhel.yml create mode 100644 .github/workflows/build-setup-ubuntu-26.04.yml create mode 100644 .github/workflows/build-setup-ubuntu.yml create mode 100644 .github/workflows/check-ci-disable.yml delete mode 100644 .github/workflows/chipyard-chisel7.yml delete mode 100644 .github/workflows/chipyard-full-flow.yml delete mode 100644 .github/workflows/chipyard-run-tests.yml create mode 100644 .github/workflows/config/firesim-tests.json create mode 100644 .github/workflows/config/generator-tests.json delete mode 100644 .github/workflows/config/release-notes.json delete mode 100644 .github/workflows/firesim-cluster-tests.yml create mode 100644 .github/workflows/pr-ci.yml delete mode 100644 .github/workflows/release-notes.yml delete mode 100644 .github/workflows/require-label.yml create mode 100644 .github/workflows/run-firesim-tests.yml create mode 100644 .github/workflows/run-generator-tests.yml delete mode 100644 .github/workflows/update-circt.yml.disabled diff --git a/.ctagsignore b/.ctagsignore index 1ff269b2a7..41d7560b85 100644 --- a/.ctagsignore +++ b/.ctagsignore @@ -2,3 +2,4 @@ sims toolchains .conda-env +.ci diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000000..d8be571f5e --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*-release.log diff --git a/.github/CI_README.md b/.github/CI_README.md deleted file mode 100644 index a4efc35a0a..0000000000 --- a/.github/CI_README.md +++ /dev/null @@ -1,105 +0,0 @@ -Chipyard Continuous Integration (CI) -=========== - -Website: https://github.com/ucb-bar/chipyard/actions - -GitHub Actions Brief Explanation ---------------------------- - -CI is executed by Github Actions (GA). GA is controlled by `.yml` files in the `.github/workflows/` directory. -In our case, we have just one workflow named `chipyard-run-tests.yml`. -It defines a number of `jobs` within it that do particular tasks. -All jobs in the workflow must pass for the CI run to be successful. -In general, a job is run in parallel with others unless it depends on some other job. -The dependency of one job on the completion of another is specified via the `needs` field. - -For example: -```yaml - prepare-chipyard-cores: - name: prepare-chipyard-cores - needs: [make-keys, setup-complete] -``` -This specifies that the `prepare-chipyard-cores` job needs the both the `make-keys` and the `setup-complete` steps to -be completed before it can run. - -Chipyard runs its CI using a docker image created from `dockerfiles/Dockerfile` and on Berkeley's compute infrastructure. -See its [README](../dockerfiles/README.md) for more details. - -Finally, within each job's `steps:` section, the steps are run sequentially and state persists throughout a job. -So when you run something like `checkout` the next step has the checked out code. - -[Composite Actions](https://docs.github.com/en/actions/creating-actions) (CA) allow for limited subroutine like code re-use within GA. -We use both community created and our own Composite Actions in our CI process. CA capabilities are changing rapidly. -Nesting of composite actions was only recently unveiled. There is a lot of room for more code reuse, in particular -we specify things over and over like docker image tag and checkout commands. - -One use of CA: our process relies on caching to avoid running time-consuming and intensive tasks more often than necessary. - -The following is an example of using the cache@v2 composite action. A step `uses: actions/cache@v2` which take as parameters the -path that contains the data to be cached and a key. Paths can have multiple targets. -The following step can look at the result of the cache operation, if there was cache miss, then we run the command that -will generate the data to be cached. The caching of the generated data is implicit. ->Note: GA cache documentation suggests using the yml level `if: steps.cache-primes.outputs.cache-hit != 'true'` to -> determine whether to run the data generation command. -> At the time of this writing the if construct has a bug and will not run correctly within a composite action. The use -> of a bash based if is a [hack found on stackoverflow](https://stackoverflow.com/questions/65473359/github-action-unable-to-add-if-condition-in-steps) -```yaml - - uses: actions/cache@v2 - id: rtl-build-id - with: - path: | - sims/verilator - sims/firesim/sim - generators/gemmini/software/gemmini-rocc-tests - key: ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }} - - name: run rtl build script if not cached - run: | - if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then - echo "Cache miss on ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}" - ./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }} - else - echo "cache hit do not prepare rtl" - fi - shell: bash -``` - -Our own composite actions are defined in the `.github/actions//action.yml` - -.github/scripts directory -------------------- - -This directory contains most the collateral for the Chipyard CI to work. -The following is included in `.github/scripts/: directory - - `remote-do-rtl-build.sh` # use verilator to build a sim executable (remotely) - `defaults.sh` # default variables used - `check-commit.sh` # check that submodule commits are valid - `build-extra-tests.sh` # build default chipyard tests located in tests/ - `clean-old-files.sh` # clean up build server files - `do-fpga-rtl-build.sh` # similar to `do-rtl-build` but using fpga/ - `remote-install-verilator.sh` # install verilator on build server - `remote-run-firesim-scala-tests.sh` # run firesim scala tests - `run-tests.sh # run tests for a specific set of designs - -How things are set up for Chipyard ---------------------------------- - -The steps for CI to run are as follows. -1. Build the toolchains in parallel (note: `esp-tools` is currently not used in the run). -The docker image sets up the `PATH` and `RISCV` variable so that `riscv-tools` is the default (currently the `env.sh` script that is created at tool build is unused). -2. Create the simulator binary. -This requires the `riscv-tools` for `fesvr` and `verilator` to be able to build the binary. -This stores all collateral for the tests (srcs, generated-srcs, sim binary, etc) to run "out of the gate" in the next job (make needs everything or else it will run again). -3. Finally, run the desired tests. - -Other CI Setup --------------- - -You need to install conda on the build servers that exist. - -Notes on CIRCLE CI ------------------- -This code is heavily based on the origin [CircleCI]() work. There a quite a few differences -- CCI allows a much larger cache. The entire CY directory with toolchains and RTL could be cached, with GA there is a 5Gb total cache limit -- GA support more parallel jobs 20 vs 4 -- GA seems to allow much longer run times diff --git a/.github/actions/cleanup-conda/action.yml b/.github/actions/cleanup-conda/action.yml deleted file mode 100644 index 336beec080..0000000000 --- a/.github/actions/cleanup-conda/action.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: cleanup-conda -description: 'Remove extra conda environments' - -runs: - using: "composite" - steps: - - name: Remove extra conda environments - run: | - conda env list - CONDA_REMOVE_NAMES=$(conda env list | awk '{print $1}' | tail -n +3 | grep "${{ env.conda-env-name-no-time }}" || true) - if [ -z "$CONDA_REMOVE_NAMES" ]; then - echo "No matching conda environments for ${{ env.conda-env-name-no-time }}. Skip removal." - else - echo "Removing $CONDA_REMOVE_NAMES conda environments." - for env in $CONDA_REMOVE_NAMES; do - conda env remove -n $env - done - fi - IS_NUMBER_REGEX='^[0-9]+$' - conda env list | awk '{print $1}' | tail -n +4 | while read envname; do - ENV_DATE=$(echo $envname | sed "s/cy-[[:digit:]]\+-\(.*\)-\(riscv\|esp\)-tools/\1/") - if ! [[ $ENV_DATE =~ $IS_NUMBER_REGEX ]]; then - echo "Skipping removal of $envname since it cannot be parsed into a date" - else - NUM_DIFF=$(( ( $(date +%s) - $(date --date="$ENV_DATE" +%s) )/(60*60*24) )) - if (( $NUM_DIFF > 2 )); then - echo "Removing $envname since it is $NUM_DIFF days old." - conda env remove -n $envname - else - echo "Skipping removal of $envname since it is $NUM_DIFF days old." - fi - fi - done - shell: bash -leo pipefail {0} diff --git a/.github/actions/create-conda-env/action.yml b/.github/actions/create-conda-env/action.yml deleted file mode 100644 index 7faa2a70f4..0000000000 --- a/.github/actions/create-conda-env/action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: create-conda-env -description: 'Create conda environments if they dont exist' -runs: - using: "composite" - steps: - - name: Create conda environments - run: | - conda env list - if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}"; then - echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}" - else - echo "Creating a conda environment for each toolchain with the toolchain installed" - ./build-setup.sh \ - --conda-env-name ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) \ - --github-token ${{ github.token }} \ - --verbose \ - --skip-submodules \ - --skip-ctags \ - --skip-precompile \ - --skip-firesim \ - --skip-marshal \ - --skip-clean - fi - shell: bash -leo pipefail {0} diff --git a/.github/actions/git-workaround/action.yml b/.github/actions/git-workaround/action.yml deleted file mode 100644 index c9d923d36d..0000000000 --- a/.github/actions/git-workaround/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: git-workaround -description: 'Workaround https://github.com/actions/checkout/issues/766' - -runs: - using: "composite" - steps: - - name: Workaround - run: | - if git config --global -l | grep -q "safe.directory=$GITHUB_WORKSPACE"; then - echo "Skip adding safe directory" - else - echo "Add $GITHUB_WORKSPACE to global git config" - git config --global --add safe.directory "$GITHUB_WORKSPACE" - fi - shell: bash -leo pipefail {0} diff --git a/.github/actions/prepare-rtl/action.yml b/.github/actions/prepare-rtl/action.yml deleted file mode 100644 index 5366460687..0000000000 --- a/.github/actions/prepare-rtl/action.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: prepare-rtl -description: 'Builds RTL based on parameters, caches the entire chipyard root dir when done' - -inputs: - group-key: - description: group key - required: true - build-script: - description: rtl build script to use - required: false - default: "remote-do-rtl-build.sh" - build-type: - description: type of build - required: false - default: "sim" - -runs: - using: "composite" - steps: - - uses: actions/cache@v3 - id: rtl-build-id - with: - path: | - sims/verilator - sims/firesim/sim - generators/gemmini/software/gemmini-rocc-tests - key: ${{ inputs.group-key }}-${{ github.sha }} - - - name: Run RTL build if not cached - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then - echo "Cache miss on ${{ inputs.group-key }}-${{ github.sha }}" - ./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }} - else - echo "Cache hit do not rebuild RTL for ${{ inputs.group-key }}" - fi - shell: bash -leo pipefail {0} diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml deleted file mode 100644 index 65c22f241e..0000000000 --- a/.github/actions/run-tests/action.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: run-tests -description: 'Runs tests according to input parameters' - -inputs: - group-key: - description: group key - required: true - project-key: - description: project key - required: true - run-script: - description: rtl build script to use - required: false - default: "run-tests.sh" - -runs: - using: "composite" - steps: - - name: Init submodules (since only the RTL is cached) - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - git submodule sync - ./scripts/init-submodules-no-riscv-tools.sh --full - shell: bash -leo pipefail {0} - - # Note: You shouldn't need the other inputs since it shouldn't build RTL from scratch - - name: Build RTL - uses: ./.github/actions/prepare-rtl - with: - group-key: ${{ inputs.group-key }} - - - name: Run RTL tests - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - ./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }} - shell: bash -leo pipefail {0} diff --git a/.github/firesim-bitstream-templates/au250/config_build.yaml b/.github/firesim-bitstream-templates/au250/config_build.yaml new file mode 100644 index 0000000000..5d8e045df9 --- /dev/null +++ b/.github/firesim-bitstream-templates/au250/config_build.yaml @@ -0,0 +1,61 @@ +# Build-time build design / AGFI configuration for the FireSim Simulation Manager +# See https://docs.fires.im/en/stable/Advanced-Usage/Manager/Manager-Configuration-Files.html for documentation of all of these params. + +# this refers to build farms defined in config_build_farm.yaml +build_farm: + base_recipe: build-farm-recipes/externally_provisioned.yaml + recipe_arg_overrides: + # REQUIRED: (replace this) default location of build directory on build host. + default_build_dir: /tools/C/chipyard-cicd/head + # REQUIRED: List of IP addresses (or "localhost"). Each can have an OPTIONAL + # argument, called "override_build_dir", specifying to override the default + # build directory. + # + # Ex: + # build_farm_hosts: + # # use localhost and don't override the default build dir + # - localhost + # # use other IP address (don't override default build dir) + # - "111.111.1.111" + # # use other IP address (override default build dir for this build host) + # - "222.222.2.222": + # override_build_dir: /scratch/specific-build-host-build-dir + build_farm_hosts: + - {machine1}: + override_build_dir: /tools/C/chipyard-cicd/machine1 + - {machine2}: + override_build_dir: /tools/C/chipyard-cicd/machine2 + - {machine3}: + override_build_dir: /tools/C/chipyard-cicd/machine3 + - {machine4}: + override_build_dir: /tools/C/chipyard-cicd/machine4 + - {machine5}: + override_build_dir: /tools/C/chipyard-cicd/machine5 + - {machine6}: + override_build_dir: /tools/C/chipyard-cicd/machine6 + +builds_to_run: + # this section references builds defined in config_build_recipes.yaml + # if you add a build here, it will be built when you run buildbitstream + - alveo_u250_firesim_rocket_singlecore_no_nic + - alveo_u250_firesim_rocket_quadcore_no_nic + ## - alveo_u250_firesim_rocket_singlecore_nic + - alveo_u250_firesim_boom_singlecore_no_nic + - alveo_u250_firesim_gemmini_rocket_singlecore_no_nic + - alveo_u250_firesim_saturn_REFV256D128_rocket_singlecore_no_nic + - alveo_u250_firesim_saturn_GENV256D128_shuttle_singlecore_no_nic + +agfis_to_share: + - alveo_u250_firesim_rocket_singlecore_no_nic + - alveo_u250_firesim_rocket_quadcore_no_nic + ## - alveo_u250_firesim_rocket_singlecore_nic + - alveo_u250_firesim_boom_singlecore_no_nic + - alveo_u250_firesim_gemmini_rocket_singlecore_no_nic + - alveo_u250_firesim_saturn_REFV256D128_rocket_singlecore_no_nic + - alveo_u250_firesim_saturn_GENV256D128_shuttle_singlecore_no_nic + +share_with_accounts: + # To share with a specific user: + somebodysname: 123456789012 + # To share publicly: + # public: public diff --git a/.github/firesim-bitstream-templates/au250/config_runtime.yaml b/.github/firesim-bitstream-templates/au250/config_runtime.yaml new file mode 100644 index 0000000000..267f4a1d88 --- /dev/null +++ b/.github/firesim-bitstream-templates/au250/config_runtime.yaml @@ -0,0 +1,105 @@ +# Run-time configuration for the FireSim Simulation Manager +# See https://docs.fires.im/en/stable/Advanced-Usage/Manager/Manager-Configuration-Files.html for documentation of all of these params. + +run_farm: + base_recipe: run-farm-recipes/externally_provisioned.yaml + recipe_arg_overrides: + # REQUIRED: default platform used for run farm hosts. this is a class specifying + # how to run simulations on a run farm host. + default_platform: XilinxAlveoU250InstanceDeployManager + + # REQUIRED: default directory where simulations are run out of on the run farm hosts + default_simulation_dir: /tools/C/chipyard-cicd/default_simulation_dir + + # REQUIRED: default fpga db file that enumerates what fpgas are available on the machine (used by XilinxU* Deploy Managers) + default_fpga_db: /tools/C/chipyard-cicd/firesim_fpga_db.json + + # REQUIRED: List of unique hostnames/IP addresses, each with their + # corresponding specification that describes the properties of the host. + # + # Ex: + # run_farm_hosts_to_use: + # # use localhost which is described by "four_fpgas_spec" below. + # - localhost: four_fpgas_spec + # # supply IP address, which points to a machine that is described + # # by "four_fpgas_spec" below. + # - "111.111.1.111": four_fpgas_spec + run_farm_hosts_to_use: + - localhost: one_fpgas_spec + +metasimulation: + metasimulation_enabled: false + # vcs or verilator. use vcs-debug or verilator-debug for waveform generation + metasimulation_host_simulator: verilator + # plusargs passed to the simulator for all metasimulations + metasimulation_only_plusargs: "+fesvr-step-size=128 +max-cycles=100000000" + # plusargs passed to the simulator ONLY FOR vcs metasimulations + metasimulation_only_vcs_plusargs: "+vcs+initreg+0 +vcs+initmem+0" + +# DOCREF START: target_config area +target_config: + topology: no_net_config + no_net_num_nodes: 1 + link_latency: 6405 + switching_latency: 10 + net_bandwidth: 200 + profile_interval: -1 + + # This references a section from config_hwdb.yaml for fpga-accelerated simulation + # or from config_build_recipes.yaml for metasimulation + # In homogeneous configurations, use this to set the hardware config deployed + # for all simulators + default_hw_config: alveo_u250_firesim_rocket_singlecore_nic + + # Advanced: Specify any extra plusargs you would like to provide when + # booting the simulator (in both FPGA-sim and metasim modes). This is + # a string, with the contents formatted as if you were passing the plusargs + # at command line, e.g. "+a=1 +b=2" + plusarg_passthrough: "" +# DOCREF END: target_config area + +tracing: + enable: no + + # Trace output formats. Only enabled if "enable" is set to "yes" above + # 0 = human readable; 1 = binary (compressed raw data); 2 = flamegraph (stack + # unwinding -> Flame Graph) + output_format: 0 + + # Trigger selector. + # 0 = no trigger; 1 = cycle count trigger; 2 = program counter trigger; 3 = + # instruction trigger + selector: 1 + start: 0 + end: -1 + +autocounter: + read_rate: 0 + +workload: + workload_name: br-base-uniform.json + terminate_on_completion: no + suffix_tag: null + +host_debug: + # When enabled (=yes), Zeros-out FPGA-attached DRAM before simulations + # begin (takes 2-5 minutes). + # In general, this is not required to produce deterministic simulations on + # target machines running linux. Enable if you observe simulation non-determinism. + zero_out_dram: no + # If disable_synth_asserts: no, simulation will print assertion message and + # terminate simulation if synthesized assertion fires. + # If disable_synth_asserts: yes, simulation ignores assertion firing and + # continues simulation. + disable_synth_asserts: no + +# DOCREF START: Synthesized Prints +synth_print: + # Start and end cycles for outputting synthesized prints. + # They are given in terms of the base clock and will be converted + # for each clock domain. + start: 0 + end: -1 + # When enabled (=yes), prefix print output with the target cycle at which the print was triggered + cycle_prefix: yes +# DOCREF END: Synthesized Prints diff --git a/.github/firesim-bitstream-templates/vcu118/config_build.yaml b/.github/firesim-bitstream-templates/vcu118/config_build.yaml new file mode 100644 index 0000000000..6dad4aa5de --- /dev/null +++ b/.github/firesim-bitstream-templates/vcu118/config_build.yaml @@ -0,0 +1,39 @@ +# Build-time build design / AGFI configuration for the FireSim Simulation Manager +# See https://docs.fires.im/en/stable/Advanced-Usage/Manager/Manager-Configuration-Files.html for documentation of all of these params. + +# this refers to build farms defined in config_build_farm.yaml +build_farm: + base_recipe: build-farm-recipes/externally_provisioned.yaml + recipe_arg_overrides: + # REQUIRED: (replace this) default location of build directory on build host. + default_build_dir: /tools/C/chipyard-cicd/head + # REQUIRED: List of IP addresses (or "localhost"). Each can have an OPTIONAL + # argument, called "override_build_dir", specifying to override the default + # build directory. + # + # Ex: + # build_farm_hosts: + # # use localhost and don't override the default build dir + # - localhost + # # use other IP address (don't override default build dir) + # - "111.111.1.111" + # # use other IP address (override default build dir for this build host) + # - "222.222.2.222": + # override_build_dir: /scratch/specific-build-host-build-dir + build_farm_hosts: + - {machine4}: + override_build_dir: /tools/C/chipyard-cicd/machine4 + +builds_to_run: + # this section references builds defined in config_build_recipes.yaml + # if you add a build here, it will be built when you run buildbitstream + - xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic + +agfis_to_share: + - xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic + +share_with_accounts: + # To share with a specific user: + somebodysname: 123456789012 + # To share publicly: + # public: public diff --git a/.github/firesim-bitstream-templates/vcu118/config_runtime.yaml b/.github/firesim-bitstream-templates/vcu118/config_runtime.yaml new file mode 100644 index 0000000000..09ac658592 --- /dev/null +++ b/.github/firesim-bitstream-templates/vcu118/config_runtime.yaml @@ -0,0 +1,105 @@ +# Run-time configuration for the FireSim Simulation Manager +# See https://docs.fires.im/en/stable/Advanced-Usage/Manager/Manager-Configuration-Files.html for documentation of all of these params. + +run_farm: + base_recipe: run-farm-recipes/externally_provisioned.yaml + recipe_arg_overrides: + # REQUIRED: default platform used for run farm hosts. this is a class specifying + # how to run simulations on a run farm host. + default_platform: XilinxVCU118InstanceDeployManager + + # REQUIRED: default directory where simulations are run out of on the run farm hosts + default_simulation_dir: /tools/C/chipyard-cicd/default_simulation_dir + + # REQUIRED: default fpga db file that enumerates what fpgas are available on the machine (used by XilinxU* Deploy Managers) + default_fpga_db: /tools/C/chipyard-cicd/firesim_fpga_db.json + + # REQUIRED: List of unique hostnames/IP addresses, each with their + # corresponding specification that describes the properties of the host. + # + # Ex: + # run_farm_hosts_to_use: + # # use localhost which is described by "four_fpgas_spec" below. + # - localhost: four_fpgas_spec + # # supply IP address, which points to a machine that is described + # # by "four_fpgas_spec" below. + # - "111.111.1.111": four_fpgas_spec + run_farm_hosts_to_use: + - localhost: one_fpgas_spec + +metasimulation: + metasimulation_enabled: false + # vcs or verilator. use vcs-debug or verilator-debug for waveform generation + metasimulation_host_simulator: verilator + # plusargs passed to the simulator for all metasimulations + metasimulation_only_plusargs: "+fesvr-step-size=128 +max-cycles=100000000" + # plusargs passed to the simulator ONLY FOR vcs metasimulations + metasimulation_only_vcs_plusargs: "+vcs+initreg+0 +vcs+initmem+0" + +# DOCREF START: target_config area +target_config: + topology: no_net_config + no_net_num_nodes: 1 + link_latency: 6405 + switching_latency: 10 + net_bandwidth: 200 + profile_interval: -1 + + # This references a section from config_hwdb.yaml for fpga-accelerated simulation + # or from config_build_recipes.yaml for metasimulation + # In homogeneous configurations, use this to set the hardware config deployed + # for all simulators + default_hw_config: xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic + + # Advanced: Specify any extra plusargs you would like to provide when + # booting the simulator (in both FPGA-sim and metasim modes). This is + # a string, with the contents formatted as if you were passing the plusargs + # at command line, e.g. "+a=1 +b=2" + plusarg_passthrough: "" +# DOCREF END: target_config area + +tracing: + enable: no + + # Trace output formats. Only enabled if "enable" is set to "yes" above + # 0 = human readable; 1 = binary (compressed raw data); 2 = flamegraph (stack + # unwinding -> Flame Graph) + output_format: 0 + + # Trigger selector. + # 0 = no trigger; 1 = cycle count trigger; 2 = program counter trigger; 3 = + # instruction trigger + selector: 1 + start: 0 + end: -1 + +autocounter: + read_rate: 0 + +workload: + workload_name: br-base-uniform.json + terminate_on_completion: no + suffix_tag: null + +host_debug: + # When enabled (=yes), Zeros-out FPGA-attached DRAM before simulations + # begin (takes 2-5 minutes). + # In general, this is not required to produce deterministic simulations on + # target machines running linux. Enable if you observe simulation non-determinism. + zero_out_dram: no + # If disable_synth_asserts: no, simulation will print assertion message and + # terminate simulation if synthesized assertion fires. + # If disable_synth_asserts: yes, simulation ignores assertion firing and + # continues simulation. + disable_synth_asserts: no + +# DOCREF START: Synthesized Prints +synth_print: + # Start and end cycles for outputting synthesized prints. + # They are given in terms of the base clock and will be converted + # for each clock domain. + start: 0 + end: -1 + # When enabled (=yes), prefix print output with the target cycle at which the print was triggered + cycle_prefix: yes +# DOCREF END: Synthesized Prints diff --git a/.github/scripts/build-default-bitstreams.py b/.github/scripts/build-default-bitstreams.py deleted file mode 100755 index 038b973e14..0000000000 --- a/.github/scripts/build-default-bitstreams.py +++ /dev/null @@ -1,265 +0,0 @@ -#!/usr/bin/env python3 - -from pathlib import Path -from fabric.api import prefix, run, settings, execute # type: ignore -import sys - -import fabric_cfg -from ci_variables import ci_env, remote_fsim_dir, remote_cy_dir -from github_common import move_and_commit_gh_file -from utils import print_last_firesim_log - -from typing import List, Tuple - -URL_PREFIX = f"https://raw.githubusercontent.com/{ci_env['GH_ORG']}/{ci_env['GH_REPO']}" - -shared_build_dir = "/scratch/buildbot/FIRESIM_BUILD_DIR" - -from_chipyard_firesim_build_recipes = "sims/firesim-staging/sample_config_build_recipes.yaml" -from_chipyard_firesim_hwdb = ci_env['CHIPYARD_HWDB_PATH'] -# this must point to build recipe in clone setup for firesim s.t. the makefrag it points to itself points to the working clone -setup_clone_firesim_build_recipes = f"{remote_cy_dir}/{from_chipyard_firesim_build_recipes}" -workspace_firesim_hwdb = f"{ci_env['GITHUB_WORKSPACE']}/{from_chipyard_firesim_hwdb}" -assert Path(setup_clone_firesim_build_recipes).exists() -assert Path(workspace_firesim_hwdb).exists() - -# host assumptions: -# - firesim's machine-launch-script requirements are already installed (i.e. sudo scripts on all machines) -# - XILINX_VITIS, XILINX_XRT, XILINX_VIVADO are setup (in environtment - LD_LIBRARY_PATH/PATH/etc) -# priority == roughly the more powerful and available -# ipaddr, buildtool:version, use unique build dir, unique build dir path, priority (0 is highest)(unused by code but used to track which machine has most resources) -build_hosts = [ - ( "localhost", "vivado:2022.1", False, "", 0), - ("buildbot1@as4", "vivado:2022.1", True, "/scratch/buildbot1/FIRESIM_BUILD_DIR", 0), - ("buildbot2@as4", "vivado:2022.1", True, "/scratch/buildbot2/FIRESIM_BUILD_DIR", 0), - ( "a17", "vitis:2022.1", False, "", 0), - ("buildbot1@a17", "vitis:2022.1", True, "/scratch/buildbot1/FIRESIM_BUILD_DIR", 0), - ("buildbot2@a17", "vitis:2021.1", True, "/scratch/buildbot2/FIRESIM_BUILD_DIR", 0), - ("buildbot3@a17", "vitis:2021.1", True, "/scratch/buildbot3/FIRESIM_BUILD_DIR", 0), - ("buildbot4@a17", "vitis:2021.1", True, "/scratch/buildbot4/FIRESIM_BUILD_DIR", 0), - ( "firesim1", "vitis:2021.1", False, "", 1), - ( "jktgz", "vivado:2023.1", False, "", 2), - ( "jktqos", "vivado:2023.1", False, "", 2), -] - -def positive_hash(any) -> int: - return hash(any) % 2**sys.hash_info.width - -# add builds to run into a config_build.yaml -def modify_config_build(in_config_build_yaml, out_config_build_yaml, hwdb_entries_to_gen: List[str]) -> None: - global shared_build_dir - - # comment out old lines - build_yaml_lines = open(in_config_build_yaml).read().split("\n") - with open(out_config_build_yaml, "w") as byf: - for line in build_yaml_lines: - if "- midas" in line: - # comment out midasexample lines - byf.write("# " + line + '\n') - elif 'default_build_dir:' in line: - byf.write(line.replace('null', shared_build_dir) + '\n') - else: - byf.write(line + '\n') - - # add new builds to run - build_yaml_lines = open(out_config_build_yaml).read().split("\n") - with open(out_config_build_yaml, "w") as byf: - for line in build_yaml_lines: - if "builds_to_run:" in line and not "#" in line: - byf.write(line + '\n') - start_space_idx = line.index('b') - for hwdb_to_gen in hwdb_entries_to_gen: - byf.write((' ' * (start_space_idx + 4)) + f"- {hwdb_to_gen}" + '\n') - else: - byf.write(line + '\n') - -# add hosts for builds to run into a config_build.yaml -def add_host_list(in_build_yaml: str, out_build_yaml: str, hostlist: List[Tuple[str, bool, str]]) -> None: - build_yaml_lines = open(in_build_yaml).read().split("\n") - with open(out_build_yaml, "w") as byf: - for line in build_yaml_lines: - if "build_farm_hosts:" in line and not "#" in line: - byf.write(line + '\n') - start_space_idx = line.index('b') - for host, use_unique, unique_build_dir in hostlist: - if use_unique: - byf.write((' ' * (start_space_idx + 4)) + f"- {host}:" + '\n') - byf.write((' ' * (start_space_idx + 8)) + f"override_build_dir: {unique_build_dir}" + '\n') - else: - byf.write((' ' * (start_space_idx + 4)) + f"- {host}" + '\n') - elif '- localhost' in line and not '#' in line: - byf.write("# " + line + '\n') - else: - byf.write(line + '\n') - -# replace hwdb entry in config_hwdb.yaml with a link -def replace_in_hwdb(hwdb_file: str, hwdb_entry_name: str, link: str) -> None: - # replace the sample hwdb's bit line only - sample_hwdb_lines = open(hwdb_file).read().split('\n') - - with open(hwdb_file, "w") as sample_hwdb_file: - match_bit = False - for line in sample_hwdb_lines: - if hwdb_entry_name in line.strip().split(' ')[0].replace(':', ''): - # hwdb entry matches key name - match_bit = True - sample_hwdb_file.write(line + '\n') - elif match_bit == True: - if ("bitstream_tar:" in line.strip().split(' ')[0]): - # only replace this bit - match_bit = False - - new_bit_line = f" bitstream_tar: {link}" - print(f"Replacing {line.strip()} with {new_bit_line}") - - # print out the bit line - sample_hwdb_file.write(new_bit_line + '\n') - else: - raise Exception("::ERROR:: Something went wrong") - else: - # if no match print other lines - sample_hwdb_file.write(line + '\n') - - if match_bit == True: - raise Exception(f"::ERROR:: Unable to replace URL for {hwdb_entry_name} in {hwdb_file}") - - # strip newlines from end of file - with open(hwdb_file, "r+") as sample_hwdb_file: - content = sample_hwdb_file.read() - content = content.rstrip('\n') - sample_hwdb_file.seek(0) - - sample_hwdb_file.write(content) - sample_hwdb_file.truncate() - -def run_local_buildbitstreams(): - """Runs local buildbitstreams""" - - global workspace_firesim_hwdb - - with prefix(f"cd {remote_fsim_dir}"): - with prefix('source sourceme-manager.sh --skip-ssh-setup'): - - def build_upload(build_yaml: str, hwdb_entries: List[str], platforms: List[str]) -> List[str]: - global URL_PREFIX - global setup_clone_firesim_build_recipes - - print(f"Printing {build_yaml}...") - run(f"cat {build_yaml}") - - rc = 0 - with settings(warn_only=True): - # pty=False needed to avoid issues with screen -ls stalling in fabric - build_result = run(f"timeout 10h firesim buildbitstream -b {build_yaml} -r {setup_clone_firesim_build_recipes} --forceterminate", pty=False) - rc = build_result.return_code - - if rc != 0: - print(f"Buildbitstream failed.") - print_last_firesim_log(200) - raise Exception(f"Failed with code: {rc}") - - hwdb_entry_dir = f"{remote_fsim_dir}/deploy/built-hwdb-entries" - links = [] - - for hwdb_entry_name, platform in zip(hwdb_entries, platforms): - hwdb_entry = f"{hwdb_entry_dir}/{hwdb_entry_name}" - - print(f"Printing {hwdb_entry}...") - run(f"cat {hwdb_entry}") - - with open(hwdb_entry, 'r') as hwdbef: - lines = hwdbef.readlines() - for line in lines: - if "bitstream_tar:" in line: - file_path = Path(line.strip().split(' ')[1].replace('file://', '')) # 2nd element (i.e. the path) (no URI) - file_name = f"{platform}/{hwdb_entry_name}.tar.gz" - run(f"shasum -a 256 {file_path}") - sha = move_and_commit_gh_file(file_path, file_name, f"{ci_env['GITHUB_WORKSPACE']}/{ci_env['GH_REPO']}", f"Committing files from {ci_env['GITHUB_REPOSITORY']}:{ci_env['GITHUB_SHA']}") - link = f"{URL_PREFIX}/{sha}/{file_name}" - print(f"Uploaded bitstream_tar for {hwdb_entry_name} to {link}") - links.append(link) - break - - return links - - - def do_builds(batch_hwdbs, hwdb_file_to_replace): - assert len(build_hosts) >= len(batch_hwdbs), f"Need at least {len(batch_hwdbs)} build_hosts to run builds" - - # map hwdb tuple to build_hosts - hwdb_2_host = {} - for hwdb, platform, buildtool_version in batch_hwdbs: - for host_name, host_buildtool_version, host_use_unique, host_unique_build_dir, host_prio in build_hosts: - if host_buildtool_version == buildtool_version: - if not host_name in [h[0] for h in hwdb_2_host.values()]: - hwdb_2_host[hwdb] = (host_name, host_use_unique, host_unique_build_dir) - break - - assert len(hwdb_2_host) == len(batch_hwdbs), "Unable to map build_hosts to hwdb build" - - hwdbs_ordered = [hwdb[0] for hwdb in batch_hwdbs] - platforms_ordered = [hwdb[1] for hwdb in batch_hwdbs] - hosts_ordered = hwdb_2_host.values() - - print("Mappings") - print(f"HWDBS: {hwdbs_ordered}") - print(f"Platforms: {platforms_ordered}") - print(f"build_hosts: {hosts_ordered}") - - og_build_yaml = f"{remote_fsim_dir}/deploy/config_build.yaml" - intermediate_build_yaml = f"{remote_fsim_dir}/deploy/config_build_{positive_hash(tuple(hwdbs_ordered))}.yaml" - final_build_yaml = f"{remote_fsim_dir}/deploy/config_build_{positive_hash(tuple(hosts_ordered))}.yaml" - - modify_config_build(og_build_yaml, intermediate_build_yaml, hwdbs_ordered) - add_host_list(intermediate_build_yaml, final_build_yaml, hosts_ordered) - links = build_upload(final_build_yaml, hwdbs_ordered, platforms_ordered) - for hwdb, link in zip(hwdbs_ordered, links): - replace_in_hwdb(hwdb_file_to_replace, hwdb, link) - - print(f"Printing {hwdb_file_to_replace}...") - run(f"cat {hwdb_file_to_replace}") - - # wipe old data - print("Cleaning old build directories") - for host_name, host_use_unique, host_unique_build_dir in hosts_ordered: - if host_use_unique: - run(f"ssh {host_name} rm -rf {host_unique_build_dir}") - else: - run(f"ssh {host_name} rm -rf {shared_build_dir}") - - # note: next two statements can be duplicated to run different builds in phases - # i.e. run 4 agfis in 1st phase, then 6 in next - - # order of following list roughly corresponds to build host to use. - # i.e. if 1st hwdb in list wants a host with V0 of tools, it will get the 1st host with V0 of tools - # in the build_hosts list - - # hwdb_entry_name, platform_name, buildtool:version - batch_hwdbs_in = [ - # hwdb's to verify FPGA builds - - # TODO: disable due to not having xrt installed on localhost - #("vitis_firesim_rocket_singlecore_no_nic", "vitis", "vitis:2022.1"), - - ("nitefury_firesim_rocket_singlecore_no_nic", "rhsresearch_nitefury_ii", "vitis:2022.1"), - ("alveo_u200_firesim_rocket_singlecore_no_nic", "xilinx_alveo_u200", "vitis:2021.1"), - ("alveo_u250_firesim_rocket_singlecore_no_nic", "xilinx_alveo_u250", "vitis:2021.1"), - ("alveo_u280_firesim_rocket_singlecore_no_nic", "xilinx_alveo_u280", "vitis:2021.1"), - - # TODO: disable due to not having a license - #("xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic", "xilinx_vcu118", "vivado:2023.1"), - - # extra hwdb's to run CI with - ("alveo_u250_firesim_rocket_quadcore_no_nic", "xilinx_alveo_u250", "vivado:2022.1"), - ("alveo_u250_firesim_boom_singlecore_no_nic", "xilinx_alveo_u250", "vivado:2022.1"), - ("alveo_u250_firesim_rocket_singlecore_nic", "xilinx_alveo_u250", "vivado:2022.1"), - - # extra hwdb's - ("alveo_u250_firesim_gemmini_rocket_singlecore_no_nic", "xilinx_alveo_u250", "vitis:2021.1"), - ] - - # replace hwdb entries in workspace area - do_builds(batch_hwdbs_in, workspace_firesim_hwdb) - -if __name__ == "__main__": - execute(run_local_buildbitstreams, hosts=["localhost"]) diff --git a/.github/scripts/build-extra-tests.sh b/.github/scripts/build-extra-tests.sh deleted file mode 100755 index 68ad20493c..0000000000 --- a/.github/scripts/build-extra-tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# turn echo on and error on earliest command -set -ex - -# get shared variables -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -source $SCRIPT_DIR/defaults.sh - -cmake $LOCAL_CHIPYARD_DIR/tests/ -S $LOCAL_CHIPYARD_DIR/tests/ -B $LOCAL_CHIPYARD_DIR/tests/build/ -D CMAKE_BUILD_TYPE=Debug -cmake --build $LOCAL_CHIPYARD_DIR/tests/build/ --target clean -cmake --build $LOCAL_CHIPYARD_DIR/tests/build/ --target all diff --git a/.github/scripts/build-firesim-f2-bitstreams.sh b/.github/scripts/build-firesim-f2-bitstreams.sh new file mode 100755 index 0000000000..f014185b55 --- /dev/null +++ b/.github/scripts/build-firesim-f2-bitstreams.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Run this directly on an existing FireSim manager. The manager's normal AWS +# credential provider chain is used, including an attached EC2 IAM role; this +# script does not create or copy access keys. + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +DEFAULT_CY_DIR="$(cd -- "${SCRIPT_DIR}/../.." && pwd)" + +CY_DIR="${CY_DIR:-${DEFAULT_CY_DIR}}" +FS_DIR="${FIRESIM_DIR:-${CY_DIR}/sims/firesim}" +BUILD_RECIPES="${FIRESIM_BUILD_RECIPES:-${CY_DIR}/sims/firesim-staging/sample_config_build_recipes.yaml}" +BUILD_CONFIG="${FIRESIM_BUILD_CONFIG:-${SCRIPT_DIR}/config_build_f2.yaml}" +BUILD_HWDB="${FIRESIM_BUILD_HWDB:-${CY_DIR}/sims/firesim-staging/sample_config_hwdb.yaml}" +PUBLISH_HWDB="${FIRESIM_PUBLISH_HWDB:-${FS_DIR}/deploy/built-hwdb-entries/config_hwdb_f2_latest.yaml}" +firesim_args=("$@") + +require_file() { + local path="$1" + if [ ! -f "${path}" ]; then + echo "Missing required file: ${path}" >&2 + exit 1 + fi +} + +require_file "${FS_DIR}/sourceme-manager.sh" +require_file "${BUILD_RECIPES}" +require_file "${BUILD_CONFIG}" +require_file "${BUILD_HWDB}" + +cd "${FS_DIR}" + +# FireSim's environment scripts are not nounset-safe. Clear the positional +# arguments while sourcing so FireSim does not interpret this script's args. +set -- +set +u +# shellcheck disable=SC1091 +source sourceme-manager.sh +set -u + +if [ ! -r "${HOME}/firesim.pem" ]; then + echo "Missing ${HOME}/firesim.pem. Finish setting up this FireSim manager first." >&2 + exit 1 +fi + +if ! command -v aws >/dev/null 2>&1; then + echo "The AWS CLI is unavailable. Finish setting up this FireSim manager first." >&2 + exit 1 +fi + +aws_region="${AWS_REGION:-${AWS_DEFAULT_REGION:-}}" +if [ -z "${aws_region}" ]; then + aws_region="$(aws configure get region 2>/dev/null || true)" +fi +if [ -z "${aws_region}" ]; then + echo "No AWS region is configured. Set AWS_DEFAULT_REGION or configure a default region." >&2 + exit 1 +fi +export AWS_DEFAULT_REGION="${aws_region}" + +if ! aws sts get-caller-identity >/dev/null; then + echo "No usable AWS identity was found. Attach the FireSim IAM role to this manager or configure another standard AWS credential provider." >&2 + exit 1 +fi + +echo "Initializing the FireSim manager for AWS F2 in ${AWS_DEFAULT_REGION}." +printf '%s\n' "${FIRESIM_NOTIFICATION_EMAIL:-}" | firesim managerinit --platform f2 + +echo "Launching the F2 build farm described by ${BUILD_CONFIG}" +echo "Build recipes: ${BUILD_RECIPES}" +build_started_at="$(date +%s)" + +# Additional arguments are passed through to FireSim, for example +# --forceterminate when recovering from an interrupted build. +firesim buildbitstream \ + --buildrecipesconfigfile "${BUILD_RECIPES}" \ + --buildconfigfile "${BUILD_CONFIG}" \ + --hwdbconfigfile "${BUILD_HWDB}" \ + "${firesim_args[@]}" + +# FireSim writes the newly created AGFI entry for each successful build into +# deploy/built-hwdb-entries. Assemble only entries created by this run so that +# shareagfi cannot publish stale AGFIs from the sample HWDB. +python3 - "${BUILD_CONFIG}" "${FS_DIR}/deploy/built-hwdb-entries" "${PUBLISH_HWDB}" "${build_started_at}" <<'PY' +import sys +from pathlib import Path + +import yaml + +build_config_path = Path(sys.argv[1]) +entries_dir = Path(sys.argv[2]) +publish_hwdb_path = Path(sys.argv[3]) +build_started_at = int(sys.argv[4]) + +with build_config_path.open(encoding="utf-8") as build_config_file: + build_config = yaml.safe_load(build_config_file) + +names = build_config.get("agfis_to_share") or [] +if not names: + raise SystemExit(f"No agfis_to_share entries found in {build_config_path}") + +publish_hwdb = {} +for name in names: + entry_path = entries_dir / name + if not entry_path.is_file(): + raise SystemExit(f"Missing AGFI entry from the completed build: {entry_path}") + if entry_path.stat().st_mtime < build_started_at: + raise SystemExit(f"Refusing to publish stale AGFI entry: {entry_path}") + + with entry_path.open(encoding="utf-8") as entry_file: + entry = yaml.safe_load(entry_file) + if not isinstance(entry, dict) or list(entry) != [name]: + raise SystemExit(f"Unexpected AGFI entry in {entry_path}") + publish_hwdb[name] = entry[name] + +publish_hwdb_path.parent.mkdir(parents=True, exist_ok=True) +with publish_hwdb_path.open("w", encoding="utf-8") as publish_hwdb_file: + yaml.safe_dump(publish_hwdb, publish_hwdb_file, sort_keys=False) + +print(f"Wrote freshly built AGFI database: {publish_hwdb_path}") +PY + +echo "Sharing the newly built AGFIs using ${PUBLISH_HWDB}" +firesim shareagfi \ + --buildrecipesconfigfile "${BUILD_RECIPES}" \ + --buildconfigfile "${BUILD_CONFIG}" \ + --hwdbconfigfile "${PUBLISH_HWDB}" diff --git a/.github/scripts/build-zephyr.sh b/.github/scripts/build-zephyr.sh index a5eab3a887..3eacffe382 100755 --- a/.github/scripts/build-zephyr.sh +++ b/.github/scripts/build-zephyr.sh @@ -1,24 +1,25 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail -# turn echo on and error on earliest command -set -ex +chipyard_dir="${LOCAL_CHIPYARD_DIR:-/home/ubuntu/chipyard}" +zephyr_dir="${chipyard_dir}/software/zephyrproject/zephyr" -# get shared variables -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -source $SCRIPT_DIR/defaults.sh +if [ -z "${RISCV:-}" ]; then + echo "RISCV is unset. Source env.sh before building Zephyr." >&2 + exit 1 +fi -# install Zephyr dependencies -git submodule update --init $LOCAL_CHIPYARD_DIR/software/zephyrproject/zephyr -cd $LOCAL_CHIPYARD_DIR/software/zephyrproject/zephyr/ -west init -l . +git -C "${chipyard_dir}" submodule update --init -- software/zephyrproject/zephyr + +cd "${zephyr_dir}" +if [ ! -d .west ]; then + west init -l . +fi west config manifest.file west-riscv.yml west update -# set environment variables for Zephyr -export ZEPHYR_BASE=$LOCAL_CHIPYARD_DIR/software/zephyrproject/zephyr +export ZEPHYR_BASE="${zephyr_dir}" export ZEPHYR_TOOLCHAIN_VARIANT=cross-compile -export CROSS_COMPILE=$RISCV/bin/riscv64-unknown-elf- - +export CROSS_COMPILE="${RISCV}/bin/riscv64-unknown-elf-" -# Build hello world -west build -p -b chipyard_riscv64 samples/chipyard/hello_world/ \ No newline at end of file +west build -p -b chipyard_riscv64 samples/chipyard/hello_world/ diff --git a/.github/scripts/check-commit.sh b/.github/scripts/check-commit.sh deleted file mode 100755 index 1152da95d2..0000000000 --- a/.github/scripts/check-commit.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -# check to see that submodule commits are present on the master branch - -# turn echo on and error on earliest command -set -ex - -# get shared variables -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -source $SCRIPT_DIR/defaults.sh - -cd $LOCAL_CHIPYARD_DIR - -# ignore the private vlsi submodules -git config submodule.vlsi/hammer-mentor-plugins.update none - -# initialize submodules and get the hashes -git submodule update --init -status=$(git submodule status) - -all_names=() - - -search_submodule() { - echo "Running check on submodule $submodule in $dir" - hash=$(echo "$status" | grep "$dir.*$submodule " | awk '{print$1}' | grep -o "[[:alnum:]]*") - for branch in "${branches[@]}" - do - echo "Searching for $hash in origin/$branch of $submodule" - (git -C $dir/$submodule branch -r --contains "$hash" | grep "origin/$branch") && true # needs init'ed submodules - if [ $? -eq 0 ] - then - all_names+=("$dir/$submodule $hash 0") - return - fi - done - all_names+=("$dir/$submodule $hash 1") - return -} - -search () { - for submodule in "${submodules[@]}" - do - search_submodule - done -} - - -submodules=("cva6" "boom" "ibex" "gemmini" "icenet" "nvdla" "rocket-chip" "rocket-chip-blocks" "rocket-chip-inclusive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers" "shuttle" "constellation" "fft-generator" "hardfloat" "caliptra-aes-acc" "rocc-acc-utils" "diplomacy" "rerocc" "compress-acc" "saturn" "ara" "vexiiriscv" "tacit" "radiance") -dir="generators" -branches=("master" "main" "dev") -search - -submodules=("riscv-tools-feedstock") -dir="toolchains/riscv-tools" -branches=("main") -search - -submodules=("riscv-isa-sim" "riscv-pk" "riscv-tests") -dir="toolchains/riscv-tools" -branches=("master") -search - -# riscv-openocd doesn't use its master branch -submodules=("riscv-openocd") -dir="toolchains/riscv-tools" -branches=("riscv") -search - -submodules=("libgloss") -dir="toolchains" -branches=("master") -search - -submodules=("firesim") -dir="sims" -branches=("main") -search - - -submodules=("coremark" "firemarshal" "nvdla-workload" "spec2017" "zephyrproject/zephyr") -dir="software" -branches=("master" "dev") -search - -submodules=("DRAMSim2" "axe" "dsptools" "rocket-dsp-utils" "torture" "fixedpoint" "cde" "firrtl2") -dir="tools" -branches=("master" "dev" "main") -search - -submodules=("fpga-shells") -dir="fpga" -branches=("main") -search - -# turn off verbose printing to make this easier to read -set +x - -# print 0's -for str in "${all_names[@]}"; -do - if [ 0 = $(echo "$str" | awk '{print$3}') ]; then - echo "$str" - fi -done - -echo "" - -# check if there was a non-zero return code and print 1's -EXIT=0 -for str in "${all_names[@]}"; -do - if [ ! 0 = $(echo "$str" | awk '{print$3}') ]; then - echo "$str" - EXIT=1 - fi -done - -echo "Done checking all submodules" -exit $EXIT diff --git a/.github/scripts/ci_variables.py b/.github/scripts/ci_variables.py deleted file mode 100644 index 2693ed7064..0000000000 --- a/.github/scripts/ci_variables.py +++ /dev/null @@ -1,61 +0,0 @@ -import os - -# This package contains utilities that rely on environment variable -# definitions present only on the CI container instance. - -GITHUB_ACTIONS_ENV_VAR_NAME = 'GITHUB_ACTIONS' -RUN_LOCAL = os.environ.get(GITHUB_ACTIONS_ENV_VAR_NAME, 'false') == 'false' - -# When running locally (not in a CI pipeline) run commands out of the clone hosting this file. -# Should be equivalent to GITHUB_WORKSPACE if running locally -local_cy_dir = os.path.normpath((os.path.realpath(__file__)) + "/../../..") - -def get_ci_value(env_var: str, default_value: str = "") -> str: - if RUN_LOCAL: - return default_value - else: - return os.environ.get(env_var, default_value) - -# Create a env. dict that is populated from the environment or from defaults. -ci_env = { - # If not running under a CI pipeline defaults are provided that - # will suffice to run scripts that do not use GHA API calls. - # To manually provide environment variable settings, export GITHUB_ACTIONS=true, and provide - # values for all of the environment variables listed. - GITHUB_ACTIONS_ENV_VAR_NAME: 'false' if RUN_LOCAL else 'true', # type: ignore - # This is used as a unique tag for all instances launched in a workflow - 'GITHUB_RUN_ID': get_ci_value('GITHUB_RUN_ID'), - # Self explanatory - 'GITHUB_SHA': get_ci_value('GITHUB_SHA'), - # Multiple clones of the Chipyard repository exists on a CI machine. We expect state - # to persist between jobs in a workflow and faciliate that by having jobs run - # out of a centralized clone (REMOTE_WORK_DIR)-- not the default clones setup by - # the GHA runners (GITHUB_WORKSPACE) - # This is the location of the clone setup by the GHA runner infrastructure by default - # expanduser to replace the ~ present in the default, for portability - 'GITHUB_WORKSPACE': os.path.expanduser(os.environ['GITHUB_WORKSPACE']) if not RUN_LOCAL else local_cy_dir, - # Self explanatory - 'GITHUB_API_URL': get_ci_value('GITHUB_API_URL'), - # We look this up, instead of hardcoding "ucb-bar/chipyard", to support running - # this CI pipeline under forks. - 'GITHUB_REPOSITORY': get_ci_value('GITHUB_REPOSITORY'), - # Path to webhook payload on the runner machine - 'GITHUB_EVENT_PATH': get_ci_value('GITHUB_EVENT_PATH'), - # Chipyard repo used on local CI machine to run tests from (cached across all workflow CI jobs) - # CI scripts should refer variables - # derived from this path so that they may be reused across workflows that may - # initialize the Chipyard repository differently (e.g., as a submodule of a - # larger project.) - 'REMOTE_WORK_DIR': get_ci_value('REMOTE_WORK_DIR', local_cy_dir if RUN_LOCAL else ""), - # Github token with more permissions to access repositories across the FireSim org. - 'PERSONAL_ACCESS_TOKEN': get_ci_value('PERSONAL_ACCESS_TOKEN'), - # Path to Chipyard's HWDB file (if it exists) - 'CHIPYARD_HWDB_PATH': get_ci_value('CHIPYARD_HWDB_PATH'), - # Org/repo name of repository to store build bitstreams - 'GH_ORG': get_ci_value('GH_ORG'), - 'GH_REPO': get_ci_value('GH_REPO'), -} - -# for most uses these should be used (over using GITHUB_WORKSPACE) -remote_cy_dir = ci_env['REMOTE_WORK_DIR'] -remote_fsim_dir = ci_env['REMOTE_WORK_DIR'] + "/sims/firesim" diff --git a/.github/scripts/clean-old-files.sh b/.github/scripts/clean-old-files.sh deleted file mode 100755 index 5824c4b74f..0000000000 --- a/.github/scripts/clean-old-files.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# clean directories that are older than 14 days -# argument is used as the directory to look in - -age () { - local AGE_SEC - local CUR_SEC - local DIFF_SEC - local SEC_PER_DAY - - SEC_PER_DAY=86400 - - CUR_SEC=$(date +%s) - AGE_SEC=$(stat -c %Y -- "$1") - DIFF_SEC=$(expr $CUR_SEC - $AGE_SEC) - - echo $(expr $DIFF_SEC / $SEC_PER_DAY) -} - -for d in $1/*/ ; do - DIR_AGE="$(age $d)" - if [ $DIR_AGE -ge 14 ]; then - echo "Deleting $d since is it $DIR_AGE old" - rm -rf $d - else - echo "Keep $d since it is $DIR_AGE old" - fi -done diff --git a/.github/scripts/config_build_f2.yaml b/.github/scripts/config_build_f2.yaml new file mode 100644 index 0000000000..b833af15bf --- /dev/null +++ b/.github/scripts/config_build_f2.yaml @@ -0,0 +1,47 @@ +# Build-time configuration for rebuilding and publishing Chipyard's AWS F2 +# AGFIs from an existing FireSim manager. + +build_farm: + base_recipe: build-farm-recipes/aws_ec2.yaml + recipe_arg_overrides: + build_farm_tag: mainbuildfarm + instance_type: m8i.4xlarge + build_instance_market: spot + spot_interruption_behavior: terminate + spot_max_price: "0.5" + default_build_dir: /home/ubuntu/firesim-build + +builds_to_run: + - firesim_rocket_quadcore_nic_l2_llc4mb_ddr3 + - firesim_rocket_quadcore_no_nic_l2_llc4mb_ddr3 + - firesim_boom_singlecore_nic_l2_llc4mb_ddr3 + - firesim_boom_singlecore_no_nic_l2_llc4mb_ddr3 + - firesim_megaboom_singlecore_no_nic_l2_llc4mb_ddr3 + # - firesim_supernode_rocket_singlecore_nic_l2_lbp + - firesim_rocket_singlecore_no_nic_l2_lbp + # - firesim_rocket_singlecore_sha3_nic_l2_llc4mb_ddr3 + # - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3 + # - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3_printf + - firesim_gemmini_printf_rocket_singlecore_no_nic + - firesim_gemmini_rocket_singlecore_no_nic + - firesim_saturn_REFV256D128_rocket_singlecore_no_nic_l2_llc4mb_ddr3 + - firesim_saturn_GENV256D128_shuttle_singlecore_no_nic_l2_llc4mb_ddr3 + +agfis_to_share: + - firesim_rocket_quadcore_nic_l2_llc4mb_ddr3 + - firesim_rocket_quadcore_no_nic_l2_llc4mb_ddr3 + - firesim_boom_singlecore_nic_l2_llc4mb_ddr3 + - firesim_boom_singlecore_no_nic_l2_llc4mb_ddr3 + - firesim_megaboom_singlecore_no_nic_l2_llc4mb_ddr3 + # - firesim_supernode_rocket_singlecore_nic_l2_lbp + - firesim_rocket_singlecore_no_nic_l2_lbp + # - firesim_rocket_singlecore_sha3_nic_l2_llc4mb_ddr3 + # - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3 + # - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3_printf + - firesim_gemmini_printf_rocket_singlecore_no_nic + - firesim_gemmini_rocket_singlecore_no_nic + - firesim_saturn_REFV256D128_rocket_singlecore_no_nic_l2_llc4mb_ddr3 + - firesim_saturn_GENV256D128_shuttle_singlecore_no_nic_l2_llc4mb_ddr3 + +share_with_accounts: + public: public diff --git a/.github/scripts/defaults.sh b/.github/scripts/defaults.sh deleted file mode 100755 index 0b354bf734..0000000000 --- a/.github/scripts/defaults.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -# make parallelism -CI_MAKE_NPROC=8 -# chosen based on a 24c system shared with 1 other project -REMOTE_MAKE_NPROC=4 - -# remote variables -REMOTE_WORK_DIR=$GITHUB_WORKSPACE -REMOTE_CHIPYARD_DIR=$GITHUB_WORKSPACE -REMOTE_SIM_DIR=$REMOTE_CHIPYARD_DIR/sims/verilator -REMOTE_FIRESIM_DIR=$REMOTE_CHIPYARD_DIR/sims/firesim/sim -REMOTE_FPGA_DIR=$REMOTE_CHIPYARD_DIR/fpga - -# local variables (aka within the docker container) -LOCAL_CHIPYARD_DIR=$GITHUB_WORKSPACE -LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator -LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim - -# CI uses temp directories with very long names -# explicitly force socket creation to use /tmp to avoid name length errors -# https://github.com/sbt/sbt/pull/6887 -REMOTE_JAVA_TMP_DIR=$(mktemp -d -t ci-cy-XXXXXXXX) -REMOTE_COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache - -# key value store to get the build groups -declare -A grouping -grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boomv3 chipyard-boomv4 chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone chipyard-prefetchers chipyard-shuttle chipyard-shuttle3 chipyard-vexiiriscv chipyard-tacit-rocket chipyard-radiance" -grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboomv3 chipyard-dmiboomv4 chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered chipyard-symmetric chipyard-llcchiplet" -grouping["group-accels"]="chipyard-compressacc chipyard-mempress chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb chipyard-rerocc chipyard-rocketvector chipyard-shuttlevector chipyard-hlsacc" # chipyard-shuttleara - Add when Ara works again -grouping["group-constellation"]="chipyard-constellation" -grouping["group-tracegen"]="tracegen tracegen-boomv3 tracegen-boomv4" -grouping["group-other"]="icenet testchipip constellation rocketchip-amba rocketchip-tlsimple rocketchip-tlwidth rocketchip-tlxbar chipyard-clusters" -grouping["group-fpga"]="arty35t arty100t genesys2 nexysvideo vc707 vcu118 zcu104" - -# key value store to get the build strings -declare -A mapping -mapping["chipyard-rocket"]=" CONFIG=QuadChannelRocketConfig" -# TODO: Verilator chokes on cospikeCheckpointingRocketConfig -# mapping["chipyard-dmirocket"]=" CONFIG=dmiCospikeCheckpointingRocketConfig" -mapping["chipyard-dmirocket"]=" CONFIG=dmiRocketConfig" -mapping["chipyard-mempress"]=" CONFIG=MempressRocketConfig" -mapping["chipyard-compressacc"]=" CONFIG=ZstdCompressorRocketConfig" -mapping["chipyard-hlsacc"]=" CONFIG=GCDHLSRocketConfig" -mapping["chipyard-prefetchers"]=" CONFIG=PrefetchingRocketConfig" -mapping["chipyard-digitaltop"]=" TOP=DigitalTop" -mapping["chipyard-manymmioaccels"]=" CONFIG=ManyMMIOAcceleratorRocketConfig" -mapping["chipyard-nvdla"]=" CONFIG=SmallNVDLARocketConfig verilog" -mapping["chipyard-hetero"]=" CONFIG=LargeBoomAndRocketConfig" -mapping["chipyard-boomv3"]=" CONFIG=MediumBoomV3CosimConfig" -mapping["chipyard-dmiboomv3"]=" CONFIG=dmiCheckpointingMediumBoomV3Config" -mapping["chipyard-boomv4"]=" CONFIG=MediumBoomV4CosimConfig" -mapping["chipyard-dmiboomv4"]=" CONFIG=dmiCheckpointingMediumBoomV4Config" -mapping["chipyard-spike"]=" CONFIG=SpikeZicntrConfig EXTRA_SIM_FLAGS='+spike-ipc=10'" -mapping["chipyard-gemmini"]=" CONFIG=GemminiRocketConfig" -mapping["chipyard-cva6"]=" CONFIG=CVA6Config" -mapping["chipyard-ibex"]=" CONFIG=IbexConfig" -mapping["chipyard-vexiiriscv"]=" CONFIG=VexiiRiscvConfig" -mapping["chipyard-spiflashwrite"]=" CONFIG=SmallSPIFlashRocketConfig EXTRA_SIM_FLAGS='+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img'" -mapping["chipyard-manyperipherals"]=" CONFIG=ManyPeripheralsRocketConfig EXTRA_SIM_FLAGS='+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img'" -mapping["chipyard-chiplike"]=" CONFIG=ChipLikeRocketConfig MODEL=FlatTestHarness MODEL_PACKAGE=chipyard.example verilog" -mapping["chipyard-tethered"]=" CONFIG=VerilatorCITetheredChipLikeRocketConfig" -mapping["chipyard-symmetric"]=" CONFIG=MultiSimMultiLinkSymmetricChipletRocketConfig" -mapping["chipyard-llcchiplet"]=" CONFIG=MultiSimLLCChipletRocketConfig" -mapping["chipyard-cloneboom"]=" CONFIG=Cloned64MegaBoomV3Config verilog" -mapping["chipyard-nocores"]=" CONFIG=NoCoresConfig verilog" -mapping["tracegen"]=" CONFIG=NonBlockingTraceGenL2Config" -mapping["tracegen-boomv3"]=" CONFIG=BoomV3TraceGenConfig" -mapping["tracegen-boomv4"]=" CONFIG=BoomV4TraceGenConfig" -mapping["chipyard-sodor"]=" CONFIG=Sodor5StageConfig" -mapping["chipyard-shuttle"]=" CONFIG=ShuttleConfig" -mapping["chipyard-shuttle3"]=" CONFIG=Shuttle3WideConfig" -mapping["chipyard-tacit-rocket"]=" CONFIG=TacitRocketConfig" -mapping["chipyard-multiclock-rocket"]=" CONFIG=MulticlockRocketConfig" -mapping["chipyard-nomem-scratchpad"]=" CONFIG=MMIOScratchpadOnlyRocketConfig" -mapping["chipyard-constellation"]=" CONFIG=SharedNoCConfig" -mapping["chipyard-clusters"]=" CONFIG=ClusteredRocketConfig verilog" -mapping["chipyard-aes256ecb"]=" CONFIG=AES256ECBRocketConfig" -mapping["chipyard-rerocc"]=" CONFIG=ReRoCCTestConfig" -mapping["chipyard-rocketvector"]=" CONFIG=MINV128D64RocketConfig" -mapping["chipyard-shuttlevector"]=" CONFIG=GENV256D128ShuttleConfig" -mapping["chipyard-shuttleara"]=" CONFIG=V4096Ara2LaneShuttleConfig USE_ARA=1 verilog" -mapping["chipyard-radiance"]=" CONFIG=RadianceFP16ClusterConfig verilog" - -mapping["constellation"]=" SUB_PROJECT=constellation" -mapping["icenet"]="SUB_PROJECT=icenet" -mapping["testchipip"]="SUB_PROJECT=testchipip" -mapping["rocketchip-amba"]="SUB_PROJECT=rocketchip CONFIG=AMBAUnitTestConfig" -mapping["rocketchip-tlsimple"]="SUB_PROJECT=rocketchip CONFIG=TLSimpleUnitTestConfig" -mapping["rocketchip-tlwidth"]="SUB_PROJECT=rocketchip CONFIG=TLWidthUnitTestConfig" -mapping["rocketchip-tlxbar"]="SUB_PROJECT=rocketchip CONFIG=TLXbarUnitTestConfig" - -mapping["arty35t"]="SUB_PROJECT=arty35t verilog" -mapping["arty100t"]="SUB_PROJECT=arty100t verilog" -mapping["genesys2"]="SUB_PROJECT=genesys2 verilog" -mapping["nexysvideo"]="SUB_PROJECT=nexysvideo verilog" -mapping["vc707"]="SUB_PROJECT=vc707 verilog" -mapping["vcu118"]="SUB_PROJECT=vcu118 verilog" -mapping["zcu104"]="SUB_PROJECT=zcu104 verilog" diff --git a/.github/scripts/fabric_cfg.py b/.github/scripts/fabric_cfg.py deleted file mode 100644 index ba1043a3c6..0000000000 --- a/.github/scripts/fabric_cfg.py +++ /dev/null @@ -1,9 +0,0 @@ -from fabric.api import env # type: ignore - -# Common fabric settings -env.output_prefix = False -env.abort_on_prompts = True -env.timeout = 100 -env.connection_attempts = 10 -env.disable_known_hosts = True -env.keepalive = 60 # keep long SSH connections running diff --git a/.github/scripts/generate-generator-release-notes.sh b/.github/scripts/generate-generator-release-notes.sh new file mode 100755 index 0000000000..35c08512cb --- /dev/null +++ b/.github/scripts/generate-generator-release-notes.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: .github/scripts/generate-generator-release-notes.sh [base-tag] + +Generate .github/-release.log for every generator submodule. Each +file contains the submodule's git log from the commit pinned by base-tag to the +commit pinned by the current Chipyard HEAD. + +If base-tag is omitted, the nearest tag reachable before HEAD is used. Set +SKIP_FETCH=1 to use only locally available Chipyard tags and submodule refs. +EOF +} + +if [ "$#" -gt 1 ]; then + usage >&2 + exit 2 +fi +if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then + usage + exit 0 +fi + +REPO_DIR="$(git rev-parse --show-toplevel)" +OUTPUT_DIR="${REPO_DIR}/.github" +TARGET_COMMIT="$(git -C "${REPO_DIR}" rev-parse HEAD^{commit})" + +if [ "${SKIP_FETCH:-0}" != "1" ]; then + echo "Fetching Chipyard tags from origin." + git -C "${REPO_DIR}" fetch --tags origin +fi + +if [ -n "${1:-}" ]; then + BASE_TAG="$1" +else + if ! BASE_TAG="$(git -C "${REPO_DIR}" describe --tags --abbrev=0 "${TARGET_COMMIT}^")"; then + echo "Could not find a tag before ${TARGET_COMMIT}. Pass the base tag explicitly." >&2 + exit 1 + fi +fi + +BASE_COMMIT="$(git -C "${REPO_DIR}" rev-parse "${BASE_TAG}^{commit}")" +echo "Generating generator release logs for ${BASE_TAG} (${BASE_COMMIT})..HEAD (${TARGET_COMMIT})." + +mapfile -t generator_paths < <( + git -C "${REPO_DIR}" config --file .gitmodules --get-regexp '^submodule\..*\.path$' \ + | awk '$2 ~ /^generators\// { print $2 }' \ + | sort -u +) + +if [ "${#generator_paths[@]}" -eq 0 ]; then + echo "No generator submodules found in .gitmodules." >&2 + exit 1 +fi + +for generator_path in "${generator_paths[@]}"; do + generator_name="${generator_path##*/}" + output_path="${OUTPUT_DIR}/${generator_name}-release.log" + + new_entry="$(git -C "${REPO_DIR}" ls-tree "${TARGET_COMMIT}" -- "${generator_path}")" + if [ -z "${new_entry}" ] || [ "${new_entry%% *}" != "160000" ]; then + echo "Expected ${generator_path} to be a submodule at ${TARGET_COMMIT}." >&2 + exit 1 + fi + new_commit="$(awk '{ print $3 }' <<< "${new_entry}")" + + old_entry="$(git -C "${REPO_DIR}" ls-tree "${BASE_COMMIT}" -- "${generator_path}")" + if [ -n "${old_entry}" ] && [ "${old_entry%% *}" = "160000" ]; then + old_commit="$(awk '{ print $3 }' <<< "${old_entry}")" + else + old_commit="" + fi + + if ! git -C "${REPO_DIR}/${generator_path}" rev-parse --git-dir >/dev/null 2>&1; then + if [ "${SKIP_FETCH:-0}" = "1" ]; then + echo "${generator_path} is not initialized and SKIP_FETCH=1 was requested." >&2 + exit 1 + fi + echo "Initializing ${generator_path}." + git -C "${REPO_DIR}" submodule update --init -- "${generator_path}" + fi + + if [ "${SKIP_FETCH:-0}" != "1" ]; then + echo "Fetching ${generator_path} from origin." + git -C "${REPO_DIR}/${generator_path}" fetch origin + fi + + if ! git -C "${REPO_DIR}/${generator_path}" cat-file -e "${new_commit}^{commit}" 2>/dev/null; then + git -C "${REPO_DIR}/${generator_path}" fetch origin "${new_commit}" + fi + + if [ -n "${old_commit}" ]; then + if ! git -C "${REPO_DIR}/${generator_path}" cat-file -e "${old_commit}^{commit}" 2>/dev/null; then + git -C "${REPO_DIR}/${generator_path}" fetch origin "${old_commit}" + fi + git -C "${REPO_DIR}/${generator_path}" log --no-color "${old_commit}..${new_commit}" > "${output_path}" + commit_count="$(git -C "${REPO_DIR}/${generator_path}" rev-list --count "${old_commit}..${new_commit}")" + echo "Wrote ${output_path} (${commit_count} commits; ${old_commit}..${new_commit})." + else + # A generator added after the base tag has no old gitlink. Include all + # history reachable from the first Chipyard-pinned commit. + git -C "${REPO_DIR}/${generator_path}" log --no-color "${new_commit}" > "${output_path}" + commit_count="$(git -C "${REPO_DIR}/${generator_path}" rev-list --count "${new_commit}")" + echo "Wrote ${output_path} (${commit_count} commits; generator was not present in ${BASE_TAG})." + fi +done diff --git a/.github/scripts/github_common.py b/.github/scripts/github_common.py deleted file mode 100644 index 7c638a1b03..0000000000 --- a/.github/scripts/github_common.py +++ /dev/null @@ -1,14 +0,0 @@ -from fabric.api import prefix, run # type: ignore - -# move and commit a binary file to a Github repository. -# it is another persons job to create the repository and push it (to avoid needing an SSH key here). -# by default this uses the bar-tender bot credentials. -def move_and_commit_gh_file(local_abs_file_path, gh_rel_file_path, repo_path, commit_msg): - print(f":DEBUG: Attempting to commit {local_abs_file_path} to {repo_path}/{gh_rel_file_path}") - - with prefix(f"cd {repo_path}"): - run(f"mv {local_abs_file_path} ./{gh_rel_file_path}") - run(f"git add -u") - run(f"""git commit -m "{commit_msg}" --author="bar-tender " """) - # return the sha of the commit you added - return run("git rev-parse HEAD") diff --git a/.github/scripts/install-conda.sh b/.github/scripts/install-conda.sh deleted file mode 100755 index b6fcce1891..0000000000 --- a/.github/scripts/install-conda.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash - -export HOME="${HOME:-/root}" - -CONDA_INSTALL_PREFIX=/opt/conda -CONDA_INSTALLER_VERSION=23.1.0-1 -CONDA_INSTALLER="https://github.com/conda-forge/miniforge/releases/download/${CONDA_INSTALLER_VERSION}/Miniforge3-${CONDA_INSTALLER_VERSION}-Linux-x86_64.sh" -CONDA_CMD="conda" # some installers install mamba or micromamba - -DRY_RUN_OPTION="" -DRY_RUN_ECHO=() -REINSTALL_CONDA=0 - -usage() -{ - echo "Usage: $0 [options]" - echo - echo "Options:" - echo "[--help] List this help" - echo "[--prefix ] Install prefix for conda. Defaults to /opt/conda." - echo " If /bin/conda already exists, it will be used and install is skipped." - echo "[--dry-run] Pass-through to all conda commands and only print other commands." - echo " NOTE: --dry-run will still install conda to --prefix" - echo "[--reinstall-conda] Repairs a broken base environment by reinstalling." - echo " NOTE: will only reinstall conda and exit" - echo - echo "Examples:" - echo " % $0" - echo " Install into default system-wide prefix (using sudo if needed) and add install to system-wide /etc/profile.d" - echo " % $0 --prefix ~/conda" - echo " Install into $HOME/conda" -} - - -while [ $# -gt 0 ]; do - case "$1" in - --help) - usage - exit 1 - ;; - --prefix) - shift - CONDA_INSTALL_PREFIX="$1" - shift - ;; - --dry-run) - shift - DRY_RUN_OPTION="--dry-run" - DRY_RUN_ECHO=(echo "Would Run:") - ;; - --reinstall-conda) - shift - REINSTALL_CONDA=1 - ;; - *) - echo "Invalid Argument: $1" - usage - exit 1 - ;; - esac -done - -if [[ $REINSTALL_CONDA -eq 1 && -n "$DRY_RUN_OPTION" ]]; then - echo "::ERROR:: --dry-run and --reinstall-conda are mutually exclusive. Pick one or the other." -fi - -set -ex -set -o pipefail - -# uname options are not portable so do what https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#uname-is-system-specific -# suggests and iteratively probe the system type -if ! type uname >&/dev/null; then - echo "::ERROR:: need 'uname' command available to determine if we support this sytem" - exit 1 -fi - -if [[ "$(uname)" != "Linux" ]]; then - echo "::ERROR:: $0 only supports 'Linux' not '$(uname)'" - exit 1 -fi - -if [[ "$(uname -mo)" != "x86_64 GNU/Linux" ]]; then - echo "::ERROR:: $0 only supports 'x86_64 GNU/Linux' not '$(uname -io)'" - exit 1 -fi - -if [[ ! -r /etc/os-release ]]; then - echo "::ERROR:: $0 depends on /etc/os-release for distro-specific setup and it doesn't exist here" - exit 1 -fi - -OS_FLAVOR=$(grep '^ID=' /etc/os-release | awk -F= '{print $2}' | tr -d '"') -OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | awk -F= '{print $2}' | tr -d '"') - -# platform-specific setup -case "$OS_FLAVOR" in - ubuntu) - ;; - centos) - ;; - *) - echo "::ERROR:: Unknown OS flavor '$OS_FLAVOR'. Unable to do platform-specific setup." - exit 1 - ;; -esac - - -# everything else is platform-agnostic and could easily be expanded to Windows and/or OSX - -SUDO="" -prefix_parent=$(dirname "$CONDA_INSTALL_PREFIX") -if [[ ! -e "$prefix_parent" ]]; then - mkdir -p "$prefix_parent" || SUDO=sudo -elif [[ ! -w "$prefix_parent" ]]; then - SUDO=sudo -fi - -if [[ -n "$SUDO" ]]; then - echo "::INFO:: using 'sudo' to install conda" - # ensure files are read-execute for everyone - umask 022 -fi - -if [[ -n "$SUDO" || "$(id -u)" == 0 ]]; then - INSTALL_TYPE=system -else - INSTALL_TYPE=user -fi - -# to enable use of sudo and avoid modifying 'secure_path' in /etc/sudoers, we specify the full path to conda -CONDA_EXE="${CONDA_INSTALL_PREFIX}/bin/$CONDA_CMD" - -if [[ -x "$CONDA_EXE" && $REINSTALL_CONDA -eq 0 ]]; then - echo "::INFO:: '$CONDA_EXE' already exists, skipping conda install" -else - wget -O install_conda.sh "$CONDA_INSTALLER" || curl -fsSLo install_conda.sh "$CONDA_INSTALLER" - if [[ $REINSTALL_CONDA -eq 1 ]]; then - conda_install_extra="-u" - echo "::INFO:: RE-installing conda to '$CONDA_INSTALL_PREFIX'" - else - conda_install_extra="" - echo "::INFO:: installing conda to '$CONDA_INSTALL_PREFIX'" - fi - # -b for non-interactive install - $SUDO bash ./install_conda.sh -b -p "$CONDA_INSTALL_PREFIX" $conda_install_extra - rm ./install_conda.sh - - # get most up-to-date conda version - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" update $DRY_RUN_OPTION -y -n base -c conda-forge conda - - # see https://conda-forge.org/docs/user/tipsandtricks.html#multiple-channels - # for more information on flexible channel_priority - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" config --system --set channel_priority flexible - # By default, don't mess with people's PS1, I personally find it annoying - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" config --system --set changeps1 false - # don't automatically activate the 'base' environment when initializing shells - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" config --system --set auto_activate_base false - # automatically use the ucb-bar channel for specific packages https://anaconda.org/ucb-bar/repo - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" config --system --add channels ucb-bar - - # conda-build is a special case and must always be installed into the base environment - $SUDO "$CONDA_EXE" install $DRY_RUN_OPTION -y -n base conda-build - - # conda-libmamba-solver is a special case and must always be installed into the base environment - # see https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community - $SUDO "$CONDA_EXE" install $DRY_RUN_OPTION -y -n base conda-libmamba-solver - - # Use the fast solver by default - "${DRY_RUN_ECHO[@]}" $SUDO "$CONDA_EXE" config --system --set experimental_solver libmamba - - # conda-lock is a special case and must always be installed into the base environment - $SUDO "$CONDA_EXE" install $DRY_RUN_OPTION -y -n base conda-lock=1.4 - - conda_init_extra_args=() - if [[ "$INSTALL_TYPE" == system ]]; then - # if we're installing into a root-owned directory using sudo, or we're already root - # initialize conda in the system-wide rcfiles - conda_init_extra_args=(--no-user --system) - fi - $SUDO "${CONDA_EXE}" init $DRY_RUN_OPTION "${conda_init_extra_args[@]}" bash - - if [[ $REINSTALL_CONDA -eq 1 ]]; then - echo "::INFO:: Done reinstalling conda. Exiting" - exit 0 - fi -fi diff --git a/.github/scripts/prepare-generator-test-submodules.sh b/.github/scripts/prepare-generator-test-submodules.sh new file mode 100755 index 0000000000..04ef8636d0 --- /dev/null +++ b/.github/scripts/prepare-generator-test-submodules.sh @@ -0,0 +1,159 @@ +#!/usr/bin/env bash +set -euo pipefail + +test_name="${1:?usage: prepare-generator-test-submodules.sh TEST_NAME [CHIPYARD_DIR] [TESTS_JSON]}" +chipyard_dir="${2:-/home/ubuntu/chipyard}" +tests_json="${3:-${chipyard_dir}/.github/workflows/config/generator-tests.json}" + +is_empty_dir() { + local path="$1" + [ ! -d "${path}" ] || [ -z "$(find "${path}" -mindepth 1 -maxdepth 1 -print -quit 2>/dev/null)" ] +} + +update_submodule_if_needed() { + local repo_dir="$1" + local submodule_path="$2" + local abs_path="${repo_dir}/${submodule_path}" + local status + local state + + status="$(git -C "${repo_dir}" submodule status -- "${submodule_path}" 2>/dev/null || true)" + if [ -z "${status}" ]; then + echo "No submodule named ${submodule_path} under ${repo_dir}" >&2 + exit 1 + fi + + state="${status:0:1}" + if [ "${state}" = "-" ] || [ "${state}" = "+" ] || is_empty_dir "${abs_path}"; then + echo "Initializing/updating BINARY owner submodule: ${submodule_path}" + git -C "${repo_dir}" submodule sync -- "${submodule_path}" + git -C "${repo_dir}" submodule update --init -- "${submodule_path}" + else + echo "BINARY owner submodule already initialized: ${submodule_path}" + fi +} + +submodule_paths="$( + git -C "${chipyard_dir}" config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null \ + | awk '{ print $2 }' +)" + +owner_submodule_for_path() { + local path="$1" + local best="" + local submodule_path + + while IFS= read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + if [ "${path}" = "${submodule_path}" ] || [[ "${path}" == "${submodule_path}/"* ]]; then + if [ "${#submodule_path}" -gt "${#best}" ]; then + best="${submodule_path}" + fi + fi + done <<< "${submodule_paths}" + + printf "%s\n" "${best}" +} + +binary_paths_for_test() { + python3 - "${tests_json}" "${test_name}" "${chipyard_dir}" <<'PY' +import json +import os +import re +import shlex +import sys + +tests_json, test_name, chipyard_dir = sys.argv[1], sys.argv[2], os.path.abspath(sys.argv[3]) +sim_dir = os.path.join(chipyard_dir, "sims", "verilator") + +with open(tests_json, encoding="utf-8") as tests_file: + tests = json.load(tests_file) + +entries = tests.get(test_name, []) +env = { + "LOCAL_CHIPYARD_DIR": chipyard_dir, + "LOCAL_SIM_DIR": sim_dir, + "RISCV": os.environ.get("RISCV", "$RISCV"), +} + +def expand(value, local_env): + def replacement(match): + name = match.group("braced") or match.group("plain") + return local_env.get(name, os.environ.get(name, match.group(0))) + + return re.sub( + r"\$(?:\{(?P[A-Za-z_][A-Za-z0-9_]*)\}|(?P[A-Za-z_][A-Za-z0-9_]*))", + replacement, + value, + ) + +def maybe_print_chipyard_relative(path): + if path in ("", "none"): + return + + path = os.path.normpath(path) + if not os.path.isabs(path): + path = os.path.normpath(os.path.join(sim_dir, path)) + + try: + relpath = os.path.relpath(path, chipyard_dir) + except ValueError: + return + + if relpath == "." or relpath.startswith(".."): + return + + print(relpath) + +def collect_command_binaries(command): + if not isinstance(command, str): + return + + local_env = dict(env) + try: + tokens = shlex.split(command) + except ValueError as err: + print(f"Could not parse command for BINARY paths: {err}: {command}", file=sys.stderr) + return + + for token in tokens: + if "=" not in token: + continue + name, value = token.split("=", 1) + if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): + continue + expanded = expand(value, local_env) + local_env[name] = expanded + if name == "BINARY": + maybe_print_chipyard_relative(expanded) + +for entry in entries: + if not isinstance(entry, dict): + continue + for binary in entry.get("binary") or []: + maybe_print_chipyard_relative(expand(str(binary), env)) + collect_command_binaries(entry.get("string")) +PY +} + +declare -A required_roots=() + +cd "${chipyard_dir}" +git config --global --add safe.directory "*" 2>/dev/null || true + +while IFS= read -r binary_path; do + [ -n "${binary_path}" ] || continue + owner="$(owner_submodule_for_path "${binary_path}")" + if [ -n "${owner}" ]; then + required_roots["${owner}"]=1 + fi +done < <(binary_paths_for_test | sort -u) + +if [ "${#required_roots[@]}" -eq 0 ]; then + echo "No BINARY paths for ${test_name} require submodule initialization" + exit 0 +fi + +for root in "${!required_roots[@]}"; do + update_submodule_if_needed "${chipyard_dir}" "${root}" +done diff --git a/.github/scripts/remote-do-rtl-build.sh b/.github/scripts/remote-do-rtl-build.sh deleted file mode 100755 index e765414abb..0000000000 --- a/.github/scripts/remote-do-rtl-build.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# create the different verilator builds -# usage: -# do-rtl-build.sh sim -# run rtl build for simulations and copy back results -# do-rtl-build.sh fpga -# run rtl build for fpga and don't copy back results - -# turn echo on and error on earliest command -set -ex - -# get shared variables -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -source $SCRIPT_DIR/defaults.sh - -cd $REMOTE_CHIPYARD_DIR -git submodule sync -./scripts/init-submodules-no-riscv-tools.sh --full - -# Constellation can run without espresso, but this improves -# elaboration time drastically -pushd $REMOTE_CHIPYARD_DIR/generators/constellation -scripts/install-espresso.sh $RISCV -popd - -if [ $1 = "group-accels" ]; then - pushd $REMOTE_CHIPYARD_DIR/generators/gemmini/software - git submodule update --init --recursive gemmini-rocc-tests - pushd gemmini-rocc-tests - ./build.sh - popd - popd -fi - -# choose what make dir to use -case $2 in - "sim") - REMOTE_MAKE_DIR=$REMOTE_SIM_DIR - ;; - "fpga") - REMOTE_MAKE_DIR=$REMOTE_FPGA_DIR - ;; -esac - -# enter the verilator directory and build the specific config on remote server -make -C $REMOTE_MAKE_DIR clean - -read -a keys <<< ${grouping[$1]} - -# need to set the PATH to use the new verilator (with the new verilator root) -for key in "${keys[@]}" -do - export COURSIER_CACHE=$REMOTE_COURSIER_CACHE - export JVM_MEMORY=10G - export JAVA_TMP_DIR=$REMOTE_JAVA_TMP_DIR - make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR ${mapping[$key]} -done diff --git a/.github/scripts/run-firesim-tests.sh b/.github/scripts/run-firesim-tests.sh new file mode 100755 index 0000000000..c50d7cd246 --- /dev/null +++ b/.github/scripts/run-firesim-tests.sh @@ -0,0 +1,149 @@ +#!/usr/bin/env bash +set -euo pipefail + +suite="${1:?usage: run-firesim-tests.sh SUITE PR_NUMBER [CHIPYARD_DIR] [CONFIG_JSON]}" +pr_number="${2:?usage: run-firesim-tests.sh SUITE PR_NUMBER [CHIPYARD_DIR] [CONFIG_JSON]}" +chipyard_dir="${3:-/home/ubuntu/chipyard}" +config_json="${4:-${chipyard_dir}/.github/workflows/config/firesim-tests.json}" + +echo "FireSim test suite: ${suite}" +echo "FireSim test timeout: ${FIRESIM_TEST_TIMEOUT_SECONDS:-7200}s" +echo "FireSim heartbeat interval: ${FIRESIM_HEARTBEAT_SECONDS:-60}s" +echo "FireSim Java heap size: ${JAVA_HEAP_SIZE:-FireSim default}" +echo "FireSim Verilator make flags: ${VERILATOR_MAKEFLAGS:-FireSim default}" + +source_with_nounset_disabled() { + local script="$1" + shift + local had_nounset=0 + + case "$-" in + *u*) + had_nounset=1 + set +u + ;; + esac + + # Conda activation/deactivation hooks can reference optional backup + # variables that are unset under bash nounset. + # shellcheck disable=SC1090 + source "${script}" "$@" + + if [ "${had_nounset}" -eq 1 ]; then + set -u + fi +} + +prepare_firesim_environment() { + cd "${chipyard_dir}/sims/firesim" + source_with_nounset_disabled sourceme-manager.sh --skip-ssh-setup +} + +prepare_f2_mgmt_tools() { + cd "${chipyard_dir}/sims/firesim/platforms/f2/aws-fpga-firesim-f2/sdk/userspace" + export AWS_FPGA_REPO_DIR + AWS_FPGA_REPO_DIR="$(git rev-parse --show-toplevel)" + bash ./mkall_fpga_mgmt_tools.sh +} + +run_with_heartbeat() { + local timeout_seconds="${1:?timeout required}" + shift + local heartbeat_seconds="${FIRESIM_HEARTBEAT_SECONDS:-60}" + local command_display="$*" + local heartbeat_pid + local rc + local had_errexit=0 + + ( + local elapsed=0 + while true; do + sleep "${heartbeat_seconds}" + elapsed=$((elapsed + heartbeat_seconds)) + printf '[%s] still running after %ss: %s\n' \ + "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + "${elapsed}" \ + "${command_display}" + done + ) & + heartbeat_pid="$!" + + case "$-" in + *e*) + had_errexit=1 + set +e + ;; + esac + + timeout --foreground --kill-after=60s "${timeout_seconds}s" "$@" + rc="$?" + + kill "${heartbeat_pid}" 2>/dev/null || true + wait "${heartbeat_pid}" 2>/dev/null || true + + if [ "${had_errexit}" -eq 1 ]; then + set -e + fi + + if [ "${rc}" -eq 124 ]; then + echo "Timed out after ${timeout_seconds}s: ${command_display}" >&2 + elif [ "${rc}" -eq 137 ]; then + echo "Timed out and was force-killed after ${timeout_seconds}s: ${command_display}" >&2 + fi + + return "${rc}" +} + +run_firesim_scala_test() { + local test_class="$1" + local timeout_seconds="${FIRESIM_TEST_TIMEOUT_SECONDS:-7200}" + + if ! [[ "${test_class}" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then + echo "Invalid FireSim Scala test class name: ${test_class}" >&2 + exit 1 + fi + + if ! grep -Eq "class[[:space:]]+${test_class}([[:space:]({]|$)" \ + "${chipyard_dir}/generators/firechip/chip/src/test/scala/FireSimTestSuite.scala"; then + echo "FireSim Scala test class does not exist: ${test_class}" >&2 + exit 1 + fi + + cd "${chipyard_dir}" + echo "========== FireSim Scala test: firechip.chip.${test_class} ==========" + run_with_heartbeat \ + "${timeout_seconds}" \ + env TEST_DISABLE_VCS=1 TEST_DISABLE_VIVADO=1 \ + sbt "project firechip; testOnly firechip.chip.${test_class}" +} + +prepare_firesim_environment + +if [ "${suite}" = "f2" ]; then + prepare_f2_mgmt_tools +fi + +while IFS= read -r test_class; do + run_firesim_scala_test "${test_class}" +done < <( + python3 - "${config_json}" "${suite}" <<'PY' +import json +import sys + +config_json, suite = sys.argv[1], sys.argv[2] +with open(config_json, encoding="utf-8") as config_file: + config = json.load(config_file) + +if suite not in config: + print(f"Unknown FireSim test suite: {suite}", file=sys.stderr) + sys.exit(1) + +tests = config[suite] +if not isinstance(tests, list): + print(f"FireSim suite {suite} must be a list of Scala test class names", file=sys.stderr) + sys.exit(1) + +for test in tests: + print(test) +PY +) diff --git a/.github/scripts/run-generator-test.py b/.github/scripts/run-generator-test.py new file mode 100644 index 0000000000..c9180d68c3 --- /dev/null +++ b/.github/scripts/run-generator-test.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 + +import argparse +import json +import os +import subprocess +import sys + + +class TestCommandFailed: + def __init__(self, label, command, returncode): + self.label = label + self.command = command + self.returncode = returncode + + +def keep_going_for_test_suites(command): + if command.startswith("make run-asm-tests-fast") or command.startswith("make run-bmark-tests-fast"): + return command.replace("make ", "make -k ", 1) + return command + + +def run_shell(command, chipyard_dir, sim_dir, env, label=None): + command = keep_going_for_test_suites(command) + label = label or command + wrapped = ( + f'source "{chipyard_dir}/env.sh"\n' + f'cd "{sim_dir}"\n' + f'{command}' + ) + print("::group::" + label, flush=True) + print(f"Running: {command}", flush=True) + try: + process = subprocess.Popen( + ["bash", "-leo", "pipefail", "-c", wrapped], + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + bufsize=1, + ) + assert process.stdout is not None + for line in process.stdout: + print(line, end="", flush=True) + returncode = process.wait() + if returncode != 0: + print(f"\nFAILED: {label}", flush=True) + print(f"Command: {command}", flush=True) + print(f"Exit code: {returncode}", flush=True) + print( + f"::error title=Generator test command failed::{label} failed with exit code {returncode}", + flush=True, + ) + return TestCommandFailed(label, command, returncode) + return None + finally: + print("::endgroup::", flush=True) + + +def run_entry(entry, chipyard_dir, sim_dir, env): + failures = [] + + if entry.get("custom") is True: + command = entry.get("string") + if not command: + raise ValueError("custom test entry must include a non-empty string") + failure = run_shell(command, chipyard_dir, sim_dir, env, label=f"custom command: {command}") + return [failure] if failure else [] + + if entry.get("custom") is not False: + raise ValueError("test entry must set custom to true or false") + + configs = entry.get("config") + binaries = entry.get("binary") + loadmem = entry.get("loadmem") + + if not isinstance(configs, list) or not configs: + raise ValueError("non-custom test entry must include a non-empty config list") + if not isinstance(binaries, list) or not binaries: + raise ValueError("non-custom test entry must include a non-empty binary list") + if loadmem != "1": + raise ValueError("non-custom test entries must set loadmem to string value \"1\"") + + for config in configs: + for binary in binaries: + label = f"CONFIG={config} BINARY={binary} LOADMEM=1" + failure = run_shell( + f"make run-binary CONFIG={config} BINARY={binary} LOADMEM=1", + chipyard_dir, + sim_dir, + env, + label=label, + ) + if failure: + failures.append(failure) + + return failures + + +def main(): + parser = argparse.ArgumentParser(description="Run a JSON-defined Chipyard generator test group.") + parser.add_argument("test_name") + parser.add_argument( + "--tests-json", + default="/home/ubuntu/chipyard/.github/workflows/config/generator-tests.json", + ) + parser.add_argument("--chipyard-dir", default="/home/ubuntu/chipyard") + args = parser.parse_args() + + chipyard_dir = os.path.abspath(args.chipyard_dir) + sim_dir = os.path.join(chipyard_dir, "sims", "verilator") + + with open(args.tests_json, encoding="utf-8") as tests_file: + tests = json.load(tests_file) + + if args.test_name not in tests: + print(f"Unknown test group: {args.test_name}", file=sys.stderr) + return 1 + + env = os.environ.copy() + env.setdefault("FORCE_NON_EC2", "1") + env.setdefault("JVM_OPTS", "-Xmx3200m") + env["LOCAL_CHIPYARD_DIR"] = chipyard_dir + env["LOCAL_SIM_DIR"] = sim_dir + + entries = tests[args.test_name] + if not isinstance(entries, list) or not entries: + print(f"Test group {args.test_name} must be a non-empty list", file=sys.stderr) + return 1 + + failures = [] + for entry in entries: + failures.extend(run_entry(entry, chipyard_dir, sim_dir, env)) + + if failures: + print("\n::group::Generator test failure summary", flush=True) + print(f"Generator test failed: {args.test_name}", flush=True) + print(f"Failed command count: {len(failures)}", flush=True) + for index, failure in enumerate(failures, start=1): + print("", flush=True) + print(f"{index}. {failure.label}", flush=True) + print(f" exit code: {failure.returncode}", flush=True) + print(f" command: {failure.command}", flush=True) + print("::endgroup::", flush=True) + return 1 + + print(f"Generator test complete: {args.test_name}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.github/scripts/run-linux-poweroff.py b/.github/scripts/run-linux-poweroff.py deleted file mode 100755 index cf51182149..0000000000 --- a/.github/scripts/run-linux-poweroff.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python3 - -from fabric.api import prefix, run, execute # type: ignore - -import fabric_cfg -from ci_variables import ci_env, remote_fsim_dir, remote_cy_dir -from utils import search_match_in_last_workloads_output_file, create_args, FpgaPlatform, print_last_firesim_log, print_last_firesim_workload, run_warn_only - -args = create_args() -if args.platform != FpgaPlatform.xilinx_alveo_u250: - raise Exception(f"Unable to run this script with {args.platform}") - -def run_linux_poweroff(): - """ Runs Linux Poweroff Tests - All Single-node Tests (Single-core Rocket/BOOM, Multi-core Rocket)""" - - # assumptions: - # - machine-launch-script requirements are already installed - # - repo is already setup fully - - with prefix(f"cd {remote_fsim_dir}"): - with prefix('source sourceme-manager.sh --skip-ssh-setup'): - with prefix(f'cd {remote_cy_dir}/software/firemarshal'): - # build outputs.yaml (use this workload since firemarshal can guestmount) - run("./marshal -v build test/outputs.yaml") - run("./marshal -v install test/outputs.yaml") - - def run_w_timeout(workload_path, config_runtime, workload, timeout, num_passes): - print(f"Starting workload run {workload}.") - log_tail_length = 300 - - def run_firesim_cmd(typ, extra_args = ""): - timeout_prefix = f"timeout {timeout} " - firesim_opts = f"-c {workload_path}/{config_runtime} -a {remote_cy_dir}/sims/firesim-staging/sample_config_hwdb.yaml -r {remote_cy_dir}/sims/firesim-staging/sample_config_build_recipes.yaml" - return run_warn_only(f"{timeout_prefix} firesim {firesim_opts} {extra_args} {typ}", pty=False) - - rc = run_firesim_cmd("launchrunfarm") - if rc != 0: - print_last_firesim_log(log_tail_length) - - rc = run_firesim_cmd("infrasetup") - if rc != 0: - print_last_firesim_log(log_tail_length) - - rc = run_firesim_cmd("runworkload") - if rc != 0: - print_last_firesim_log(log_tail_length) - - # This is a janky solution to the fact the manager does not - # return a non-zero exit code or some sort of result summary. - # The expectation here is that the PR author will manually - # check these output files for correctness until it can be - # done programmatically.. - print_last_firesim_workload(log_tail_length) - - # need to confirm that instance is off - print("Terminating runfarm. Assuming this will pass.") - run_firesim_cmd("terminaterunfarm", "-q") - print_last_firesim_log(log_tail_length) - - # using rc of runworkload - if rc != 0: - raise Exception(f"Workload {workload} failed with code: {rc}") - else: - print(f"Workload run {workload} successful. Checking workload files...") - - def check(match_key, file_name = 'uartlog'): - out_count = search_match_in_last_workloads_output_file(file_name, match_key) - assert out_count == num_passes, f"Workload {file_name} files are malformed: '{match_key}' found {out_count} times (!= {num_passes}). Something went wrong." - - # first driver completed successfully - check('*** PASSED ***') - - # verify login was reached (i.e. linux booted) - check('running /etc/init.d/S99run') - - # verify reaching poweroff - check('Power down') - - print(f"Workload run {workload} successful.") - - run_w_timeout(f"{remote_cy_dir}/sims/firesim-staging/ci/{args.platform}", "config_runtime_rocket_singlecore.yaml", "linux-poweroff-singlenode-rocketsinglecore", "30m", 1) - run_w_timeout(f"{remote_cy_dir}/sims/firesim-staging/ci/{args.platform}", "config_runtime_rocket_quadcore.yaml", "linux-poweroff-singlenode-rocketquadcore", "30m", 1) - run_w_timeout(f"{remote_cy_dir}/sims/firesim-staging/ci/{args.platform}", "config_runtime_boom_singlecore.yaml", "linux-poweroff-singlenode-boomsinglecore", "30m", 1) - -if __name__ == "__main__": - execute(run_linux_poweroff, hosts=["localhost"]) diff --git a/.github/scripts/run-metasims.py b/.github/scripts/run-metasims.py deleted file mode 100755 index 7c736b232f..0000000000 --- a/.github/scripts/run-metasims.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -from pathlib import Path -from fabric.api import prefix, run, execute # type: ignore - -import fabric_cfg -from ci_variables import ci_env, remote_fsim_dir, remote_cy_dir -from utils import print_last_firesim_log, print_last_firesim_workload, run_warn_only - -def run_parallel_metasim(): - """ Runs parallel baremetal metasimulations """ - - # assumptions: - # - machine-launch-script requirements are already installed - # - VCS is installed - - with prefix(f"cd {remote_fsim_dir}"): - with prefix('source sourceme-manager.sh --skip-ssh-setup'): - with prefix(f'cd {remote_cy_dir}/software/firemarshal'): - # build hello world baremetal test - run("./marshal -v build test/bare.yaml") - run("./marshal -v install test/bare.yaml") - - def run_w_timeout(workload: str, timeout: str): - """ Run workload with a specific timeout - - :arg: workload (str) - workload yaml (abs path) - :arg: timeout (str) - timeout amount for the workload to run - """ - log_tail_length = 300 - - def run_firesim_cmd(typ, extra_args = ""): - timeout_prefix = f"timeout {timeout} " - firesim_opts = f"-c {workload} -a {remote_cy_dir}/sims/firesim-staging/sample_config_hwdb.yaml -r {remote_cy_dir}/sims/firesim-staging/sample_config_build_recipes.yaml" - return run_warn_only(f"{timeout_prefix} firesim {firesim_opts} {extra_args} {typ}", pty=False) - - # unique tag based on the ci workflow and filename is needed to ensure - # run farm is unique to each linux-poweroff test - with prefix(f"export FIRESIM_RUNFARM_PREFIX={ci_env['GITHUB_RUN_ID']}-{Path(__file__).stem}"): - rc = run_firesim_cmd("launchrunfarm") - if rc != 0: - print_last_firesim_log(log_tail_length) - - rc = run_firesim_cmd("infrasetup") - if rc != 0: - print_last_firesim_log(log_tail_length) - - rc = run_firesim_cmd("runworkload") - if rc != 0: - print_last_firesim_log(log_tail_length) - - # This is a janky solution to the fact the manager does not - # return a non-zero exit code or some sort of result summary. - # The expectation here is that the PR author will manually - # check these output files for correctness until it can be - # done programmatically.. - print_last_firesim_workload(log_tail_length) - - # need to confirm that instance is off - print("Terminating runfarm. Assuming this will pass.") - run_firesim_cmd("terminaterunfarm", "-q") - print_last_firesim_log(log_tail_length) - - # using rc of runworkload - if rc != 0: - raise Exception(f"Workload {workload} failed with code: {rc}") - else: - print(f"Workload {workload} successful.") - - run_w_timeout(f"{remote_cy_dir}/sims/firesim-staging/ci/hello-world-localhost-vcs-metasim.yaml", "45m") - run_w_timeout(f"{remote_cy_dir}/sims/firesim-staging/ci/hello-world-localhost-verilator-metasim.yaml", "45m") - -if __name__ == "__main__": - execute(run_parallel_metasim, hosts=["localhost"]) diff --git a/.github/scripts/run-tests.sh b/.github/scripts/run-tests.sh deleted file mode 100755 index 1b4bc143f1..0000000000 --- a/.github/scripts/run-tests.sh +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/bash - -# run the different tests - -# turn echo on and error on earliest command -set -ex - -# get remote exec variables -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -source $SCRIPT_DIR/defaults.sh - -DISABLE_SIM_PREREQ="BREAK_SIM_PREREQ=1" -MAPPING_FLAGS=${mapping[$1]} - -run_bmark () { - make run-bmark-tests-fast -j1 -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ $MAPPING_FLAGS $@ -} - -run_asm () { - make run-asm-tests-fast -j1 -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ $MAPPING_FLAGS $@ -} - -run_tracegen () { - make tracegen -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ $MAPPING_FLAGS $@ -} - -run_binary () { - make run-binary-fast -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ $MAPPING_FLAGS $@ -} - -build_tests() { - (cd $LOCAL_CHIPYARD_DIR/tests && cmake . && make) -} - -case $1 in - chipyard-rocket) - run_bmark LOADMEM=1 - run_asm LOADMEM=1 - build_tests - - # Test run-binary with and without loadmem - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv LOADMEM=1 - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv - ;; - chipyard-dmirocket) - # Test checkpoint-restore without cospike - # TODO: This is broken on verilator for some reason - # $LOCAL_CHIPYARD_DIR/scripts/generate-ckpt.sh -b $RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv -i 10000 - # run_binary LOADARCH=$PWD/dhrystone.riscv.0x80000000.unused.10000.defaultspikedts.loadarch EXTRA_SIM_FLAGS="+cospike-enable=0" - # Test cospike without checkpoint-restore - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv LOADMEM=1 - ;; - chipyard-boomv3|chipyard-boomv4|chipyard-shuttle|chipyard-spike|chipyard-shuttle3) - run_asm LOADMEM=1 - run_bmark LOADMEM=1 - ;; - chipyard-dmiboomv3|chipyard-dmiboomv4) - # Test checkpoint-restore - $LOCAL_CHIPYARD_DIR/scripts/generate-ckpt.sh -b $RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv -i 10000 - run_binary LOADARCH=$PWD/dhrystone.riscv.0x80000000.unused.10000.defaultspikedts.loadarch - ;; - chipyard-hetero) - run_bmark LOADMEM=1 - ;; - chipyard-prefetchers) - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv LOADMEM=1 - ;; - chipyard-gemmini) - GEMMINI_SOFTWARE_DIR=$LOCAL_SIM_DIR/../../generators/gemmini/software/gemmini-rocc-tests - rm -rf $GEMMINI_SOFTWARE_DIR/riscv-tests - cd $LOCAL_SIM_DIR - run_binary BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/aligned-baremetal LOADMEM=1 - run_binary BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/raw_hazard-baremetal LOADMEM=1 - run_binary BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/mvin_mvout-baremetal LOADMEM=1 - ;; - chipyard-mempress) - (cd $LOCAL_CHIPYARD_DIR/generators/mempress/software/src && make) - run_binary BINARY=$LOCAL_CHIPYARD_DIR/generators/mempress/software/src/mempress-rocc.riscv LOADMEM=1 - ;; - chipyard-compressacc) - (cd $LOCAL_CHIPYARD_DIR/generators/compress-acc/software-zstd/compress && ./build-hcb-single-file.sh) - run_binary BINARY=$LOCAL_CHIPYARD_DIR/generators/compress-acc/software-zstd/compress/009987_cl0_ws12.riscv LOADMEM=1 - ;; - chipyard-manymmioaccels) - build_tests - - # test streaming-passthrough - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/streaming-passthrough.riscv LOADMEM=1 - - # test streaming-fir - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/streaming-fir.riscv LOADMEM=1 - - # test fft - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/fft.riscv LOADMEM=1 - ;; - chipyard-nvdla) - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/nvdla.riscv LOADMEM=1 - ;; - chipyard-manyperipherals) - # SPI Flash read tests - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashread.riscv - ;; - chipyard-spiflashwrite) - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashwrite.riscv LOADMEM=1 - [[ "`xxd $LOCAL_CHIPYARD_DIR/tests/spiflash.img | grep 1337\ 00ff\ aa55\ face | wc -l`" == "6" ]] || false - ;; - chipyard-tethered) - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv LOADMEM=1 EXTRA_SIM_FLAGS="+cflush_addr=0x2010200" - ;; - chipyard-symmetric) - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/symmetric.riscv LOADMEM=1 EXTRA_SIM_FLAGS="+offchip_sel=0" - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/symmetric.riscv LOADMEM=1 EXTRA_SIM_FLAGS="+offchip_sel=1" - ;; - chipyard-llcchiplet) - build_tests - - run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv LOADMEM=1 - ;; - chipyard-rerocc) - make -C $LOCAL_CHIPYARD_DIR/generators/rerocc/software - run_binary BINARY=$LOCAL_CHIPYARD_DIR/generators/rerocc/software/test.riscv LOADMEM=1 - ;; - chipyard-rocketvector|chipyard-shuttlevector) - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-sgemm.riscv LOADMEM=1 - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-strcmp.riscv LOADMEM=1 - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv LOADMEM=1 - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv LOADMEM=1 - ;; - chipyard-shuttleara) - # Ara does not work with verilator - # run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-sgemm.riscv LOADMEM=1 - # Ara cannot run strcmp - # run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-strcmp.riscv LOADMEM=1 - # run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv LOADMEM=1 - # run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv LOADMEM=1 - ;; - tracegen) - run_tracegen - ;; - tracegen-boomv3) - run_tracegen - ;; - tracegen-boomv4) - run_tracegen - ;; - chipyard-cva6) - run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/multiply.riscv - ;; - chipyard-ibex) - # Ibex cannot run the riscv-tests binaries for some reason - # run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/isa/rv32ui-p-simple - ;; - chipyard-vexiiriscv) - run_asm LOADMEM=1 - run_bmark LOADMEM=1 - ;; - chipyard-sodor) - run_asm - ;; - chipyard-constellation) - run_binary LOADMEM=1 BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv - ;; - chipyard-tacit-rocket) - run_binary LOADMEM=1 BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv - ;; - chipyard-zephyr) - run_binary LOADMEM=1 BINARY=$LOCAL_CHIPYARD_DIR/software/zephyrproject/zephyr/build/zephyr/zephyr.elf - ;; - chipyard-radiance) - # Verilator fails to build sim binary, just generate verilog - ;; - icenet) - run_binary BINARY=none - ;; - testchipip) - run_binary BINARY=none - ;; - constellation) - run_binary BINARY=none - ;; - rocketchip-amba) - run_binary BINARY=none - ;; - rocketchip-tlsimple) - run_binary BINARY=none - ;; - rocketchip-tlwidth) - run_binary BINARY=none - ;; - rocketchip-tlxbar) - run_binary BINARY=none - ;; - *) - echo "No set of tests for $1. Did you spell it right?" - exit 1 - ;; -esac diff --git a/.github/scripts/utils.py b/.github/scripts/utils.py deleted file mode 100644 index 4e9d86b6b3..0000000000 --- a/.github/scripts/utils.py +++ /dev/null @@ -1,56 +0,0 @@ -from fabric.api import run, settings # type: ignore -from enum import Enum -import argparse -import os -from ci_variables import remote_fsim_dir - -def search_match_in_last_workloads_output_file(file_name: str = "uartlog", match_key: str = "*** PASSED ***") -> int: - # if grep doesn't find any results, this command will fail - out = run(f"""cd deploy/results-workload/ && LAST_DIR=$(ls | tail -n1) && if [ -d "$LAST_DIR" ]; then grep -an "{match_key}" $LAST_DIR/*/{file_name}; fi""") - out_split = [e for e in out.split('\n') if match_key in e] - out_count = len(out_split) - print(f"Found {out_count} '{match_key}' strings in {file_name}") - return out_count - -class FpgaPlatform(Enum): - vitis = 'vitis' - xilinx_alveo_u250 = 'xilinx_alveo_u250' - - def __str__(self): - return self.value - -def create_args(): - parser = argparse.ArgumentParser(description='') - parser.add_argument('--platform', type=FpgaPlatform, choices=list(FpgaPlatform), required=True) - args = parser.parse_args() - return args - -def setup_shell_env_vars(): - # if the following env. vars exist, then propagate to fabric subprocess - shell_env_vars = { - "TEST_DISABLE_VERILATOR", - "TEST_DISABLE_VIVADO", - "TEST_DISABLE_BENCHMARKS", - } - export_shell_env_vars = set() - for v in shell_env_vars: - if v in os.environ: - export_shell_env_vars.add(f"{v}={os.environ[v]}") - - return ("export " + " ".join(export_shell_env_vars)) if export_shell_env_vars else "true" - -def run_warn_only(*args, **kwargs): - rc = 0 - with settings(warn_only=True): - # pty=False needed to avoid issues with screen -ls stalling in fabric - rc = run(*args, **kwargs).return_code - return rc - -def print_last_firesim_log(log_lines = 300): - print(f"Printing last {log_lines} lines of most recent log.") - run(f"""cd {remote_fsim_dir}/deploy/logs && LAST_LOG=$(ls | tail -n1) && if [ -f "$LAST_LOG" ]; then tail -n{log_lines} $LAST_LOG; fi""") - -def print_last_firesim_workload(log_lines = 300): - workload_path = f"{remote_fsim_dir}/deploy/results-workload" - print(f"Printing last {log_lines} lines of all output files. See {workload_path} for more info.") - run(f"""cd {workload_path} && LAST_DIR=$(ls | tail -n1) && if [ -d "$LAST_DIR" ]; then tail -n{log_lines} $LAST_DIR/*/*; fi""") diff --git a/.github/workflows/build-and-publish-container.yml b/.github/workflows/build-and-publish-container.yml new file mode 100644 index 0000000000..ebe2f65442 --- /dev/null +++ b/.github/workflows/build-and-publish-container.yml @@ -0,0 +1,84 @@ +name: build and publish container + +on: + schedule: + - cron: '0 8 * * *' + workflow_dispatch: + +permissions: + contents: read + packages: write + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + build-and-publish-container: + name: build and publish container + runs-on: ubuntu-24.04 + env: + BUILDKIT_PROGRESS: plain + DOCKER_BUILDKIT: 1 + DOCKER_DATA_ROOT: ${{ github.workspace }}/.ci/docker + FORCE_NON_EC2: 1 + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Check out main + uses: actions/checkout@v4 + with: + ref: main + + - name: Move Docker storage to workspace + run: | + sudo systemctl stop docker + sudo mkdir -p "${DOCKER_DATA_ROOT}" + printf '{ "data-root": "%s" }\n' "${DOCKER_DATA_ROOT}" | sudo tee /etc/docker/daemon.json + sudo systemctl start docker + docker info --format 'Docker root: {{ .DockerRootDir }}' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + with: + buildkitd-flags: --allow-insecure-entitlement security.insecure + + - name: Log in to GHCR + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set image metadata + id: image + run: | + image_name="ghcr.io/${GITHUB_REPOSITORY,,}" + unix_timestamp="$(date +%s)" + echo "image_ref=${image_name}:main" >> "${GITHUB_OUTPUT}" + echo "unix_timestamp=${unix_timestamp}" >> "${GITHUB_OUTPUT}" + + - name: Build and publish container + uses: docker/build-push-action@v7 + with: + context: . + file: dockerfiles/Dockerfile + target: base-with-tools + allow: security.insecure + build-args: | + CHIPYARD_REPO=${{ github.server_url }}/${{ github.repository }}.git + CHIPYARD_REF=main + labels: | + org.chipyard.ci.unix-timestamp=${{ steps.image.outputs.unix_timestamp }} + tags: | + ${{ steps.image.outputs.image_ref }} + outputs: | + type=image,push=true,oci-mediatypes=true,compression=zstd,compression-level=15,force-compression=true diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000000..9f739fb71c --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,59 @@ +name: build documentation + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + build-docs: + name: build documentation + runs-on: ubuntu-24.04 + timeout-minutes: 30 + env: + PIP_DISABLE_PIP_VERSION_CHECK: "1" + SKIP_URL_CHECK: "1" + steps: + - name: Check out pull request merge ref + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ inputs.pr_number }}/merge + + - name: Initialize documentation submodules + run: | + git submodule sync -- generators/fft-generator + git submodule update --init --depth 1 -- generators/fft-generator + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: docs/requirements.txt + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: docs/.nvmrc + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Install Sphinx dependencies + run: python -m pip install -r docs/requirements.txt + + - name: Install Starlight dependencies + working-directory: docs + run: npm ci + + - name: Build documentation + working-directory: docs + run: npm run build diff --git a/.github/workflows/build-setup-rhel.yml b/.github/workflows/build-setup-rhel.yml new file mode 100644 index 0000000000..c3b53fd6d2 --- /dev/null +++ b/.github/workflows/build-setup-rhel.yml @@ -0,0 +1,153 @@ +name: build-setup rhel + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + build-setup-rhel: + name: build-setup rhel + runs-on: ubuntu-latest + timeout-minutes: 180 + env: + DOCKER_DATA_ROOT: ${{ github.workspace }}/.ci/docker + FORCE_NON_EC2: 1 + JVM_OPTS: -Xmx3200m + RHEL_IMAGE: registry.access.redhat.com/ubi9/ubi:latest + RHEL_CONDA_INSTALL_DIR: /workspace/.ci/rhel-conda + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Check out main + uses: actions/checkout@v4 + with: + ref: main + + - name: Refresh pull request merge ref + run: | + git fetch --no-tags origin "pull/${{ inputs.pr_number }}/merge" + git checkout --detach FETCH_HEAD + git rev-parse --short HEAD + + - name: Move Docker storage to workspace + run: | + sudo systemctl stop docker + sudo mkdir -p "${DOCKER_DATA_ROOT}" + printf '{ "data-root": "%s" }\n' "${DOCKER_DATA_ROOT}" | sudo tee /etc/docker/daemon.json + sudo systemctl start docker + docker info --format 'Docker root: {{ .DockerRootDir }}' + + - name: Exclude CI-managed directories from ctags + run: | + grep -qxF ".ci" .ctagsignore || printf "\n.ci\n" >> .ctagsignore + + - name: Run build setup in RHEL 9 + run: | + docker run --rm \ + --privileged \ + --volume "${GITHUB_WORKSPACE}:/workspace" \ + --workdir /workspace \ + --env "CONDA_INSTALL_DIR=${RHEL_CONDA_INSTALL_DIR}" \ + --env "FORCE_NON_EC2=${FORCE_NON_EC2}" \ + --env "JVM_OPTS=${JVM_OPTS}" \ + "${RHEL_IMAGE}" \ + bash -leo pipefail -c ' + dnf install -y \ + bzip2 \ + findutils \ + git \ + gzip \ + kmod \ + make \ + patch \ + procps-ng \ + python3 \ + shadow-utils \ + sudo \ + tar \ + unzip \ + util-linux \ + wget \ + which \ + xz + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm + printf "%s\n" \ + "[almalinux-baseos]" \ + "name=AlmaLinux 9 BaseOS" \ + "baseurl=https://repo.almalinux.org/almalinux/9/BaseOS/\$basearch/os/" \ + "enabled=1" \ + "gpgcheck=0" \ + "" \ + "[almalinux-appstream]" \ + "name=AlmaLinux 9 AppStream" \ + "baseurl=https://repo.almalinux.org/almalinux/9/AppStream/\$basearch/os/" \ + "enabled=1" \ + "gpgcheck=0" \ + "" \ + "[almalinux-crb]" \ + "name=AlmaLinux 9 CRB" \ + "baseurl=https://repo.almalinux.org/almalinux/9/CRB/\$basearch/os/" \ + "enabled=1" \ + "gpgcheck=0" \ + > /etc/yum.repos.d/almalinux-guestfs.repo + dnf install -y --setopt=install_weak_deps=False libguestfs-tools libguestfs-tools-c + command -v guestmount + command -v guestunmount + + # Run build-setup as the mounted workspace owner so FireMarshal + # cannot use passwordless sudo and falls back to guestmount. + workspace_uid="$(stat -c %u /workspace)" + workspace_gid="$(stat -c %g /workspace)" + + if ! getent group "${workspace_gid}" >/dev/null; then + groupadd -g "${workspace_gid}" chipyard-ci + fi + workspace_group="$(getent group "${workspace_gid}" | cut -d: -f1)" + + if ! getent passwd "${workspace_uid}" >/dev/null; then + useradd -m -u "${workspace_uid}" -g "${workspace_group}" chipyard-ci + fi + workspace_user="$(getent passwd "${workspace_uid}" | cut -d: -f1)" + workspace_home="$(getent passwd "${workspace_uid}" | cut -d: -f6)" + + mkdir -p "$(dirname "${CONDA_INSTALL_DIR}")" + chown "${workspace_uid}:${workspace_gid}" "$(dirname "${CONDA_INSTALL_DIR}")" + + runuser -u "${workspace_user}" -- env \ + "CONDA_INSTALL_DIR=${CONDA_INSTALL_DIR}" \ + "FORCE_NON_EC2=${FORCE_NON_EC2}" \ + "JVM_OPTS=${JVM_OPTS}" \ + "HOME=${workspace_home}" \ + bash -leo pipefail -c " + cd /workspace + git config --global --add safe.directory \"*\" + mkdir -p \"\$(dirname \"\${CONDA_INSTALL_DIR}\")\" + wget -O Miniforge3.sh \"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-\$(uname)-\$(uname -m).sh\" + bash Miniforge3.sh -b -p \"\${CONDA_INSTALL_DIR}\" + source \"\${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh\" + if [ -f \"\${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh\" ]; then + source \"\${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh\" + fi + conda activate + ./build-setup.sh riscv-tools + grep -F \"Setup complete!\" build-setup.log + " + ' diff --git a/.github/workflows/build-setup-ubuntu-26.04.yml b/.github/workflows/build-setup-ubuntu-26.04.yml new file mode 100644 index 0000000000..117a286603 --- /dev/null +++ b/.github/workflows/build-setup-ubuntu-26.04.yml @@ -0,0 +1,72 @@ +name: build-setup ubuntu 26.04 + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + build-setup-ubuntu-2604: + name: build-setup ubuntu 26.04 + runs-on: ubuntu-26.04 + timeout-minutes: 180 + env: + CONDA_INSTALL_DIR: ${{ github.workspace }}/.ci/conda + FORCE_NON_EC2: 1 + JVM_OPTS: -Xmx3200m + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Check out main + uses: actions/checkout@v4 + with: + ref: main + + - name: Refresh pull request merge ref + run: | + git fetch --no-tags origin "pull/${{ inputs.pr_number }}/merge" + git checkout --detach FETCH_HEAD + git rev-parse --short HEAD + + - name: Install conda + run: | + mkdir -p "$(dirname "${CONDA_INSTALL_DIR}")" + wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" + bash Miniforge3.sh -b -p "${CONDA_INSTALL_DIR}" + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" + fi + conda activate + + - name: Exclude CI-managed directories from ctags + run: | + grep -qxF ".ci" .ctagsignore || printf "\n.ci\n" >> .ctagsignore + + - name: Run build setup + run: | + git config --global --add safe.directory "*" + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" + fi + conda activate + ./build-setup.sh riscv-tools + grep -F "Setup complete!" build-setup.log diff --git a/.github/workflows/build-setup-ubuntu.yml b/.github/workflows/build-setup-ubuntu.yml new file mode 100644 index 0000000000..6854cb0a6f --- /dev/null +++ b/.github/workflows/build-setup-ubuntu.yml @@ -0,0 +1,72 @@ +name: build-setup ubuntu + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + build-setup-ubuntu: + name: build-setup ubuntu + runs-on: ubuntu-24.04 + timeout-minutes: 180 + env: + CONDA_INSTALL_DIR: ${{ github.workspace }}/.ci/conda + FORCE_NON_EC2: 1 + JVM_OPTS: -Xmx3200m + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Check out main + uses: actions/checkout@v4 + with: + ref: main + + - name: Refresh pull request merge ref + run: | + git fetch --no-tags origin "pull/${{ inputs.pr_number }}/merge" + git checkout --detach FETCH_HEAD + git rev-parse --short HEAD + + - name: Install conda + run: | + mkdir -p "$(dirname "${CONDA_INSTALL_DIR}")" + wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" + bash Miniforge3.sh -b -p "${CONDA_INSTALL_DIR}" + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" + fi + conda activate + + - name: Exclude CI-managed directories from ctags + run: | + grep -qxF ".ci" .ctagsignore || printf "\n.ci\n" >> .ctagsignore + + - name: Run build setup + run: | + git config --global --add safe.directory "*" + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" + fi + conda activate + ./build-setup.sh riscv-tools + grep -F "Setup complete!" build-setup.log diff --git a/.github/workflows/check-ci-disable.yml b/.github/workflows/check-ci-disable.yml new file mode 100644 index 0000000000..6383b51d7b --- /dev/null +++ b/.github/workflows/check-ci-disable.yml @@ -0,0 +1,102 @@ +name: check-ci-disable + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + pr_head_ref: + required: true + type: string + pr_head_repo_id: + required: true + type: number + pr_labels: + required: true + type: string + outputs: + ci_disabled: + value: ${{ jobs.check-ci-disable.outputs.ci_disabled }} + +permissions: + actions: write + contents: read + pull-requests: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + check-ci-disable: + name: check-ci-disable + runs-on: ubuntu-latest + outputs: + ci_disabled: ${{ steps.ci-label.outputs.ci_disabled }} + steps: + - name: Check ci:disable label + id: ci-label + env: + PR_LABELS: ${{ inputs.pr_labels }} + run: | + if jq -e 'index("ci:disable") != null' <<< "${PR_LABELS}" > /dev/null; then + echo "ci_disabled=true" >> "${GITHUB_OUTPUT}" + echo "ci:disable is present; downstream CI workflows will be skipped." >> "${GITHUB_STEP_SUMMARY}" + else + echo "ci_disabled=false" >> "${GITHUB_OUTPUT}" + echo "ci:disable is not present; downstream CI workflows may run." >> "${GITHUB_STEP_SUMMARY}" + fi + + - name: Cancel active CI runs for this PR + if: ${{ steps.ci-label.outputs.ci_disabled == 'true' }} + uses: actions/github-script@v7 + env: + PR_NUMBER: ${{ inputs.pr_number }} + PR_HEAD_REF: ${{ inputs.pr_head_ref }} + PR_HEAD_REPO_ID: ${{ inputs.pr_head_repo_id }} + with: + script: | + const { owner, repo } = context.repo; + const prNumber = Number(process.env.PR_NUMBER); + const prHeadRef = process.env.PR_HEAD_REF; + const prHeadRepoId = Number(process.env.PR_HEAD_REPO_ID); + const activeStatuses = ['queued', 'in_progress', 'requested', 'waiting', 'pending']; + const currentRunId = context.runId; + const cancelled = []; + + function isSamePullRequest(run) { + const pullRequests = run.pull_requests || []; + const matchesPrNumber = pullRequests.some((runPr) => runPr.number === prNumber); + if (matchesPrNumber) { + return true; + } + + const runRepoId = run.head_repository && run.head_repository.id; + return runRepoId === prHeadRepoId && run.head_branch === prHeadRef; + } + + for (const status of activeStatuses) { + const runs = await github.paginate(github.rest.actions.listWorkflowRunsForRepo, { + owner, + repo, + event: 'pull_request', + status, + per_page: 100, + }); + + for (const run of runs) { + if (run.id === currentRunId || !isSamePullRequest(run)) { + continue; + } + + await github.rest.actions.cancelWorkflowRun({ + owner, + repo, + run_id: run.id, + }); + cancelled.push(`${run.name || run.workflow_id}#${run.run_number}`); + } + } + + core.info(`Cancelled ${cancelled.length} active run(s): ${cancelled.join(', ') || 'none'}`); diff --git a/.github/workflows/chipyard-chisel7.yml b/.github/workflows/chipyard-chisel7.yml deleted file mode 100644 index 0f4ea828aa..0000000000 --- a/.github/workflows/chipyard-chisel7.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: chipyard-chisel7 - -on: - pull_request: - branches: - - main - - '1.[0-9]*.x' - workflow_dispatch: - -defaults: - run: - shell: bash -leo pipefail {0} - -jobs: - chisel7-firrtl: - name: chisel7-firrtl - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install DTC (device-tree-compiler) - run: | - sudo apt-get update - sudo apt-get install -y device-tree-compiler - - - name: Set up JDK 17 (Temurin) - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - cache: 'sbt' - - - name: Init submodules (saturn only) - run: | - scripts/init-submodules-no-riscv-tools-nolog.sh --saturn - - - name: Run firrtl target with Chisel 7 - env: - USE_CHISEL7: "1" - run: | - cd sims/verilator - make firrtl - diff --git a/.github/workflows/chipyard-full-flow.yml b/.github/workflows/chipyard-full-flow.yml deleted file mode 100644 index 3de358c984..0000000000 --- a/.github/workflows/chipyard-full-flow.yml +++ /dev/null @@ -1,207 +0,0 @@ -name: chipyard-ci-full-flow - -on: - # run ci on pull requests targeting following branches (runs on the merge commit) - pull_request: - branches: - - main - - '1.[0-9]*.x' - schedule: - # run at 00:00 on sunday - - cron: "0 0 * * 0" - -defaults: - run: - shell: bash -leo pipefail {0} - -env: - # temporary directories should be located in /scratch (since it's larger) - REMOTE_WORK_DIR: /scratch/buildbot/cy-ci-shared/cy-workdir-${{ github.sha }} - JAVA_TMP_DIR: /scratch/buildbot/cy-ci-shared/cy-javatmpdir-${{ github.sha }} - -jobs: - cancel-prior-workflows: - name: cancel-prior-workflows - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - start-workflow: - name: start-workflow - # unable to access env context in job.if thus have to put gh-a context expression directly here. - # note that the check is using a boolean true instead of string 'true' since it's directly using - # the expression not a variable like if checking against the env context string. - if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:disable') != true }} - runs-on: ubuntu-22.04 - steps: - - run: true - - # Set up a set of boolean conditions to control which branches of the CI - # workflow will execute This is based off the conditional job execution - # example here: https://github.com/dorny/paths-filter#examples - change-filters: - name: filter-jobs-on-changes - runs-on: ubuntu-latest - needs: start-workflow - # Queried by downstream jobs to determine if they should run. - outputs: - needs-rtl: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-rtl_count }} - steps: - - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - all: - - '**' - - # If any of the files changed match, do a doc build - docs: &docs-filter - - 'docs/**' - - '.readthedocs.yml' - - # If all files match to this filter, skip the main ci pipeline - skip-rtl: - - *docs-filter - - '**/*.md' - - '**/.gitignore' - - '.github/ISSUE_TEMPLATE/**' - - '.github/PULL_REQUEST_TEMPLATE.md' - - '.github/dependabot.yml' - - '.mergify.yml' - - full-flow: - name: full-flow - needs: [change-filters, cancel-prior-workflows] - if: needs.change-filters.outputs.needs-rtl == 'true' - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - uses: actions/checkout@v4 - - name: Setup repo copy - run: | - git clone $GITHUB_WORKSPACE ${{ env.REMOTE_WORK_DIR }} - - name: Setup repo - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - mkdir ${{ env.JAVA_TMP_DIR }} - export MAKEFLAGS="-j32" - git submodule sync - ./build-setup.sh -v - - name: Run config finder - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - source env.sh - cd sims/verilator - make find-config-fragments - make find-configs - - name: Run smoke test - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - source env.sh - cd sims/verilator - make verilog - - name: VLSI test - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - source env.sh - - cd vlsi - - # remove extra channels if put in by default (avoid clashing deps) - conda config --remove channels litex-hub || true - conda config --remove channels defaults || true - - # NOTE: most conda installs are in separate conda envs because they mess up - # each other's versions (for no apparent reason) and we need the latest versions - - # installs for example-sky130.yml - conda create -y --prefix ./.conda-sky130 -c defaults -c litex-hub open_pdks.sky130a=1.0.457_0_g32e8f23 - git clone https://github.com/rahulk29/sram22_sky130_macros.git - git -C sram22_sky130_macros checkout 1f20d16 - - # installs for example-openroad.yml - conda create -y --prefix ./.conda-yosys -c defaults -c litex-hub yosys=0.27_4_gb58664d44 - conda create -y --prefix ./.conda-openroad -c defaults -c litex-hub openroad=2.0_7070_g0264023b6 - conda create -y --prefix ./.conda-klayout -c defaults -c litex-hub klayout=0.28.5_98_g87e2def28 - conda create -y --prefix ./.conda-signoff -c defaults -c litex-hub magic=8.3.376_0_g5e5879c netgen=1.5.250_0_g178b172 - - echo "# Tutorial configs" > tutorial.yml - echo "# pdk" > tutorial.yml - echo "technology.sky130.sky130A: $PWD/.conda-sky130/share/pdk/sky130A" >> tutorial.yml - echo "technology.sky130.sram22_sky130_macros: $PWD/sram22_sky130_macros" >> tutorial.yml - echo "" >> tutorial.yml - echo "# tools" >> tutorial.yml - echo "synthesis.yosys.yosys_bin: $PWD/.conda-yosys/bin/yosys" >> tutorial.yml - echo "par.openroad.openroad_bin: $PWD/.conda-openroad/bin/openroad" >> tutorial.yml - echo "par.openroad.klayout_bin: $PWD/.conda-klayout/bin/klayout" >> tutorial.yml - echo "drc.magic.magic_bin: $PWD/.conda-signoff/bin/magic" >> tutorial.yml - echo "drc.klayout.klayout_bin: $PWD/.conda-klayout/bin/klayout" >> tutorial.yml - echo "lvs.netgen.netgen_bin: $PWD/.conda-signoff/bin/netgen" >> tutorial.yml - echo "" >> tutorial.yml - echo "# speed up tutorial runs & declutter log output" >> tutorial.yml - echo "par.openroad.timing_driven: false" >> tutorial.yml - echo "par.openroad.write_reports: false" >> tutorial.yml - - export tutorial=sky130-openroad - export EXTRA_CONFS=tutorial.yml - export VLSI_TOP=RocketTile - make buildfile - make syn - # NOTE: commenting out for now bc this times out - need to debug why - # openroad freezes during some write commands after detailed route - # so need to stop the flow & run last step separately - # make par HAMMER_EXTRA_ARGS="--stop_after_step extraction" - # make redo-par HAMMER_EXTRA_ARGS="--start_before_step extraction" - # make drc - # make lvs - - name: Run FireChip bridge tests - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - source env.sh - pushd sims/firesim - source sourceme-manager.sh --skip-ssh-setup - popd - cd sims/firesim-staging - export TEST_DISABLE_VERILATOR=1 - export TEST_DISABLE_VIVADO=1 - make launch-sbt SBT_COMMAND=";project firechip_bridgestubs; testOnly firechip.bridgestubs.BridgeTests" - - name: Run FireChip FireSim target tests - run: | - cd ${{ env.REMOTE_WORK_DIR }} - eval "$(conda shell.bash hook)" - source env.sh - pushd sims/firesim - source sourceme-manager.sh --skip-ssh-setup - popd - cd sims/firesim-staging - export TEST_MINIMAL_BENCHMARKS=1 # seems like dhrystone is the longest so this doesn't affect runtime much - export TEST_DISABLE_VERILATOR=1 - export TEST_DISABLE_VIVADO=1 - make launch-sbt SBT_COMMAND=";project firechip; testOnly firechip.chip.CITests" - - cleanup: - name: cleanup - needs: [full-flow] - runs-on: as4 - if: ${{ always() }} - steps: - - name: Delete repo copy and conda env - run: | - rm -rf ${{ env.REMOTE_WORK_DIR }} - rm -rf ${{ env.JAVA_TMP_DIR }} diff --git a/.github/workflows/chipyard-run-tests.yml b/.github/workflows/chipyard-run-tests.yml deleted file mode 100644 index f177a1667a..0000000000 --- a/.github/workflows/chipyard-run-tests.yml +++ /dev/null @@ -1,1344 +0,0 @@ -name: chipyard-ci-process - -on: - # run ci on pull requests targeting following branches (runs on the merge commit) - pull_request: - branches: - - main - - '1.[0-9]*.x' - -defaults: - run: - shell: bash -leo pipefail {0} - -env: - tools-cache-version: v17 - JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit - conda-env-name-no-time: cy-${{ github.run_id }} - workflow-timestamp: ${{ github.event.pull_request.updated_at }} - -jobs: - cancel-prior-workflows: - name: cancel-prior-workflows - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - start-workflow: - name: start-workflow - # unable to access env context in job.if thus have to put gh-a context expression directly here. - # note that the check is using a boolean true instead of string 'true' since it's directly using - # the expression not a variable like if checking against the env context string. - if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:disable') != true }} - runs-on: ubuntu-22.04 - steps: - - run: true - - # Set up a set of boolean conditions to control which branches of the CI - # workflow will execute This is based off the conditional job execution - # example here: https://github.com/dorny/paths-filter#examples - change-filters: - name: filter-jobs-on-changes - runs-on: ubuntu-latest - needs: start-workflow - # Queried by downstream jobs to determine if they should run. - outputs: - needs-rtl: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-rtl_count }} - steps: - - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - all: - - '**' - - # If any of the files changed match, do a doc build - docs: &docs-filter - - 'docs/**' - - '.readthedocs.yml' - - # If all files match to this filter, skip the main ci pipeline - skip-rtl: - - *docs-filter - - '**/*.md' - - '**/.gitignore' - - '.github/ISSUE_TEMPLATE/**' - - '.github/PULL_REQUEST_TEMPLATE.md' - - '.github/dependabot.yml' - - '.mergify.yml' - - create-conda-env-as4: - name: create-conda-env-as4 - needs: [change-filters, cancel-prior-workflows] - if: needs.change-filters.outputs.needs-rtl == 'true' - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Cleanup conda - uses: ./.github/actions/cleanup-conda - - name: Create conda env - uses: ./.github/actions/create-conda-env - - # Sentinel job to simplify how we specify which that basic setup is complete - # - # When adding new prep jobs, please add them to `needs` below - setup-complete: - name: setup-complete - needs: [create-conda-env-as4] - runs-on: ubuntu-latest - steps: - - name: Set up complete - run: echo Set up is complete! - - ########################################################################## - - commit-on-master-check: - name: commit-on-master-check - needs: [setup-complete] - if: needs.change-filters.outputs.needs-rtl == 'true' - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Check commits of each submodule - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - .github/scripts/check-commit.sh - - documentation-check: - name: documentation-check - needs: [setup-complete] - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Check that documentation builds with no warnings/errors - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - scripts/init-submodules-no-riscv-tools.sh --full - make -C docs html - - name: Show error log from sphinx if failed - if: ${{ failure() }} - run: cat /tmp/sphinx-err*.log - - build-extra-tests: - name: build-extra-tests - needs: [setup-complete] - if: needs.change-filters.outputs.needs-rtl == 'true' - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Generate keys - id: genkey - run: | - echo "extra-tests-cache-key=extra-tests-${{ github.sha }}" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - id: build-extra-tools-cache - with: - path: extra-tests-install - key: ${{ steps.genkey.outputs.extra-tests-cache-key }} - restore-keys: ${{ steps.genkey.outputs.extra-tests-cache-key }} - - name: Build extra tests - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - .github/scripts/build-extra-tests.sh - - prepare-chipyard-cores: - name: prepare-chipyard-cores - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-cores" - - prepare-chipyard-constellation: - name: prepare-chipyard-constellation - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-constellation" - - prepare-chipyard-peripherals: - name: prepare-chipyard-peripherals - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-peripherals" - - prepare-chipyard-accels: - name: prepare-chipyard-accels - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-accels" - - prepare-chipyard-tracegen: - name: prepare-chipyard-tracegen - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-tracegen" - - prepare-chipyard-other: - name: prepare-chipyard-other - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-other" - - prepare-chipyard-fpga: - name: prepare-chipyard-fpga - needs: setup-complete - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build RTL on self-hosted - uses: ./.github/actions/prepare-rtl - with: - group-key: "group-fpga" - build-type: "fpga" - - ########################################################################## - - chipyard-spike-gemmini-run-tests: - name: chipyard-spike-gemmini-run-tests - needs: prepare-chipyard-accels # technically doesn't depend on RTL but should be after the build.sh for Gemmini - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build Gemmini FireMarshal - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - cd ${{ github.workspace }} && ./scripts/init-submodules-no-riscv-tools.sh --full - cd ${{ github.workspace }} && source ./scripts/fix-open-files.sh - git submodule update --init software/firemarshal && cd software/firemarshal && ./init-submodules.sh - cd ${{ github.workspace }}/generators/gemmini/software && ${{ github.workspace }}/software/firemarshal/marshal -v -d build gemmini-smoke.json - - name: Running Gemmini FireMarshal smoke test - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - cd ${{ github.workspace }}/generators/gemmini/software && ${{ github.workspace }}/software/firemarshal/marshal -v -d launch -s gemmini-smoke.json - - chipyard-rocket-run-tests: - name: chipyard-rocket-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-rocket" - - chipyard-prefetchers-run-tests: - name: chipyard-prefetchers-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-prefetchers" - - chipyard-hetero-run-tests: - name: chipyard-hetero-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-hetero" - - chipyard-boomv3-run-tests: - name: chipyard-boomv3-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-boomv3" - - chipyard-boomv4-run-tests: - name: chipyard-boomv4-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-boomv4" - - chipyard-shuttle-run-tests: - name: chipyard-shuttle-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-shuttle" - - chipyard-shuttle3-run-tests: - name: chipyard-shuttle3-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-shuttle3" - - chipyard-radiance-run-tests: - name: chipyard-radiance-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-radiance" - - chipyard-tacit-rocket-run-tests: - name: chipyard-tacit-rocket-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-tacit-rocket" - - chipyard-rocket-zephyr-run-tests: - name: chipyard-rocket-zephyr-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Build zephyr hello world - run: | - conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d) - .github/scripts/build-zephyr.sh - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-zephyr" - - - chipyard-cva6-run-tests: - name: chipyard-cva6-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-cva6" - - chipyard-ibex-run-tests: - name: chipyard-ibex-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-ibex" - - chipyard-vexiiriscv-run-tests: - name: chipyard-vexiiriscv-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-vexiiriscv" - - chipyard-sodor-run-tests: - name: chipyard-sodor-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-sodor" - - chipyard-spike-run-tests: - name: chipyard-spike-run-tests - needs: prepare-chipyard-cores - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-cores" - project-key: "chipyard-spike" - - chipyard-dmirocket-run-tests: - name: chipyard-dmirocket-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-dmirocket" - - chipyard-dmiboomv3-run-tests: - name: chipyard-dmiboomv3-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-dmiboomv3" - - chipyard-dmiboomv4-run-tests: - name: chipyard-dmiboomv4-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-dmiboomv4" - - chipyard-spiflashwrite-run-tests: - name: chipyard-spiflashwrite-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-spiflashwrite" - - chipyard-manyperipherals-run-tests: - name: chipyard-manyperipherals-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-manyperipherals" - - chipyard-tethered-run-tests: - name: chipyard-tethered-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-tethered" - - chipyard-symmetric-run-tests: - name: chipyard-symmetric-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-symmetric" - - chipyard-llcchiplet-run-tests: - name: chipyard-llcchiplet-run-tests - needs: prepare-chipyard-peripherals - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-peripherals" - project-key: "chipyard-llcchiplet" - - chipyard-rerocc-run-tests: - name: chipyard-rerocc-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-rerocc" - - chipyard-rocketvector-run-tests: - name: chipyard-rocketvector-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-rocketvector" - - chipyard-shuttlevector-run-tests: - name: chipyard-shuttlevector-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-shuttlevector" - - chipyard-gemmini-run-tests: - name: chipyard-gemmini-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-gemmini" - - chipyard-manymmioaccels-run-tests: - name: chipyard-manymmioaccels-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-manymmioaccels" - - # chipyard-nvdla-run-tests: - # name: chipyard-nvdla-run-tests - # needs: prepare-chipyard-accels - # runs-on: as4 - # steps: - # - name: Delete old checkout - # run: | - # ls -alh . - # rm -rf ${{ github.workspace }}/* || true - # rm -rf ${{ github.workspace }}/.* || true - # ls -alh . - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Git workaround - # uses: ./.github/actions/git-workaround - # - name: Create conda env - # uses: ./.github/actions/create-conda-env - # - name: Run tests - # uses: ./.github/actions/run-tests - # with: - # group-key: "group-accels" - # project-key: "chipyard-nvdla" - - chipyard-mempress-run-tests: - name: chipyard-mempress-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-mempress" - - chipyard-compressacc-run-tests: - name: chipyard-compressacc-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-accels" - project-key: "chipyard-compressacc" - - - tracegen-boomv3-run-tests: - name: tracegen-boomv3-run-tests - needs: prepare-chipyard-tracegen - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-tracegen" - project-key: "tracegen-boomv3" - - tracegen-boomv4-run-tests: - name: tracegen-boomv4-run-tests - needs: prepare-chipyard-tracegen - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-tracegen" - project-key: "tracegen-boomv4" - - tracegen-run-tests: - name: tracegen-run-tests - needs: prepare-chipyard-tracegen - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-tracegen" - project-key: "tracegen" - - icenet-run-tests: - name: icenet-run-tests - needs: prepare-chipyard-other - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-other" - project-key: "icenet" - - testchipip-run-tests: - name: testchipip-run-tests - needs: prepare-chipyard-other - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-other" - project-key: "testchipip" - - rocketchip-run-tests: - name: rocketchip-run-tests - needs: prepare-chipyard-other - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run amba tests - uses: ./.github/actions/run-tests - with: - group-key: "group-other" - project-key: "rocketchip-amba" - # Below tests segfault with verilator, work fine in VCS - # - name: Run tlsimple tests - # uses: ./.github/actions/run-tests - # with: - # group-key: "group-other" - # project-key: "rocketchip-tlsimple" - # - name: Run tlwidth tests - # uses: ./.github/actions/run-tests - # with: - # group-key: "group-other" - # project-key: "rocketchip-tlwidth" - # - name: Run tlxbar tests - # uses: ./.github/actions/run-tests - # with: - # group-key: "group-other" - # project-key: "rocketchip-tlxbar" - - constellation-run-tests: - name: constellation-run-tests - needs: prepare-chipyard-other - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-other" - project-key: "constellation" - - chipyard-constellation-run-tests: - name: chipyard-constellation-run-tests - needs: prepare-chipyard-constellation - runs-on: as4 - steps: - - name: Delete old checkout - run: | - ls -alh . - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - ls -alh . - - name: Checkout - uses: actions/checkout@v4 - - name: Git workaround - uses: ./.github/actions/git-workaround - - name: Create conda env - uses: ./.github/actions/create-conda-env - - name: Run tests - uses: ./.github/actions/run-tests - with: - group-key: "group-constellation" - project-key: "chipyard-constellation" - - # Sentinel job to simplify how we specify which checks need to pass in branch - # protection and in Mergify - # - # When adding new top level jobs, please add them to `needs` below - all_tests_passed: - name: "all tests passed" - needs: [commit-on-master-check, - documentation-check, - chipyard-rocket-run-tests, - chipyard-hetero-run-tests, - chipyard-boomv3-run-tests, - chipyard-boomv4-run-tests, - chipyard-shuttle-run-tests, - chipyard-shuttle3-run-tests, - chipyard-tacit-rocket-run-tests, - chipyard-rocket-zephyr-run-tests, - chipyard-cva6-run-tests, - chipyard-ibex-run-tests, - chipyard-vexiiriscv-run-tests, - chipyard-sodor-run-tests, - chipyard-dmiboomv3-run-tests, - chipyard-dmiboomv4-run-tests, - chipyard-dmirocket-run-tests, - chipyard-spiflashwrite-run-tests, - chipyard-manyperipherals-run-tests, - chipyard-tethered-run-tests, - chipyard-symmetric-run-tests, - chipyard-llcchiplet-run-tests, - chipyard-rerocc-run-tests, - chipyard-rocketvector-run-tests, - chipyard-shuttlevector-run-tests, - chipyard-gemmini-run-tests, - chipyard-manymmioaccels-run-tests, # chipyard-nvdla-run-tests, - chipyard-prefetchers-run-tests, - chipyard-mempress-run-tests, - chipyard-compressacc-run-tests, - chipyard-constellation-run-tests, - tracegen-boomv3-run-tests, - tracegen-boomv4-run-tests, - tracegen-run-tests, - icenet-run-tests, - testchipip-run-tests, - rocketchip-run-tests, - constellation-run-tests, - prepare-chipyard-fpga] - runs-on: ubuntu-latest - steps: - - run: echo Success! diff --git a/.github/workflows/config/firesim-tests.json b/.github/workflows/config/firesim-tests.json new file mode 100644 index 0000000000..cc18f9f1a7 --- /dev/null +++ b/.github/workflows/config/firesim-tests.json @@ -0,0 +1,9 @@ +{ + "onprem": [ + "RocketU250Tests", + "RocketVCU118Tests" + ], + "f2": [ + "RocketF2Tests" + ] +} diff --git a/.github/workflows/config/generator-tests.json b/.github/workflows/config/generator-tests.json new file mode 100644 index 0000000000..d09c78d90e --- /dev/null +++ b/.github/workflows/config/generator-tests.json @@ -0,0 +1,328 @@ +{ + "chipyard-rocket": [ + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=QuadChannelRocketConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=QuadChannelRocketConfig LOADMEM=1" + }, + { + "custom": false, + "config": ["QuadChannelRocketConfig"], + "binary": ["$LOCAL_CHIPYARD_DIR/tests/hello.riscv"], + "loadmem": "1" + }, + { + "custom": true, + "string": "make run-binary-fast CONFIG=QuadChannelRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv" + } + ], + "chipyard-dmirocket": [ + { + "custom": false, + "config": ["dmiRocketConfig"], + "binary": ["$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv"], + "loadmem": "1" + } + ], + "chipyard-boomv3": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=MediumBoomV3CosimConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=MediumBoomV3CosimConfig LOADMEM=1" + } + ], + "chipyard-boomv4": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=MediumBoomV4CosimConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=MediumBoomV4CosimConfig LOADMEM=1" + } + ], + "chipyard-shuttle": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=ShuttleConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=ShuttleConfig LOADMEM=1" + } + ], + "chipyard-shuttle3": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=Shuttle3WideConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=Shuttle3WideConfig LOADMEM=1" + } + ], + "chipyard-spike": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=SpikeZicntrConfig EXTRA_SIM_FLAGS='+spike-ipc=10' LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=SpikeZicntrConfig EXTRA_SIM_FLAGS='+spike-ipc=10' LOADMEM=1" + } + ], + "chipyard-dmiboomv3": [ + { + "custom": true, + "string": "$LOCAL_CHIPYARD_DIR/scripts/generate-ckpt.sh -b $RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv -i 10000 && make run-binary-fast CONFIG=dmiCheckpointingMediumBoomV3Config LOADARCH=$LOCAL_SIM_DIR/dhrystone.riscv.0x80000000.unused.10000.defaultspikedts.loadarch" + } + ], + "chipyard-dmiboomv4": [ + { + "custom": true, + "string": "$LOCAL_CHIPYARD_DIR/scripts/generate-ckpt.sh -b $RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv -i 10000 && make run-binary-fast CONFIG=dmiCheckpointingMediumBoomV4Config LOADARCH=$LOCAL_SIM_DIR/dhrystone.riscv.0x80000000.unused.10000.defaultspikedts.loadarch" + } + ], + "chipyard-hetero": [ + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=LargeBoomAndRocketConfig LOADMEM=1" + } + ], + "chipyard-prefetchers": [ + { + "custom": false, + "config": ["PrefetchingRocketConfig"], + "binary": ["$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv"], + "loadmem": "1" + } + ], + "chipyard-gemmini": [ + { + "custom": true, + "string": "GEMMINI_SOFTWARE_DIR=$LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests && git -C $GEMMINI_SOFTWARE_DIR submodule update --init riscv-tests && (cd $GEMMINI_SOFTWARE_DIR && ./build.sh bareMetalC) && make run-binary-fast CONFIG=GemminiRocketConfig BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/aligned-baremetal LOADMEM=1 && make run-binary-fast CONFIG=GemminiRocketConfig BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/raw_hazard-baremetal LOADMEM=1 && make run-binary-fast CONFIG=GemminiRocketConfig BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/mvin_mvout-baremetal LOADMEM=1" + } + ], + "chipyard-mempress": [ + { + "custom": true, + "string": "make -C $LOCAL_CHIPYARD_DIR/generators/mempress/software/src && make run-binary-fast CONFIG=MempressRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/generators/mempress/software/src/mempress-rocc.riscv LOADMEM=1" + } + ], + "chipyard-compressacc": [ + { + "custom": true, + "string": "cd $LOCAL_CHIPYARD_DIR/generators/compress-acc/software-zstd/compress && ./build-hcb-single-file.sh && cd $LOCAL_SIM_DIR && make run-binary-fast CONFIG=ZstdCompressorRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/generators/compress-acc/software-zstd/compress/009987_cl0_ws12.riscv LOADMEM=1" + } + ], + "chipyard-manymmioaccels": [ + { + "custom": false, + "config": ["ManyMMIOAcceleratorRocketConfig"], + "binary": [ + "$LOCAL_CHIPYARD_DIR/tests/streaming-passthrough.riscv", + "$LOCAL_CHIPYARD_DIR/tests/streaming-fir.riscv", + "$LOCAL_CHIPYARD_DIR/tests/fft.riscv" + ], + "loadmem": "1" + } + ], + "chipyard-nvdla": [ + { + "custom": true, + "string": "make run-binary-fast CONFIG=SmallNVDLARocketConfig verilog BINARY=$LOCAL_CHIPYARD_DIR/tests/nvdla.riscv LOADMEM=1" + } + ], + "chipyard-manyperipherals": [ + { + "custom": true, + "string": "make run-binary-fast CONFIG=ManyPeripheralsRocketConfig EXTRA_SIM_FLAGS=\"+spiflash0=$LOCAL_CHIPYARD_DIR/tests/spiflash.img\" BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashread.riscv" + } + ], + "chipyard-spiflashwrite": [ + { + "custom": true, + "string": "make run-binary-fast CONFIG=SmallSPIFlashRocketConfig EXTRA_SIM_FLAGS=\"+spiflash0=$LOCAL_CHIPYARD_DIR/tests/spiflash.img\" BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashwrite.riscv LOADMEM=1 && [[ \"$(xxd $LOCAL_CHIPYARD_DIR/tests/spiflash.img | grep '1337 00ff aa55 face' | wc -l)\" == \"6\" ]]" + } + ], + "chipyard-tethered": [ + { + "custom": true, + "string": "make run-binary-fast CONFIG=VerilatorCITetheredChipLikeRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv LOADMEM=1 EXTRA_SIM_FLAGS='+cflush_addr=0x2010200'" + } + ], + "chipyard-symmetric": [ + { + "custom": true, + "string": "make run-binary-fast CONFIG=MultiSimMultiLinkSymmetricChipletRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/tests/symmetric.riscv LOADMEM=1 EXTRA_SIM_FLAGS='+offchip_sel=0' && make run-binary-fast CONFIG=MultiSimMultiLinkSymmetricChipletRocketConfig BINARY=$LOCAL_CHIPYARD_DIR/tests/symmetric.riscv LOADMEM=1 EXTRA_SIM_FLAGS='+offchip_sel=1'" + } + ], + "chipyard-llcchiplet": [ + { + "custom": false, + "config": ["MultiSimLLCChipletRocketConfig"], + "binary": ["$LOCAL_CHIPYARD_DIR/tests/hello.riscv"], + "loadmem": "1" + } + ], + "chipyard-rerocc": [ + { + "custom": true, + "string": "make -C $LOCAL_CHIPYARD_DIR/generators/rerocc/software && make run-binary-fast CONFIG=ReRoCCTestConfig BINARY=$LOCAL_CHIPYARD_DIR/generators/rerocc/software/test.riscv LOADMEM=1" + } + ], + "chipyard-rocketvector": [ + { + "custom": false, + "config": ["MINV128D64RocketConfig"], + "binary": [ + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-sgemm.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-strcmp.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv" + ], + "loadmem": "1" + } + ], + "chipyard-shuttlevector": [ + { + "custom": false, + "config": ["GENV256D128ShuttleConfig"], + "binary": [ + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-sgemm.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-strcmp.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv", + "$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv" + ], + "loadmem": "1" + } + ], + "chipyard-shuttleara": [ + { + "custom": true, + "string": "true" + } + ], + "tracegen": [ + { + "custom": true, + "string": "make tracegen CONFIG=NonBlockingTraceGenL2Config" + } + ], + "tracegen-boomv3": [ + { + "custom": true, + "string": "make tracegen CONFIG=BoomV3TraceGenConfig" + } + ], + "tracegen-boomv4": [ + { + "custom": true, + "string": "make tracegen CONFIG=BoomV4TraceGenConfig" + } + ], + "chipyard-cva6": [ + { + "custom": true, + "string": "if ! git -C \"$LOCAL_CHIPYARD_DIR/generators/cva6\" rev-parse --is-inside-work-tree >/dev/null 2>&1; then git -C \"$LOCAL_CHIPYARD_DIR\" submodule update --init generators/cva6; fi && git -C \"$LOCAL_CHIPYARD_DIR/generators/cva6\" submodule update --init --recursive && make run-binary-fast -j$(nproc) CONFIG=CVA6Config BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/multiply.riscv" + } + ], + "chipyard-ibex": [ + { + "custom": true, + "string": "true" + } + ], + "chipyard-vexiiriscv": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=VexiiRiscvConfig LOADMEM=1" + }, + { + "custom": true, + "string": "make run-bmark-tests-fast -j$(nproc) CONFIG=VexiiRiscvConfig LOADMEM=1" + } + ], + "chipyard-sodor": [ + { + "custom": true, + "string": "make run-asm-tests-fast -j$(nproc) CONFIG=Sodor5StageConfig" + } + ], + "chipyard-constellation": [ + { + "custom": false, + "config": ["SharedNoCConfig"], + "binary": ["$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv"], + "loadmem": "1" + } + ], + "chipyard-tacit-rocket": [ + { + "custom": false, + "config": ["TacitRocketConfig"], + "binary": ["$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv"], + "loadmem": "1" + } + ], + "chipyard-zephyr": [ + { + "custom": true, + "string": "bash $LOCAL_CHIPYARD_DIR/.github/scripts/build-zephyr.sh && make run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/software/zephyrproject/zephyr/build/zephyr/zephyr.elf LOADMEM=1" + } + ], + "chipyard-radiance": [ + { + "custom": true, + "string": "true" + } + ], + "icenet": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=icenet BINARY=none" + } + ], + "testchipip": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=testchipip BINARY=none" + } + ], + "constellation": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=constellation BINARY=none" + } + ], + "rocketchip-amba": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=rocketchip CONFIG=AMBAUnitTestConfig BINARY=none" + } + ], + "rocketchip-tlsimple": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=rocketchip CONFIG=TLSimpleUnitTestConfig BINARY=none" + } + ], + "rocketchip-tlwidth": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=rocketchip CONFIG=TLWidthUnitTestConfig BINARY=none" + } + ], + "rocketchip-tlxbar": [ + { + "custom": true, + "string": "make run-binary-fast SUB_PROJECT=rocketchip CONFIG=TLXbarUnitTestConfig BINARY=none" + } + ] +} diff --git a/.github/workflows/config/release-notes.json b/.github/workflows/config/release-notes.json deleted file mode 100644 index d6098d7b17..0000000000 --- a/.github/workflows/config/release-notes.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "categories": [ - { - "title": "## Added", - "labels": ["changelog:added"] - }, - { - "title": "## Changed", - "labels": ["changelog:changed"] - }, - { - "title": "## Fixed", - "labels": ["changelog:fixed"] - }, - { - "title": "## Removed", - "labels": ["changelog:removed"] - }, - { - "title": "## Uncategorized", - "labels": [] - } - ], - "ignore_labels": [ - "changelog:omit" - ], - "sort": { - "order": "ASC", - "on_property": "mergedAt" - }, - "template": "${{CHANGELOG}}\n\n**Full Changelog:** ${{RELEASE_DIFF}}\n", - "pr_template": "- ${{TITLE}} (by @${{AUTHOR}} in ${{URL}})${{RELEASE_NOTES}}", - "empty_template": "- no changes", - "transformers": [ - { - "pattern": "", - "flags": "gus", - "target": "" - } - ], - "custom_placeholders": [ - { - "name": "RELEASE_NOTES", - "source": "BODY", - "transformer": { - "pattern": ".*#### Release Notes(?:[\n\\s]|(?:))*((?:\\S(?!!--)).*?)[\n\\s]*\n#.*", - "flags": "gus", - "target": "\n $1" - } - } - ], - "trim_values": false, - "max_tags_to_fetch": 200, - "max_pull_requests": 500, - "max_back_track_time_days": 365 -} diff --git a/.github/workflows/firesim-cluster-tests.yml b/.github/workflows/firesim-cluster-tests.yml deleted file mode 100644 index 9341bb6ad1..0000000000 --- a/.github/workflows/firesim-cluster-tests.yml +++ /dev/null @@ -1,213 +0,0 @@ -# ci tests that use a separate repository to run (can potentially share ci resources with other workflows) -name: firesim-cluster-tests - -on: - # run ci when pring to main (note: ci runs on the merge commit of the pr!) - pull_request: - branches: - - main - - stable - -defaults: - run: - shell: bash -leo pipefail {0} - -env: - # needed for local FPGA build bitstream (access GH repo to store bitstreams) - PERSONAL_ACCESS_TOKEN: ${{ secrets.BARTENDER_PERSONAL_ACCESS_TOKEN }} - - # temporary directories should be located in /scratch (since it's larger) - REMOTE_WORK_DIR: /scratch/buildbot/cy-ci-shared/cy-${{ github.sha }}-${{ github.workflow }} - JAVA_TMP_DIR: /scratch/buildbot/cy-ci-shared/cy-javatmpdir-${{ github.sha }}-${{ github.workflow }} - - # misc - TERM: xterm-256-color - -jobs: - cancel-prior-workflows: - name: cancel-prior-workflows - runs-on: ubuntu-22.04 - steps: - - name: Cancel previous workflow runs - if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:persist-prior-workflows') != true }} - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - start-workflow: - name: start-workflow - # unable to access env context in job.if thus have to put gh-a context expression directly here. - # note that the check is using a boolean true instead of string 'true' since it's directly using - # the expression not a variable like if checking against the env context string. - if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:disable') != true }} - runs-on: ubuntu-22.04 - steps: - - run: true - - # Set up a set of boolean conditions to control which branches of the CI - # workflow will execute. This is based off the conditional job execution - # example here: https://github.com/dorny/paths-filter#examples - filter-jobs-on-changes: - name: filter-jobs-on-changes - runs-on: ubuntu-22.04 - needs: start-workflow - # Queried by downstream jobs to determine if they should run. - outputs: - run-ci: ${{ steps.filter.outputs.all_count != steps.filter.outputs.non-ci-files_count }} - both-conda-reqs-lock-modified: ${{ - ((steps.filter.outputs.conda-reqs == 'false') && (steps.filter.outputs.conda-lockfile == 'false')) || - ((steps.filter.outputs.conda-reqs == 'true') && (steps.filter.outputs.conda-lockfile == 'true')) }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - all: - - '**' - - docs: &docs-handle - - 'docs/**' - - '.readthedocs.yml' - - release: &release-handle - - '.github/workflows/release-notes.yml' - - '.github/workflows/config/release-notes.json' - - non-ci-files: - - *docs-handle - - *release-handle - - '**/*.md' - - '**/.gitignore' - - '**/.gitattributes' - - '.github/ISSUE_TEMPLATE/**' - - '.github/PULL_REQUEST_TEMPLATE.md' - - '.github/dependabot.yml' - - '.mergify.yml' - - conda-reqs: - - 'conda-reqs/*.yaml' - - conda-lockfile: - - 'conda-reqs/conda-lock-reqs/*.conda-lock.yml' - - # Note: This doesn't check if the lock file is synced/faithful to the requirements file. - # This just ensures that both were modified in the same PR (ideally the lock file was regenerated - # from the requirements file). This job only runs when that condition is not met and - # so always fails. - check-conda-lock-modified: - name: check-conda-lock-modified - needs: filter-jobs-on-changes - if: needs.filter-jobs-on-changes.outputs.both-conda-reqs-lock-modified == 'false' - runs-on: ubuntu-22.04 - steps: - - name: Check conda lock file was regenerated with conda requirements file - run: | - echo "ERROR: Either the conda-reqs/*.yaml or conda-reqs/conda-lock-reqs/*.conda-lock.yml was not updated properly. Please regenerate lockfiles." - false - - setup-persistent-repo: - name: setup-persistent-repo - runs-on: as4 - needs: filter-jobs-on-changes - if: needs.filter-jobs-on-changes.outputs.run-ci == 'true' - steps: - # This forces a fresh clone of the repo during the `checkout` step - # to resolve stale submodule URLs. See https://github.com/ucb-bar/chipyard/pull/1156. - - name: Delete old checkout - run: | - rm -rf ${{ github.workspace }}/* || true - rm -rf ${{ github.workspace }}/.* || true - - uses: actions/checkout@v4 - - name: Setup repo copy - run: | - mkdir -p $(dirname ${{ env.REMOTE_WORK_DIR }}) - git clone ${{ github.workspace }} ${{ env.REMOTE_WORK_DIR }} - - name: Setup Java temp. directory - run: | - mkdir -p ${{ env.JAVA_TMP_DIR }} - - name: Setup repo (for xilinx_alveo_u250 platform) - run: | - cd ${{ env.REMOTE_WORK_DIR }} - export MAKEFLAGS="-j32" - ./build-setup.sh --verbose - cd sims/firesim - source sourceme-manager.sh --skip-ssh-setup - firesim managerinit --platform xilinx_alveo_u250 - - run-metasims-xilinx_alveo_u250: - name: run-metasims-xilinx_alveo_u250 - needs: [setup-persistent-repo] - runs-on: as4 - steps: - - name: Run metasims (VCS + Verilator) - run: | - cd ${{ env.REMOTE_WORK_DIR }} - source env.sh - .github/scripts/run-metasims.py - - run-basic-linux-poweroffs-xilinx_alveo_u250: - name: run-basic-linux-poweroffs-xilinx_alveo_u250 - if: contains(github.event.pull_request.labels.*.name, 'ci:fpga-deploy') - needs: [setup-persistent-repo, run-metasims-xilinx_alveo_u250] # must not run in parallel - runs-on: as4 - steps: - - name: Run non-networked single-node Linux poweroff tests (single-core Rocket/BOOM, multi-core Rocket) w/ Xilinx Alveo U250 - run: | - cd ${{ env.REMOTE_WORK_DIR }} - source env.sh - .github/scripts/run-linux-poweroff.py --platform xilinx_alveo_u250 - - build-default-bitstreams: - name: build-default-bitstreams - if: contains(github.event.pull_request.labels.*.name, 'ci:local-fpga-buildbitstream-deploy') - needs: [setup-persistent-repo, run-metasims-xilinx_alveo_u250 ] # must not run in parallel - runs-on: as4 - env: - CHIPYARD_HWDB_PATH: sims/firesim-staging/sample_config_hwdb.yaml - GH_ORG: firesim - GH_REPO: firesim-public-bitstreams - steps: - - uses: actions/checkout@v4 - - name: Create temporary clone of repo to store built bitstreams into - uses: actions/checkout@v4 - with: - repository: ${{ env.GH_ORG }}/${{ env.GH_REPO }} - ssh-key: ${{ secrets.BARTENDER_PRIVATE_SSH_KEY }} - path: ${{ env.GH_REPO }} - fetch-depth: 1 - # requires checkout above - - name: Run buildbitstream command and update sample local bitstreams in bitstream repository - run: | - cd ${{ env.REMOTE_WORK_DIR }} - source env.sh - .github/scripts/build-default-bitstreams.py - - name: Push bitstreams built/copied in bitstream repo - run: | - cd ${{ github.workspace }}/${{ env.GH_REPO }} - git log - git diff origin/main - git push origin main - - uses: peter-evans/create-pull-request@v7 - with: - base: ${{ github.head_ref }} - add-paths: ${{ env.CHIPYARD_HWDB_PATH }} - commit-message: "Update local bitstream(s) [ci skip]" - body: "Update local bitstream(s) for PR #${{ github.event.pull_request.number }}" - branch-suffix: random - title: "Update local bitstream(s) for PR #${{ github.event.pull_request.number }} (`${{ github.head_ref }}`)" - - cleanup-local-fpga-repo: - name: cleanup-local-fpga-repo - needs: [ - run-metasims-xilinx_alveo_u250, - run-basic-linux-poweroffs-xilinx_alveo_u250, - build-default-bitstreams] - # uses a separate runner to cleanup (irrespective, of other jobs cancelled, running, etc) - runs-on: as4 - if: ${{ always() }} - steps: - - name: Delete repo copy - run: | - rm -rf ${{ env.REMOTE_WORK_DIR }} - rm -rf ${{ env.JAVA_TMP_DIR }} diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml new file mode 100644 index 0000000000..eb748cd6ef --- /dev/null +++ b/.github/workflows/pr-ci.yml @@ -0,0 +1,82 @@ +name: Chipyard Pull Request CI + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + - labeled + - unlabeled + +permissions: + actions: write + contents: read + packages: read + pull-requests: read + +concurrency: + group: pr-ci-${{ github.event.pull_request.number }} + cancel-in-progress: ${{ contains(github.event.pull_request.labels.*.name, 'ci:disable') }} + +jobs: + check-ci-disable: + name: check-ci-disable + if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} + uses: ./.github/workflows/check-ci-disable.yml + with: + pr_number: ${{ github.event.pull_request.number }} + pr_head_ref: ${{ github.event.pull_request.head.ref }} + pr_head_repo_id: ${{ github.event.pull_request.head.repo.id }} + pr_labels: ${{ toJson(github.event.pull_request.labels.*.name) }} + + build-setup-ubuntu: + name: build-setup ubuntu + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/build-setup-ubuntu.yml + with: + pr_number: ${{ github.event.pull_request.number }} + + build-setup-ubuntu-2604: + name: build-setup ubuntu 26.04 + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/build-setup-ubuntu-26.04.yml + with: + pr_number: ${{ github.event.pull_request.number }} + + build-setup-rhel: + name: build-setup rhel + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/build-setup-rhel.yml + with: + pr_number: ${{ github.event.pull_request.number }} + + build-documentation: + name: build documentation + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/build-docs.yml + with: + pr_number: ${{ github.event.pull_request.number }} + + run-generator-tests: + name: run generator tests + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/run-generator-tests.yml + with: + pr_number: ${{ github.event.pull_request.number }} + secrets: inherit + + run-firesim-tests: + name: run firesim tests + needs: check-ci-disable + if: ${{ needs.check-ci-disable.outputs.ci_disabled != 'true' }} + uses: ./.github/workflows/run-firesim-tests.yml + with: + pr_number: ${{ github.event.pull_request.number }} + secrets: inherit diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml deleted file mode 100644 index 6e2f1aac8a..0000000000 --- a/.github/workflows/release-notes.yml +++ /dev/null @@ -1,51 +0,0 @@ -# adapted from https://github.com/chipsalliance/chisel/blob/main/.github/workflows/release-notes.yml - -name: Generate Release Notes - -on: - release: - types: [created] - workflow_dispatch: - inputs: - toTag: - description: 'Tag or ref for which to generate release notes' - required: true - fromTag: - # If you leave this blank, it'll select previous SemVer version - # WARNING: Cannot use anything older than a005498 because of the git tree merge - description: 'Tag or ref from which to start generating release notes' - required: false - - -jobs: - generate_release_notes: - name: Generate Release Notes - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Release Notes - id: release-notes - uses: mikepenz/release-changelog-builder-action@v5 - with: - configuration: .github/workflows/config/release-notes.json - failOnError: true - # Amazingly, on release where the inputs are empty, this just does the right thing - # The "toTag" is the released tag, and the "fromTag" is the previous tag according to SemVer - fromTag: ${{ github.event.inputs.fromTag }} - toTag: ${{ github.event.inputs.toTag }} - token: ${{ secrets.GITHUB_TOKEN }} - - name: Report Release Notes - # Put output through env variable to make it robust to quotes - env: - CHANGELOG: ${{steps.release-notes.outputs.changelog}} - run: echo "$CHANGELOG" >> $GITHUB_STEP_SUMMARY - - name: Upload Release Notes (on release) - if: github.event_name == 'release' - uses: softprops/action-gh-release@v2.2.1 - with: - body: ${{ steps.release-notes.outputs.changelog }} - - name: Error on uncategorized PRs - if: steps.release-notes.outputs.uncategorized_prs != 0 - run: exit 1 diff --git a/.github/workflows/require-label.yml b/.github/workflows/require-label.yml deleted file mode 100644 index 0088f6bd62..0000000000 --- a/.github/workflows/require-label.yml +++ /dev/null @@ -1,24 +0,0 @@ -# adapted from https://github.com/chipsalliance/chisel/blob/main/.github/workflows/require-label.yml - -name: Require Release Notes Label - -on: - pull_request: - branches: - - main - types: - - opened - - synchronize - - reopened - - labeled - - unlabeled - -jobs: - check_labels: - name: Check Labels - runs-on: ubuntu-latest - steps: - - uses: docker://agilepathway/pull-request-label-checker:v1.4.25 - with: - one_of: changelog:added,changelog:changed,changelog:fixed,changelog:omit,changelog:removed - repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-firesim-tests.yml b/.github/workflows/run-firesim-tests.yml new file mode 100644 index 0000000000..95df850899 --- /dev/null +++ b/.github/workflows/run-firesim-tests.yml @@ -0,0 +1,244 @@ +name: run firesim tests + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + packages: read + +defaults: + run: + shell: bash -leo pipefail {0} + +env: + FORCE_NON_EC2: 1 + JVM_OPTS: -Xmx3200m + FIRESIM_TEST_TIMEOUT_SECONDS: 7200 + FIRESIM_HEARTBEAT_SECONDS: 60 + # override: sims/firesim/sim/make/scala-build.mk:33 + FIRESIM_JAVA_HEAP_SIZE: 8G + # override: sims/firesim/sim/make/verilator.mk:8 -- F2 Gemmini generated C++ is memory-heavy on GitHub runners + FIRESIM_F2_VERILATOR_MAKEFLAGS: -j1 VM_PARALLEL_BUILDS=1 + +jobs: + firesim-onprem-tests: + name: FireSim Golden Gate Compile + rvi-bmark-tests OnPrem + runs-on: ubuntu-24.04 + timeout-minutes: 180 + env: + DOCKER_DATA_ROOT: ${{ github.workspace }}/.ci/docker + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Move Docker storage to workspace + run: | + sudo systemctl stop docker + sudo mkdir -p "${DOCKER_DATA_ROOT}" + printf '{ "data-root": "%s" }\n' "${DOCKER_DATA_ROOT}" | sudo tee /etc/docker/daemon.json + sudo systemctl start docker + docker info --format 'Docker root: {{ .DockerRootDir }}' + + - name: Pull Chipyard container + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + image_name="ghcr.io/${GITHUB_REPOSITORY,,}:main" + echo "CHIPYARD_IMAGE=${image_name}" >> "${GITHUB_ENV}" + echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + docker pull "${image_name}" + + - name: Run FireSim On-Prem tests + env: + PR_NUMBER: ${{ inputs.pr_number }} + run: | + docker run --rm -i \ + --env "FORCE_NON_EC2=${FORCE_NON_EC2}" \ + --env "JVM_OPTS=${JVM_OPTS}" \ + --env "JAVA_HEAP_SIZE=${FIRESIM_JAVA_HEAP_SIZE}" \ + --env "FIRESIM_TEST_TIMEOUT_SECONDS=${FIRESIM_TEST_TIMEOUT_SECONDS}" \ + --env "FIRESIM_HEARTBEAT_SECONDS=${FIRESIM_HEARTBEAT_SECONDS}" \ + --env "PR_NUMBER=${PR_NUMBER}" \ + --env "GITHUB_SERVER_URL=${GITHUB_SERVER_URL}" \ + --env "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" \ + --entrypoint /bin/bash \ + "${CHIPYARD_IMAGE}" \ + -leo pipefail <<'CONTAINER_SCRIPT' + cd /home/ubuntu/chipyard + git config --global --add safe.directory "*" + git remote set-url origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + + # Record the submodules initialized in the pulled container. + initialized_before="$(mktemp)" + submodules_after="$(mktemp)" + initialized_targets="$(mktemp)" + new_targets="$(mktemp)" + removed_targets="$(mktemp)" + + git submodule status \ + | awk 'substr($1, 1, 1) != "-" { print $2 }' \ + | sort -u > "${initialized_before}" + + # Checkout main in the container. + git fetch --no-tags origin main + git checkout --detach FETCH_HEAD + + # Move to GitHub's current PR merge commit. + git fetch --no-tags origin "pull/${PR_NUMBER}/merge" + git checkout --detach FETCH_HEAD + + # Compare submodule membership before and after the PR checkout. + git config --file .gitmodules --get-regexp '^submodule\..*\.path$' \ + | awk '{ print $2 }' \ + | sort -u > "${submodules_after}" + + comm -12 "${initialized_before}" "${submodules_after}" > "${initialized_targets}" + comm -13 "${initialized_before}" "${submodules_after}" > "${new_targets}" + comm -23 "${initialized_before}" "${submodules_after}" > "${removed_targets}" + + # Remove submodules deleted by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule deinit --force -- "${submodule_path}" || true + rm -rf -- "${submodule_path}" + done < "${removed_targets}" + + # Update submodules already initialized in the container. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${initialized_targets}" + + # Initialize submodules newly added by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule init -- "${submodule_path}" + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${new_targets}" + + git rev-parse --short HEAD + .github/scripts/run-firesim-tests.sh onprem "${PR_NUMBER}" /home/ubuntu/chipyard + CONTAINER_SCRIPT + + firesim-f2-tests: + name: FireSim Golden Gate Compile + rvi-bmark-tests AWS F2 + runs-on: ubuntu-24.04 + timeout-minutes: 180 + env: + DOCKER_DATA_ROOT: ${{ github.workspace }}/.ci/docker + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Move Docker storage to workspace + run: | + sudo systemctl stop docker + sudo mkdir -p "${DOCKER_DATA_ROOT}" + printf '{ "data-root": "%s" }\n' "${DOCKER_DATA_ROOT}" | sudo tee /etc/docker/daemon.json + sudo systemctl start docker + docker info --format 'Docker root: {{ .DockerRootDir }}' + + - name: Pull Chipyard container + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + image_name="ghcr.io/${GITHUB_REPOSITORY,,}:main" + echo "CHIPYARD_IMAGE=${image_name}" >> "${GITHUB_ENV}" + echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + docker pull "${image_name}" + + - name: Run FireSim AWS F2 tests + env: + PR_NUMBER: ${{ inputs.pr_number }} + run: | + docker run --rm -i \ + --env "FORCE_NON_EC2=${FORCE_NON_EC2}" \ + --env "JVM_OPTS=${JVM_OPTS}" \ + --env "JAVA_HEAP_SIZE=${FIRESIM_JAVA_HEAP_SIZE}" \ + --env "VERILATOR_MAKEFLAGS=${FIRESIM_F2_VERILATOR_MAKEFLAGS}" \ + --env "FIRESIM_TEST_TIMEOUT_SECONDS=${FIRESIM_TEST_TIMEOUT_SECONDS}" \ + --env "FIRESIM_HEARTBEAT_SECONDS=${FIRESIM_HEARTBEAT_SECONDS}" \ + --env "PR_NUMBER=${PR_NUMBER}" \ + --env "GITHUB_SERVER_URL=${GITHUB_SERVER_URL}" \ + --env "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" \ + --entrypoint /bin/bash \ + "${CHIPYARD_IMAGE}" \ + -leo pipefail <<'CONTAINER_SCRIPT' + cd /home/ubuntu/chipyard + git config --global --add safe.directory "*" + git remote set-url origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + + # Record the submodules initialized in the pulled container. + initialized_before="$(mktemp)" + submodules_after="$(mktemp)" + initialized_targets="$(mktemp)" + new_targets="$(mktemp)" + removed_targets="$(mktemp)" + + git submodule status \ + | awk 'substr($1, 1, 1) != "-" { print $2 }' \ + | sort -u > "${initialized_before}" + + # Checkout main in the container. + git fetch --no-tags origin main + git checkout --detach FETCH_HEAD + + # Move to GitHub's current PR merge commit. + git fetch --no-tags origin "pull/${PR_NUMBER}/merge" + git checkout --detach FETCH_HEAD + + # Compare submodule membership before and after the PR checkout. + git config --file .gitmodules --get-regexp '^submodule\..*\.path$' \ + | awk '{ print $2 }' \ + | sort -u > "${submodules_after}" + + comm -12 "${initialized_before}" "${submodules_after}" > "${initialized_targets}" + comm -13 "${initialized_before}" "${submodules_after}" > "${new_targets}" + comm -23 "${initialized_before}" "${submodules_after}" > "${removed_targets}" + + # Remove submodules deleted by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule deinit --force -- "${submodule_path}" || true + rm -rf -- "${submodule_path}" + done < "${removed_targets}" + + # Update submodules already initialized in the container. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${initialized_targets}" + + # Initialize submodules newly added by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule init -- "${submodule_path}" + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${new_targets}" + + git rev-parse --short HEAD + .github/scripts/run-firesim-tests.sh f2 "${PR_NUMBER}" /home/ubuntu/chipyard + CONTAINER_SCRIPT diff --git a/.github/workflows/run-generator-tests.yml b/.github/workflows/run-generator-tests.yml new file mode 100644 index 0000000000..766cc6ca5e --- /dev/null +++ b/.github/workflows/run-generator-tests.yml @@ -0,0 +1,159 @@ +name: run generator tests + +on: + workflow_call: + inputs: + pr_number: + required: true + type: number + +permissions: + contents: read + packages: read + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + test-matrix: + name: test matrix + runs-on: ubuntu-latest + outputs: + test_names: ${{ steps.tests.outputs.test_names }} + steps: + - name: Check out pull request merge ref + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ inputs.pr_number }}/merge + + - name: Read generator test names + id: tests + run: | + test_names="$(python3 -c 'import json; print(json.dumps(sorted(json.load(open(".github/workflows/config/generator-tests.json")).keys())))')" + echo "test_names=${test_names}" >> "${GITHUB_OUTPUT}" + + run-generator-test: + name: ${{ matrix.test_name }} + needs: test-matrix + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + test_name: ${{ fromJson(needs.test-matrix.outputs.test_names) }} + env: + DOCKER_DATA_ROOT: ${{ github.workspace }}/.ci/docker + FORCE_NON_EC2: 1 + JVM_OPTS: -Xmx3200m + steps: + - name: Maximize build space + uses: jimfangx/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 10240 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + + - name: Move Docker storage to workspace + run: | + sudo systemctl stop docker + sudo mkdir -p "${DOCKER_DATA_ROOT}" + printf '{ "data-root": "%s" }\n' "${DOCKER_DATA_ROOT}" | sudo tee /etc/docker/daemon.json + sudo systemctl start docker + docker info --format 'Docker root: {{ .DockerRootDir }}' + + - name: Pull Chipyard container + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + image_name="ghcr.io/${GITHUB_REPOSITORY,,}:main" + echo "CHIPYARD_IMAGE=${image_name}" >> "${GITHUB_ENV}" + echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + docker pull "${image_name}" + + - name: Run generator test in container + env: + PR_NUMBER: ${{ inputs.pr_number }} + TEST_NAME: ${{ matrix.test_name }} + run: | + docker run --rm -i \ + --env "FORCE_NON_EC2=${FORCE_NON_EC2}" \ + --env "JVM_OPTS=${JVM_OPTS}" \ + --env "PR_NUMBER=${PR_NUMBER}" \ + --env "TEST_NAME=${TEST_NAME}" \ + --env "GITHUB_SERVER_URL=${GITHUB_SERVER_URL}" \ + --env "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" \ + "${CHIPYARD_IMAGE}" \ + bash -leo pipefail <<'CONTAINER_SCRIPT' + cd /home/ubuntu/chipyard + git config --global --add safe.directory "*" + git remote set-url origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + + # Record the submodules initialized in the pulled container. + initialized_before="$(mktemp)" + submodules_after="$(mktemp)" + initialized_targets="$(mktemp)" + new_targets="$(mktemp)" + removed_targets="$(mktemp)" + + git submodule status \ + | awk 'substr($1, 1, 1) != "-" { print $2 }' \ + | sort -u > "${initialized_before}" + + # Checkout main in the container. + git fetch --no-tags origin main + git checkout --detach FETCH_HEAD + + # Move to GitHub's current PR merge commit. + git fetch --no-tags origin "pull/${PR_NUMBER}/merge" + git checkout --detach FETCH_HEAD + + # Compare submodule membership before and after the PR checkout. + git config --file .gitmodules --get-regexp '^submodule\..*\.path$' \ + | awk '{ print $2 }' \ + | sort -u > "${submodules_after}" + + comm -12 "${initialized_before}" "${submodules_after}" > "${initialized_targets}" + comm -13 "${initialized_before}" "${submodules_after}" > "${new_targets}" + comm -23 "${initialized_before}" "${submodules_after}" > "${removed_targets}" + + # Remove submodules deleted by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule deinit --force -- "${submodule_path}" || true + rm -rf -- "${submodule_path}" + done < "${removed_targets}" + + # Update submodules already initialized in the container. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${initialized_targets}" + + # Initialize submodules newly added by the PR. + while read -r submodule_path; do + [ -n "${submodule_path}" ] || continue + git submodule init -- "${submodule_path}" + git submodule sync -- "${submodule_path}" + git submodule update --init -- "${submodule_path}" + done < "${new_targets}" + + git rev-parse --short HEAD + + # Initialize only additional submodules needed by this generator test. + bash .github/scripts/prepare-generator-test-submodules.sh "${TEST_NAME}" /home/ubuntu/chipyard + + # Build tests in both tests/ and tests/build due to legacy paths. + source env.sh + cmake -S tests -B tests/ -D CMAKE_BUILD_TYPE=Debug + cmake --build tests --target clean + cmake --build tests --target all + cmake -S tests -B tests/build -D CMAKE_BUILD_TYPE=Debug + cmake --build tests/build --target clean + cmake --build tests/build --target all + + python3 .github/scripts/run-generator-test.py "${TEST_NAME}" + CONTAINER_SCRIPT diff --git a/.github/workflows/update-circt.yml.disabled b/.github/workflows/update-circt.yml.disabled deleted file mode 100644 index 30147b53d6..0000000000 --- a/.github/workflows/update-circt.yml.disabled +++ /dev/null @@ -1,27 +0,0 @@ -# DISABLED: This workflow is temporarily disabled - -# name: update-circt - -# # update weekly -# on: -# schedule: -# - cron: 0 0 * * 1 - -# defaults: -# run: -# shell: bash -leo pipefail {0} - -# jobs: -# update-circt: -# name: update-circt -# runs-on: ubuntu-latest -# steps: -# - name: Update CIRCT -# uses: circt/update-circt@v1 -# with: -# user: 'bartender' -# email: 'firesimchipyard@gmail.com' -# pr-reviewers: '' -# pr-labels: 'changelog:changed' -# circt-config: './conda-reqs/circt.json' -# github-token: ${{ secrets.BARTENDER_PERSONAL_ACCESS_TOKEN }} \ No newline at end of file diff --git a/common.mk b/common.mk index de111d17f4..b713ca77ed 100644 --- a/common.mk +++ b/common.mk @@ -78,6 +78,8 @@ HELP_COMMANDS += \ " run-binaries = run [./$(shell basename $(sim))] and log instructions to file" \ " run-binaries-fast = run [./$(shell basename $(sim))] and don't log instructions" \ " run-binaries-debug = run [./$(shell basename $(sim_debug))] and log instructions and waveform to files" \ +" run-asm-tests-fast = run RV64GC riscv-tests ISA tests without instruction logs" \ +" run-bmark-tests-fast = run riscv-tests benchmarks without instruction logs" \ " verilog = generate intermediate verilog files from chisel elaboration and firrtl passes" \ " firrtl = generate intermediate firrtl files from chisel elaboration" \ " run-tests = run all assembly and benchmark tests" \ @@ -329,7 +331,7 @@ verilog: $(sim_common_files) ######################################################################################### # helper rules to run simulations ######################################################################################### -.PHONY: run-binary run-binary-fast run-binary-debug run-fast +.PHONY: run-binary run-binary-fast run-binary-debug run-fast run-asm-tests-fast run-bmark-tests-fast \ %.check-exists check-binary check-binaries check-binary: @@ -447,6 +449,96 @@ run-binary-fast-hex: override SIM_FLAGS += +loadmem=$(BINARY) ######################################################################################### # run assembly/benchmarks rules ######################################################################################### +RISCV_TESTS_ISA_DIR = $(RISCV)/riscv64-unknown-elf/share/riscv-tests/isa +RISCV_TESTS_BENCHMARK_DIR = $(RISCV)/riscv64-unknown-elf/share/riscv-tests/benchmarks + +RV64GC_ISA_TEST_PREFIXES ?= rv64ui rv64uc rv64um rv64ua rv64uf rv64ud + +# https://github.com/riscv-software-src/riscv-tests/issues/419 +RV64GC_ASM_TEST_EXCLUDES ?= rv64ui-p-ma_data + +RV64GC_ASM_TESTS ?= $(filter-out \ + %.dump \ + $(addprefix $(RISCV_TESTS_ISA_DIR)/,$(RV64GC_ASM_TEST_EXCLUDES)), \ + $(foreach prefix,$(RV64GC_ISA_TEST_PREFIXES),$(wildcard $(RISCV_TESTS_ISA_DIR)/$(prefix)-p-*))) + +RISCV_BMARK_TEST_NAMES ?= \ + dhrystone \ + median \ + memcpy \ + mm \ + mt-matmul \ + mt-memcpy \ + mt-vvadd \ + multiply \ + pmp \ + qsort \ + rsort \ + spmv \ + towers \ + vvadd + +RISCV_BMARK_TESTS ?= $(wildcard $(addprefix $(RISCV_TESTS_BENCHMARK_DIR)/,$(addsuffix .riscv,$(RISCV_BMARK_TEST_NAMES)))) +RUN_FAST_STATUS_DIR = $(output_dir)/run-fast-status +RUN_FAST_SIM_READY = $(if $(SIM_PREREQ),$(output_dir)/run-fast-sim-ready) +get_run_fast_status = $(RUN_FAST_STATUS_DIR)/$(1)/$(notdir $(basename $(2))).status +RV64GC_ASM_TEST_STATUS = $(foreach binary,$(RV64GC_ASM_TESTS),$(call get_run_fast_status,asm,$(binary))) +RISCV_BMARK_TEST_STATUS = $(foreach binary,$(RISCV_BMARK_TESTS),$(call get_run_fast_status,bmark,$(binary))) + +######################################################################################### +# include build/project specific makefrags made from the generator +######################################################################################### +aggregate_fast_test_goals = run-fast run-asm-tests-fast run-bmark-tests-fast +ifneq ($(filter run% %.run %.out %.vpd %.vcd %.fsdb,$(MAKECMDGOALS)),) +ifeq ($(filter $(aggregate_fast_test_goals),$(MAKECMDGOALS)),$(MAKECMDGOALS)) +else +-include $(build_dir)/$(long_name).d +endif +endif + +define run_binary_fast_status_rule +$(call get_run_fast_status,$(1),$(2)): FORCE | $(RUN_FAST_STATUS_DIR)/$(1) $(RUN_FAST_SIM_READY) + @rm -f "$$@" + @echo "========== Running $(3): $(2) ==========" + @if $(MAKE) --no-print-directory BREAK_SIM_PREREQ=1 run-binary-fast BINARY="$(2)"; then \ + printf 'PASS\t$(2)\n' > "$$@"; \ + else \ + status="$$$$?"; \ + printf 'FAIL\t%s\t$(2)\n' "$$$${status}" > "$$@"; \ + fi +endef + +$(foreach binary,$(RV64GC_ASM_TESTS),$(eval $(call run_binary_fast_status_rule,asm,$(binary),RV64GC ISA tests))) +$(foreach binary,$(RISCV_BMARK_TESTS),$(eval $(call run_binary_fast_status_rule,bmark,$(binary),riscv-tests benchmarks))) + +$(RUN_FAST_STATUS_DIR)/asm $(RUN_FAST_STATUS_DIR)/bmark: + mkdir -p $@ + +$(RUN_FAST_SIM_READY): $(SIM_PREREQ) | $(output_dir) + touch $@ + +.PHONY: FORCE +FORCE: + +define summarize_run_binary_fast_status + $(call require_riscv) + @if [ -z "$($(1))" ]; then \ + echo "No $(2) found under $(3)." >&2; \ + exit 1; \ + fi + @failures="$$(awk -F '\t' '$$1 == "FAIL" { printf " - %s (exit %s)\n", $$3, $$2 }' $(4))"; \ + if [ -n "$${failures}" ]; then \ + printf "\nFailed $(2):\n%s" "$${failures}" >&2; \ + exit 1; \ + fi +endef + +run-asm-tests-fast: $(RV64GC_ASM_TEST_STATUS) + $(call summarize_run_binary_fast_status,RV64GC_ASM_TESTS,RV64GC ISA tests,$(RISCV_TESTS_ISA_DIR),$^) + +run-bmark-tests-fast: $(RISCV_BMARK_TEST_STATUS) + $(call summarize_run_binary_fast_status,RISCV_BMARK_TESTS,riscv-tests benchmarks,$(RISCV_TESTS_BENCHMARK_DIR),$^) + $(output_dir): mkdir -p $@ @@ -461,13 +553,6 @@ $(output_dir)/%.run: $(output_dir)/% $(SIM_PREREQ) $(output_dir)/%.out: $(output_dir)/% $(SIM_PREREQ) (set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(call get_common_sim_flags,$<) $(PERMISSIVE_OFF) $< >(spike-dasm > $@) | tee $<.log) -######################################################################################### -# include build/project specific makefrags made from the generator -######################################################################################### -ifneq ($(filter run% %.run %.out %.vpd %.vcd %.fsdb,$(MAKECMDGOALS)),) --include $(build_dir)/$(long_name).d -endif - ####################################### # Rules for building DRAMSim2 library ####################################### diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index a9a9af3450..0bef1d51f0 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -1,61 +1,152 @@ +# syntax=docker/dockerfile:1-labs + ### This is a full chipyard setup # BUILD BASE FOR CI -FROM ubuntu:20.04 as base -ARG CHIPYARD_HASH +FROM ubuntu:24.04 AS base +ARG CHIPYARD_REPO=https://github.com/ucb-bar/chipyard.git +ARG CHIPYARD_REF=main + +LABEL maintainer="https://groups.google.com/forum/#!forum/chipyard" -MAINTAINER https://groups.google.com/forum/#!forum/chipyard +SHELL ["/bin/bash", "-leo", "pipefail", "-c"] -SHELL ["/bin/bash", "-c"] +ENV CONDA_INSTALL_DIR=/opt/conda +ENV FORCE_NON_EC2=1 +ENV HOME=/home/ubuntu +ENV JVM_OPTS=-Xmx3200m +ENV LOGNAME=ubuntu +ENV PATH="${CONDA_INSTALL_DIR}/bin:${PATH}" +ENV USER=ubuntu -# Install dependencies for ubuntu-req.sh +# Install host dependencies needed to clone Chipyard and bootstrap conda. RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + bc \ + build-essential \ + bzip2 \ + ca-certificates \ curl \ - wget \ + findutils \ git \ + gzip \ + iputils-ping \ + kmod \ + make \ + net-tools \ + netcat-openbsd \ + openssh-client \ + openssh-server \ + patch \ + procps \ + python3 \ sudo \ - ca-certificates \ - keyboard-configuration \ - console-setup \ - bc \ - unzip - -WORKDIR /root - -# Install Chipyard and run ubuntu-req.sh to install necessary dependencies -RUN git clone https://github.com/ucb-bar/chipyard.git && \ - cd chipyard && \ - git checkout $CHIPYARD_HASH - -RUN ./chipyard/.github/scripts/install-conda.sh + tar \ + unzip \ + xz-utils \ + wget && \ + rm -rf /var/lib/apt/lists/* + +RUN if id -u ubuntu >/dev/null 2>&1; then \ + usermod -o -u 0 -g 0 -d /home/ubuntu -s /bin/bash ubuntu; \ + else \ + useradd -o -u 0 -g 0 -d /home/ubuntu -s /bin/bash ubuntu; \ + fi && \ + mkdir -p /home/ubuntu && \ + chown ubuntu:root "$(dirname "${CONDA_INSTALL_DIR}")" /home/ubuntu + +USER ubuntu +WORKDIR /home/ubuntu + +# Clone Chipyard. CHIPYARD_REF can be a branch, tag, commit SHA, PR number, or refs/pull/... ref. +RUN git clone "${CHIPYARD_REPO}" chipyard && \ + cd chipyard && \ + if [[ "${CHIPYARD_REF}" =~ ^[0-9]+$ ]]; then \ + git fetch origin "pull/${CHIPYARD_REF}/merge" && \ + git checkout --detach FETCH_HEAD; \ + elif [[ "${CHIPYARD_REF}" =~ ^refs/pull/[0-9]+/(head|merge)$ ]]; then \ + git fetch origin "${CHIPYARD_REF}" && \ + git checkout --detach FETCH_HEAD; \ + else \ + git checkout "${CHIPYARD_REF}"; \ + fi && \ + git rev-parse --short HEAD + +# Install Miniforge using the same bootstrap scheme as CI. +RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ + bash Miniforge3.sh -b -p "${CONDA_INSTALL_DIR}" && \ + rm Miniforge3.sh && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh"; \ + fi && \ + conda activate # BUILD IMAGE WITH TOOLCHAINS # Use above build as base -FROM base as base-with-tools +FROM base AS base-with-tools -SHELL ["/bin/bash", "-cl"] +# Conda environment and Chipyard submodules. +RUN cd chipyard && \ + git config --global --add safe.directory "*" && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + if [ -f "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh" ]; then \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/mamba.sh"; \ + fi && \ + conda activate && \ + ./build-setup.sh riscv-tools \ + -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9 -s 10 -s 11 + +# Toolchain. +RUN cd chipyard && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 5 -s 6 -s 7 -s 8 -s 9 -s 10 -s 11 -# Initialize repo +# Scala compile. RUN cd chipyard && \ - export MAKEFLAGS=-"j $(nproc)" && \ - conda activate base && \ - ./setup.sh --env-name chipyard --skip-validate + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 3 -s 4 -s 6 -s 7 -s 8 -s 9 -s 10 -s 11 -SHELL ["/opt/conda/bin/conda", "run", "-n", "chipyard", "/bin/bash", "-cl"] +# FireSim initialization. +RUN cd chipyard && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 3 -s 4 -s 5 -s 9 -s 10 -s 11 + +# FireMarshal buildroot Linux. +RUN --security=insecure cd chipyard && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 10 -s 11 + +# CIRCT. +RUN cd chipyard && \ + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9 -s 11 -# Set up FireMarshal. Building and cleaning br-base.json builds the underlying -# buildroot image (which takes a long time) but doesn't keep all the br-base -# stuff around (since that's faster to rebuild). +# Finish setup and verify completion. RUN cd chipyard && \ - source env.sh && \ - cd software/firemarshal && \ - ./init-submodules.sh && \ - pip3 install -r python-requirements.txt && \ - ./marshal build br-base.json && \ - ./marshal clean br-base.json + source "${CONDA_INSTALL_DIR}/etc/profile.d/conda.sh" && \ + conda activate && \ + source /home/ubuntu/chipyard/env.sh && \ + ./build-setup.sh riscv-tools \ + -s 1 -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9 -s 10 && \ + grep -F "Setup complete!" build-setup.log # Run script to set environment variables on entry ENTRYPOINT ["chipyard/scripts/entrypoint.sh"] diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 887cda6297..aadf9fdaa1 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -8,7 +8,8 @@ Build and Deploy the Container ------------------------------ sudo docker build --target base . # to build the image for the CI - sudo docker build --target base --build-arg CHIPYARD_HASH= . # to build the image for the CI from a specific chipyard commit + sudo docker build --target base --build-arg CHIPYARD_REF= . # to build the image for the CI from a specific ref + sudo docker build --target base --build-arg CHIPYARD_REPO= --build-arg CHIPYARD_REF= . # to build from a specific repository/ref sudo docker build --target base-with-tools . # to build the full image sudo docker tag :tag . # to tag the image after the build (ex. 0.0.3) sudo docker login # login into the account to push to diff --git a/generators/firechip/chip/src/main/makefrag/firesim/build.mk b/generators/firechip/chip/src/main/makefrag/firesim/build.mk index d326aa6889..dcf8e7eb7c 100644 --- a/generators/firechip/chip/src/main/makefrag/firesim/build.mk +++ b/generators/firechip/chip/src/main/makefrag/firesim/build.mk @@ -53,6 +53,33 @@ CVA6_VERILATOR_FLAGS = \ DEFAULT_MIDAS_VERILATOR_FLAGS = \ --assert +# here to make verilator happy; prevents: +# "Operator DIV expects 16 bits on the RHS, but RHS's CONST '5'h10' generates 5 bits." err -- known issue, see: +# generators/gemmini/src/main/scala/gemmini/LoadController.scala:117 +# generators/gemmini/src/main/scala/gemmini/LoopConv.scala:474 +GEMMINI_VERILATOR_FLAGS = \ + $(DEFAULT_MIDAS_VERILATOR_FLAGS) \ + -Wno-WIDTHEXPAND + +# Saturn/Shuttle vector configs can emit unsigned comparisons that Verilator +# treats as fatal under the FireSim verilator backend. +SHUTTLE_VECTOR_VERILATOR_FLAGS = \ + $(DEFAULT_MIDAS_VERILATOR_FLAGS) \ + -Wno-UNSIGNED + # AJG: this must be evaluated after verilog generation to work (hence the =) EXTRA_VERILATOR_FLAGS = \ - $(shell if ! grep -iq "module.*cva6" $(simulator_verilog); then echo "$(DEFAULT_MIDAS_VERILATOR_FLAGS)"; else echo "$(CVA6_VERILATOR_FLAGS)"; fi) + $(shell \ + if grep -iq "module.*cva6" $(simulator_verilog); then \ + echo "$(CVA6_VERILATOR_FLAGS)"; \ + elif echo "$(TARGET_CONFIG)" | grep -Eiq "Gemmini"; then \ + echo "$(GEMMINI_VERILATOR_FLAGS)"; \ + elif grep -iq "module.*gemmini" $(simulator_verilog); then \ + echo "$(GEMMINI_VERILATOR_FLAGS)"; \ + elif echo "$(TARGET_CONFIG)" | grep -Eiq "Shuttle"; then \ + echo "$(SHUTTLE_VECTOR_VERILATOR_FLAGS)"; \ + elif grep -Eiq "module.*shuttle.*vector|shuttle_tile.*vector_unit|vector_unit\.vu" $(simulator_verilog); then \ + echo "$(SHUTTLE_VECTOR_VERILATOR_FLAGS)"; \ + else \ + echo "$(DEFAULT_MIDAS_VERILATOR_FLAGS)"; \ + fi) diff --git a/generators/firechip/chip/src/main/makefrag/firesim/metasim.mk b/generators/firechip/chip/src/main/makefrag/firesim/metasim.mk index 1e7c50a35d..87501448ba 100644 --- a/generators/firechip/chip/src/main/makefrag/firesim/metasim.mk +++ b/generators/firechip/chip/src/main/makefrag/firesim/metasim.mk @@ -1,5 +1,7 @@ # See LICENSE for license details. +SHELL := /bin/bash + ################################################################ # SW RTL Simulation Args -- for MIDAS- & FPGA-level Simulation # ################################################################ diff --git a/generators/firechip/chip/src/test/scala/FireSimTestSuite.scala b/generators/firechip/chip/src/test/scala/FireSimTestSuite.scala index e4d889bb66..f0c0c39625 100644 --- a/generators/firechip/chip/src/test/scala/FireSimTestSuite.scala +++ b/generators/firechip/chip/src/test/scala/FireSimTestSuite.scala @@ -17,7 +17,10 @@ import freechips.rocketchip.system.TestGeneration._ import freechips.rocketchip.system.DefaultTestSuites._ object BaseConfigs { - case object F1 extends BasePlatformConfig("f1", Seq("BaseF1Config")) + case object F1 extends BasePlatformConfig("f1", Seq("BaseF1Config")) + case object F2 extends BasePlatformConfig("f2", Seq("BaseF2Config")) + case object U250 extends BasePlatformConfig("xilinx_alveo_u250", Seq("BaseXilinxAlveoU250Config")) + case object VCU118 extends BasePlatformConfig("xilinx_vcu118", Seq("BaseXilinxVCU118Config")) } abstract class FireSimTestSuite( @@ -83,6 +86,7 @@ abstract class FireSimTestSuite( } } +// AWS F1 tests class SimpleRocketF1Tests extends FireSimTestSuite( "FireSim", @@ -131,11 +135,106 @@ class CVA6F1Tests Seq("FRFCFS16GBQuadRankLLC4MB"), ) -class CITests +// F2 platform tests +class RocketF2Tests + extends FireSimTestSuite( + "FireSim", + "WithDefaultFireSimBridges_WithFireSimHighPerfConfigTweaks_chipyard.RocketConfig", + BaseConfigs.F2, + ) + +class MultiRocketF2Tests + extends FireSimTestSuite( + "FireSim", + "WithNIC_WithDefaultFireSimBridges_WithFireSimHighPerfConfigTweaks_chipyard.QuadRocketConfig", + BaseConfigs.F2, + Seq("WithSynthAsserts", "WithModelMultiThreading", "FRFCFS16GBQuadRankLLC4MB"), + ) + +class GemminiRocketF2Tests + extends FireSimTestSuite( + "FireSim", + "FireSimLeanGemminiRocketConfig", + BaseConfigs.F2, + ) + +class LargeBoomF2Tests + extends FireSimTestSuite( + "FireSim", + "WithNIC_WithDefaultFireSimBridges_WithFireSimHighPerfConfigTweaks_chipyard.LargeBoomV3Config", + BaseConfigs.F2, + Seq("WithAutoILA_FRFCFS16GBQuadRankLLC4MB"), + ) + +class MegaBoomF2Tests + extends FireSimTestSuite( + "FireSim", + "WithDefaultFireSimBridges_WithFireSimTestChipConfigTweaks_chipyard.MegaBoomV3Config", + BaseConfigs.F2, + Seq("WithAutoILA_FRFCFS16GBQuadRankLLC4MB"), + ) + +class ShuttleF2Tests + extends FireSimTestSuite( + "FireSim", + "FireSimGENV256D128ShuttleConfig", + BaseConfigs.F2, + Seq("WithAutoILA_FRFCFS16GBQuadRankLLC4MB"), + ) + +// U250 platform tests +class RocketU250Tests + extends FireSimTestSuite( + "FireSim", + "FireSimRocketConfig", + BaseConfigs.U250, + ) + +class QuadRocketU250Tests + extends FireSimTestSuite( + "FireSim", + "FireSimQuadRocketConfig", + BaseConfigs.U250, + ) + +class LargeBoomU250Tests + extends FireSimTestSuite( + "FireSim", + "FireSimLargeBoomConfig", + BaseConfigs.U250, + ) + +class ShuttleU250Tests + extends FireSimTestSuite( + "FireSim", + "FireSimGENV256D128ShuttleConfig", + BaseConfigs.U250, + ) + +// VCU118 platform tests +class RocketVCU118Tests + extends FireSimTestSuite( + "FireSim", + "FireSimRocket4GiBDRAMConfig", + BaseConfigs.VCU118, + ) + +class AllTests extends Suites( new SimpleRocketF1Tests, new RocketF1Tests, new MultiRocketF1Tests, new BoomF1Tests, new RocketNICF1Tests, + new RocketF2Tests, + new MultiRocketF2Tests, + new GemminiRocketF2Tests, + new LargeBoomF2Tests, + new MegaBoomF2Tests, + new ShuttleF2Tests, + new RocketU250Tests, + new QuadRocketU250Tests, + new LargeBoomU250Tests, + new ShuttleU250Tests, + new RocketVCU118Tests, ) diff --git a/generators/tracegen/tracegen.mk b/generators/tracegen/tracegen.mk index 55a544e751..b12a7bff50 100644 --- a/generators/tracegen/tracegen.mk +++ b/generators/tracegen/tracegen.mk @@ -8,11 +8,26 @@ AXE=$(AXE_DIR)/axe $(AXE): $(wildcard $(AXE_DIR)/*.[ch]) $(AXE_DIR)/make.sh cd $(AXE_DIR) && ./make.sh -$(output_dir)/tracegen.out: $(SIM_PREREQ) - mkdir -p $(output_dir) && $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) none $@ +$(output_dir)/tracegen.out: $(if $(BREAK_SIM_PREREQ),,$(sim)) + mkdir -p $(output_dir) && \ + rm -f $@ $@.tmp && \ + if $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) none $@.tmp; then \ + mv $@.tmp $@; \ + else \ + cat $@.tmp >&2; \ + rm -f $@.tmp; \ + exit 1; \ + fi $(output_dir)/tracegen.result: $(output_dir)/tracegen.out $(AXE) - $(base_dir)/scripts/check-tracegen.sh $< > $@ + rm -f $@ $@.tmp && \ + if $(base_dir)/scripts/check-tracegen.sh $< > $@.tmp; then \ + mv $@.tmp $@; \ + else \ + cat $@.tmp >&2; \ + rm -f $@.tmp; \ + exit 1; \ + fi .PHONY: tracegen tracegen: $(output_dir)/tracegen.result diff --git a/scripts/check-tracegen.sh b/scripts/check-tracegen.sh index c30447ee21..fcd73bac37 100755 --- a/scripts/check-tracegen.sh +++ b/scripts/check-tracegen.sh @@ -7,20 +7,41 @@ AXE_DIR=$(realpath ${SCRIPT_DIR}/../tools/axe) ROCKET_DIR=$(realpath ${SCRIPT_DIR}/../generators/rocket-chip) TMP_DIR=$(mktemp -d -t tracegen-XXXXXXXX) +trap 'rm -rf "$TMP_DIR"' EXIT TO_AXE=${ROCKET_DIR}/scripts/toaxe.py TO_AXE_PY3=${TMP_DIR}/toaxe.py AXE=${AXE_DIR}/src/axe AXE_SHRINK=${AXE_DIR}/src/axe-shrink.py AXE_SHRINK_PY3=${TMP_DIR}/axe-shrink.py +run_2to3() { + local log_file="${TMP_DIR}/2to3.log" + if command -v 2to3 > /dev/null 2>&1; then + cmd=(2to3) + else + cmd=(python3 -m lib2to3) + fi + + if ! "${cmd[@]}" "$@" > "$log_file" 2>&1; then + cat "$log_file" >&2 + exit 1 + fi +} + # TODO: convert scripts to py3 in src -2to3 $TO_AXE -o ${TMP_DIR} -n -w +run_2to3 $TO_AXE -o ${TMP_DIR} -n -w sed -i '30d' $TO_AXE_PY3 # remove import sets -2to3 $AXE_SHRINK -o ${TMP_DIR} -n -w +run_2to3 $AXE_SHRINK -o ${TMP_DIR} -n -w PATH=$PATH:${AXE_DIR}/src -grep '.*:.*#.*@' $1 > ${TMP_DIR}/clean-trace.txt +if ! grep '.*:.*#.*@' "$1" > ${TMP_DIR}/clean-trace.txt; then + echo "ERROR: no tracegen events found in $1" >&2 + echo "The simulator may not have run successfully. First lines of trace output:" >&2 + sed -n '1,40p' "$1" >&2 || true + exit 1 +fi + python "$TO_AXE_PY3" ${TMP_DIR}/clean-trace.txt > ${TMP_DIR}/trace.axe result=$("$AXE" check wmo ${TMP_DIR}/trace.axe) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 457656e81e..689d62f9d6 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -3,6 +3,6 @@ # used with the dockerfile to set up enviroment variables by running env.sh # adapted from https://stackoverflow.com/questions/55921914/how-to-source-a-script-with-environment-variables-in-a-docker-build-process -. /root/chipyard/env.sh +. /home/ubuntu/chipyard/env.sh exec "$@" diff --git a/sims/firesim-staging/sample_config_hwdb.yaml b/sims/firesim-staging/sample_config_hwdb.yaml index 0e7383af89..b308fab8df 100644 --- a/sims/firesim-staging/sample_config_hwdb.yaml +++ b/sims/firesim-staging/sample_config_hwdb.yaml @@ -63,65 +63,67 @@ firesim_saturn_REFV256D128_rocket_singlecore_no_nic_l2_llc4mb_ddr3: deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null vitis_firesim_rocket_singlecore_no_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/11ba762decd46c5a933960eae699aaf551d6769f/vitis/vitis_firesim_rocket_singlecore_no_nic.tar.gz + # https://bitstreams.ucb.bar/vitis/vitis_firesim_rocket_singlecore_no_nic.xclbin + bitstream_tar: https://bitstreams.ucb.bar/vitis/vitis_firesim_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null vitis_firesim_gemmini_rocket_singlecore_no_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/0af81b912264abbe3f90f8140987814291090560/vitis/vitis_firesim_gemmini_rocket_singlecore_no_nic.tar.gz + # https://bitstreams.ucb.bar/vitis/vitis_firesim_gemmini_rocket_singlecore_no_nic.xclbin + bitstream_tar: https://bitstreams.ucb.bar/vitis/vitis_firesim_gemmini_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_rocket_singlecore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_rocket_quadcore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_rocket_quadcore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_rocket_quadcore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_boom_singlecore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_boom_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_boom_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_rocket_singlecore_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/d8e0d2535f2cae6834d8acc25fdc0c9c26230d28/xilinx_alveo_u250/alveo_u250_firesim_rocket_singlecore_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_rocket_singlecore_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_gemmini_rocket_singlecore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_gemmini_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_gemmini_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u250_firesim_saturn_GENV256D128_shuttle_singlecore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_saturn_GENV256D128_shuttle_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_saturn_GENV256D128_shuttle_singlecore_no_nic.tar.gz deploy_quintuplet_override: null custom_runtime_config: null alveo_u250_firesim_saturn_REFV256D128_rocket_singlecore_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_alveo_u250/alveo_u250_firesim_saturn_REFV256D128_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u250/alveo_u250_firesim_saturn_REFV256D128_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null custom_runtime_config: null alveo_u200_firesim_rocket_singlecore_no_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/357c8268872ea107e5877b140b470f9ba20ea7ff/xilinx_alveo_u200/alveo_u200_firesim_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u200/alveo_u200_firesim_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null alveo_u280_firesim_rocket_singlecore_no_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/5718958b05ada4d35197b04d27132439ad1b8aae/xilinx_alveo_u280/alveo_u280_firesim_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_alveo_u280/alveo_u280_firesim_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic: - bitstream_tar: https://github.com/firesim/firesim-public-bitstreams/raw/b31b0c9571f8b9725cf9864a3221face63535a94/xilinx_vcu118/xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/xilinx_vcu118/xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null nitefury_firesim_rocket_singlecore_no_nic: - bitstream_tar: https://raw.githubusercontent.com/firesim/firesim-public-bitstreams/4fed63d5a4836de28ac69edf2620d304615572c9/rhsresearch_nitefury_ii/nitefury_firesim_rocket_singlecore_no_nic.tar.gz + bitstream_tar: https://bitstreams.ucb.bar/rhsresearch_nitefury_ii/nitefury_firesim_rocket_singlecore_no_nic.tar.gz deploy_quintuplet_override: null deploy_makefrag_override: ../../generators/firechip/chip/src/main/makefrag/firesim custom_runtime_config: null