Skip to content

Is there a reliable way to generate one-hot multiplexers? #1562

Answered by whitequark
tilk asked this question in Q&A
Discussion options

You must be logged in to vote

I'm aware that one-hot multiplexers, as an element relying on having undefined behavior on some cases, might be in opposition to the idea that every value in the circuit must be defined to ensure simulation and synthesis behaviors match. I would argue that the "undefinedness" here is rather weak, and a runtime check in the Amaranth simulator would be enough to detect problems and avoid mismatches.

This is the crux of the matter. As of right now, there is no undefined behavior in Amaranth at all (which is a useful property in some cases, and annoying in others). In other words, there is no equivalent of the unique case construct.

We could introduce it via the RFC process, like any other …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tilk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants