Skip to content
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

[Rust] Child references to multiports are not yet supported #806

Closed
oowekyala opened this issue Dec 16, 2021 · 0 comments
Closed

[Rust] Child references to multiports are not yet supported #806

oowekyala opened this issue Dec 16, 2021 · 0 comments
Labels
enhancement Enhancement of existing feature rust Related to the Rust target

Comments

@oowekyala
Copy link
Collaborator

The last missing part for implementing multiports/reactor banks fully is to support references to ports of a child bank.
There are several instances of this problem

  1. a bank of children which each expose a single port
reactor Foo {
  output i: u32;
}
main reactor {
   bank = new[15] Foo();
   reaction(bank.i) {=
      // here, the variable bank__i should have type ReadablePortBank
   =}
}
  1. a bank of children which each expose a multiport
  2. a single child which exposes a multiport

To implement all of those, we should probably ruse, just how we do to implement references to a child port (see screenshot of my thesis below). The idea would be to create an intermediate multiport, and bind each channel to the referenced channel. In the above example, the main reactor would contain a multiport __bank__i, with the connection bank.i -> __bank__i (connecting ports like this is already supported). There are multiple todos in the RustReactorEmitter that should hint at how that can be done (at least for case 3, the easiest case). The two first cases may require some tweaks to RustModel classes (ChildPortReference).

Capture d’écran de 2021-12-16 16-11-52

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Enhancement of existing feature rust Related to the Rust target
Projects
None yet
Development

No branches or pull requests

3 participants