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

[MLIR] Add option to emit muxes as if-then-else #1220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsetaluri
Copy link
Collaborator

No description provided.

with push_block(curr.then_block):
sv.BPAssignOp(operands=[wire, data[index]])
with push_block(curr.else_block):
_process()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the lack of else logic here be problematic for downstream tools? I could imagine a potential latch inference being triggered if the tool doesn't reason about all possible values being matched. In fact, if there is a non power of two number of inputs then there is a potential for a latch (e.g. if the select logic is generated incorrectly w.r.t. to the number of mux inputs, it's possible for the select value to be equal to a constant that's greater than len(data)). IIRC, MLIR would normally emit the mux as an array create/select. Perhaps in Verilog this is okay because the "extra" select values are ignored?

Copy link
Collaborator Author

@rsetaluri rsetaluri Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finalizing need with customer. Will report back what codegen is desired. For now can hold off on merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants