xls icon indicating copy to clipboard operation
xls copied to clipboard

[enhancement] [DSLX] `priority_sel` builtin should support a specified default value

Open ericastor opened this issue 1 year ago • 0 comments

What's hard to do? (limit 100 words)

Currently, priority-select always uses a zero default value, restricting its use to Bits-typed inputs.

Current best alternative workaround (limit 100 words)

Even for Bits-typed inputs, using a nonzero default value requires adding another bit to the selector & manually setting it to the NOR of all the other bits, and adding a final case - and the result still puts a zero default-value in the circuit emitted unless codegen happens to prove that the selector is never zero.

For non-Bits-typed inputs, the only option is to use a select and map your selector to integer values.

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

priority_sel should allow the user to specify a default value, or a version that does should be added.

ericastor avatar Jun 18 '24 22:06 ericastor