From 671117f3332ac10d1e7c5cc4f4cb5278f72ed6ab Mon Sep 17 00:00:00 2001 From: ducky Date: Fri, 20 May 2016 19:50:05 -0700 Subject: Add implicit xToLiteral, add Element, use internal package object --- src/main/scala/chisel/compatibility.scala | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/scala/chisel/compatibility.scala b/src/main/scala/chisel/compatibility.scala index 80936a42..fd45987b 100644 --- a/src/main/scala/chisel/compatibility.scala +++ b/src/main/scala/chisel/compatibility.scala @@ -26,6 +26,7 @@ package object Chisel { val BitPat = chisel.BitPat type BitPat = chisel.BitPat + type Element = chisel.Element type Bits = chisel.Bits val Bits = chisel.Bits type Num[T <: Data] = chisel.Num[T] @@ -64,6 +65,12 @@ package object Chisel { val throwException = chisel.throwException + object testers { + type BasicTester = chisel.testers.BasicTester + val TesterDriver = chisel.testers.TesterDriver + } + + val log2Up = chisel.log2Up val log2Ceil = chisel.log2Ceil val log2Down = chisel.log2Down @@ -129,11 +136,15 @@ package object Chisel { val Valid = chisel.Valid val Pipe = chisel.Pipe type Pipe[T <: Data] = chisel.Pipe[T] -} -package Chisel { - package object testers { - type BasicTester = chisel.testers.BasicTester - val TesterDriver = chisel.testers.TesterDriver - } + + import chisel.internal.firrtl.Width + implicit def fromBigIntToLiteral(x: BigInt): chisel.fromBigIntToLiteral = + new chisel.fromBigIntToLiteral(x) + implicit def fromIntToLiteral(x: Int): chisel.fromIntToLiteral= + new chisel.fromIntToLiteral(x) + implicit def fromStringToLiteral(x: String): chisel.fromStringToLiteral= + new chisel.fromStringToLiteral(x) + implicit def fromBooleanToLiteral(x: Boolean): chisel.fromBooleanToLiteral= + new chisel.fromBooleanToLiteral(x) } -- cgit v1.2.3