-
Notifications
You must be signed in to change notification settings - Fork 52
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
Optional with
clause for invoke
#712
Conversation
4c62ef9
to
1cb6c29
Compare
@EclecticGriffin I added a correctness test for
Expected output is 21. The two possibilities for why this doesn't work are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely fantastic; this seems like an important advance in making it easier for frontends to generate code for lots of common cases.
Is it the case that is this is replacing the output list on Invoke statements? |
Regardless, seems pretty cool! I'll take a look at the interpreter stuff after the meeting and get back to you on what's going wrong |
No. It just defines assignments that should be active while the component is invoked. Does it subsume output ports? Edit: Just noticed that the examples above were missing output arguments. Fixed. |
@EclecticGriffin if the changes to the interpreter look good, I'd like to land this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interpreter changes look fine for the moment. There should also probably be an assert in the InvokeInterpreter struct, but I wouldn't worry about it right now. I can deal with that later as needed
Optional
with
clause forinvoke
operator. The semantics will require that the assignments within the with clause are active for the duration ofinvoke
operator.For example
The program will ensure that while
comp
is being executed, the indices from the combinational groupread_mems
are used to select the memory location.Before this PR, the only way to implement this functionality is to use a group that first reads the locations in the memory into registers and then to use the values within those registers.
Similarly, this will allow us to generate combinational chains for expressions like this:
When generating this code, frontends like Dahlia have to use
std_mult_pipe
structurally because the values from the two adds need to be visible to the inputs of the multiplier:Instead, we'll be able to write:
TODO
invoke-with
inremove-comb-groups
.compile-invoke
can compileinvoke-with
clauses better but can't do this right now because the optimizations don't work withcomb group
definitions.