diff --git a/pipelined/testbench/testbench.sv b/pipelined/testbench/testbench.sv index 5060ec9e6..bd1f4bb66 100644 --- a/pipelined/testbench/testbench.sv +++ b/pipelined/testbench/testbench.sv @@ -98,7 +98,7 @@ logic [3:0] dummy; "wally64a": if (`A_SUPPORTED) tests = wally64a; "imperas64c": if (`C_SUPPORTED) tests = imperas64c; else tests = imperas64iNOc; - "testsBP64": tests = testsBP64; + "custom": tests = custom; "wally64i": tests = wally64i; "wally64priv": tests = wally64priv; "wally64periph": tests = wally64periph; diff --git a/pipelined/testbench/tests.vh b/pipelined/testbench/tests.vh index 8c596071f..6420589c4 100644 --- a/pipelined/testbench/tests.vh +++ b/pipelined/testbench/tests.vh @@ -874,16 +874,6 @@ string imperas32f[] = '{ "rv32i_m/I/XORI-01" }; - string testsBP64[] = '{ - `IMPERASTEST, - "rv64BP/simple" -// "rv64BP/mmm", -// "rv64BP/linpack_bench", -// "rv64BP/sieve", -// "rv64BP/qsort", -// "rv64BP/dhrystone" - }; - string imperas32p[] = '{ `MYIMPERASTEST, "rv32p/WALLY-MSTATUS", @@ -1934,8 +1924,19 @@ string imperas32f[] = '{ string custom[] = '{ `CUSTOM, + "cacheTest", "simple" }; + string testsBP64[] = '{ + `IMPERASTEST, + "rv64BP/simple" +// "rv64BP/mmm", +// "rv64BP/linpack_bench", +// "rv64BP/sieve", +// "rv64BP/qsort", +// "rv64BP/dhrystone" + }; + string ahb[] = '{ `RISCVARCHTEST, diff --git a/tests/custom/cacheTest/Makefile b/tests/custom/cacheTest/Makefile new file mode 100644 index 000000000..f5ad40232 --- /dev/null +++ b/tests/custom/cacheTest/Makefile @@ -0,0 +1,19 @@ +TARGETDIR := cacheTest +TARGET := $(TARGETDIR)/$(TARGETDIR).elf +ROOT := .. +LIBRARY_DIRS := ${ROOT}/crt0 +LIBRARY_FILES := crt0 + +MARCH :=-march=rv64imfdc +MABI :=-mabi=lp64d +LINKER := ${ROOT}/linker8000-0000.x +LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map + +CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2 +CC=riscv64-unknown-elf-gcc +DA=riscv64-unknown-elf-objdump -d + + +include $(ROOT)/makefile.inc + + diff --git a/tests/custom/cacheTest/header.h b/tests/custom/cacheTest/header.h new file mode 100644 index 000000000..aab8973fd --- /dev/null +++ b/tests/custom/cacheTest/header.h @@ -0,0 +1,12 @@ +#ifndef __header +#define __header + +int fail(); +int simple_csrbr_test(); +int lbu_test(); +int icache_spill_test(); +void global_hist_0_space_test(); +void global_hist_1_space_test(); +void global_hist_2_space_test(); +void global_hist_3_space_test(); +#endif diff --git a/tests/custom/cacheTest/main.c b/tests/custom/cacheTest/main.c new file mode 100644 index 000000000..4e041d994 --- /dev/null +++ b/tests/custom/cacheTest/main.c @@ -0,0 +1,10 @@ +#include "header.h" + +int main(){ + long int array [1024]; + int index; + for(index = 0; index < 1024; index++) { + array[index] = index; + } + return 0; +} diff --git a/tests/custom/crt0/start.s b/tests/custom/crt0/start.s index 731a61e34..53aa44f59 100644 --- a/tests/custom/crt0/start.s +++ b/tests/custom/crt0/start.s @@ -44,7 +44,7 @@ _start: # set the stack pointer to the top of memory - 8 bytes (pointer size) - li sp, 0x07FFFFF8 + li sp, 0x87FFFFF8 jal ra, pre_main jal ra, _halt diff --git a/tests/custom/makefile.inc b/tests/custom/makefile.inc index 961311a7b..ccc2205a8 100644 --- a/tests/custom/makefile.inc +++ b/tests/custom/makefile.inc @@ -89,5 +89,5 @@ $(TARGET).memfile: $(TARGET) @echo 'Making memory file' riscv64-unknown-elf-elf2hex --bit-width $(WIDTH) --input $< --output $@ extractFunctionRadix.sh $<.objdump - mkdir -p ../../imperas-riscv-tests/work/rv64BP/ - cp -f $(TARGETDIR)/* ../../imperas-riscv-tests/work/rv64BP/ + mkdir -p ../work/ + cp -f $(TARGETDIR)/* ../work/ diff --git a/tests/custom/simple/Makefile b/tests/custom/simple/Makefile index 729c3b4e0..f85aedd5c 100644 --- a/tests/custom/simple/Makefile +++ b/tests/custom/simple/Makefile @@ -6,7 +6,7 @@ LIBRARY_FILES := crt0 MARCH :=-march=rv64imfdc MABI :=-mabi=lp64d -LINKER := ${ROOT}/linker1000.x +LINKER := ${ROOT}/linker8000-0000.x LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2 diff --git a/tests/custom/simple/sample.s b/tests/custom/simple/sample.s index 1c707cba7..a5f5df04c 100644 --- a/tests/custom/simple/sample.s +++ b/tests/custom/simple/sample.s @@ -50,6 +50,7 @@ pass: done: li t0, 0x30 csrrs x0, 0x320, t0 # set bits 4 and 5 + ecall ret fail: