osate / osate2

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

Property values (list of record) missing after instantiation #327

Closed Etienne13 closed 10 years ago

Etienne13 commented 10 years ago

Hi all,

I am trying to map AADL + ARINC653 into ARINC653 XML configuration files. In order to represent arinc health monitoring tables in AADL, I extended the ARINC653 property set with the following properties (added to the standardized ARINC653 property set):

HM_Error_ID_Levels: list of ARINC653::HM_Error_ID_Level_Type applies to (processor);

HM_Error_ID_Level_Type: type record ( ErrorIdentifier:aadlinteger; Description: aadlstring; ErrorLevel: ARINC653::Error_Level_Type; ErrorCode: ARINC653::Supported_Error_Code; );

Error_Level_Type: type enumeration (Module_Level,Partition_Level,Process_Level);

System_State_Description: aadlstring applies to (mode);

System_State_Identifier: aadlinteger applies to (mode);

HM_Error_ID_Action_Type: type record ( ErrorIdentifier:aadlinteger; Description: aadlstring; Action: aadlstring; );

HM_Error_ID_Actions: list of ARINC653::HM_Error_ID_Action_Type applies to (processor, virtual processor);

Then I made a model to test the xml generator:

package test_HM public with ARINC653; system root end root;

system implementation root.impl subcomponents the_cpu: processor cpu.impl; end root.impl;

processor cpu end cpu;

processor implementation cpu.impl subcomponents the_part1: virtual processor part.impl {ARINC653::Partition_Identifier => "1";}; the_part2: virtual processor part.impl {ARINC653::Partition_Identifier => "2"; ARINC653::HM_Error_ID_Actions => ([ErrorIdentifier => 5; Description=>"Segmentation Error"; Action=>"IDLE";], [ErrorIdentifier => 6; Description=>"Time Duration Exceeded"; Action=>"IGNORE";]) in modes (Process_Execution); }; modes Module_Init: initial mode {ARINC653::System_State_Description=>"Module Init";}; System_Function_Execution: mode {ARINC653::System_State_Description=>"Module Init";}; Process_Execution: mode {ARINC653::System_State_Description=>"Process Execution";}; properties ARINC653::Module_Major_Frame => 2000 ms; ARINC653::Partition_Slots => (1000 ms, 1000 ms); ARINC653::Slots_Allocation => (reference (the_part1), reference (the_part2)); ARINC653::HM_Error_ID_Levels => ([ErrorIdentifier => 1; Description=>"Configuration Error"; ErrorLevel=>Module_Level;], [ErrorIdentifier => 2; Description=>"Module Configuration Error"; ErrorLevel=>Module_Level;]) in modes (Module_Init); ARINC653::HM_Error_ID_Levels => ([ErrorIdentifier => 5; Description=>"Segmentation violation"; ErrorLevel=>Module_Level;], [ErrorIdentifier => 6; Description=>"Time duration exceeded"; ErrorLevel=>Module_Level;]) in modes (System_Function_Execution);

end cpu.impl;

virtual processor part end part;

virtual processor implementation part.impl end part.impl;

end test_HM;

The instantiation does not crash, but the result is incomplete:

1) processor instance the_cpu should have two property association objects for property ARINC653::HM_Error_ID_Levels (one per mode) but only one is present in the instance model; 2) virtual processor instance the_part2 has a Property association for property HM_Error_ID_Actions but the modal property value field is empty.

I am using the develop branch of OSATE, up to date.

I hope you have enough material to reproduce the bug, let me know if more information is needed. Best regards, Etienne.

juli1 commented 10 years ago

Sounds to be an error related to the instantiation code. We will investigate.

Etienne13 commented 10 years ago

Hi Julien,

I just wanted to know if you had time to look at this issue. It would be great to have some progress on this since I need to use such constructs to experiment further my AADL to XML ARINC mapping.

Thanks a lot, Etienne.

juli1 commented 10 years ago

Hi,

Well, we have to fix this bug. The problem is that the code related to the instantiation is not dealing correctly with different modes. I will try to investigate and make some progress on a short order. Sorry for the delay.

lwrage commented 10 years ago

The first part is an issue in the model: Modal property values must be assigned in a single property association.

ARINC653::HM_Error_ID_Levels => 
  ([ErrorIdentifier => 1; Description=>"Configuration Error"; ErrorLevel=>Module_Level;], 
   [ErrorIdentifier => 2; Description=>"Module Configuration Error"; ErrorLevel=>Module_Level;])
        in modes (Module_Init),
  ([ErrorIdentifier => 5; Description=>"Segmentation violation"; ErrorLevel=>Module_Level;],
   [ErrorIdentifier => 6; Description=>"Time duration exceeded"; ErrorLevel=>Module_Level;])
        in modes (System_Function_Execution)
    ;

When written this way both values show up in the instance.

The second part is also a problem in the model: The mode in a modal property association is one of the component the property is associated with, not its containing component, so part.impl needs a mode Process_Execution, e.g., using requires modes in virtual processor type part. However, instantiation still only works if the property association is written as a contained property association in cpu.impl.

ARINC653::HM_Error_ID_Actions => (
    [ErrorIdentifier => 5; Description=>"Segmentation Error"; Action=>"IDLE";],
    [ErrorIdentifier => 6; Description=>"Time Duration Exceeded"; Action=>"IGNORE";])
        in modes (Process_Execution) applies to the_part2;

Bugs in OSATE:

lwrage commented 10 years ago

See #337 for the duplicate property association issue.