summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorchick2016-11-09 16:23:52 -0800
committerducky2016-11-21 12:48:10 -0800
commit22406a589c4a3f8de42a9f5c988201f474c11282 (patch)
tree35f8bdcfe288ed5b9fd051172afe342f3686f1e9 /src/main
parentd46b9acd557d2fe6ffe27f43ee72cd9b2a22f65d (diff)
simple test that range interpolator works with UInt factory method
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/chisel3/package.scala7
1 files changed, 7 insertions, 0 deletions
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")