Skip to content

Commit

Permalink
Added nop after every ld
Browse files Browse the repository at this point in the history
  • Loading branch information
UmerShahidengr committed Apr 26, 2024
1 parent 25b9bff commit c61488a
Show file tree
Hide file tree
Showing 42 changed files with 161 additions and 53 deletions.
1 change: 1 addition & 0 deletions riscv-test-suite/rv32i_m/F/src/fmul_b9-01.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RVTEST_CODE_BEGIN
#ifdef TEST_CASE_1

RVTEST_CASE(0,"//check ISA:=regex(.*I.*F.*);def TEST_CASE_1=True;",fmul_b9)
RVTEST_CASE(1,"//check ISA:=regex(.*E.*F.*);def TEST_CASE_1=True;",fmul_b9)

RVTEST_FP_ENABLE()
RVTEST_VALBASEUPD(x3,test_dataset_0)
Expand Down
95 changes: 81 additions & 14 deletions riscv-test-suite/rv64i_m/pmp64/pmp64-CSR-access.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,23 @@ main:
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpaddr in M-mode /////////////////////////////////////////
LI(a4,0x01) // RANDOM VALUE
.set pmpaddri, PMPADDR0 // Initialize an iterating variable with the address of pmpaddr0
.rept 16 // START OF LOOP
csrw pmpaddri, a4 // WRITING pmpaddri (i is from 0-15)
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpcfg registers //////////////////////////////////////////
// Write in M-mode will be valid, Write in other modes will cause trap
LI(a5, PMP_R| PMP_W | PMP_X | PMP_TOR) // LOCKED BIT IS NOT SET
// Loop to Write ALL pmpcfg regs
.set pmpcfgi, PMPCFG0 // Initialize an iterating variable with the address of pmpcfg0
.rept 2 // START OF LOOP
csrw pmpcfgi, a5 // Write pmpcfgi
nop // Added nop in case of trap
csrw pmpcfgi, a5 // Write pmpcfgi
nop // Added nop in case of trap
.set pmpcfgi, pmpcfgi+2 // increment variable to next pmpcfg reg
.endr // END OF LOOP BODY
//////////////// VERIFICATION /////////////////////////////////////////
Expand Down Expand Up @@ -93,13 +102,43 @@ main:
// REPEATING THE SAME TEST //////////////////////////////////////////
// IN Smode now
/////////////////// TEST 01 ////////////////////////////////////////////
// WRITING pmpaddr registers //////////////////////////////////////////
// Write in M-mode will be valid, Write in other modes will cause trap
csrw pmpaddr0, x2 // Write pmpaddr0 in S mode (TRAP)
nop // Added nop in case of trap
// READING pmpaddr in S-mode /////////////////////////////////////////
csrr a4, pmpaddr0 // Reading pmpaddr0 in S mode (TRAP)
.set pmpaddri, PMPADDR0 // Initialize an iterating variable with the address of pmpaddr0
.rept 4 // START OF LOOP
csrr a4, pmpaddri // READING pmpaddri (i is from 0-15)
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpaddr in S-mode /////////////////////////////////////////
LI(a4,0x01) // RANDOM VALUE
.set pmpaddri, PMPADDR0 // Initialize an iterating variable with the address of pmpaddr0
.rept 4 // START OF LOOP
csrw pmpaddri, a4 // WRITING pmpaddri (i is from 0-15)
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpcfg registers //////////////////////////////////////////
// Write in M-mode will be valid, Write in other modes will cause trap
LI(a5, PMP_R| PMP_W | PMP_X | PMP_TOR) // LOCKED BIT IS NOT SET
// Loop to Write ALL pmpcfg regs
.set pmpcfgi, PMPCFG0 // Initialize an iterating variable with the address of pmpcfg0
.rept 2 // START OF LOOP
csrw pmpcfgi, a5 // Write pmpcfgi
nop // Added nop in case of trap
.set pmpcfgi, pmpcfgi+2 // increment variable to next pmpcfg reg
.endr // END OF LOOP BODY
//////////////// VERIFICATION /////////////////////////////////////////
// READING pmpcfg in S-mode /////////////////////////////////////////
// Loop to verify the contents of pmpcfg regs
.set pmpcfgi, PMPCFG0 // Initialize an iterating variable with the address of pmpcfg0
.rept 2 // START OF LOOP
csrr a4, pmpcfg0 // Read pmpcfg0
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4)
.set pmpcfgi, pmpcfgi+2 // increment variable to next pmpcfg reg
.endr // END OF LOOP BODY
/////////////////// Switch back to M-mode ////////////////////////////////////////////
RVTEST_GOTO_MMODE
csrr a4, mstatus // VERIFICATION of M-mode
Expand All @@ -121,15 +160,43 @@ main:
RVTEST_GOTO_LOWER_MODE Umode
// REPEATING THE SAME TEST //////////////////////////////////////////
// IN U-mode now
/////////////////// TEST 01 ////////////////////////////////////////////
// WRITING pmpaddr registers //////////////////////////////////////////
// Write in M-mode will be valid, Write in other modes will cause trap
csrw pmpaddr0, x2 // Write pmpaddr0 in u mode (TRAP)
// READING pmpaddr in U-mode /////////////////////////////////////////
.set pmpaddri, PMPADDR0 // Initialize an iterating variable with the address of pmpaddr0
.rept 4 // START OF LOOP
csrr a4, pmpaddri // READING pmpaddri (i is from 0-15)
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpaddr in U-mode /////////////////////////////////////////
LI(a4,0x01) // RANDOM VALUE
.set pmpaddri, PMPADDR0 // Initialize an iterating variable with the address of pmpaddr0
.rept 4 // START OF LOOP
csrw pmpaddri, a4 // WRITING pmpaddri (i is from 0-15)
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4) // Storing into signature file
.set pmpaddri, pmpaddri+1 // increment variable pmpaddri to the next pmpaddr reg
.endr // END OF LOOP BODY
// WRITING pmpcfg registers //////////////////////////////////////////
// Write in M-mode will be valid, Write in other modes will cause trap
LI(a5, PMP_R| PMP_W | PMP_X | PMP_TOR) // LOCKED BIT IS NOT SET
// Loop to Write ALL pmpcfg regs
.set pmpcfgi, PMPCFG0 // Initialize an iterating variable with the address of pmpcfg0
.rept 2 // START OF LOOP
csrw pmpcfgi, a5 // Write pmpcfgi
nop // Added nop in case of trap
.set pmpcfgi, pmpcfgi+2 // increment variable to next pmpcfg reg
.endr // END OF LOOP BODY
//////////////// VERIFICATION /////////////////////////////////////////
// READING pmpaddr in S-mode /////////////////////////////////////////
csrr a4, pmpaddr0 // Reading pmpaddr0 in U mode (TRAP)
// READING pmpcfg in U-mode /////////////////////////////////////////
// Loop to verify the contents of pmpcfg regs
.set pmpcfgi, PMPCFG0 // Initialize an iterating variable with the address of pmpcfg0
.rept 2 // START OF LOOP
csrr a4, pmpcfg0 // Read pmpcfg0
nop // Added nop in case of trap
RVTEST_SIGUPD(x13,a4)
.set pmpcfgi, pmpcfgi+2 // increment variable to next pmpcfg reg
.endr // END OF LOOP BODY

#endif

Expand Down Expand Up @@ -161,7 +228,7 @@ signature_x13_1:
tsig_begin_canary:
CANARY;
mtrap_sigptr:
.fill 64*(XLEN/32),4,0xdeadbeef
.fill 256*(XLEN/32),4,0xdeadbeef
tsig_end_canary:
CANARY;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-R-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-R.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-RW-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-RW.S
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-RWX.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-RX-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-RX.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-X-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NA4-X.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-R-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
1 change: 1 addition & 0 deletions riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-R.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-RW-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-RW.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-RWX.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-RX-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-RX.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-X-priority.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
3 changes: 2 additions & 1 deletion riscv-test-suite/rv64i_m/pmp64/pmp64-NAPOT-X.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RVTEST_SIGBASE( x13,signature_x13_1)
nop
nop
ld a4,0(a5) // Reload for verification (CHECK IF DATA HAS BEEN UPDATED SUCCESSFULLY)
jal \ADDRESS // Test for execution, an instruction is placed at this address
nop
jal \ADDRESS // Test for execution, an instruction is placed at this address
.endm

main:
Expand Down
Loading

0 comments on commit c61488a

Please sign in to comment.