summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/TesterDriverSpec.scala32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/test/scala/chiselTests/TesterDriverSpec.scala b/src/test/scala/chiselTests/TesterDriverSpec.scala
index 6271d382..bfe8602a 100644
--- a/src/test/scala/chiselTests/TesterDriverSpec.scala
+++ b/src/test/scala/chiselTests/TesterDriverSpec.scala
@@ -2,39 +2,43 @@
package chiselTests
-/**
- * Created by chick on 2/9/16.
- */
import Chisel._
import Chisel.testers.BasicTester
-/**
- * Created by chick on 2/8/16.
+/** Extends basic tester with a finish method.
+ *
*/
class FinishTester extends BasicTester {
var finish_was_run = false
override def finish(): Unit = {
- finish_was_run = true
+ finish_was_run = true
}
}
class TesterDriverSpec extends ChiselFlatSpec {
class DummyCircuit extends Module {
val io = new Bundle {
- val in = Bool(INPUT)
- val out = Bool(OUTPUT)
+ val in = UInt(INPUT, width = 1)
+ val out = UInt(OUTPUT, width = 1)
}
+
+ io.out := io.in
}
- runTester {
- new FinishTester {
- val dut = new DummyCircuit
+ class DummyTester extends FinishTester {
+ val dut = new DummyCircuit
+
+ dut.io.in := UInt(1)
+ Chisel.assert(dut.io.out === UInt(1))
- "Extending BasicTester" should "allow developer to have finish method run automatically" in {
- assert(finish_was_run)
- }
+ "Extending BasicTester" should "allow developer to have finish method run automatically" in {
+ assert(finish_was_run)
}
}
+
+ runTester {
+ new DummyTester
+ }
}