Skip to content

Commit

Permalink
Fix wrong mask for 64 bits IO access
Browse files Browse the repository at this point in the history
  • Loading branch information
bi262934 committed Mar 4, 2024
1 parent 8f0bd88 commit 9d1eb83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/naxriscv/platform/NaxriscvProbe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ class NaxriscvProbe(nax : NaxRiscv, hartId : Int){
ioAccess.error = ioBus.rsp.error.toBoolean
if(!ioAccess.write) {
val offset = (ioAccess.address) & (ioBus.p.dataWidth/8-1)
val mask = (1l << ioAccess.size*8)-1
ioAccess.data = (ioBus.rsp.data.toLong >> offset*8) & mask
val mask = (BigInt(1) << ioAccess.size*8)-1
ioAccess.data = (ioBus.rsp.data.toLong >> offset*8) & mask.toLong
}
backends.foreach(_.ioAccess(hartId, ioAccess))
ioAccess = null
Expand Down

0 comments on commit 9d1eb83

Please sign in to comment.