-
Notifications
You must be signed in to change notification settings - Fork 8
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
Shared subprogram access yields too many connection instances in instance model #2032
Comments
Further testing indicates the same problems for shared data connections, but that shared bus connections work as desired:
|
More tests:
Complete test system:
|
There are two main places in
This clearly captures all the possibilities of
Again, this filters out the case of I started by trying to fix
and
but this is not sufficient because the second block of code is guarded by an extremely complicated chain of conditions. Towards the start of this chain, there is test of the local variable There is a test early on in this conditional chain
If I change it to
Then data access connections work as required. As I have used the super type |
The logic for checking the end of the connection instance in
This can probably be simplified, but it works this way and the intent seems much clearer like this. |
Added unit tests. |
Ran all the unit tests. Things are not okay. First test that fails is for Issue 667. The logic for the changes to |
I have to revisit the intention of the guard statements identified above in I can use a similar example as the ones above to demonstrate this. Here we have a thread with an abstract subcomponent, and the connection instances are messed up:
The connection instances generated are But, if I take the model above and change the threads and processes to
the generated instance model is correct, which two connection instances corresponding to the bidirectionally of the original connections. |
I discussed this with Lutz. The guard against threads, processors, and devices is meant to prevent connections ending at subprogram parameters. This is because of timing considerations. Lutz needs to get more clarification from Peter about this. For now
Lots more things to create tests for:
|
Not sure what I need to do on the other end of the connection yet in |
May have gotten carried away in yesterday's discussion. The only things that can have subprogram calls and parameter connections are threads and other subprograms. So I don't see why we need to worry about memory, device, processor, or virtual processor. Parser/verifier doesn't even allow parameter connections outside of thread or subprogram implementation classifiers. Also, remember: parameter connections aren't dealt with at all in the instance model. |
I tried attacking this problem in a more principle fashion as described above. The test we really care about is the connections inside the component are Again, I have changed things in 3 main locations, plus fiddled with some of the helper methods this time.
with just
but, I also changed
In
to just
I'm not sure what to do with this yet. I have a feeling this is also wrong and that it will prevent access features inside of feature groups from working correctly. I need a test case for this.
with
where, earlier in the method I changed how the list of ingoing connections is computed. I replaced
with code that gets the connections, but filters out any parameter connections, but also makes note if there were any parameter connections.
where I also changed
My earlier unit tests for this issue pass with these changes. I need to run all the tests now and see what I may have broken. I also want to add additional test of my own:
|
Good news, all the existing unit tests pass under this scenario! I'm going to add some more tests specific to this issue (see above comment), and hopefully all will be fine. Need to remember to get rid of any commented out code. |
Fixed the above problem. Had to update
|
Added a ton of more tests, trying to capture all the cases where an access connection can be applied. Also added tests where we use access connections inside of feature groups. As predicted, not all of the feature group cases work. I believe this to be due to the use of the |
Fixed feature group problems by removing the special section in
Was able to remove the whole All OSATE Unit tests pass with this change. |
Added test case for the |
Created test for the case where a thread has port feature that is internal connected via both parameter connection and a port connection. This is admittedly a convoluted case because it requires the use of an
This works as expected.
|
Lutz pointed out that the above "stop and go" behavior is not desirable. I tested this on the |
So the whole "stop and go" thing is enabled by getting rid of the I made a new version of the test that includes a subprogram access connection:
Currently this has 4 connection instances:
Now to make sure that we don't break feature groups I made a version that uses a feature group with two features instead of the two features we have above:
I expected this to also have 4 connection instances. It does not. It has only 1, the subprogram access connection from
I think there is something wrong in |
There are several things that cause the above behavior with
Follow up: Actually both these problems come from fact that I got rid of the "final component" checking in |
Okay, gotta rollback some of my earlier changes. Changed the check in
where
This fixes some things. But now I have a connection instance between the two subprogram access features in the feature group: |
Can fix some more problems by putting back the final component checks in
(Don't need a separate check for feature groups like there used to be be because the executed code was identical.) However, we do need to add some specialness for feature groups because we need to treat feature groups that have access features the same as we treat access features. |
Further tweaked
where
Then I changed the part that gets the internal "ingoing connections" to filter the connections differently. Namely, if the connection end is part of a final component and but has access features, we only want to return access connections. This is necessary to keep from connecting to the port features inside of feature groups on final components.
|
Now I still have one extra connection instance in the feature group case, the connection instance between the provides and requires access features. This shouldn't be there, and doesn't appear in the case where I don't use feature groups. I'm not sure where it is coming from. Going to set a breakpoint on |
Okay the unwanted connection between the access features of the feature groups is generated by This behavior was not introduced by trying to fix this bug. It exists on the master branch as well. Probably should introduce a separate issue for it. |
Started going through my unit tests for this issue and the feature groups were being weird again. Problem is that I forgot I need to go into the feature group at the start in Changed the block in
and I also updated
This fixed the feature group problems in my unit tests. |
After the above changes the |
The new problems with
and the interaction with the conditional in the following
specifically, the test We need to separately keep track of what kind of features are present on the end point and explicitly test for the one that we care about at each point. There is probably an analogous place in |
According to Lutz, we should ignore port connections inside of thread:
Since we are considering |
Things get uglier and uglier. To prevent the creation of "upward" connections from the output ports of abstract subcomponents to the ports of their containing "connection ending component", we need to add checks to |
Added
into Can now focus on making changes to the end of |
fixed
|
Unit tests (all) pass. Going to create pull request. |
This example is derived from the example in Issue #1941. When the system below is instantiated, the process instance
MyP
has three connection instances, two of which should not be generated. Furthermore, it should have an additional connection instance that is missing.The instance model has the connection instances (with the given connection references):
Only the second connection instance
MyT1.CompAvg -> MyT2.ext_sub
should exist. The other two connections are incomplete nonsense.Furthermore, the connection between
CompAvg
andext_sub
should be bidirectional, so there should be a connection instancesMyT2.ext_sub -> MyT1.CompAvg
, but there currently is not one.The text was updated successfully, but these errors were encountered: