google / google/xls

[enhancement] DSLX Polymorphism

Open
#1,646 0 comments 0 reactions 0 assignees View on GitHub
dslx enhancement 🧦 sox
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)

It's hard to write reusable components like an arbiter because you ideally want it to be type-generic, e.g.

```
proc Arb {
...
config(inputs: chan[N] in, outputs: chan out) { ... }
...
}
```

With traits (#617, #618), you could event take advantage of interfaces to do more interesting things besides shuffling data around.

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

Rewrite or use templating. Channel legalization builds type-generic arbiters as part of an opt pass, which is an option if the pattern is common enough.

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

Rust-style type generics with traits.

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.