summaryrefslogtreecommitdiff
path: root/src/test/scala/ChiselTests/ModuleVec.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/ModuleVec.scala
parent7e69966362b1dbd9835695250494857f3a3767c8 (diff)
being to convert tests to scala-test; tests compile and run
Diffstat (limited to 'src/test/scala/ChiselTests/ModuleVec.scala')
-rw-r--r--src/test/scala/ChiselTests/ModuleVec.scala35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/test/scala/ChiselTests/ModuleVec.scala b/src/test/scala/ChiselTests/ModuleVec.scala
deleted file mode 100644
index 26b4ed5e..00000000
--- a/src/test/scala/ChiselTests/ModuleVec.scala
+++ /dev/null
@@ -1,35 +0,0 @@
-package ChiselTests
-import Chisel._
-import Chisel.testers._
-
-class PlusOne extends Module {
- val io = new Bundle {
- val in = UInt(INPUT, 32)
- val out = UInt(OUTPUT, 32)
- }
- io.out := io.in + UInt(1)
-}
-
-class ModuleVec(val n: Int) extends Module {
- val io = new Bundle {
- val ins = Vec(UInt(INPUT, 32), n)
- val outs = Vec(UInt(OUTPUT, 32), n)
- }
- val pluses = Vec.fill(n){ Module(new PlusOne).io }
- for (i <- 0 until n) {
- pluses(i).in := io.ins(i)
- io.outs(i) := pluses(i).out
- }
-}
-
-
-class ModuleVecTester(c: ModuleVec) extends Tester(c) {
- for (t <- 0 until 16) {
- val test_ins = Array.fill(c.n){ rnd.nextInt(256) }
- for (i <- 0 until c.n)
- poke(c.io.ins(i), test_ins(i))
- step(1)
- for (i <- 0 until c.n)
- expect(c.io.outs(i), test_ins(i) + 1)
- }
-}