[rocket] use more standard pattern for computing integer min
This commit is contained in:
parent
ffac86b041
commit
c465120610
@ -125,7 +125,7 @@ class DmaFrontend(implicit p: Parameters) extends CoreModule()(p)
|
|||||||
val last_src_vpn = Reg(UInt(width = vpnBits))
|
val last_src_vpn = Reg(UInt(width = vpnBits))
|
||||||
val last_dst_vpn = Reg(UInt(width = vpnBits))
|
val last_dst_vpn = Reg(UInt(width = vpnBits))
|
||||||
|
|
||||||
val tx_len = Util.minUInt(src_pglen, dst_pglen, bytes_left)
|
val tx_len = src_pglen min dst_pglen min bytes_left
|
||||||
|
|
||||||
val dma_busy = Reg(init = UInt(0, tlMaxClientXacts))
|
val dma_busy = Reg(init = UInt(0, tlMaxClientXacts))
|
||||||
val dma_xact_id = PriorityEncoder(~dma_busy)
|
val dma_xact_id = PriorityEncoder(~dma_busy)
|
||||||
|
@ -44,12 +44,6 @@ object Util {
|
|||||||
def toBits(): UInt = Cat(x.map(_.toBits).reverse)
|
def toBits(): UInt = Cat(x.map(_.toBits).reverse)
|
||||||
}
|
}
|
||||||
|
|
||||||
def minUInt(values: Seq[UInt]): UInt =
|
|
||||||
values.reduce((a, b) => Mux(a < b, a, b))
|
|
||||||
|
|
||||||
def minUInt(first: UInt, rest: UInt*): UInt =
|
|
||||||
minUInt(first +: rest.toSeq)
|
|
||||||
|
|
||||||
implicit class UIntIsOneOf(val x: UInt) extends AnyVal {
|
implicit class UIntIsOneOf(val x: UInt) extends AnyVal {
|
||||||
def isOneOf(s: Seq[UInt]): Bool = s.map(x === _).reduce(_||_)
|
def isOneOf(s: Seq[UInt]): Bool = s.map(x === _).reduce(_||_)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user