[enhancement] Allow specifying custom names for proc instances
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
When creating a new proc using spawn, it is not possible to assign a custom name to the spawned instance. This makes it harder to track and identify procs in larger designs after generating IR or SystemVerilog, as the mangled names can become less readable in designs with nested hierarchy.
### Current best alternative workaround (limit 100 words)
Currently, developers must rely on auto-generated long names. This is inconvenient and prone to confusion when analyzing the system’s behavior or checking signal traces in tools like waveform viewers or simulators.
### Your view of the "best case XLS enhancement" (limit 100 words)
It would be useful to allow naming procs when spawning them, in the same way channels can be named during creation. An optional keyword argument such as `name=` could be used for this purpose. For example:
```rust
let x = spawn MyProc(a, b, c, name="my_proc");
```
The name could be preserved and used as the instance name in the generated SystemVerilog.
Preserving these names would make designs much easier to follow in trace viewers like [GTKWave](https://gtkwave.sourceforge.net/) or [surfer](https://surfer-project.org/).
Contributor guide
Assessment
This issue has not been assessed yet.