Added performance counting to sumtest and added imperas32/64periph to testbench.

This commit is contained in:
David Harris 2021-12-29 00:28:51 +00:00
parent 52469db9ff
commit d78b806332
4 changed files with 16 additions and 10 deletions

View File

@ -6,9 +6,13 @@ rvtest_entry_point:
la sp, topofstack # Initialize stack pointer la sp, topofstack # Initialize stack pointer
la t0, N # get address of N in data la t0, N # get address of N in data
ld a0, 0(t0) # load N ld a0, 0(t0) # load N
csrr s8, instret # count instructions before call
jal sum # call sum(N) jal sum # call sum(N)
csrr s9, instret # count instructions after call
sub s9, s9, s8 # length of call
la t0, begin_signature # address of signature la t0, begin_signature # address of signature
sd a0, 0(t0) # store sum(N) in signature sd a0, 0(t0) # store sum(N) in signature
sd s9, 8(t0) # record performance
write_tohost: write_tohost:
la t1, tohost la t1, tohost
@ -28,8 +32,9 @@ fromhost:
N: N:
.dword 4 .dword 4
.EQU XLEN,64
begin_signature: begin_signature:
.fill 2,4,0xdeadbeef .fill 2*(XLEN/32),4,0xdeadbeef #
end_signature: end_signature:
# Initialize stack with room for 512 bytes # Initialize stack with room for 512 bytes

View File

@ -1 +1,2 @@
000000000000000A 000000000000000A
000000000000001C

View File

@ -1,3 +1,3 @@
vsim -c <<! vsim -c <<!
do wally-pipelined-batch.do rv64gc imperas64c do wally-pipelined-batch.do rv64gc imperas64periph
! !

View File

@ -76,7 +76,7 @@ logic [3:0] dummy;
// pick tests based on modes supported // pick tests based on modes supported
initial begin initial begin
$display("TEST is %s", TEST); $display("TEST is %s", TEST);
tests = '{"empty"}; tests = '{};
if (`XLEN == 64) begin // RV64 if (`XLEN == 64) begin // RV64
case (TEST) case (TEST)
"arch64i": tests = arch64i; "arch64i": tests = arch64i;
@ -94,9 +94,9 @@ logic [3:0] dummy;
"imperas64c": if (`C_SUPPORTED) tests = imperas64c; "imperas64c": if (`C_SUPPORTED) tests = imperas64c;
else tests = imperas64iNOc; else tests = imperas64iNOc;
"testsBP64": tests = testsBP64; "testsBP64": tests = testsBP64;
"wally64i": tests = wally64i; "wally64i": tests = wally64i; // *** redo
"wally64priv": tests = wally64priv; "wally64priv": tests = wally64priv;// *** redo
"wally64periph": tests = wally64periph; "imperas64periph": tests = imperas64periph;
endcase endcase
end else begin // RV32 end else begin // RV32
case (TEST) case (TEST)
@ -113,12 +113,12 @@ logic [3:0] dummy;
"imperas32a": if (`A_SUPPORTED) tests = imperas32a; "imperas32a": if (`A_SUPPORTED) tests = imperas32a;
"imperas32c": if (`C_SUPPORTED) tests = imperas32c; "imperas32c": if (`C_SUPPORTED) tests = imperas32c;
else tests = imperas32iNOc; else tests = imperas32iNOc;
"wally32i": tests = wally32i; "wally32i": tests = wally32i; // *** redo
"wally32priv": tests = wally32priv; "wally32priv": tests = wally32priv; // *** redo
"wally32periph": tests = wally32periph; "imperas32periph": tests = imperas32periph;
endcase endcase
end end
if (tests.size() == 1) begin if (tests.size() == 0) begin
$display("TEST %s not supported in this configuration", TEST); $display("TEST %s not supported in this configuration", TEST);
$stop; $stop;
end end