1
0

Add UInt->BitPat implicit conversion

This will be removed from Chisel3, so we're putting it here to maintain
compatibility.
This commit is contained in:
Andrew Waterman 2016-05-26 18:52:08 -07:00
parent 0c50bfcfb3
commit 96fa1eb6ad

View File

@ -8,6 +8,7 @@ import scala.math._
import cde.{Parameters, Field} import cde.{Parameters, Field}
object Util { object Util {
implicit def uintToBitPat(x: UInt): BitPat = BitPat(x)
implicit def intToUInt(x: Int): UInt = UInt(x) implicit def intToUInt(x: Int): UInt = UInt(x)
implicit def booleanToBool(x: Boolean): Bits = Bool(x) implicit def booleanToBool(x: Boolean): Bits = Bool(x)
implicit def intSeqToUIntSeq(x: Seq[Int]): Seq[UInt] = x.map(UInt(_)) implicit def intSeqToUIntSeq(x: Seq[Int]): Seq[UInt] = x.map(UInt(_))