google / google/xls

[enhancement] dslx should allow per-function naming of output ports

Open
#1,433 0 comments 0 reactions 0 assignees View on GitHub
codegen dslx enhancement stitching
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)

#448 #1427 #1429 discuss how to make output port names configurable globally (by adding an argument to `codegen_main`), but it would be nice to also have a way to specify those per function.

### Current best alternative workaround (limit 100 words)

One could achieve something similar by specifying a different `output_port_name` for each function in `xls_dslx_verilog` rules, but this would have the drawback of scattering the information about a given function across multiple files: as the name is often more tighly coupled to the function definition (rather than the systemverilog context into which it is being integrated).

### Your view of the "best case XLS enhancement" (limit 100 words)

@hzeller suggested we use `#[codegen(...)]` annotations, but we could also leverage the (recently proposed) syntax for named returns in Rust:
- https://internals.rust-lang.org/t/named-returns/18787
- https://github.com/rust-lang/rfcs/issues/2638
- https://crates.io/crates/named_return

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.