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

MuxN -> If #894

Merged
merged 15 commits into from
Jun 26, 2020
Merged

MuxN -> If #894

merged 15 commits into from
Jun 26, 2020

Conversation

leonardt
Copy link
Collaborator

@leonardt leonardt commented Jun 5, 2020

Depends on leonardt/verilogAST-cpp#49

This augments the inlining of commonlib.muxn instances to if/elseif/else statements inside an always *. We also update the declaration to use a reg instead of a wire (in my experience, synthesis tools will complain if you try to assign to a wire inside an always * block).

We should consider making muxn a primitive since we're giving it some special behavior in the backend, but the current implementation doesn't require any changes to the core so it's less invasive while being useful. This is guarded behind the inline flag so it won't be enabled in default flows.

I also moved the AST transformers used for inlining into a separate file for organization

@rdaly525
Copy link
Owner

rdaly525 commented Jun 7, 2020

This is great progress for improving the verilog code quality.

I do not want to have a MuxN as a primitive though, as it has no real correspondence with the SMT QF BitVector primitives and introduces specialization creep into the IR. Instead, I think we should move to an approach of having multiple different kinds of ModuleDef/GeneratorDef instead of ones just for CoreIR implementations. A MuxN would thus just have a particular generator implementation that would generate a verilog AST module containing the always block. Verilog Instances in verilogAST could then be inlined if desired.

@leonardt leonardt merged commit 9642814 into master Jun 26, 2020
@leonardt leonardt deleted the reconstruct-if branch June 26, 2020 00:50
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.

None yet

3 participants