Add MuxT to mux on Tuple2 and Tuple3
This commit is contained in:
parent
511cc6c5c5
commit
66e9f027e0
@ -34,6 +34,14 @@ object Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object MuxT {
|
||||||
|
def apply[T <: Data, U <: Data](cond: Bool, con: (T, U), alt: (T, U)): (T, U) =
|
||||||
|
(Mux(cond, con._1, alt._1), Mux(cond, con._2, alt._2))
|
||||||
|
|
||||||
|
def apply[T <: Data, U <: Data, W <: Data](cond: Bool, con: (T, U, W), alt: (T, U, W)): (T, U, W) =
|
||||||
|
(Mux(cond, con._1, alt._1), Mux(cond, con._2, alt._2), Mux(cond, con._3, alt._3))
|
||||||
|
}
|
||||||
|
|
||||||
import Util._
|
import Util._
|
||||||
|
|
||||||
object Str
|
object Str
|
||||||
|
Loading…
Reference in New Issue
Block a user