summaryrefslogtreecommitdiff
path: root/src/test/scala/ChiselTests/Tbl.scala
diff options
context:
space:
mode:
authorHenry Cook2015-08-12 19:32:43 -0700
committerHenry Cook2015-08-12 19:32:57 -0700
commit85d7403f9bf7bc2b3520f924736c237f21f70ebd (patch)
tree64560f779063a419395a2fb8a31ea52c52af4404 /src/test/scala/ChiselTests/Tbl.scala
parent7e69966362b1dbd9835695250494857f3a3767c8 (diff)
being to convert tests to scala-test; tests compile and run
Diffstat (limited to 'src/test/scala/ChiselTests/Tbl.scala')
-rw-r--r--src/test/scala/ChiselTests/Tbl.scala32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/test/scala/ChiselTests/Tbl.scala b/src/test/scala/ChiselTests/Tbl.scala
deleted file mode 100644
index c5bc4fe5..00000000
--- a/src/test/scala/ChiselTests/Tbl.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-package ChiselTests
-import Chisel._
-import Chisel.testers._
-
-class Tbl extends Module {
- val io = new Bundle {
- val i = Bits(INPUT, 16)
- val we = Bool(INPUT)
- val d = Bits(INPUT, 16)
- val o = Bits(OUTPUT, 16)
- }
- val m = Mem(Bits(width = 10), 256)
- io.o := Bits(0)
- when (io.we) { m(io.i) := io.d(9, 0) }
- .otherwise { io.o := m(io.i) }
-}
-
-class TblTester(c: Tbl) extends Tester(c) {
- val m = Array.fill(1 << 16){ 0 }
- for (t <- 0 until 16) {
- val i = rnd.nextInt(1 << 16)
- val d = rnd.nextInt(1 << 16)
- val we = rnd.nextInt(2)
- poke(c.io.i, i)
- poke(c.io.we, we)
- poke(c.io.d, d)
- step(1)
- expect(c.io.o, if (we == 1) 0 else m(i))
- if (we == 1)
- m(i) = d
- }
-}