summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/compatibility.scala
diff options
context:
space:
mode:
authorducky2016-11-16 18:47:36 -0800
committerducky2016-11-21 13:30:22 -0800
commite0b277a40693476247a68e7c52672b547d7ceb17 (patch)
tree14d2a8de52243c4dc3bd4d1420f7cc436676a6e9 /src/main/scala/chisel3/compatibility.scala
parent15a8d3818a1b185051b260ffc82da1fb4a60a45e (diff)
Deprecate things, split more things
Diffstat (limited to 'src/main/scala/chisel3/compatibility.scala')
-rw-r--r--src/main/scala/chisel3/compatibility.scala12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/scala/chisel3/compatibility.scala b/src/main/scala/chisel3/compatibility.scala
index 7157b4d4..ac0caa45 100644
--- a/src/main/scala/chisel3/compatibility.scala
+++ b/src/main/scala/chisel3/compatibility.scala
@@ -42,13 +42,12 @@ package object Chisel { // scalastyle:ignore package.object.name
trait UIntFactory extends chisel3.core.UIntFactory {
import chisel3.internal.firrtl.Width
- /** Create a UInt with a specified width */
- def width(width: Int): UInt = apply(Width(width))
-
/** Create a UInt literal with inferred width. */
- def apply(n: String): UInt = Lit(n)
+ def apply(n: String): UInt = Lit(chisel3.core.fromStringToLiteral.parse(n),
+ chisel3.core.fromStringToLiteral.parsedWidth(n))
/** Create a UInt literal with fixed width. */
- def apply(n: String, width: Int): UInt = Lit(parse(n), width)
+ def apply(n: String, width: Int): UInt = Lit(chisel3.core.fromStringToLiteral.parse(n),
+ Width(width))
/** Create a UInt literal with specified width. */
def apply(value: BigInt, width: Width): UInt = Lit(value, width)
@@ -74,6 +73,9 @@ package object Chisel { // scalastyle:ignore package.object.name
}
}
+ /** Create a UInt with a specified width */
+ def width(width: Int): UInt = apply(Width(width))
+
/** Create a UInt port with specified width. */
def width(width: Width): UInt = apply(width)
}