osate / osate2

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

Issue with connections - legality rule error #728

Closed juli1 closed 8 years ago

juli1 commented 8 years ago

See the following bug I have a problem with the following component. The connection c0 is said to be illegal but it always worked before. Any clue why it does not work?

thread implementation producer_thread.impl calls mycalls: { p_spg : subprogram do_ping_spg; }; connections c0 : parameter p_spg.data_source -> data_source; properties dispatch_protocol => periodic; period => 1000 ms; deadline => 1000 ms; priority => 2; end producer_thread.impl;

thread implementation producer_event_thread.impl


package software
public

----------
-- data --
----------

data simple_type
properties
  source_name => "int"; 
  source_text => ("ping");
  data_size => 8 bytes;
end simple_type;

-----------------
-- subprograms --
-----------------

subprogram do_ping_spg
features
  data_source : out parameter simple_type;
properties
  source_language => (c);
  source_name     => "user_do_ping_spg";
  source_text     => ("ping.c");
end do_ping_spg;

subprogram ping_spg
features
  data_sink : in parameter simple_type;
properties
  source_language => (c);
  source_name     => "user_ping_spg";
  source_text     => ("ping.c");
end ping_spg;

subprogram hello_spg
features
  data_sink : in parameter simple_type;
properties
  source_language => (c);
  source_name     => "user_hello_spg";
  source_text     => ("hello.c");
end hello_spg;

-------------
-- threads --
-------------

thread producer_thread
features
  data_source : out data port simple_type;
end producer_thread;

thread producer_event_thread
features
  data_source : out event data port simple_type;
end producer_event_thread;

thread implementation producer_thread.impl
calls 
mycalls: {
  p_spg : subprogram do_ping_spg;
};
connections
  c0 : parameter p_spg.data_source -> data_source;
properties
  dispatch_protocol                  => periodic;
  period                             => 1000 ms;
  deadline                           => 1000 ms;
  priority                           => 2;
end producer_thread.impl;

thread implementation producer_event_thread.impl
calls 
mycalls: {
  p_spg : subprogram do_ping_spg;
};
connections
  c0 : parameter p_spg.data_source -> data_source;
properties
  dispatch_protocol                  => periodic;
  period                             => 1000 ms;
  deadline                           => 1000 ms;
  priority                           => 2;
end producer_event_thread.impl;

-----------------------
--  Consumer Thread  --
-----------------------

thread consumer_thread
features
  data_sink : in data port simple_type;
end consumer_thread;

thread consumer_sporadic_thread
features
  data_sink : in event data port simple_type;
end consumer_sporadic_thread;

thread implementation consumer_thread.impl
calls 
mycalls: {
  q_spg : subprogram ping_spg;
};
connections
  c0 : parameter data_sink -> q_spg.data_sink;
properties
  dispatch_protocol                  => periodic;
  period                             => 2000 ms;
  deadline                           => 2000 ms;
  priority                           => 1;
end consumer_thread.impl;

thread implementation consumer_sporadic_thread.impl
calls 
mycalls: {
  q_spg : subprogram ping_spg;
};
connections
  c0 : parameter data_sink -> q_spg.data_sink;
properties
  dispatch_protocol                  => sporadic;
end consumer_thread.impl;

thread hello_thread
end hello_thread;

thread implementation hello_thread.impl
calls 
mycalls: {
  q_spg : subprogram hello_spg;
};
properties
  dispatch_protocol                  => periodic;
  period                             => 4000 ms;
  deadline                           => 4000 ms;
  priority                           => 1;
end hello_thread.impl;

end software;
lwrage commented 8 years ago

Yesterday, Joe worked con connection validation. Maybe he introduced this issue. And a hint: If you enclose AADL code in triple backquotes it'll be formatted as code:

code