Commit fd2e288c authored by Maxime Perrotin's avatar Maxime Perrotin

Add testcase in buildsupport and generic property parsing

parent 75b667c6
......@@ -25,6 +25,7 @@ package body Buildsupport_Utils is
use Ocarina.ME_AADL.AADL_Instances.Nutils;
use Ada.Characters.Latin_1;
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
use type ATN.Node_Kind;
------------
......@@ -257,35 +258,46 @@ package body Buildsupport_Utils is
Ocarina.ME_AADL.AADL_Instances.Nodes.Properties (D);
result : Property_Maps.Map := Empty_Map;
property : Node_Id := First_Node (properties);
prop_value : Node_Id;
single_val : Node_Id;
begin
while Present (property) loop
Put (Get_Name_String (Display_Name (Identifier (property))));
Put_Line (" of kind " & ATN.Kind (property)'Img);
result.Insert (Key => Get_Name_String
-- pragma Assert (AIN.Kind (property) =
-- AIN.K_Property_Association_Instance);
prop_value := AIN.Property_Association_Value (property);
-- prop_value is is of ATN.Kind K_Property_Value
-- Put (Get_Name_String (Display_Name (Identifier (property))));
-- Put_Line (" of kind " & AIN.Kind (property)'Img);
if Present (ATN.Single_Value (prop_value)) then
-- Only support single-value properties for now
single_val := ATN.Single_Value (prop_value);
Put_Line (ATN.Kind (single_val)'Img); -- e.g. K_Literal!
result.Insert (Key => Get_Name_String
(Display_Name (Identifier (property))),
New_Item =>
(case ATN.Kind (property) is
when ATN.K_Signed_AADLNumber =>
Ocarina.AADL_Values.Image
(ATN.Value (ATN.Number_Value (property))) &
(if Present (ATN.Unit_Identifier (property)) then " " &
(case ATN.Kind (single_val) is
when ATN.K_Signed_AADLNumber =>
Ocarina.AADL_Values.Image
(ATN.Value (ATN.Number_Value (single_val))) &
(if Present (ATN.Unit_Identifier (single_val)) then " " &
Get_Name_String
(ATN.Display_Name (ATN.Unit_Identifier (property)))
(ATN.Display_Name (ATN.Unit_Identifier (single_val)))
else ""),
when ATN.K_Literal =>
Ocarina.AADL_Values.Image (ATN.Value (property),
Quoted => False),
when ATN.K_Reference_Term =>
Get_Name_String
(ATN.Display_Name (ATN.First_Node -- XXX must iterate
(ATN.List_Items (ATN.Reference_Term (property))))),
when ATN.K_Enumeration_Term =>
Get_Name_String
(ATN.Display_Name (ATN.Identifier (property))),
when ATN.K_Number_Range_Term =>
"RANGE NOT SUPPORTED!",
when others => "ERROR! Unsupported kind: "
& ATN.Kind (property)'Img));
when ATN.K_Literal =>
Ocarina.AADL_Values.Image (ATN.Value (single_val),
Quoted => False),
when ATN.K_Reference_Term =>
Get_Name_String
(ATN.Display_Name (ATN.First_Node -- XXX must iterate
(ATN.List_Items (ATN.Reference_Term (single_val))))),
when ATN.K_Enumeration_Term =>
Get_Name_String
(ATN.Display_Name (ATN.Identifier (single_val))),
when ATN.K_Number_Range_Term =>
"RANGE NOT SUPPORTED!",
when others => "ERROR! Unsupported kind: "
& ATN.Kind (single_val)'Img));
end if;
property := Next_Node (property);
end loop;
return result;
......
......@@ -1137,7 +1137,7 @@ void Set_Ignore_Params(FV *fv)
distant_RI = FindCorrespondingRI(remote, i);
if (NULL != distant_RI) {
distant_RI->ignore_params = false;
printf("set RI %s->ignore_params to FALSE", i->name);
//printf("set RI %s->ignore_params to FALSE", i->name);
}
}
});
......
-- mapping TASTE : AADL
-- Node : System
-- Processor : Processor
-- Process : Function
-- Bus : Bus
-- Device : Device
-- Driver : Driver
property set TASTE_DV_Properties is
-- MyBoolean: aadlboolean applies to (System, Processor, Process);
CoverageEnabled: aadlboolean applies to (Process);
Comment: aadlstring applies to (Device, Bus);
-- MyInt: aadlinteger applies to (System);
-- MyReal: aadlreal applies to (Bus);
-- MyEnum: enumeration (val1, val2, val3, val4) applies to (Device);
end TASTE_DV_Properties;
This diff is collapsed.
This diff is collapsed.
PACKAGE interfaceview::IV
PUBLIC
WITH DataView;
WITH interfaceview::FV;
WITH Taste;
---------------------------------------------------
-- TASTE Interface View
---------------------------------------------------
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
pinger: SYSTEM interfaceview::IV::pinger.others
{ Taste::Coordinates => "19 8 49 16"; };
pingee1: SYSTEM interfaceview::IV::pingee1.others
{ Taste::Coordinates => "67 8 100 15"; };
pingee2: SYSTEM interfaceview::IV::pingee2.others
{ Taste::Coordinates => "42 25 96 33"; };
finalpingee: SYSTEM interfaceview::IV::finalpingee.others
{ Taste::Coordinates => "61 47 90 57"; };
CONNECTIONS
obj282 : SUBPROGRAM ACCESS pingee1.receive_int_obj107 -> pinger.obj247_obj86
{ Taste::Coordinates => "49 12 58 12 58 12 67 12"; };
obj521 : SUBPROGRAM ACCESS pingee2.receive_int2_obj140 -> pingee1.obj485_obj119
{ Taste::Coordinates => "86 15 86 20 86 20 86 25"; };
obj1232 : SUBPROGRAM ACCESS finalpingee.receive_int3_obj173 -> pingee2.obj1121_obj152
{ Taste::Coordinates => "83 33 83 40 83 40 83 47"; };
END interfaceview.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::pinger
---------------------------------------------------
SYSTEM pinger
FEATURES
activator_obj75 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::activator_obj75.others
{ Taste::Coordinates => "19 12";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 10000 ms;
Taste::Deadline => 10000 ms;
Taste::Importance => MEDIUM ;};
obj247_obj86 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::receive_int_obj107.others
{ Taste::Coordinates => "49 12";
Taste::RCMoperationKind => sporadic;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "pinger";
END pinger;
SYSTEM IMPLEMENTATION pinger.others
SUBCOMPONENTS
activator_obj75_impl : SUBPROGRAM interfaceview::FV::activator_obj75.others
{ Compute_Execution_Time => 0ms..500ms ;};
CONNECTIONS
SUBPROGRAM ACCESS activator_obj75_impl -> activator_obj75;
END pinger.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::pingee1
---------------------------------------------------
SYSTEM pingee1
FEATURES
receive_int_obj107 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::receive_int_obj107.others
{ Taste::Coordinates => "67 12 67 12";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 6000 ms;
Taste::Deadline => 6000 ms;
Taste::Importance => MEDIUM ;};
obj485_obj119 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::receive_int2_obj140.others
{ Taste::Coordinates => "86 15";
Taste::RCMoperationKind => sporadic;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "pingee1";
END pingee1;
SYSTEM IMPLEMENTATION pingee1.others
SUBCOMPONENTS
receive_int_obj107_impl : SUBPROGRAM interfaceview::FV::receive_int_obj107.others
{ Compute_Execution_Time => 0ms..200ms ;};
CONNECTIONS
SUBPROGRAM ACCESS receive_int_obj107_impl -> receive_int_obj107;
END pingee1.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::pingee2
---------------------------------------------------
SYSTEM pingee2
FEATURES
receive_int2_obj140 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::receive_int2_obj140.others
{ Taste::Coordinates => "86 25 86 25";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 6000 ms;
Taste::Deadline => 6000 ms;
Taste::Importance => MEDIUM ;};
obj1121_obj152 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::receive_int3_obj173.others
{ Taste::Coordinates => "83 33";
Taste::RCMoperationKind => sporadic;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "pingee2";
END pingee2;
SYSTEM IMPLEMENTATION pingee2.others
SUBCOMPONENTS
receive_int2_obj140_impl : SUBPROGRAM interfaceview::FV::receive_int2_obj140.others
{ Compute_Execution_Time => 0ms..200ms ;};
CONNECTIONS
SUBPROGRAM ACCESS receive_int2_obj140_impl -> receive_int2_obj140;
END pingee2.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::finalpingee
---------------------------------------------------
SYSTEM finalpingee
FEATURES
receive_int3_obj173 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::receive_int3_obj173.others
{ Taste::Coordinates => "83 47 83 47";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 6000 ms;
Taste::Deadline => 6000 ms;
Taste::Importance => MEDIUM ;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "finalpingee";
END finalpingee;
SYSTEM IMPLEMENTATION finalpingee.others
SUBCOMPONENTS
receive_int3_obj173_impl : SUBPROGRAM interfaceview::FV::receive_int3_obj173.others
{ Compute_Execution_Time => 0ms..5ms ;};
CONNECTIONS
SUBPROGRAM ACCESS receive_int3_obj173_impl -> receive_int3_obj173;
END finalpingee.others;
PROPERTIES
Taste::Coordinates => "0 0 297 210";
Taste::dataView => ("DataView");
Taste::dataViewPath => ("dataview.aadl");
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH DataView;
WITH TASTE;
SUBPROGRAM activator_obj75
END activator_obj75;
SUBPROGRAM IMPLEMENTATION activator_obj75.others
END activator_obj75.others;
SUBPROGRAM receive_int_obj107
FEATURES
v : IN PARAMETER DataView::My_Integer
{ Taste::encoding => UPER; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END receive_int_obj107;
SUBPROGRAM IMPLEMENTATION receive_int_obj107.others
END receive_int_obj107.others;
SUBPROGRAM receive_int2_obj140
FEATURES
v : IN PARAMETER DataView::My_Integer
{ Taste::encoding => UPER; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END receive_int2_obj140;
SUBPROGRAM IMPLEMENTATION receive_int2_obj140.others
END receive_int2_obj140.others;
SUBPROGRAM receive_int3_obj173
FEATURES
v : IN PARAMETER DataView::My_Integer
{ Taste::encoding => UPER; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END receive_int3_obj173;
SUBPROGRAM IMPLEMENTATION receive_int3_obj173.others
END receive_int3_obj173.others;
END interfaceview::FV;
This diff is collapsed.
../buildsupport -glue -i interfaceview.aadl -c deploymentview.aadl -d dataview.aadl ocarina_components.aadl TASTE_DV_Properties.aadl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment