Add 32 bit privileged tests

This commit is contained in:
Domenico Ottolia 2021-04-15 16:55:39 -04:00
parent aa74b14314
commit 531423d7e1
3 changed files with 49 additions and 35 deletions

View File

@ -342,7 +342,7 @@ module testbench();
}; };
string tests64p[] = '{ string tests64p[] = '{
"rv64p/WALLY-CAUSE", "3000", "rv64p/WALLY-MCAUSE", "3000",
"rv64p/WALLY-EPC", "3000", "rv64p/WALLY-EPC", "3000",
"rv64p/WALLY-TVAL", "3000", "rv64p/WALLY-TVAL", "3000",
"rv64p/WALLY-MARCHID", "4000", "rv64p/WALLY-MARCHID", "4000",
@ -351,6 +351,16 @@ module testbench();
"rv64p/WALLY-MVENDORID", "4000" "rv64p/WALLY-MVENDORID", "4000"
}; };
string tests32p[] = '{
"rv32p/WALLY-MCAUSE", "3000",
"rv32p/WALLY-EPC", "3000",
"rv32p/WALLY-TVAL", "3000",
"rv32p/WALLY-MARCHID", "4000",
"rv32p/WALLY-MIMPID", "4000",
"rv32p/WALLY-MHARTID", "4000",
"rv32p/WALLY-MVENDORID", "4000"
};
string tests64periph[] = '{ string tests64periph[] = '{
"rv64i-periph/WALLY-PLIC", "2080" "rv64i-periph/WALLY-PLIC", "2080"
}; };
@ -397,12 +407,13 @@ module testbench();
end end
//tests = {tests64a, tests}; //tests = {tests64a, tests};
// tests = {tests, tests64p}; // tests = {tests, tests64p};
tests = tests64p;
end else begin // RV32 end else begin // RV32
// *** add the 32 bit bp tests // *** add the 32 bit bp tests
if (TESTSPERIPH) begin if (TESTSPERIPH) begin
tests = tests32periph; tests = tests32periph;
end else begin end else begin
tests = {tests32i};//,tests32periph}; *** broken at the moment tests = {tests32i, tests32p};//,tests32periph}; *** broken at the moment
if (`C_SUPPORTED % 2 == 1) tests = {tests, tests32ic}; if (`C_SUPPORTED % 2 == 1) tests = {tests, tests32ic};
else tests = {tests, tests32iNOc}; else tests = {tests, tests32iNOc};
if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m}; if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m};
@ -410,8 +421,9 @@ module testbench();
if (`A_SUPPORTED) tests = {tests, tests32a}; if (`A_SUPPORTED) tests = {tests, tests32a};
if (`MEM_VIRTMEM) tests = {tests32mmu, tests}; if (`MEM_VIRTMEM) tests = {tests32mmu, tests};
end end
tests = tests32p;
end end
//tests = tests64p;
end end

View File

@ -274,7 +274,7 @@ def writeTest(storecmd, f, r, test, interrupt, code, mode = "m", resetHander = "
# csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci # csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci
author = "dottolia@hmc.edu" author = "dottolia@hmc.edu"
xlens = [32, 64] xlens = [32, 64]
numrand = 10; numrand = 8;
# setup # setup
seed(0xC365DDEB9173AB42) # make tests reproducible seed(0xC365DDEB9173AB42) # make tests reproducible
@ -295,43 +295,45 @@ for xlen in xlens:
0x624B3E976C52DD14 % 2**xlen, 2**(xlen-1)-2, 2**(xlen-1)-1, 0x624B3E976C52DD14 % 2**xlen, 2**(xlen-1)-2, 2**(xlen-1)-1,
2**(xlen-1), 2**(xlen-1)+1, 0xC365DDEB9173AB42 % 2**xlen, 2**(xlen)-2, 2**(xlen)-1 2**(xlen-1), 2**(xlen-1)+1, 0xC365DDEB9173AB42 % 2**xlen, 2**(xlen)-2, 2**(xlen)-1
] ]
imperaspath = "../../../imperas-riscv-tests/riscv-test-suite/rv" + str(xlen) + "p/"
basename = "WALLY-CAUSE"
fname = imperaspath + "src/" + basename + ".S"
refname = imperaspath + "references/" + basename + ".reference_output"
testnum = 0
# print custom header part for mode in ["m", "s", "u"]:
f = open(fname, "w") imperaspath = "../../../imperas-riscv-tests/riscv-test-suite/rv" + str(xlen) + "p/"
r = open(refname, "w") basename = "WALLY-" + mode.upper() + "CAUSE"
line = "///////////////////////////////////////////\n" fname = imperaspath + "src/" + basename + ".S"
f.write(line) refname = imperaspath + "references/" + basename + ".reference_output"
lines="// "+fname+ "\n// " + author + "\n" testnum = 0
f.write(lines)
line ="// Created " + str(datetime.now())
f.write(line)
# insert generic header # print custom header part
h = open("../testgen_header.S", "r") f = open(fname, "w")
for line in h: r = open(refname, "w")
line = "///////////////////////////////////////////\n"
f.write(line)
lines="// "+fname+ "\n// " + author + "\n"
f.write(lines)
line ="// Created " + str(datetime.now())
f.write(line) f.write(line)
# print directed and random test vectors # insert generic header
for i in range(0,numrand): h = open("../testgen_header.S", "r")
writeVectors(storecmd) for line in h:
f.write(line)
# print directed and random test vectors
for i in range(0,numrand):
writeVectors(storecmd)
# print footer # print footer
h = open("../testgen_footer.S", "r") h = open("../testgen_footer.S", "r")
for line in h: for line in h:
f.write(line) f.write(line)
# Finish # Finish
lines = ".fill " + str(testnum) + ", " + str(wordsize) + ", -1\n" lines = ".fill " + str(testnum) + ", " + str(wordsize) + ", -1\n"
lines = lines + "\nRV_COMPLIANCE_DATA_END\n" lines = lines + "\nRV_COMPLIANCE_DATA_END\n"
f.write(lines) f.write(lines)
f.close() f.close()
r.close() r.close()

View File

@ -163,7 +163,7 @@ def writeTest(storecmd, f, r, test, expected, mode = "m", resetHander = ""):
# csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci # csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci
author = "dottolia@hmc.edu" author = "dottolia@hmc.edu"
xlens = [32, 64] xlens = [32, 64]
numrand = 30; numrand = 20;
# setup # setup
seed(0xC363DDEB9173AB42) # make tests reproducible seed(0xC363DDEB9173AB42) # make tests reproducible