Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cdleary opened this issue Feb 5, 2025 · 1 comment
Labels
enhancement New feature or request long-term-enhancement Issues that are sensible enhancements but XLS devs expect may not be addressed in the near-term

Comments

@cdleary
Copy link
Collaborator

cdleary commented Feb 5, 2025

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<NUM_DUPES>(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.

@cdleary cdleary added enhancement New feature or request long-term-enhancement Issues that are sensible enhancements but XLS devs expect may not be addressed in the near-term labels Feb 5, 2025
@cdleary
Copy link
Collaborator Author

cdleary commented Feb 5, 2025

Also note another tweaked formulation: where x is already coming in duplicated into an array and we get to say "assume forall i x is the same value".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term-enhancement Issues that are sensible enhancements but XLS devs expect may not be addressed in the near-term
Projects
None yet
Development

No branches or pull requests

1 participant