summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/MulLookup.scala
diff options
context:
space:
mode:
authorJim Lawson2016-12-02 12:51:03 -0800
committerGitHub2016-12-02 12:51:03 -0800
commitd3ec37edd39799e8cf039e5caed915c00dff7eeb (patch)
tree03329ddc11ca15b9d6c7f832354a9cba20c87843 /src/test/scala/chiselTests/MulLookup.scala
parent1b53d893816d349f5ea18fa0ed13325b9f1b6917 (diff)
parenteba224e524b249207b47a3b378458c61c9b66e2c (diff)
Merge branch 'master' into exceptionfix
Diffstat (limited to 'src/test/scala/chiselTests/MulLookup.scala')
-rw-r--r--src/test/scala/chiselTests/MulLookup.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/scala/chiselTests/MulLookup.scala b/src/test/scala/chiselTests/MulLookup.scala
index 26ee4e03..936f3a45 100644
--- a/src/test/scala/chiselTests/MulLookup.scala
+++ b/src/test/scala/chiselTests/MulLookup.scala
@@ -9,24 +9,24 @@ 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 z = Output(UInt.width(2 * w))
+ val x = Input(UInt(w.W))
+ val y = Input(UInt(w.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))
}
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)
- assert(dut.io.z === UInt(x * y))
+ dut.io.x := x.asUInt
+ dut.io.y := y.asUInt
+ assert(dut.io.z === (x * y).asUInt)
stop()
}