diff options
| author | Jim Lawson | 2015-05-11 13:02:03 -0700 |
|---|---|---|
| committer | Jim Lawson | 2015-07-24 15:50:53 -0700 |
| commit | 2ae50411cbc5e2cd5fdc9ca4069b9c5f64919bc4 (patch) | |
| tree | a656e44d86a68a7c53b159fe6c74d328a126126d /src/test/scala/ChiselTests/Outer.scala | |
| parent | b208bfb5691c7b5921dd47d0b599726872acd1cd (diff) | |
Incorporate chisel3-tests; update Makefile.
Diffstat (limited to 'src/test/scala/ChiselTests/Outer.scala')
| -rw-r--r-- | src/test/scala/ChiselTests/Outer.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/scala/ChiselTests/Outer.scala b/src/test/scala/ChiselTests/Outer.scala new file mode 100644 index 00000000..8e206f90 --- /dev/null +++ b/src/test/scala/ChiselTests/Outer.scala @@ -0,0 +1,32 @@ +package ChiselTests +import Chisel._ + +class Inner extends Module { + val io = new Bundle { + val in = Bits(INPUT, 8) + val out = Bits(OUTPUT, 8) + } + io.out := io.in +% Bits(1) +} + +class Outer extends Module { + val io = new Bundle { + val in = Bits(INPUT, 8) + val out = Bits(OUTPUT, 8) + } + // val c = Module(new Inner) + val c = Array(Module(new Inner)) + // val w = Wire(Bits(NO_DIR, 8)) + // w := io.in + c(0).io.in := io.in + io.out := (c(0).io.out * Bits(2))(7,0) +} + +class OuterTester(c: Outer) extends Tester(c) { + for (t <- 0 until 16) { + val test_in = rnd.nextInt(256) + poke(c.io.in, test_in) + step(1) + expect(c.io.out, ((test_in + 1) * 2)&255) + } +} |
