diff options
| author | Jack | 2022-11-11 06:53:04 +0000 |
|---|---|---|
| committer | Jack | 2022-11-11 06:53:04 +0000 |
| commit | 3ce953c81f06519351c48277e3474b5720ec07ff (patch) | |
| tree | ac79dcb80d0528c2ae86ca21da4cf424715ab645 /src/test/scala/chiselTests/WireSpec.scala | |
| parent | adccde9998c91875e5490cff6d5822ffacc593ed (diff) | |
| parent | c8046636a25474be4c547c6fe9c6d742ea7b1d13 (diff) | |
Merge branch '3.5.x' into 3.5-release
Diffstat (limited to 'src/test/scala/chiselTests/WireSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/WireSpec.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/WireSpec.scala b/src/test/scala/chiselTests/WireSpec.scala index 11a1f1a1..058a7f08 100644 --- a/src/test/scala/chiselTests/WireSpec.scala +++ b/src/test/scala/chiselTests/WireSpec.scala @@ -3,6 +3,7 @@ package chiselTests import chisel3._ +import chisel3.stage.ChiselStage class WireSpec extends ChiselFlatSpec { "WireDefault.apply" should "work" in { @@ -17,4 +18,19 @@ class WireSpec extends ChiselFlatSpec { it should "not allow init argument to affect type inference" in { assertDoesNotCompile("val x: UInt = WireDefault(UInt(4.W), 2.S)") } + it should "have source locator information on wires" in { + class Dummy extends chisel3.Module { + val in = IO(Input(Bool())) + val out = IO(Output(Bool())) + + val wire = WireInit(Bool(), true.B) + val wire2 = Wire(Bool()) + wire2 := in + out := in & wire & wire2 + } + + val chirrtl = ChiselStage.emitChirrtl(new Dummy) + chirrtl should include("wire wire : UInt<1> @[WireSpec.scala") + chirrtl should include("wire wire2 : UInt<1> @[WireSpec.scala") + } } |
