diff options
| author | Jim Lawson | 2016-07-20 13:28:15 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-07-20 13:28:15 -0700 |
| commit | 28e80311f172ae4d1d477e8bb47ca3719c9a8fc5 (patch) | |
| tree | 5d7a077498317c5f2412604380acc43c6b1fc371 /src/test/scala/chiselTests/GCD.scala | |
| parent | f81202b896d30d90075be487895befa009b11733 (diff) | |
Compile ok.
Need to convert UInt(x) into UInt.Lit(x) or UInt.width(x)
Diffstat (limited to 'src/test/scala/chiselTests/GCD.scala')
| -rw-r--r-- | src/test/scala/chiselTests/GCD.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/scala/chiselTests/GCD.scala b/src/test/scala/chiselTests/GCD.scala index a8b907af..7c04ae00 100644 --- a/src/test/scala/chiselTests/GCD.scala +++ b/src/test/scala/chiselTests/GCD.scala @@ -21,18 +21,18 @@ class GCD extends Module { .otherwise { y := y -% x } when (io.e) { x := io.a; y := io.b } io.z := x - io.v := y === UInt(0) + io.v := y === 0.U } class GCDTester(a: Int, b: Int, z: Int) extends BasicTester { val dut = Module(new GCD) - val first = Reg(init=Bool(true)) - dut.io.a := UInt(a) - dut.io.b := UInt(b) + val first = Reg(init=true.B) + dut.io.a := a.U + dut.io.b := b.U dut.io.e := first - when(first) { first := Bool(false) } - when(dut.io.v) { - assert(dut.io.z === UInt(z)) + when(first) { first := false.B } + when(!first && dut.io.v) { + assert(dut.io.z === z.U) stop() } } |
