summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJim Lawson2016-07-20 13:28:15 -0700
committerJim Lawson2016-07-20 13:28:15 -0700
commit28e80311f172ae4d1d477e8bb47ca3719c9a8fc5 (patch)
tree5d7a077498317c5f2412604380acc43c6b1fc371 /src/test
parentf81202b896d30d90075be487895befa009b11733 (diff)
Compile ok.
Need to convert UInt(x) into UInt.Lit(x) or UInt.width(x)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/GCD.scala14
-rw-r--r--src/test/scala/chiselTests/Module.scala2
-rw-r--r--src/test/scala/chiselTests/Risc.scala12
3 files changed, 14 insertions, 14 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()
}
}
diff --git a/src/test/scala/chiselTests/Module.scala b/src/test/scala/chiselTests/Module.scala
index f1608d5b..857aeda3 100644
--- a/src/test/scala/chiselTests/Module.scala
+++ b/src/test/scala/chiselTests/Module.scala
@@ -11,7 +11,7 @@ class SimpleIO extends Bundle {
class PlusOne extends Module {
val io = IO(new SimpleIO)
- io.out := io.in + UInt(1)
+ io.out := io.in + 1.asUInt
}
class ModuleVec(val n: Int) extends Module {
diff --git a/src/test/scala/chiselTests/Risc.scala b/src/test/scala/chiselTests/Risc.scala
index fafec95a..c110d37e 100644
--- a/src/test/scala/chiselTests/Risc.scala
+++ b/src/test/scala/chiselTests/Risc.scala
@@ -27,13 +27,13 @@ class Risc extends Module {
val rai = inst(15, 8)
val rbi = inst( 7, 0)
- val ra = Mux(rai === Bits(0), Bits(0), file(rai))
- val rb = Mux(rbi === Bits(0), Bits(0), file(rbi))
+ val ra = Mux(rai === 0.asUInt(), 0.asUInt(), file(rai))
+ val rb = Mux(rbi === 0.asUInt(), 0.asUInt(), file(rbi))
val rc = Wire(Bits(width = 32))
io.valid := Bool(false)
- io.out := Bits(0)
- rc := Bits(0)
+ io.out := 0.asUInt()
+ rc := 0.asUInt()
when (io.isWr) {
code(io.wrAddr) := io.wrData
@@ -45,12 +45,12 @@ class Risc extends Module {
is(imm_op) { rc := (rai << 8) | rbi }
}
io.out := rc
- when (rci === UInt(255)) {
+ when (rci === 255.asUInt()) {
io.valid := Bool(true)
} .otherwise {
file(rci) := rc
}
- pc := pc +% UInt(1)
+ pc := pc +% 1.asUInt()
}
}