1
0

make sure PseudoLRU is given power of 2 ways

This commit is contained in:
Howard Mao 2016-07-27 18:39:33 -07:00
parent 15d1aa9346
commit fbcc7317cf

View File

@ -82,6 +82,7 @@ class SeqRandom(n_ways: Int) extends SeqReplacementPolicy {
class PseudoLRU(n: Int) class PseudoLRU(n: Int)
{ {
require(isPow2(n))
val state_reg = Reg(Bits(width = n)) val state_reg = Reg(Bits(width = n))
def access(way: UInt) { def access(way: UInt) {
state_reg := get_next_state(state_reg,way) state_reg := get_next_state(state_reg,way)