xls
xls copied to clipboard
[enhancement] DSLX Polymorphism
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<typename T, N: u32> {
...
config(inputs: chan<T>[N] in, outputs: chan<T> 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.