summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/RebindingSpec.scala
blob: f7a79ace398794752e1cd46733534bcc4db1707f (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
// See LICENSE for license details.

package chiselTests

import chisel3._

class RebindingSpec extends ChiselFlatSpec {
  "Rebinding a literal" should "fail" in {
    a [BindingException] should be thrownBy {
      elaborate { new Module {
        val io = IO(new Bundle {
          val a = 4.U
        })
      } }
    }
  }

  "Rebinding a hardware type" should "fail" in {
    a [BindingException] should be thrownBy {
      elaborate { new Module {
        val io = IO(new Bundle {
          val a = Reg(UInt(32.W))
        })
      } }
    }
  }
}