Skip to content

Commit

Permalink
Improve performance of PrioritizingRouter by skipping simple cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Apr 1, 2023
1 parent 4606ee1 commit 6a12a21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/scala/router/vcalloc/Prioritizing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ trait Prioritizing { this: VCAllocator =>
val ref = (((e.inVId << addr_bundle.id.getWidth) | e.inId) << addr_bundle.flow.getWidth) | e.flow.asLiteral(flow)
(BitPat(ref.U), BitPat((1 << e.prio).U(nPrios.W)))
}
Mux(in(i)(j), DecodeLogic(addr, BitPat.dontCare(nPrios), lookup), 0.U(nPrios.W))
if (lookup.map(_._2).distinct.size == 1) {
Mux(in(i)(j), BitPat.bitPatToUInt(lookup.head._2), 0.U(nPrios.W))
} else {
Mux(in(i)(j), DecodeLogic(addr, BitPat.dontCare(nPrios), lookup), 0.U(nPrios.W))
}
}}

val mask = RegInit(0.U(w.W))
Expand Down

0 comments on commit 6a12a21

Please sign in to comment.