Added coverage tests to regression coverage

This commit is contained in:
David Harris 2023-03-22 13:00:10 -07:00
parent c7aa602b01
commit c1adc09da0
4 changed files with 32 additions and 25 deletions

View File

@ -130,8 +130,7 @@ for test in ahbTests:
tests64gc = ["arch64f", "arch64d", "arch64i", "arch64priv", "arch64c", "arch64m", "arch64zi", "wally64a", "wally64periph", "wally64priv"] tests64gc = ["arch64f", "arch64d", "arch64i", "arch64priv", "arch64c", "arch64m", "arch64zi", "wally64a", "wally64periph", "wally64priv"]
if (coverage): # delete all but 64gc tests when running coverage if (coverage): # delete all but 64gc tests when running coverage
configs = [] configs = []
tests64gc = ["arch64f", "arch64d", "arch64i", "arch64priv", "arch64c", "arch64m", "arch64zi", "wally64a", "wally64periph", "wally64priv", "imperas64f", "imperas64d", "imperas64c", "imperas64i"] tests64gc = ["coverage64gc", "arch64f", "arch64d", "arch64i", "arch64priv", "arch64c", "arch64m", "arch64zi", "wally64a", "wally64periph", "wally64priv", "imperas64f", "imperas64d", "imperas64c", "imperas64i"]
# tests64gc.append(["imperas64f", "imperas64d", "imperas64c", "imperas64i"])
coverStr = '-coverage' coverStr = '-coverage'
else: else:
coverStr = '' coverStr = ''

View File

@ -106,6 +106,7 @@ logic [3:0] dummy;
"coremark": tests = coremark; "coremark": tests = coremark;
"fpga": tests = fpga; "fpga": tests = fpga;
"ahb" : tests = ahb; "ahb" : tests = ahb;
"coverage64gc" : tests = coverage64gc;
endcase endcase
end else begin // RV32 end else begin // RV32
case (TEST) case (TEST)
@ -313,6 +314,8 @@ logic [3:0] dummy;
end end
$fclose(outputFilePointer); $fclose(outputFilePointer);
$display("Embench Benchmark: created output file: %s", outputfile); $display("Embench Benchmark: created output file: %s", outputfile);
end else if (TEST == "coverage64gc") begin
$display("Coverage tests don't get checked");
end else begin end else begin
// for tests with no self checking mechanism, read .signature.output file and compare to check for errors // for tests with no self checking mechanism, read .signature.output file and compare to check for errors
// clear signature to prevent contamination from previous tests // clear signature to prevent contamination from previous tests

View File

@ -27,20 +27,24 @@
`define IMPERASTEST "0" `define IMPERASTEST "0"
`define RISCVARCHTEST "1" `define RISCVARCHTEST "1"
`define WALLYTEST "2" `define WALLYTEST "2"
`define MYIMPERASTEST "3" `define COREMARK "3"
`define COREMARK "4" `define EMBENCH "4"
`define EMBENCH "5" `define CUSTOM "5"
`define CUSTOM "6" `define COVERAGE "6"
// *** remove MYIMPERASTEST cases when ported
string tvpaths[] = '{ string tvpaths[] = '{
"$RISCV/imperas-riscv-tests/work/", "$RISCV/imperas-riscv-tests/work/",
"../tests/riscof/work/riscv-arch-test/", "../tests/riscof/work/riscv-arch-test/",
"../tests/riscof/work/wally-riscv-arch-test/", "../tests/riscof/work/wally-riscv-arch-test/",
"../tests/imperas-riscv-tests/work/",
"../benchmarks/coremark/work/", "../benchmarks/coremark/work/",
"../addins/embench-iot/", "../addins/embench-iot/",
"../tests/custom/work/" "../tests/custom/work/",
"../tests/coverage/"
};
string coverage64gc[] = '{
`COVERAGE,
"badinstr"
}; };
string coremark[] = '{ string coremark[] = '{

View File

@ -16,11 +16,12 @@ all: $(OBJECTS)
%.elf.objdump: %.elf %.elf.objdump: %.elf
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile %.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
# Change many things if bit width isn't 64
echo $@ echo $@
riscv64-unknown-elf-gcc -g -o $@ -march=rv64gc -mabi=lp64 -mcmodel=medany \ riscv64-unknown-elf-gcc -g -o $@ -march=rv64gc -mabi=lp64 -mcmodel=medany \
-nostartfiles -T../../examples/link/link.ld $< -nostartfiles -T../../examples/link/link.ld $<
riscv64-unknown-elf-objdump -D $@ > $@.objdump riscv64-unknown-elf-objdump -D $@ > $@.objdump
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $@ --output $@.memfile riscv64-unknown-elf-elf2hex --bit-width 64 --input $@ --output $@.memfile
extractFunctionRadix.sh $@.objdump extractFunctionRadix.sh $@.objdump
sim: %.elf sim: %.elf
@ -29,7 +30,7 @@ sim: %.elf
echo "Signature matches! Success!" echo "Signature matches! Success!"
clean: clean:
rm -f *.elf *.objdump *.signature.output rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile