osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Incorrect error reporting: "Value for property.. is inconsistent along connection" #158

Closed reteprelief closed 11 years ago

reteprelief commented 11 years ago

We indicate the fact that a connection is immediate or delayed via a connection property. I have an example (see below) of a thread in process connected to a thread in another process. The connection from the the thread to the process on each side has the timing property with value immediate. The test if (!newPA.valueInMode(m).equals(setPA.valueInMode(m))){ inthe method cacheConnectionPropertyAssociations thiks the two property values are not the same. They are two instances of NamedValue objects, each pointing to the same enumeration literal object, but the equals method does not discover that. We may need to add in equals method for the various property value objects.

The second issue is that the property has a default value of sampling. When caching the property I think sampling, the default value, is returned by evaluate as property value to the third connection (between the two processes) since there is no explicit assignment. Its value is actually different from the assigned value of immediate for the other connection declarations. This should not be flagged as an error. At the moment I have commented out the generation of the error message because of these two issues.

The example (you can also find it in the SEI SVN model repository under aadlv2/examples/oppositeconnection as connectiontiming.aadl). package connectiontiming public

-- in this example we assign two different property values to connection declarations -- that are part of the same connection instance. So it is ambiguous which value holds. thread t features outp: out event port; end t;

thread tt features inp: in event port; end tt;

process p features outp: out event port; end p;

process implementation p.i subcomponents t1: THREAD T;
connections c1: port t1.outp -> outp { timing => immediate;}; end p.i;

process implementation pp.i subcomponents t2: THREAD tt;
connections c2: port inp -> t2.inp { timing => immediate;}; end pp.i;

process pp features inp: in event port; end pp;

system s end s;

system implementation s.i subcomponents p1: process p.i; p2: process pp.i; connections cc: port p1.outp -> p2.inp ; end s.i;

end connectiontiming ;

juli1 commented 11 years ago

Hi Peter,

There is a lot of issue with connection in the instantiation code. We would need to clean this part of the code at some points but since one change has many impacts (as in Steve model, the inheritance case, etc ...), it is difficult to do without breaking something. Anyway, this has to be done, will try to investigate that case also on my side.

juli1 commented 11 years ago

Should be fixed by now, let me know if you still have issues.

alnayeem commented 11 years ago

Hi,

I am submitting an issue in this one. It seems the most related one. It appears that if you do not declare the "timing" property in process p.i, the connection instance gives a value "sampled". It works only if one declares at the first connection reference. Otherwise, the default value is used. Please check with the modified example.

Best, Abdullah

package connectiontiming public

-- in this example we assign two different property values to connection declarations -- that are part of the same connection instance. So it is ambiguous which value holds. thread t features outp: out event port; end t;

thread tt features inp: in event port; end tt;

process p features outp: out event port; end p;

process implementation p.i subcomponents t1: THREAD T;

connections c1: port t1.outp -> outp; end p.i;

process implementation pp.i subcomponents t2: THREAD tt;

connections c2: port inp -> t2.inp { timing => immediate;}; end pp.i;

process pp features inp: in event port; end pp;

system s end s;

system implementation s.i subcomponents p1: process p.i; p2: process pp.i; connections cc: port p1.outp -> p2.inp ; end s.i;

end connectiontiming ;

juli1 commented 11 years ago

Dear Abdullah,

Please submit a separate bug report and explain more precisely :

Thanks,