chipsalliance / chipsalliance/chisel
earlyLocalName calls instanceName
- Dominant language
- Scala
- Stars
- 4.8k
- Forks
- 658
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 14
Description
**Type of issue**: Bug Report
**Please provide the steps to reproduce the problem:**
Use a Probe in a monoconnect:
```scala
val in = IO(Output(Probe(Bool()))
in := true
```
Note that this is expected to fail, but with a clearer error message that is currently getting masked by this bug.
**What is the current behavior?**
```
[info] chisel3.package$ChiselException: signalName/pathName should be called after circuit elaboration: ProbeSpec_Anon.readInternalBundle_probe_read: Wire[BarBundle], Some(chiselTests.ProbeSpec$$anon$8@46c95d1b)
[info] at chisel3.internal.throwException$.apply(Error.scala:215)
[info] at chisel3.internal.HasId.instanceName(Builder.scala:319)
[info] at chisel3.internal.HasId.instanceName$(Builder.scala:311)
[info] at chisel3.Data.instanceName(Data.scala:286)
[info] at chisel3.internal.firrtl.Node.name(IR.scala:89)
```
Which comes from the expected error message, detailed below.
**What is the expected behavior?**
```
Source ${formatName(source)} of Probed type cannot participate in a mono connection (:=)
```
from [MonoConnect.scala](https://github.com/chipsalliance/chisel/blob/94ad13fea1a72cdaa085eefc898b5b82aa44d1e8/core/src/main/scala/chisel3/internal/MonoConnect.scala#L79C5-L79C5)
**Please tell us about your environment:**
**Other Information**
**What is the use case for changing the behavior?**
Contributor guide
Research direction
Start with the Probe-in-monoconnect reproduction in the issue and inspect MonoConnect.scala around line 79, where the expected error is produced. Trace the name formatting through the stack frames in Builder.scala, Data.scala, and IR.scala. Done means the invalid connection reports the expected source/type message without the instanceName elaboration error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100