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

Support after delays on broadcast connections in C++ #553

Merged
merged 6 commits into from
Sep 30, 2021
Merged

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Sep 28, 2021

Currently, after delays do not work on broadcast connections (using the (...)+ syntax). In part, this is because the iterated property of the connection is not preserved in our AST transformation. I fixed this, so that the newly generated upstream connection is also iterated if the original connection was iterated. This solves the issue for C++. However, a similar test written in C still fails, and I haven't found out why. I will push the test that I have to broadcast-after-c based on this branch, and will open a separate issue.

This PR also does a few cleanups and adds C++ tests.

@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #553 (6a387ea) into master (ca3d24d) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #553      +/-   ##
============================================
+ Coverage     66.39%   66.41%   +0.01%     
- Complexity     3470     3474       +4     
============================================
  Files           132      132              
  Lines         22310    22311       +1     
  Branches       2885     2885              
============================================
+ Hits          14812    14817       +5     
  Misses         6351     6351              
+ Partials       1147     1143       -4     
Impacted Files Coverage Δ
org.lflang/xtend-gen/org/lflang/ASTUtils.java 75.79% <0.00%> (+0.30%) ⬆️
...ang/src-gen/org/lflang/lf/impl/ConnectionImpl.java 50.40% <0.00%> (+0.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca3d24d...6a387ea. Read the comment docs.

@@ -177,7 +177,7 @@ class ASTUtils {
* if the port on the left or right of the connection involves a bank of reactors or a multiport.
* @param connection The connection.
*/
private static def boolean isWide(Connection connection) {
static def boolean isMultiportConnection(Connection connection) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name isMultiportConnection for this method seems misleading because the connection may not involve any multiports and the method could still return true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found isWide also not very clear, because it could be multiple individual connections in case of o1, o2 -> i1, i2. Do you have a suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

How about isMultipleConnection?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I renamed it to hasMultipleConnections, which seems better from a grammatical point of view.

@@ -0,0 +1,27 @@
target Cpp;

reactor Source {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think at least the Source reactor (but also a parametrized version of Sink) can be imported for a bit of a more minimalistic design. This is by no means a critical issue though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, having better guidelines for writing tests and establishing a set of basic library reactors would be nice.

@cmnrd cmnrd merged commit 620d437 into master Sep 30, 2021
@cmnrd cmnrd deleted the broadcast-after branch September 30, 2021 12:39
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.

3 participants