blob: f4cbcd3bdd51ac7572986cc06914d7918e92b980 [file] [log] [blame]
Greg Chadwick063e5cc2020-04-07 13:13:07 +01001parameters:
2 ibex_configs: []
3
4steps:
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 Robertsd14b37a2020-04-20 16:51:18 +010010 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 Chadwick063e5cc2020-04-07 13:13:07 +010015
16 - bash: |
Tom Robertsd14b37a2020-04-20 16:51:18 +010017 fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core_tracing $IBEX_CONFIG_OPTS
Greg Chadwick063e5cc2020-04-07 13:13:07 +010018 if [ $? != 0 ]; then
19 echo -n "##vso[task.logissue type=error]"
Michael Schaffner1a1b94d2020-07-13 19:27:25 -070020 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 Chadwick063e5cc2020-04-07 13:13:07 +010021 exit 1
22 fi
23 displayName: Lint Verilog source files with Verilator for ${{ config }}
24
25 - bash: |
Michael Schaffner1a1b94d2020-07-13 19:27:25 -070026 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 Chadwick063e5cc2020-04-07 13:13:07 +010035 # Build simulation model of Ibex
Tom Robertsd14b37a2020-04-20 16:51:18 +010036 fusesoc --cores-root=. run --target=sim --setup --build lowrisc:ibex:ibex_riscv_compliance $IBEX_CONFIG_OPTS
Greg Chadwick063e5cc2020-04-07 13:13:07 +010037 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 }}