Clear MIP CSR to avoid trapping (#1660)

This commit is contained in:
Jalali 2023-11-29 12:55:50 +00:00 committed by GitHub
parent 66287defa0
commit 6254dfa721
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 0 deletions

View file

@ -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}
##########################

View file

@ -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}
##########################

View file

@ -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}
##########################

View file

@ -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}
##########################