diff options
| author | Howard Mao | 2016-06-20 13:44:08 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2016-06-20 13:44:08 -0700 |
| commit | 077aa80ea61b8517ef13f72d1fa3bec2aaa3063b (patch) | |
| tree | b3190c5773b738c987b5178b51eaa8fe15268305 /src | |
| parent | b5a534914795d9d17f4dfe623525f1b804e4c60f (diff) | |
make sure MuxCase and MuxLookup can take all subclasses of Data (#222)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/chisel/util/Mux.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/chisel/util/Mux.scala b/src/main/scala/chisel/util/Mux.scala index 6f074a7e..04b174e9 100644 --- a/src/main/scala/chisel/util/Mux.scala +++ b/src/main/scala/chisel/util/Mux.scala @@ -40,7 +40,7 @@ object MuxLookup { * @param mapping a sequence to search of keys and values * @return the value found or the default if not */ - def apply[S <: UInt, T <: Bits] (key: S, default: T, mapping: Seq[(S, T)]): T = { + def apply[S <: UInt, T <: Data] (key: S, default: T, mapping: Seq[(S, T)]): T = { var res = default for ((k, v) <- mapping.reverse) res = Mux(k === key, v, res) @@ -54,7 +54,7 @@ object MuxCase { /** @param default the default value if none are enabled * @param mapping a set of data values with associated enables * @return the first value in mapping that is enabled */ - def apply[T <: Bits] (default: T, mapping: Seq[(Bool, T)]): T = { + def apply[T <: Data] (default: T, mapping: Seq[(Bool, T)]): T = { var res = default for ((t, v) <- mapping.reverse){ res = Mux(t, v, res) |
