1
0
rocket-chip/rocket/src/main/scala/util.scala

17 lines
301 B
Scala
Raw Normal View History

package rocket
2011-11-09 23:52:17 +01:00
import Chisel._
import Node._
import scala.math._
2012-02-01 22:24:28 +01:00
class Mux1H [T <: Data](n: Int)(gen: => T) extends Component
2011-12-09 09:42:43 +01:00
{
val io = new Bundle {
val sel = Vec(n) { Bool(dir = INPUT) }
2012-02-01 22:24:28 +01:00
val in = Vec(n) { gen }.asInput
val out = gen.asOutput
2011-12-09 09:42:43 +01:00
}
io.out := Mux1H(io.sel, io.in)
2011-12-09 09:42:43 +01:00
}