mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-23 04:54:29 +00:00
Attempted to make a cache test.
This commit is contained in:
parent
9d1cb9337e
commit
7a352edf13
@ -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;
|
||||
|
@ -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,
|
||||
|
19
tests/custom/cacheTest/Makefile
Normal file
19
tests/custom/cacheTest/Makefile
Normal file
@ -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
|
||||
|
||||
|
12
tests/custom/cacheTest/header.h
Normal file
12
tests/custom/cacheTest/header.h
Normal file
@ -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
|
10
tests/custom/cacheTest/main.c
Normal file
10
tests/custom/cacheTest/main.c
Normal file
@ -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;
|
||||
}
|
@ -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
|
||||
|
@ -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/
|
||||
|
@ -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
|
||||
|
@ -50,6 +50,7 @@ pass:
|
||||
done:
|
||||
li t0, 0x30
|
||||
csrrs x0, 0x320, t0 # set bits 4 and 5
|
||||
ecall
|
||||
ret
|
||||
|
||||
fail:
|
||||
|
Loading…
Reference in New Issue
Block a user