google / google/xls

[enhancement][idea] XLS assisted fanout management for register duplication

Open
#1,908 1 comment 0 reactions 0 assignees View on GitHub
enhancement long-term-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)

There are scenarios where you want to experiment with replicating flops and fanning out from the number of dupes to the logic that consumes the value; e.g. imagine something shaped like:

```
fn my_block(x: MyInput) -> Output {
let dupes = gate!(MyInput[NUM_DUPES]:[x, ...]);
for i in 0..NUM_INSTANCES {
f(x[arbitrary!()])
}
}
```

there's two interesting aspects here:
- we use `gate!` as an approximation of a "register duplication is desirable with this replication factor" hint
- we want to ask XLS to pick some fanout policy knowing that all of the registers hold the same content, so we don't care which one we select

this is in the general theme of "expressing a choice sort of knob XLS can try to tune"

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

Doing this in wrapping layers outside of XLS itself.

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

Hypothetically you could enable constructs like shown above (the arbitrary!() macro that can select an arbitrary value of a given type, though we'd need to prove the result was functionally the same forall value. Perhaps we could create a dedicated tool for this kind of duplication experimentation if it's a common enough use case in design exploration. Seemed worth documenting as a potential enhancement or use case that would be helped via "XLS-qua-toolkit" automation.

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.