google / google/xls

[enhancement] Allow specifying custom names for proc instances

Open
#3,311 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.