diff options
| author | Richard Lin | 2016-11-21 13:44:26 -0800 |
|---|---|---|
| committer | GitHub | 2016-11-21 13:44:26 -0800 |
| commit | 3b4755716a74d4711efa3ce6799742479e17e80b (patch) | |
| tree | 56652eaa478d5dfd8cddfbe2795c0123d39d230d /src/test/scala/chiselTests/Reg.scala | |
| parent | cd6eb41275381a4399a8a88c886110d276bb805c (diff) | |
| parent | 81e5d00d18a5ba9ae33c10219a270148002fc672 (diff) | |
Merge pull request #372 from ucb-bar/onetrueliteral
Standardize the One True Way of specifying literals
Diffstat (limited to 'src/test/scala/chiselTests/Reg.scala')
| -rw-r--r-- | src/test/scala/chiselTests/Reg.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/scala/chiselTests/Reg.scala b/src/test/scala/chiselTests/Reg.scala index 90992c01..43e64fe7 100644 --- a/src/test/scala/chiselTests/Reg.scala +++ b/src/test/scala/chiselTests/Reg.scala @@ -17,7 +17,7 @@ class RegSpec extends ChiselFlatSpec { "A Reg" should "be of the same type and width as outType, if specified" in { class RegOutTypeWidthTester extends BasicTester { - val reg = Reg(t=UInt(width=2), next=Wire(UInt(width=3)), init=UInt(20)) + val reg = Reg(t=UInt(2.W), next=Wire(UInt(3.W)), init=20.U) reg.getWidth should be (2) } elaborate{ new RegOutTypeWidthTester } @@ -25,13 +25,13 @@ class RegSpec extends ChiselFlatSpec { "A Reg" should "be of unknown width if outType is not specified and width is not forced" in { class RegUnknownWidthTester extends BasicTester { - val reg1 = Reg(next=Wire(UInt(width=3)), init=UInt(20)) + val reg1 = Reg(next=Wire(UInt(3.W)), init=20.U) reg1.isWidthKnown should be (false) DataMirror.widthOf(reg1).known should be (false) - val reg2 = Reg(init=UInt(20)) + val reg2 = Reg(init=20.U) reg2.isWidthKnown should be (false) DataMirror.widthOf(reg2).known should be (false) - val reg3 = Reg(next=Wire(UInt(width=3)), init=UInt(5)) + val reg3 = Reg(next=Wire(UInt(3.W)), init=5.U) reg3.isWidthKnown should be (false) DataMirror.widthOf(reg3).known should be (false) } @@ -40,7 +40,7 @@ class RegSpec extends ChiselFlatSpec { "A Reg" should "be of width of init if outType and next are missing and init is a literal of forced width" in { class RegForcedWidthTester extends BasicTester { - val reg2 = Reg(init=UInt(20, width=7)) + val reg2 = Reg(init=20.U(7.W)) reg2.getWidth should be (7) } elaborate{ new RegForcedWidthTester } |
