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[] = '{
"rv64p/WALLY-CAUSE", "3000",
"rv64p/WALLY-MCAUSE", "3000",
"rv64p/WALLY-EPC", "3000",
"rv64p/WALLY-TVAL", "3000",
"rv64p/WALLY-MARCHID", "4000",
@ -351,6 +351,16 @@ module testbench();
"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[] = '{
"rv64i-periph/WALLY-PLIC", "2080"
};
@ -397,12 +407,13 @@ module testbench();
end
//tests = {tests64a, tests};
// tests = {tests, tests64p};
tests = tests64p;
end else begin // RV32
// *** add the 32 bit bp tests
if (TESTSPERIPH) begin
tests = tests32periph;
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};
else tests = {tests, tests32iNOc};
if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m};
@ -410,8 +421,9 @@ module testbench();
if (`A_SUPPORTED) tests = {tests, tests32a};
if (`MEM_VIRTMEM) tests = {tests32mmu, tests};
end
tests = tests32p;
end
//tests = tests64p;
end

View File

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