Skip to content

Commit

Permalink
fix Chisel compile warnings in PseudoLRU.access(ways: Seq) (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingallsj authored Apr 4, 2020
1 parent 2cef6e4 commit 8e1f0c8
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 8e1f0c8

Please sign in to comment.