Skip to content

Commit

Permalink
fix: key word error given
Browse files Browse the repository at this point in the history
+ Rename `given` to `allocated`, as `given` will become a keyword
  in Scala 3.
  • Loading branch information
SingularityKChen authored and sequencer committed Feb 24, 2023
1 parent d13aff5 commit c8bcd33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/util/IDPool.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class IDPool(numIds: Int, lateValid: Boolean = false, revocableSelect: Boolean =
io.alloc.bits := (if (revocableSelect) PriorityEncoder(bitmap) else select)

val taken = Mux(io.alloc.ready, UIntToOH(io.alloc.bits, numIds), 0.U)
val given = Mux(io.free .valid, UIntToOH(io.free .bits, numIds), 0.U)
val bitmap1 = (bitmap & ~taken) | given
val allocated = Mux(io.free .valid, UIntToOH(io.free .bits, numIds), 0.U)
val bitmap1 = (bitmap & ~taken) | allocated
val select1 = PriorityEncoder(bitmap1)
val valid1 = ( (bitmap.orR && !((PopCount(bitmap) === 1.U) && io.alloc.ready)) // bitmap not zero, and not allocating last bit
|| io.free.valid)
Expand Down

0 comments on commit c8bcd33

Please sign in to comment.