Skip to content

Commit

Permalink
Clear MIP CSR to avoid trapping (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyoubJalali authored Nov 29, 2023
1 parent 66287de commit 6254dfa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions verif/tests/custom/csr_embedded/csrcs_test.S
Original file line number Diff line number Diff line change
Expand Up @@ -3042,6 +3042,12 @@ csrcs:
#MIP read value
csrr x14, 0x344

#Clear MIP to avoid traping
csrw 0x344, x0

#MIP read value
csrr x14, 0x344

##########################
#MHPMCOUNTERH9 testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'ha}
##########################
Expand Down
6 changes: 6 additions & 0 deletions verif/tests/custom/csr_embedded/csrcsi_test.S
Original file line number Diff line number Diff line change
Expand Up @@ -3560,6 +3560,12 @@ csrcsi:
#MIP read value
csrr x14, 0x344

#Clear MIP to avoid traping
csrw 0x344, x0

#MIP read value
csrr x14, 0x344

##########################
#MHPMCOUNTERH11 testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h11}
##########################
Expand Down
6 changes: 6 additions & 0 deletions verif/tests/custom/csr_embedded/csrrw_test.S
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,12 @@ csrrw:
#MIP read value
csrr x14, 0x344

#Clear MIP to avoid traping
csrw 0x344, x0

#MIP read value
csrr x14, 0x344

##########################
#MHPMCOUNTERH27 testing W/R values '{'hffffffff, 'h0, 'h55555555, 'haaaaaaaa, 'h22c2d883}
##########################
Expand Down
6 changes: 6 additions & 0 deletions verif/tests/custom/csr_embedded/csrrwi_test.S
Original file line number Diff line number Diff line change
Expand Up @@ -3320,6 +3320,12 @@ csrrwi:
#MIP read value
csrr x14, 0x344

#Clear MIP to avoid traping
csrw 0x344, x0

#MIP read value
csrr x14, 0x344

##########################
#MHPMEVENT9 testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'ha}
##########################
Expand Down

0 comments on commit 6254dfa

Please sign in to comment.