fixes slight bug for non-power of 2 number of ras entries
This commit is contained in:
parent
a98127c09e
commit
00e074cdd9
@ -23,7 +23,7 @@ abstract trait BTBParameters extends UsesParameters {
|
|||||||
class RAS(nras: Int) {
|
class RAS(nras: Int) {
|
||||||
def push(addr: UInt): Unit = {
|
def push(addr: UInt): Unit = {
|
||||||
when (count < nras) { count := count + 1 }
|
when (count < nras) { count := count + 1 }
|
||||||
val nextPos = Mux(Bool(isPow2(nras)) || pos > 0, pos+1, UInt(0))
|
val nextPos = Mux(Bool(isPow2(nras)) || pos < nras-1, pos+1, UInt(0))
|
||||||
stack(nextPos) := addr
|
stack(nextPos) := addr
|
||||||
pos := nextPos
|
pos := nextPos
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user