osate / osate2

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

Inverse feature group connections work in only one direction #357

Closed scbarrett closed 10 years ago

scbarrett commented 10 years ago

inverse-error

Blocks in my design are connected with feature groups that are passed in as prototypes. It is possible to connect to individual ports that are part of the group. but only if they are explicitly declared. If the group is declared to be the inverse of another group, Osate can't find the port.

This can be seen in the attached screen shot -- lines 33-36 duplicate the feature group at lines 28-31, so BlockA can make connections in both directions. Lines 54-55 try to do the same thing for the group at lines 49-52 using the inverse of keywords. This results in BlockB getting a connection error at line 60.

Let me know if you would like the AADL.

lwrage commented 10 years ago

Can you add a comment that includes the AADL source text shown above, please? I can then copy and paste.

scbarrett commented 10 years ago

-- Example AADL code to demonstrate "inverse of" issue.

package inv_err public with Base_Types;

system Block prototypes the_outs : feature group; the_ins : feature group; features outs : feature group the_outs; ins : feature group the_ins; end Block;

system implementation Block.impl subcomponents a_system : system ASystem.impl; end Block.impl;

system BlockA extends Block ( the_outs => feature group a_out, the_ins => feature group a_in ) features sys_out : out data port Base_Types::Boolean; sys_in : in data port Base_Types::Boolean; end BlockA;

feature group a_out features a_line : out data port Base_Types::Boolean; end a_out;

feature group a_in
features a_line : in data port Base_Types::Boolean; end a_in;

system implementation BlockA.impl extends Block.impl connections a_blk_out : port a_system.sys_out -> outs.a_line; a_blk_in : port ins.a_line -> a_system.sys_in; end BlockA.impl;

system BlockB extends Block ( the_outs => feature group b_out, the_ins => feature group b_in ) end BlockB;

feature group b_out features b_line : out data port Base_Types::Boolean; end b_out;

feature group b_in inverse of a_out -- Osate won't connect to inversed groups... end b_in; -- ...much redeclare with directions reversed.

system implementation BlockB.impl extends Block.impl connections b_blk_out : port a_system.sys_out -> outs.b_line; -- b_blk_in : port ins.b_line -> a_system.sys_in;

end BlockB.impl;

system ASystem features sys_out : out data port Base_Types::Boolean; sys_in : in data port Base_Types::Boolean; end ASystem;

system implementation ASystem.impl end ASystem.impl;

end inv_err;

lwrage commented 10 years ago

There a problem in the model:

feature group b_in inverse of a_out

should be

feature group b_in inverse of b_out

There's still an OSATE bug in testing compatibility of port and feature directions if the feature comes from feature group prototype.