Fix paddrBits < xLen && paddrBits == vaddrBits case
Require and/or force vaddrBits to be bigger than paddrBits so there's room to zero-extend a physical address by 1 bit, so that when the virtual address is sign-extended, the sign is zero.
This commit is contained in:
parent
0e6aa7ae9d
commit
2c4009a138
@ -48,7 +48,9 @@ trait HasTileParameters {
|
|||||||
require(v == xLen || xLen > v && v > paddrBits)
|
require(v == xLen || xLen > v && v > paddrBits)
|
||||||
v
|
v
|
||||||
} else {
|
} else {
|
||||||
paddrBits min xLen
|
// since virtual addresses sign-extend but physical addresses
|
||||||
|
// zero-extend, make room for a zero sign bit for physical addresses
|
||||||
|
(paddrBits + 1) min xLen
|
||||||
}
|
}
|
||||||
def paddrBits: Int = p(SharedMemoryTLEdge).bundle.addressBits
|
def paddrBits: Int = p(SharedMemoryTLEdge).bundle.addressBits
|
||||||
def vpnBits: Int = vaddrBits - pgIdxBits
|
def vpnBits: Int = vaddrBits - pgIdxBits
|
||||||
|
Loading…
Reference in New Issue
Block a user