diff options
| author | Jim Lawson | 2016-07-20 14:49:35 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-07-20 14:49:35 -0700 |
| commit | 2dce378deda1cc33833eb378c89a1c5415817bae (patch) | |
| tree | e3bc5361030d63e017d065491e9e7e4cf788fe3c /src/test/scala/chiselTests/UIntOps.scala | |
| parent | 28e80311f172ae4d1d477e8bb47ca3719c9a8fc5 (diff) | |
Distinguish between ?Int.Lit and ?Int.width
Diffstat (limited to 'src/test/scala/chiselTests/UIntOps.scala')
| -rw-r--r-- | src/test/scala/chiselTests/UIntOps.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/test/scala/chiselTests/UIntOps.scala b/src/test/scala/chiselTests/UIntOps.scala index ca83ee1d..812f822d 100644 --- a/src/test/scala/chiselTests/UIntOps.scala +++ b/src/test/scala/chiselTests/UIntOps.scala @@ -8,15 +8,15 @@ import chisel3.testers.BasicTester class UIntOps extends Module { val io = IO(new Bundle { - val a = Input(UInt(16)) - val b = Input(UInt(16)) - val addout = Output(UInt(16)) - val subout = Output(UInt(16)) - val timesout = Output(UInt(16)) - val divout = Output(UInt(16)) - val modout = Output(UInt(16)) - val lshiftout = Output(UInt(16)) - val rshiftout = Output(UInt(16)) + val a = Input(UInt.width(16)) + val b = Input(UInt.width(16)) + val addout = Output(UInt.width(16)) + val subout = Output(UInt.width(16)) + val timesout = Output(UInt.width(16)) + val divout = Output(UInt.width(16)) + val modout = Output(UInt.width(16)) + val lshiftout = Output(UInt.width(16)) + val rshiftout = Output(UInt.width(16)) val lessout = Output(Bool()) val greatout = Output(Bool()) val eqout = Output(Bool()) @@ -31,10 +31,10 @@ class UIntOps extends Module { io.addout := a +% b io.subout := a -% b io.timesout := (a * b)(15, 0) - io.divout := a / Mux(b === UInt(0), UInt(1), b) + io.divout := a / Mux(b === UInt.Lit(0), UInt.Lit(1), b) // io.modout := a % b // TODO: - io.modout := UInt(0) + io.modout := UInt.Lit(0) io.lshiftout := (a << b(3, 0))(15, 0) io.rshiftout := a >> b io.lessout := a < b @@ -78,7 +78,7 @@ class UIntOpsTester(c: UIntOps) extends Tester(c) { class GoodBoolConversion extends Module { val io = IO(new Bundle { - val u = Input(UInt(1)) + val u = Input(UInt.width(1)) val b = Output(Bool()) }) io.b := io.u.toBool |
