-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Initial support for childref multiports #1228
Conversation
e7d7379
to
971ceba
Compare
Another caveat, if a reactor is initialised in another, and
it does not compile. I have reduced this to a minimal example, that can be found here: https://gist.github.com/jhaye/ce4d92af09c37379529d3902bec1faab I'm not sure how I would implement value propagation like this. |
Why it's broken is explained here: lf-lang/lingua-franca#1228 (comment)
971ceba
to
4900a7d
Compare
Why it's broken is explained here: lf-lang/lingua-franca#1228 (comment)
I'm not sure how it's not ideal... IMHO it's a usability feature that there is a uniform API regardless of whether you're accessing a multiport on a child, a port on a bank of children, or a multiport on a bank. Are other targets doing this differently?
This is now supported, thanks for the MWE. |
I am not sure if I understand how this works in Rust, but in C++ we do not unroll the multiport. In the case of multiports within a bank, the reaction body can say precisely which port in which reactor instance it wants to access. If it wants to read all values, it needs two nested loops:
|
The C target does this similarly to Cpp. |
Thanks for your feedback, so there is one view class generated per reaction to expose only the declared dependencies... We can probably also do that in Rust, I'll create a ticket |
Fails right now due to what appears to be a scheduling error
A new struct with extra parameters is added as construction parameters to reactors. References to child banks use this instead of recomputing the width.
79164c7
to
03df0fa
Compare
@oowekyala What is the status of this PR? Should it be reviewed? |
@cmnrd one of the new benchmarks in lf-lang/benchmarks-lingua-franca#38 shows a weird bug which I still have to investigate. I expect the fix will only touch the runtime crate so I think this PR can still be reviewed. |
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.
This looks good to me, but it would be better if someone with a better understanding of the Rust target could have a look. Maybe @jhaye or @revol-xut?
I don't know much about the internals either, which is why I handed this PR off. All I can say from a cursory glance is that it looks good. I also like how the issue of value propagation was solved. |
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.
Looks great!
This is an initial attempt to implement child references within a reactor being allowed to be multiports as explained in #806.
Some caveats:
Right now if the child reactors that are being referenced are a bank and then are further referenced to a multiport, this completely flattens this structure. So if the bank is of size 4 and the multiport of size 5, the childref would be unrolled into a PortBank of size 20. This is not ideal but was the easiest to implement right now.
Secondly, one of the provided unit tests calledReadOutputOfContainedBank
fails right now due to a scheduling error, but it shows that it is able to access the data of the child reactor successfully.Refs lf-lang/benchmarks-lingua-franca#38