summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/WireSpec.scala
blob: 11a1f1a193528ef216d3805a6447d211f22db13a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: Apache-2.0

package chiselTests

import chisel3._

class WireSpec extends ChiselFlatSpec {
  "WireDefault.apply" should "work" in {
    assertCompiles("WireDefault(UInt(4.W), 2.U)")
  }
  it should "allow DontCare" in {
    assertCompiles("WireDefault(UInt(4.W), DontCare)")
  }
  it should "not allow DontCare to affect type inference" in {
    assertCompiles("val x: UInt = WireDefault(UInt(4.W), DontCare)")
  }
  it should "not allow init argument to affect type inference" in {
    assertDoesNotCompile("val x: UInt = WireDefault(UInt(4.W), 2.S)")
  }
}