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

Add support for cross connections #416

Merged
merged 20 commits into from
Jul 29, 2021
Merged

Add support for cross connections #416

merged 20 commits into from
Jul 29, 2021

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Jul 20, 2021

This PR adds support for so-called interleaved connections using the interleaved(b.p) qualifier that can be optionally added to a port reference b.p. Normally, the connection logic would iterate first over banks, then multiports, on both sides of the connection. If the interleaved qualifier is used, this pattern is changed for the specified port and ports are iterated before banks. This allows creating patterns where bank instances can send messages to a specific second instance. See #415 for more details and a usage example.

Closes #415

@cmnrd cmnrd mentioned this pull request Jul 20, 2021
24 tasks
example/Cpp/src/Patterns/FullyConnected.lf Outdated Show resolved Hide resolved
test/Cpp/src/multiport/FullyConnectedAdressable.lf Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/LinguaFranca.xtext Outdated Show resolved Hide resolved
@cmnrd
Copy link
Collaborator Author

cmnrd commented Jul 28, 2021

I pushed some new changes that address @edwardalee's comments. Most importantly, the syntax changed, and we can now use interleaved on port references nodes.out -> interleaved(nodes.in). Note that with this new syntax, we can alternatively also write interleaved(nodes.out) -> nodes.in to achieve the same result.

I extended the tests so that they include both cases, and also added a test that checks the correct operation in conjunction with after.

Copy link
Collaborator

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Minor comments and suggestions added.

org.lflang/src/org/lflang/generator/ReactorInstance.xtend Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/generator/ReactorInstance.xtend Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/validation/LFValidatorImpl.xtend Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/validation/LFValidatorImpl.xtend Outdated Show resolved Hide resolved
org.lflang/src/org/lflang/validation/LFValidatorImpl.xtend Outdated Show resolved Hide resolved
test/Cpp/src/multiport/FullyConnectedAdressableAfter.lf Outdated Show resolved Hide resolved
@cmnrd cmnrd merged commit ab8e914 into master Jul 29, 2021
@cmnrd
Copy link
Collaborator Author

cmnrd commented Jul 29, 2021

@edwardalee I added a description of this feature to the bottom of Multiports and Banks of Reactors. Could you check this description and see if it is understandable?

@edwardalee
Copy link
Collaborator

Nice! I added to Multiports and Banks of Reactors an explanation of the addressing scheme that results.

@cmnrd cmnrd deleted the cross-connections branch August 20, 2021 05:53
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.

Connection pattern: fully connected and adressable banks
3 participants