Skip to content

Commit

Permalink
fix Chisel compile warnings in PseudoLRU.access(ways: Seq)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingallsj committed Mar 30, 2020
1 parent 38c2903 commit 82ffc6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/util/Replacement.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ class PseudoLRU(n: Int)
state_reg := get_next_state(state_reg,way)
}
def access(ways: Seq[ValidIO[UInt]]) {
state_reg := ways.fold(state_reg) { case (prev: UInt, way: ValidIO[UInt]) =>
Mux(way.valid, get_next_state(prev, way.bits), prev) }
state_reg := ways.foldLeft(state_reg)((prev, way) => Mux(way.valid, get_next_state(prev, way.bits), prev))
}
def get_next_state(state: UInt, way: UInt) = {
var next_state = state << 1
Expand Down

0 comments on commit 82ffc6e

Please sign in to comment.