Generate an RTLIL representation of bind constructs #2875
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code now takes the AST nodes of type AST_BIND and generates a
representation in the RTLIL for them.
This is a little tricky, because a binding of the form:
means "make an instance of
foo_t
calledfoo_i
, instantiate it insidebaz
and connect the portarg
to the result of the expression1+bar
".Of course,
1+bar
needs a cell for the addition. Where should that celllive?
With this patch, the
Binding
structure that represents the constructis itself an
AST::AstModule
module. This lets us put the adder cellinside it. We'll pull the contents out and plonk them into 'baz' when
we actually do the binding operation as part of the hierarchy pass.
Of course, we don't want
RTLIL::Binding
to contain anAST::AstModule
(since kernel code shouldn't depend on a frontend), sowe define
RTLIL::Binding
as an abstract base class and put theAST-specific code into an
AST::Binding
subclass. This is analogous tothe
AST::AstModule
class.(Note: This patch is part of the larger queue at #2752. The idea is to split things out to avoid having a giant PR to review all at once)