Add MuxT to mux on Tuple2 and Tuple3
This commit is contained in:
		| @@ -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._ | ||||
|  | ||||
| object Str | ||||
|   | ||||
		Reference in New Issue
	
	Block a user