458 lines
14 KiB
YAML
458 lines
14 KiB
YAML
# CircleCI Configuration File
|
|
|
|
# version of circleci
|
|
version: 2.1
|
|
|
|
parameters:
|
|
verilator-cache-version:
|
|
type: string
|
|
default: "v3"
|
|
tools-cache-version:
|
|
type: string
|
|
default: "v4"
|
|
|
|
# default execution env.s
|
|
executors:
|
|
main-env:
|
|
docker:
|
|
- image: riscvboom/riscvboom-images:0.0.12
|
|
environment:
|
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
|
|
|
# re-usable commands
|
|
commands:
|
|
toolchain-build:
|
|
description: "Build a toolchain"
|
|
parameters:
|
|
tools-version:
|
|
type: string
|
|
default: "riscv-tools"
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Create hash of toolchains
|
|
command: |
|
|
.circleci/create-hash.sh
|
|
- restore_cache:
|
|
keys:
|
|
- << parameters.tools-version >>-installed-<< pipeline.parameters.tools-cache-version >>-{{ checksum "../<< parameters.tools-version >>.hash" }}
|
|
- run:
|
|
name: Building << parameters.tools-version >>
|
|
command: |
|
|
.circleci/build-toolchains.sh << parameters.tools-version >>
|
|
no_output_timeout: 120m
|
|
- save_cache:
|
|
key: << parameters.tools-version >>-installed-<< pipeline.parameters.tools-cache-version >>-{{ checksum "../<< parameters.tools-version >>.hash" }}
|
|
paths:
|
|
- "/home/riscvuser/<< parameters.tools-version >>-install"
|
|
|
|
ssh-checkout:
|
|
description: "Add SSH key and checkout code"
|
|
steps:
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
|
- checkout
|
|
|
|
setup-tools-verilator:
|
|
description: "Get toolchain and verilator"
|
|
parameters:
|
|
tools-version:
|
|
type: string
|
|
default: "riscv-tools"
|
|
steps:
|
|
- ssh-checkout
|
|
- run:
|
|
name: Create hash of toolchains
|
|
command: |
|
|
.circleci/create-hash.sh
|
|
- restore_cache:
|
|
keys:
|
|
- << parameters.tools-version >>-installed-<< pipeline.parameters.tools-cache-version >>-{{ checksum "../<< parameters.tools-version >>.hash" }}
|
|
- restore_cache:
|
|
keys:
|
|
- verilator-installed-<< pipeline.parameters.verilator-cache-version >>-{{ checksum "sims/verilator/verilator.mk" }}
|
|
|
|
prepare-rtl:
|
|
description: "Run the prepare step of RTL"
|
|
parameters:
|
|
tools-version:
|
|
type: string
|
|
default: "riscv-tools"
|
|
project-key:
|
|
type: string
|
|
timeout:
|
|
type: string
|
|
default: "120m"
|
|
build-script:
|
|
type: string
|
|
default: "do-rtl-build.sh"
|
|
steps:
|
|
- setup-tools-verilator:
|
|
tools-version: "<< parameters.tools-version >>"
|
|
- run:
|
|
name: Building << parameters.project-key >> subproject using Verilator
|
|
command: .circleci/<< parameters.build-script >> << parameters.project-key >>
|
|
no_output_timeout: << parameters.timeout >>
|
|
- save_cache:
|
|
key: << parameters.project-key >>-{{ .Branch }}-{{ .Revision }}
|
|
paths:
|
|
- "/home/riscvuser/project"
|
|
|
|
run-tests:
|
|
description: "Run a set of tests"
|
|
parameters:
|
|
tools-version:
|
|
type: string
|
|
default: "riscv-tools"
|
|
project-key:
|
|
type: string
|
|
extra-cache-restore:
|
|
type: string
|
|
default: ""
|
|
run-script:
|
|
type: string
|
|
default: "run-tests.sh"
|
|
timeout:
|
|
type: string
|
|
default: "10m"
|
|
steps:
|
|
- setup-tools-verilator:
|
|
tools-version: "<< parameters.tools-version >>"
|
|
- restore_cache:
|
|
keys:
|
|
- << parameters.project-key >>-{{ .Branch }}-{{ .Revision }}
|
|
- when:
|
|
condition: << parameters.extra-cache-restore >>
|
|
steps:
|
|
- restore_cache:
|
|
keys:
|
|
- << parameters.extra-cache-restore >>-{{ .Branch }}-{{ .Revision }}
|
|
- run:
|
|
name: Run << parameters.project-key >> subproject tests
|
|
command: .circleci/<< parameters.run-script >> << parameters.project-key >>
|
|
no_output_timeout: << parameters.timeout >>
|
|
|
|
# set of jobs to run
|
|
jobs:
|
|
commit-on-master-check:
|
|
executor: main-env
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Check commits of each submodule
|
|
command: |
|
|
.circleci/check-commit.sh
|
|
install-riscv-toolchain:
|
|
executor: main-env
|
|
steps:
|
|
- toolchain-build:
|
|
tools-version: "riscv-tools"
|
|
install-esp-toolchain:
|
|
executor: main-env
|
|
steps:
|
|
- toolchain-build:
|
|
tools-version: "esp-tools"
|
|
install-verilator:
|
|
executor: main-env
|
|
steps:
|
|
- ssh-checkout
|
|
- restore_cache:
|
|
keys:
|
|
- verilator-installed-<< pipeline.parameters.verilator-cache-version >>-{{ checksum "sims/verilator/verilator.mk" }}
|
|
- run:
|
|
name: Build Verilator
|
|
command: |
|
|
.circleci/build-verilator.sh
|
|
no_output_timeout: 120m
|
|
- save_cache:
|
|
key: verilator-installed-<< pipeline.parameters.verilator-cache-version >>-{{ checksum "sims/verilator/verilator.mk" }}
|
|
paths:
|
|
- "/home/riscvuser/verilator"
|
|
build-extra-tests:
|
|
executor: main-env
|
|
steps:
|
|
- ssh-checkout
|
|
- run:
|
|
name: Create hash of toolchains
|
|
command: |
|
|
.circleci/create-hash.sh
|
|
- restore_cache:
|
|
keys:
|
|
- riscv-tools-installed-<< pipeline.parameters.tools-cache-version >>-{{ checksum "../riscv-tools.hash" }}
|
|
- run:
|
|
name: Build extra tests
|
|
command: .circleci/build-extra-tests.sh
|
|
no_output_timeout: 120m
|
|
- save_cache:
|
|
key: extra-tests-{{ .Branch }}-{{ .Revision }}
|
|
paths:
|
|
- "/home/riscvuser/project/tests"
|
|
prepare-chipyard-rocket:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "chipyard-rocket"
|
|
prepare-chipyard-hetero:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "chipyard-hetero"
|
|
timeout: "240m"
|
|
prepare-chipyard-boom:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "chipyard-boom"
|
|
prepare-rocketchip:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "rocketchip"
|
|
prepare-chipyard-blkdev:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "chipyard-blkdev"
|
|
prepare-chipyard-hwacha:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
tools-version: "esp-tools"
|
|
project-key: "chipyard-hwacha"
|
|
prepare-chipyard-gemmini:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
tools-version: "esp-tools"
|
|
project-key: "chipyard-gemmini"
|
|
prepare-tracegen:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "tracegen"
|
|
prepare-tracegen-boom:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "tracegen-boom"
|
|
prepare-firesim:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "firesim"
|
|
build-script: "do-firesim-build.sh"
|
|
prepare-fireboom:
|
|
executor: main-env
|
|
steps:
|
|
- prepare-rtl:
|
|
project-key: "fireboom"
|
|
build-script: "do-firesim-build.sh"
|
|
|
|
|
|
|
|
chipyard-rocket-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "chipyard-rocket"
|
|
chipyard-hetero-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "chipyard-hetero"
|
|
chipyard-boom-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "chipyard-boom"
|
|
rocketchip-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "rocketchip"
|
|
chipyard-hwacha-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
tools-version: "esp-tools"
|
|
project-key: "chipyard-hwacha"
|
|
chipyard-gemmini-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
tools-version: "esp-tools"
|
|
project-key: "chipyard-gemmini"
|
|
tracegen-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "tracegen"
|
|
tracegen-boom-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
project-key: "tracegen-boom"
|
|
firesim-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
extra-cache-restore: "extra-tests"
|
|
project-key: "firesim"
|
|
run-script: "run-firesim-tests.sh"
|
|
fireboom-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- run-tests:
|
|
extra-cache-restore: "extra-tests"
|
|
project-key: "fireboom"
|
|
run-script: "run-firesim-tests.sh"
|
|
timeout: "30m"
|
|
|
|
midasexamples-run-tests:
|
|
executor: main-env
|
|
steps:
|
|
- setup-tools-verilator
|
|
- run:
|
|
name: Run midasexamples tests
|
|
command: .circleci/run-midasexamples-tests.sh
|
|
# Order and dependencies of jobs to run
|
|
workflows:
|
|
version: 2
|
|
submodules-on-master:
|
|
jobs:
|
|
# Check to make sure submodule commits are on master branches
|
|
- commit-on-master-check
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 0 * * *"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
|
|
build-and-test-chipyard-integration:
|
|
jobs:
|
|
# Make the toolchains
|
|
- install-riscv-toolchain
|
|
|
|
- install-esp-toolchain
|
|
|
|
# Build verilator
|
|
- install-verilator
|
|
|
|
- commit-on-master-check
|
|
|
|
# Build extra tests
|
|
- build-extra-tests:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
|
|
# Prepare the verilator builds
|
|
- prepare-chipyard-rocket:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-chipyard-hetero:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-chipyard-boom:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-rocketchip:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-chipyard-blkdev:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-chipyard-hwacha:
|
|
requires:
|
|
- install-esp-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-chipyard-gemmini:
|
|
requires:
|
|
- install-esp-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-tracegen:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-tracegen-boom:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-firesim:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
- prepare-fireboom:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
# Run the respective tests
|
|
|
|
# Run midasexamples test
|
|
- midasexamples-run-tests:
|
|
requires:
|
|
- install-riscv-toolchain
|
|
- install-verilator
|
|
|
|
# Run the example tests
|
|
- chipyard-rocket-run-tests:
|
|
requires:
|
|
- prepare-chipyard-rocket
|
|
|
|
- chipyard-hetero-run-tests:
|
|
requires:
|
|
- prepare-chipyard-hetero
|
|
|
|
- chipyard-boom-run-tests:
|
|
requires:
|
|
- prepare-chipyard-boom
|
|
|
|
- rocketchip-run-tests:
|
|
requires:
|
|
- prepare-rocketchip
|
|
|
|
- chipyard-hwacha-run-tests:
|
|
requires:
|
|
- prepare-chipyard-hwacha
|
|
|
|
- chipyard-gemmini-run-tests:
|
|
requires:
|
|
- prepare-chipyard-gemmini
|
|
|
|
- tracegen-run-tests:
|
|
requires:
|
|
- prepare-tracegen
|
|
|
|
- tracegen-boom-run-tests:
|
|
requires:
|
|
- prepare-tracegen-boom
|
|
|
|
# Run the firesim tests
|
|
- firesim-run-tests:
|
|
requires:
|
|
- prepare-firesim
|
|
- build-extra-tests
|
|
|
|
- fireboom-run-tests:
|
|
requires:
|
|
- prepare-fireboom
|
|
- build-extra-tests
|