Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 1 | parameters: |
| 2 | ibex_configs: [] |
| 3 | |
| 4 | steps: |
| 5 | - ${{ each config in parameters.ibex_configs }}: |
| 6 | # ibex_config.py will exit with error code 1 on any error which will cause |
| 7 | # the CI to fail if there's an issue with the configuration file or an |
| 8 | # incorrect configuration name being used |
| 9 | - bash: | |
Tom Roberts | d14b37a | 2020-04-20 16:51:18 +0100 | [diff] [blame] | 10 | set -e |
| 11 | IBEX_CONFIG_OPTS=`./util/ibex_config.py ${{ config }} fusesoc_opts` |
| 12 | echo $IBEX_CONFIG_OPTS |
| 13 | echo "##vso[task.setvariable variable=ibex_config_opts]" $IBEX_CONFIG_OPTS |
| 14 | displayName: Test and display fusesoc config for ${{ config }} |
Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 15 | |
| 16 | - bash: | |
Tom Roberts | d14b37a | 2020-04-20 16:51:18 +0100 | [diff] [blame] | 17 | fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core_tracing $IBEX_CONFIG_OPTS |
Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 18 | if [ $? != 0 ]; then |
| 19 | echo -n "##vso[task.logissue type=error]" |
Michael Schaffner | 1a1b94d | 2020-07-13 19:27:25 -0700 | [diff] [blame^] | 20 | echo "Verilog lint failed. Run 'fusesoc --cores-root . run --target=lint --tool=verilator lowrisc:ibex:ibex_core_tracing $IBEX_CONFIG_OPTS' to check and fix all errors." |
Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 21 | exit 1 |
| 22 | fi |
| 23 | displayName: Lint Verilog source files with Verilator for ${{ config }} |
| 24 | |
| 25 | - bash: | |
Michael Schaffner | 1a1b94d | 2020-07-13 19:27:25 -0700 | [diff] [blame^] | 26 | fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core_tracing $IBEX_CONFIG_OPTS |
| 27 | if [ $? != 0 ]; then |
| 28 | echo -n "##vso[task.logissue type=error]" |
| 29 | echo "Verilog lint failed. Run 'fusesoc --cores-root . run --target=lint --tool=veriblelint lowrisc:ibex:ibex_core_tracing $IBEX_CONFIG_OPTS' to check and fix all errors." |
| 30 | exit 1 |
| 31 | fi |
| 32 | displayName: Lint Verilog source files with Verible Verilog Lint for ${{ config }} |
| 33 | |
| 34 | - bash: | |
Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 35 | # Build simulation model of Ibex |
Tom Roberts | d14b37a | 2020-04-20 16:51:18 +0100 | [diff] [blame] | 36 | fusesoc --cores-root=. run --target=sim --setup --build lowrisc:ibex:ibex_riscv_compliance $IBEX_CONFIG_OPTS |
Greg Chadwick | 063e5cc | 2020-04-07 13:13:07 +0100 | [diff] [blame] | 37 | if [ $? != 0 ]; then |
| 38 | echo -n "##vso[task.logissue type=error]" |
| 39 | echo "Unable to build Verilator model of Ibex for compliance testing." |
| 40 | exit 1 |
| 41 | fi |
| 42 | |
| 43 | # Run compliance test suite |
| 44 | export TARGET_SIM=$PWD/build/lowrisc_ibex_ibex_riscv_compliance_0.1/sim-verilator/Vibex_riscv_compliance |
| 45 | export RISCV_PREFIX=riscv32-unknown-elf- |
| 46 | export RISCV_TARGET=ibex |
| 47 | export RISCV_DEVICE=rv32imc |
| 48 | fail=0 |
| 49 | for isa in rv32i rv32im rv32imc rv32Zicsr rv32Zifencei; do |
| 50 | make -C build/riscv-compliance RISCV_ISA=$isa 2>&1 | tee run.log |
| 51 | if [ ${PIPESTATUS[0]} != 0 ]; then |
| 52 | echo -n "##vso[task.logissue type=error]" |
| 53 | echo "The RISC-V compliance test suite failed for $isa" |
| 54 | |
| 55 | # There's no easy way to get the test results in machine-readable |
| 56 | # form to properly exclude known-failing tests. Going with an |
| 57 | # approximate solution for now. |
| 58 | if [ $isa == rv32i ] && grep -q 'FAIL: 4/48' run.log; then |
| 59 | echo -n "##vso[task.logissue type=error]" |
| 60 | echo "Expected failure for rv32i, see lowrisc/ibex#100 more more information." |
| 61 | else |
| 62 | fail=1 |
| 63 | fi |
| 64 | fi |
| 65 | done |
| 66 | exit $fail |
| 67 | displayName: Run RISC-V Compliance test for Ibex RV32IMC for ${{ config }} |