From 85d7403f9bf7bc2b3520f924736c237f21f70ebd Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Wed, 12 Aug 2015 19:32:43 -0700 Subject: being to convert tests to scala-test; tests compile and run --- src/test/scala/ChiselTests/Tbl.scala | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/test/scala/ChiselTests/Tbl.scala (limited to 'src/test/scala/ChiselTests/Tbl.scala') 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 - } -} -- cgit v1.2.3