2012-02-26 02:09:26 +01:00
|
|
|
package rocket
|
2011-11-09 23:52:17 +01:00
|
|
|
|
|
|
|
import Chisel._
|
2012-01-14 00:55:56 +01:00
|
|
|
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 {
|
2012-01-18 19:28:48 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2012-03-10 05:01:47 +01:00
|
|
|
io.out := Mux1H(io.sel, io.in)
|
2011-12-09 09:42:43 +01:00
|
|
|
}
|