1
0
Fork 0

PLIC: simplify some scala code

This commit is contained in:
Megan Wachs 2017-06-29 19:35:15 -07:00 committed by GitHub
parent eae4fe1469
commit 834bcf6b7e
1 changed files with 2 additions and 4 deletions

View File

@ -177,12 +177,10 @@ class TLPLIC(params: PLICParams)(implicit p: Parameters) extends LazyModule
}
val claimer = Wire(init = Vec.fill(nHarts){Bool(false)})
val claiming = Wire(init = Vec.tabulate(nHarts){i => Mux(claimer(i), UIntToOH(maxDevs(i)), UInt(0, width=log2Up(nDevices+1)))})
val claiming = Wire(init = Vec.tabulate(nHarts){i => Mux(claimer(i), UIntToOH(maxDevs(i)), UInt(0))})
val claimedDevs = Wire(init = Vec(claiming.reduceLeft( _ | _ ).toBools))
for ((pg, c) <- (pending zip gateways) zip claimedDevs) {
val p = pg._1
val g = pg._2
for ((p, g), c) <- (pending zip gateways) zip claimedDevs) {
g.ready := !p
g.complete := false
when(c) {