From 22406a589c4a3f8de42a9f5c988201f474c11282 Mon Sep 17 00:00:00 2001 From: chick Date: Wed, 9 Nov 2016 16:23:52 -0800 Subject: simple test that range interpolator works with UInt factory method --- src/main/scala/chisel3/package.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main') diff --git a/src/main/scala/chisel3/package.scala b/src/main/scala/chisel3/package.scala index 3cdda971..436534e1 100644 --- a/src/main/scala/chisel3/package.scala +++ b/src/main/scala/chisel3/package.scala @@ -1,3 +1,4 @@ + // See LICENSE for license details. package object chisel3 { // scalastyle:ignore package.object.name @@ -11,6 +12,8 @@ package object chisel3 { // scalastyle:ignore package.object.name import chisel3.util._ import chisel3.internal.firrtl.Port + import chisel3.internal.firrtl.NumericBound + type Direction = chisel3.core.Direction val Input = chisel3.core.Input val Output = chisel3.core.Output @@ -156,6 +159,10 @@ package object chisel3 { // scalastyle:ignore package.object.name def F(binaryPoint: Int): FixedPoint = FixedPoint.fromDouble(x, binaryPoint = binaryPoint) } + implicit class ChiselRange(val sc: StringContext) extends AnyVal { + def range(args: Any*): (NumericBound[Int], NumericBound[Int]) = macro chisel3.internal.RangeTransform.apply + } + implicit class fromUIntToBitPatComparable(val x: UInt) extends AnyVal { final def === (that: BitPat): Bool = macro SourceInfoTransform.thatArg @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3") -- cgit v1.2.3