From 54d3f8dc054e55dfbd01d1aa034169a3dabe89f2 Mon Sep 17 00:00:00 2001 From: ducky Date: Thu, 17 Nov 2016 13:01:03 -0800 Subject: Restyle a lot of test code, mainly with regex --- src/test/scala/chiselTests/MulLookup.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/test/scala/chiselTests/MulLookup.scala') diff --git a/src/test/scala/chiselTests/MulLookup.scala b/src/test/scala/chiselTests/MulLookup.scala index 26ee4e03..f0b2aa21 100644 --- a/src/test/scala/chiselTests/MulLookup.scala +++ b/src/test/scala/chiselTests/MulLookup.scala @@ -9,8 +9,8 @@ import chisel3.testers.BasicTester class MulLookup(val w: Int) extends Module { val io = IO(new Bundle { - val x = Input(UInt.width(w)) - val y = Input(UInt.width(w)) + val x = Input(UInt(w.W)) + val y = Input(UInt(w.W)) val z = Output(UInt.width(2 * w)) }) val tbl = Vec( @@ -24,8 +24,8 @@ class MulLookup(val w: Int) extends Module { class MulLookupTester(w: Int, x: Int, y: Int) extends BasicTester { val dut = Module(new MulLookup(w)) - dut.io.x := UInt(x) - dut.io.y := UInt(y) + dut.io.x := x.asUInt + dut.io.y := y.asUInt assert(dut.io.z === UInt(x * y)) stop() } -- cgit v1.2.3 From 37a569372c70a651c813d0beb44124878a596e73 Mon Sep 17 00:00:00 2001 From: ducky Date: Thu, 17 Nov 2016 13:16:40 -0800 Subject: Fix all deprecations from new style --- src/test/scala/chiselTests/MulLookup.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/scala/chiselTests/MulLookup.scala') diff --git a/src/test/scala/chiselTests/MulLookup.scala b/src/test/scala/chiselTests/MulLookup.scala index f0b2aa21..936f3a45 100644 --- a/src/test/scala/chiselTests/MulLookup.scala +++ b/src/test/scala/chiselTests/MulLookup.scala @@ -11,13 +11,13 @@ class MulLookup(val w: Int) extends Module { val io = IO(new Bundle { val x = Input(UInt(w.W)) val y = Input(UInt(w.W)) - val z = Output(UInt.width(2 * w)) + val z = Output(UInt((2 * w).W)) }) val tbl = Vec( for { i <- 0 until 1 << w j <- 0 until 1 << w - } yield UInt(i * j, 2 * w) + } yield (i * j).asUInt((2 * w).W) ) io.z := tbl(((io.x << w) | io.y)) } @@ -26,7 +26,7 @@ class MulLookupTester(w: Int, x: Int, y: Int) extends BasicTester { val dut = Module(new MulLookup(w)) dut.io.x := x.asUInt dut.io.y := y.asUInt - assert(dut.io.z === UInt(x * y)) + assert(dut.io.z === (x * y).asUInt) stop() } -- cgit v1.2.3