[ci] Run riscv-compliance suites in parallel

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index ba9ea0f..5f07e71 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -229,40 +229,17 @@
       ci/run_verilator_pytest.sh
     displayName: Execute tests
 
-- job: riscv_compliance_tests
-  displayName: Execute RISC-V compliance tests
-  pool:
-    vmImage: ubuntu-16.04
-  dependsOn:
-    - top_earlgrey_verilator
-    - sw_build
-  steps:
-  - template: ci/install-package-dependencies.yml
-  - template: ci/download-artifacts-template.yml
-  - bash: |
-      set -x
-      sudo util/get-toolchain.py \
-        --target-dir="${TOOLCHAIN_PATH}" \
-        --release-version="${TOOLCHAIN_VERSION}" \
-        --update
-    displayName: Install toolchain
-  - bash: |
-      set -e
-      . util/build_consts.sh
-      export TARGET_SIM="$BIN_DIR/hw/top_earlgrey/Vtop_earlgrey_verilator"
-      export RISCV_DEVICE=rv32imc
-      export RISCV_TARGET=opentitan
-      export OT_BIN=$BIN_DIR
-      export OT_TARGET=verilator
-      export OT_TOOLS="$TOOLCHAIN_PATH/bin"
-      export OT_RV_NO_LIB_ROM_BUILD=1
-      cd sw/vendor/riscv_compliance
+- template: ci/run-riscv-compliance.yml
+  parameters:
+    rvc_test_suites:
+      - rv32i
 
-      make RISCV_ISA=rv32i
-      make RISCV_ISA=rv32im
-      make RISCV_ISA=rv32imc
-      make RISCV_ISA=rv32Zicsr
-    displayName: Execute tests
+- template: ci/run-riscv-compliance.yml
+  parameters:
+    rvc_test_suites:
+      - rv32im
+      - rv32imc
+      - rv32Zicsr
 
 - job: top_earlgrey_nexysvideo
   displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado
diff --git a/ci/run-riscv-compliance.yml b/ci/run-riscv-compliance.yml
new file mode 100644
index 0000000..bcd9114
--- /dev/null
+++ b/ci/run-riscv-compliance.yml
@@ -0,0 +1,34 @@
+parameters:
+  rvc_test_suites: []
+
+jobs:
+  - job: riscv_compliance_tests_${{ join('_', parameters.rvc_test_suites) }}
+    displayName: Execute RISC-V compliance tests for ${{ join(' ', parameters.rvc_test_suites) }}
+    pool:
+      vmImage: ubuntu-16.04
+    dependsOn:
+      - top_earlgrey_verilator
+      - sw_build
+    steps:
+    - template: install-package-dependencies.yml
+    - template: download-artifacts-template.yml
+    - bash: |
+        set -x
+        sudo util/get-toolchain.py \
+          --target-dir="${TOOLCHAIN_PATH}" \
+          --release-version="${TOOLCHAIN_VERSION}" \
+          --update
+      displayName: Install toolchain
+    - ${{ each test_suite in parameters.rvc_test_suites }}:
+      - bash: |
+          set -e
+          . util/build_consts.sh
+          export TARGET_SIM="$BIN_DIR/hw/top_earlgrey/Vtop_earlgrey_verilator"
+          export RISCV_DEVICE=rv32imc
+          export RISCV_TARGET=opentitan
+          export OT_BIN="$BIN_DIR"
+          export OT_TARGET=verilator
+          export OT_TOOLS="$TOOLCHAIN_PATH/bin"
+          cd sw/vendor/riscv_compliance
+          make RISCV_ISA=${{ test_suite }}
+        displayName: Execute ${{ test_suite }}