summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/DeqIOSpec.scala
blob: dfa63eb1a26b5095dd6be97b365e75859a2f2a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// See LICENSE for license details.

package chiselTests

import Chisel._
import Chisel.testers.BasicTester

/**
  * Created by chick on 2/8/16.
  */
class FinishTester extends BasicTester {
  var finish_was_run = false

  override def finish(): Unit = {
    finish_was_run = true
  }
}

class FinishTesterSpec extends ChiselFlatSpec {
  class DummyCircuit extends Module {
    val io = new Bundle {
      val in = Bool(INPUT)
      val out = Bool(OUTPUT)
    }
  }

  runTester {
    new FinishTester {
      val dut = new DummyCircuit

      "Extending BasicTester" should "allow developer to have finish method run automatically" in {
        assert(finish_was_run)
      }
    }
  }
}