From ea099ed02a1bd24e65a562eb1a1dd3910807dfd4 Mon Sep 17 00:00:00 2001 From: mbertuletti Date: Fri, 15 Dec 2023 15:57:18 +0100 Subject: [PATCH] [tests] Add zvecquarterinx hardware tests --- software/Makefile | 1 + software/riscv-tests/isa/Makefile | 4 ++- .../isa/rv32uzvecquarterinx/Makefrag | 12 +++++++ .../isa/rv32uzvecquarterinx/vfadd_b.S | 33 +++++++++++++++++++ .../isa/rv32uzvecquarterinx/vfcpka_b.S | 31 +++++++++++++++++ .../isa/rv32uzvecquarterinx/vfmac_b.S | 31 +++++++++++++++++ .../isa/rv32uzvecquarterinx/vfmin_b.S | 31 +++++++++++++++++ .../isa/rv32uzvecquarterinx/vfsgnj_b.S | 31 +++++++++++++++++ software/riscv-tests/isa/snitch_isa.mk | 4 +++ 9 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/Makefrag create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/vfadd_b.S create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/vfcpka_b.S create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/vfmac_b.S create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/vfmin_b.S create mode 100644 software/riscv-tests/isa/rv32uzvecquarterinx/vfsgnj_b.S diff --git a/software/Makefile b/software/Makefile index 230298a7b..4283db9e0 100644 --- a/software/Makefile +++ b/software/Makefile @@ -52,6 +52,7 @@ $(eval $(call rtl_mempool_tests_template,rv32uzfinx)) $(eval $(call rtl_mempool_tests_template,rv32uzhinx)) $(eval $(call rtl_mempool_tests_template,rv32uzquarterinx)) $(eval $(call rtl_mempool_tests_template,rv32uzvechalfinx)) +$(eval $(call rtl_mempool_tests_template,rv32uzvecquarterinx)) else $(eval $(call rtl_mempool_tests_template,rv32ui)) $(eval $(call rtl_mempool_tests_template,rv32um)) diff --git a/software/riscv-tests/isa/Makefile b/software/riscv-tests/isa/Makefile index cbb1c8c51..9c75fb7c3 100644 --- a/software/riscv-tests/isa/Makefile +++ b/software/riscv-tests/isa/Makefile @@ -30,6 +30,7 @@ include $(src_dir)/rv32uzfinx/Makefrag include $(src_dir)/rv32uzhinx/Makefrag include $(src_dir)/rv32uzquarterinx/Makefrag include $(src_dir)/rv32uzvechalfinx/Makefrag +include $(src_dir)/rv32uzvecquarterinx/Makefrag ifneq ($(COMPILER), llvm) include $(src_dir)/rv32si/Makefrag include $(src_dir)/rv32mi/Makefrag @@ -127,12 +128,13 @@ $(eval $(call compile_template,rv32um,-march=rv32g -mabi=ilp32)) $(eval $(call compile_template,rv32ua,-march=rv32g -mabi=ilp32)) $(eval $(call compile_template,rv32uf,-march=rv32g -mabi=ilp32)) $(eval $(call compile_template,rv32ud,-march=rv32g -mabi=ilp32)) -RISCV_ARCH := rv$(XLEN)ima_zfinx_zhinx_zquarterinx_zvechalfinx_zexpauxvechalfinx +RISCV_ARCH := rv$(XLEN)ima_zfinx_zhinx_zquarterinx_zvechalfinx_zvecquarterinx_zexpauxvechalfinx RISCV_ARCH := $(RISCV_ARCH)_xpulppostmod_xpulpmacsi_xpulpvect_xpulpvectshufflepack_xmempool $(eval $(call compile_template,rv32uzfinx,-march=$(RISCV_ARCH) -mabi=ilp32)) $(eval $(call compile_template,rv32uzhinx,-march=$(RISCV_ARCH) -mabi=ilp32)) $(eval $(call compile_template,rv32uzquarterinx,-march=$(RISCV_ARCH) -mabi=ilp32)) $(eval $(call compile_template,rv32uzvechalfinx,-march=$(RISCV_ARCH) -mabi=ilp32)) +$(eval $(call compile_template,rv32uzvecquarterinx,-march=$(RISCV_ARCH) -mabi=ilp32)) $(eval $(call compile_template,rv32uxpulpimg,-march=$(RISCV_ARCH) -mabi=ilp32)) else $(eval $(call compile_template,rv32ui,-march=rv32g -mabi=ilp32)) diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/Makefrag b/software/riscv-tests/isa/rv32uzvecquarterinx/Makefrag new file mode 100644 index 000000000..77145a317 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/Makefrag @@ -0,0 +1,12 @@ +#======================================================================= +# Makefrag for rv32uzvecquarterinx tests +#----------------------------------------------------------------------- + +ifeq ($(COMPILER), llvm) +rv32uzvecquarterinx_sc_tests = \ + vfadd_b +endif + +rv32uzvecquarterinx_p_tests = $(addprefix rv32uzvecquarterinx-p-, $(rv32uzvecquarterinx_sc_tests)) + +# Zvecquarterinx extensions are not tested on Spike diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/vfadd_b.S b/software/riscv-tests/isa/rv32uzvecquarterinx/vfadd_b.S new file mode 100644 index 000000000..0b7c77aa7 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/vfadd_b.S @@ -0,0 +1,33 @@ +# See LICENSE for license details. + +#***************************************************************************** +# vfadd_h.S +#----------------------------------------------------------------------------- +# +# Test add instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, vfadd.b, 0x443F5644, 0x423E3442, 0x3E34563E ); + TEST_RR_OP( 3, vfsub.b, 0x3E3DD63E, 0x423E3442, 0x3E34563E ); + TEST_RR_OP( 4, vfmul.b, 0x44364E44, 0x423E3442, 0x3E34563E ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/vfcpka_b.S b/software/riscv-tests/isa/rv32uzvecquarterinx/vfcpka_b.S new file mode 100644 index 000000000..f7ea24378 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/vfcpka_b.S @@ -0,0 +1,31 @@ +# See LICENSE for license details. + +#***************************************************************************** +# vfcpka_h.S +#----------------------------------------------------------------------------- +# +# Test add instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + # TO DO + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/vfmac_b.S b/software/riscv-tests/isa/rv32uzvecquarterinx/vfmac_b.S new file mode 100644 index 000000000..c18dcb1f0 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/vfmac_b.S @@ -0,0 +1,31 @@ +# See LICENSE for license details. + +#***************************************************************************** +# vfmac_h.S +#----------------------------------------------------------------------------- +# +# Test add instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + # TO DO + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/vfmin_b.S b/software/riscv-tests/isa/rv32uzvecquarterinx/vfmin_b.S new file mode 100644 index 000000000..4cafc38e8 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/vfmin_b.S @@ -0,0 +1,31 @@ +# See LICENSE for license details. + +#***************************************************************************** +# vfmin_h.S +#----------------------------------------------------------------------------- +# +# Test add instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + # TO DO + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/software/riscv-tests/isa/rv32uzvecquarterinx/vfsgnj_b.S b/software/riscv-tests/isa/rv32uzvecquarterinx/vfsgnj_b.S new file mode 100644 index 000000000..2836377f4 --- /dev/null +++ b/software/riscv-tests/isa/rv32uzvecquarterinx/vfsgnj_b.S @@ -0,0 +1,31 @@ +# See LICENSE for license details. + +#***************************************************************************** +# vfsgnj_h.S +#----------------------------------------------------------------------------- +# +# Test add instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + # TO DO + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/software/riscv-tests/isa/snitch_isa.mk b/software/riscv-tests/isa/snitch_isa.mk index 146de1887..e9f950083 100644 --- a/software/riscv-tests/isa/snitch_isa.mk +++ b/software/riscv-tests/isa/snitch_isa.mk @@ -135,16 +135,20 @@ ifeq ($(zfinx_rv),1) vfmac_h \ vfmin_h \ vfsgnj_h + rv32uzvecquarterinx_snitch_sc_tests = \ + vfadd_b rv32uzfinx_mempool_tests = $(addprefix rv32uzfinx-mempool-, $(rv32uzfinx_snitch_sc_tests)) rv32uzhinx_mempool_tests = $(addprefix rv32uzhinx-mempool-, $(rv32uzhinx_snitch_sc_tests)) rv32uzquarterinx_mempool_tests = $(addprefix rv32uzquarterinx-mempool-, $(rv32uzquarterinx_snitch_sc_tests)) rv32uzvechalfinx_mempool_tests = $(addprefix rv32uzvechalfinx-mempool-, $(rv32uzvechalfinx_snitch_sc_tests)) + rv32uzvecquarterinx_mempool_tests = $(addprefix rv32uzvecquarterinx-mempool-, $(rv32uzvecquarterinx_snitch_sc_tests)) rtl_mempool_tests += $(rv32uzfinx_mempool_tests) rtl_mempool_tests += $(rv32uzhinx_mempool_tests) rtl_mempool_tests += $(rv32uzquarterinx_mempool_tests) rtl_mempool_tests += $(rv32uzvechalfinx_mempool_tests) + rtl_mempool_tests += $(rv32uzvecquarterinx_mempool_tests) endif endif