summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/ModuleExplicitResetSpec.scala
blob: 27cf4a5f4d8505569c2e852cbb14c34bf0d030b6 (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
37
38
// See LICENSE for license details.

package chiselTests

class ModuleExplicitResetSpec extends ChiselFlatSpec  {

  "A Module with an explicit reset in compatibility mode" should "elaborate" in {
    import Chisel._
    val myReset = true.B
    class ModuleExplicitReset(reset: Bool) extends Module(_reset = reset) {
      val io = new Bundle {
        val done = Bool(OUTPUT)
      }

      io.done := false.B
    }

    elaborate {
      new ModuleExplicitReset(myReset)
    }
  }

  "A Module with an explicit reset in non-compatibility mode" should "elaborate" in {
    import chisel3._
    val myReset = true.B
    class ModuleExplicitReset(reset: Bool) extends Module(_reset = reset) {
      val io = IO(new Bundle {
        val done = Output(Bool())
      })

      io.done := false.B
    }

    elaborate {
      new ModuleExplicitReset(myReset)
    }
  }
}