Commit e794562a authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Parse busses

parent 624feb74
...@@ -67,7 +67,6 @@ procedure AADL_Parser is ...@@ -67,7 +67,6 @@ procedure AADL_Parser is
AADL_Version : AADL_Version_Type := Ocarina.AADL_V2; AADL_Version : AADL_Version_Type := Ocarina.AADL_V2;
procedure Parse_Command_Line; procedure Parse_Command_Line;
procedure Process_Deployment_View (My_Root : Node_Id);
-- procedure Process_DataView (My_Root : Node_Id); -- procedure Process_DataView (My_Root : Node_Id);
procedure Browse_Deployment_View_System procedure Browse_Deployment_View_System
(My_System : Node_Id; NodeName : String) with Unreferenced; (My_System : Node_Id; NodeName : String) with Unreferenced;
...@@ -138,12 +137,6 @@ procedure AADL_Parser is ...@@ -138,12 +137,6 @@ procedure AADL_Parser is
-- Current_function is read from the list of system subcomponents -- Current_function is read from the list of system subcomponents
-----------------------------
-- Process_Deployment_View --
-----------------------------
procedure Process_Deployment_View (My_Root : Node_Id) is null;
------------------------------------- -------------------------------------
-- Load_Deployment_View_Properties -- -- Load_Deployment_View_Properties --
------------------------------------- -------------------------------------
...@@ -173,7 +166,6 @@ procedure AADL_Parser is ...@@ -173,7 +166,6 @@ procedure AADL_Parser is
"memory_properties.aadl" & "memory_properties.aadl" &
"modeling_properties.aadl" & "modeling_properties.aadl" &
"arinc653.aadl" & "arinc653.aadl" &
-- "arinc653_properties.aadl" &
"base_types.aadl" & "base_types.aadl" &
"data_model.aadl" & "data_model.aadl" &
"deployment.aadl"; "deployment.aadl";
...@@ -817,7 +809,8 @@ procedure AADL_Parser is ...@@ -817,7 +809,8 @@ procedure AADL_Parser is
end Initialize; end Initialize;
IV_Root : Node_Id; IV_Root : Node_Id;
AST : Complete_Interface_View; IV_AST : Complete_Interface_View;
DV_AST : Complete_Deployment_View;
begin begin
Banner; Banner;
...@@ -834,9 +827,9 @@ begin ...@@ -834,9 +827,9 @@ begin
Get_String_Name ("interfaceview.others"); Get_String_Name ("interfaceview.others");
IV_Root := Root_System (Instantiate_Model (Root => Interface_Root)); IV_Root := Root_System (Instantiate_Model (Root => Interface_Root));
AST := AADL_to_Ada_IV (IV_Root); IV_AST := AADL_to_Ada_IV (IV_Root);
Debug_Dump_IV (AST); Debug_Dump_IV (IV_AST);
-- Now, we are done with the interface view. We now analyze the -- Now, we are done with the interface view. We now analyze the
-- deployment view. -- deployment view.
...@@ -845,15 +838,17 @@ begin ...@@ -845,15 +838,17 @@ begin
Load_Deployment_View_Properties (Deployment_Root); Load_Deployment_View_Properties (Deployment_Root);
Process_Deployment_View (Deployment_Root); DV_AST := AADL_To_Ada_DV (Deployment_Root);
-- Process_Deployment_View (Deployment_Root);
Ocarina.Configuration.Reset_Modules; Ocarina.Configuration.Reset_Modules;
Ocarina.Reset; Ocarina.Reset;
exception exception
when Error : AADL_Parser_Error => when Error : AADL_Parser_Error | Deployment_View_Error =>
Put (Red_Bold & "[ERROR] " & White); Put (Red_Bold & "[ERROR] " & White);
Put_Line (Exception_Message (Error) & No_Color); Put_Line (Exception_Message (Error) & No_Color);
OS_Exit (1); OS_Exit (1);
when E : others => when E : others =>
Errors.Display_Bug_Box (E); Errors.Display_Bug_Box (E);
end AADL_Parser; end AADL_Parser;
...@@ -73,15 +73,9 @@ package body Deployment_View is ...@@ -73,15 +73,9 @@ package body Deployment_View is
(Corresponding_Declaration (Bus)) /= No_Node (Corresponding_Declaration (Bus)) /= No_Node
then then
Set_Str_To_Name_Buffer (""); Set_Str_To_Name_Buffer ("");
Get_Name_String Get_Name_String (ATN.Name (ATN.Identifier (ATN.Namespace
(ATN.Name (Corresponding_Declaration (Bus)))));
(ATN.Identifier
(ATN.Namespace
(Corresponding_Declaration (Bus)))));
Pkg_Name := Name_Find; Pkg_Name := Name_Find;
-- C_Add_Package
-- (Get_Name_String (Pkg_Name),
Set_Str_To_Name_Buffer (""); Set_Str_To_Name_Buffer ("");
Get_Name_String (Pkg_Name); Get_Name_String (Pkg_Name);
Add_Str_To_Name_Buffer ("::"); Add_Str_To_Name_Buffer ("::");
...@@ -91,12 +85,12 @@ package body Deployment_View is ...@@ -91,12 +85,12 @@ package body Deployment_View is
else else
Classifier := Name (Identifier (Bus)); Classifier := Name (Identifier (Bus));
end if; end if;
return Taste_Bus'(Name => return Taste_Bus'(Name =>
US (Get_Name_String (Name (Identifier (Elem)))), US (Get_Name_String (Name (Identifier (Elem)))),
Classifier => US (Get_Name_String (Classifier)), AADL_Package => US (Get_Name_String (Pkg_Name)),
Properties => Properties); Classifier => US (Get_Name_String (Classifier)),
Properties => Properties);
end Parse_Bus; end Parse_Bus;
begin begin
My_Root_System := Initialize (System); My_Root_System := Initialize (System);
...@@ -115,7 +109,6 @@ package body Deployment_View is ...@@ -115,7 +109,6 @@ package body Deployment_View is
-- (CI, Get_Name_String (Name (Identifier (Subs)))); -- (CI, Get_Name_String (Name (Identifier (Subs))));
elsif Get_Category_Of_Component (CI) = CC_Bus then elsif Get_Category_Of_Component (CI) = CC_Bus then
Busses.Append (Parse_Bus (Subs, CI)); Busses.Append (Parse_Bus (Subs, CI));
end if; end if;
Subs := Next_Node (Subs); Subs := Next_Node (Subs);
end loop; end loop;
......
...@@ -42,9 +42,10 @@ package Deployment_View is ...@@ -42,9 +42,10 @@ package Deployment_View is
type Taste_Bus is type Taste_Bus is
record record
Name : Unbounded_String; Name : Unbounded_String;
Classifier : Unbounded_String; AADL_Package : Unbounded_String;
Properties : Property_Maps.Map; Classifier : Unbounded_String;
Properties : Property_Maps.Map;
end record; end record;
package Taste_Busses is new Indefinite_Vectors (Natural, Taste_Bus); package Taste_Busses is new Indefinite_Vectors (Natural, Taste_Bus);
......
...@@ -783,20 +783,20 @@ public ...@@ -783,20 +783,20 @@ public
-- used through the TCP_IP_Device defined in TCP_IP_Protocol -- used through the TCP_IP_Device defined in TCP_IP_Protocol
-- package. -- package.
processor Generic_Processor -- processor Generic_Processor
features -- features
eth0_tcp_ip : requires bus access Generic_Bus::Generic_Bus.impl; -- eth0_tcp_ip : requires bus access Generic_Bus::Generic_Bus.impl;
-- One ethernet card, connected to the processor. It is assumed -- -- One ethernet card, connected to the processor. It is assumed
-- later that it is used through a TCP/IP stack -- -- later that it is used through a TCP/IP stack
--
end Generic_Processor; -- end Generic_Processor;
--
processor implementation Generic_Processor.impl -- processor implementation Generic_Processor.impl
properties -- properties
Deployment::Execution_Platform => Native; -- Deployment::Execution_Platform => Native;
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); -- Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; -- Priority_Range => 0 .. 255;
end Generic_Processor.impl; -- end Generic_Processor.impl;
------------ ------------
-- MEMORY -- -- MEMORY --
...@@ -838,15 +838,15 @@ public ...@@ -838,15 +838,15 @@ public
-- XXX Add UARTS -- XXX Add UARTS
end LEON2; end LEON2;
processor implementation LEON2.impl -- processor implementation LEON2.impl
properties -- properties
Deployment::Execution_Platform => LEON_ORK; -- for using GNATforLEON -- Deployment::Execution_Platform => LEON_ORK; -- for using GNATforLEON
--
-- Information on the scheduler used by GNATforLEON -- -- Information on the scheduler used by GNATforLEON
--
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); -- Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; -- Priority_Range => 0 .. 255;
end LEON2.impl; -- end LEON2.impl;
------------ ------------
-- MEMORY -- -- MEMORY --
...@@ -2132,78 +2132,167 @@ with Cheddar_Properties; ...@@ -2132,78 +2132,167 @@ with Cheddar_Properties;
processor arm processor arm
end arm; end arm;
processor cortex_m extends arm processor crazyflie_v2 extends arm
properties properties
Deployment::Execution_Platform => GNAT_Runtime; Deployment::Execution_Platform => GNAT_Runtime;
end cortex_m; Deployment::Ada_Runtime => "crazyflie_full";
end crazyflie_v2;
processor implementation cortex_m.i processor implementation crazyflie_v2.gnat
properties properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms; Cheddar_Properties::Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true; Cheddar_Properties::Preemptive_Scheduler => true;
end cortex_m.i; end crazyflie_v2.gnat;
processor nds extends arm
end nds;
processor implementation nds.rtems processor stm32f407_discovery extends arm
properties
Deployment::Execution_Platform => GNAT_Runtime;
Deployment::Ada_Runtime => "stm32f407_discovery_full";
end stm32f407_discovery;
processor implementation stm32f407_discovery.gnat2017
properties properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms; Cheddar_Properties::Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true; Cheddar_Properties::Preemptive_Scheduler => true;
Deployment::Execution_Platform => NDS_RTEMS; end stm32f407_discovery.gnat2017;
end nds.rtems;
processor gumstix extends arm processor stm32f429_discovery extends arm
end gumstix; properties
Deployment::Execution_Platform => GNAT_Runtime;
Deployment::Ada_Runtime => "stm32f429_discovery_full";
end stm32f429_discovery;
processor implementation gumstix.rtems processor implementation stm32f429_discovery.gnat2017
properties properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms; Cheddar_Properties::Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true; Cheddar_Properties::Preemptive_Scheduler => true;
Deployment::Execution_Platform => GUMSTIX_RTEMS; end stm32f429_discovery.gnat2017;
end gumstix.rtems;
processor nds extends arm
end nds;
-- processor implementation nds.rtems
-- properties
-- Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
-- Priority_Range => 0 .. 255;
-- Cheddar_Properties::Scheduler_Quantum => 0 Ms;
-- Cheddar_Properties::Preemptive_Scheduler => true;
-- Deployment::Execution_Platform => NDS_RTEMS;
-- end nds.rtems;
processor gumstix extends arm
end gumstix;
-- processor implementation gumstix.rtems
-- properties
-- Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
-- Priority_Range => 0 .. 255;
-- Cheddar_Properties::Scheduler_Quantum => 0 Ms;
-- Cheddar_Properties::Preemptive_Scheduler => true;
-- Deployment::Execution_Platform => GUMSTIX_RTEMS;
-- end gumstix.rtems;
end ocarina_processors_arm; end ocarina_processors_arm;
package ocarina_processors_leon package ocarina_processors_leon
public public
with Deployment; with Deployment;
with Cheddar_Properties;
processor leon processor leon
end leon; end leon;
processor implementation leon.rtems processor leon2 extends leon
end leon2;
processor gr712 extends leon
end gr712;
processor gr740 extends leon
end gr740;
-- processor implementation leon.rtems
-- properties
-- Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
-- Priority_Range => 0 .. 255;
-- Scheduler_Quantum => 0 Ms;
-- Preemptive_Scheduler => true;
-- Deployment::Execution_Platform => LEON_RTEMS;
-- end leon.rtems;
processor implementation leon.rtems_posix
properties properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms; Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true; Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS; Deployment::Execution_Platform => LEON_RTEMS_POSIX;
end leon.rtems; EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.12-2017.07.17/sparc-rtems4.12/leon3";
end leon.rtems_posix;
processor implementation leon.rtems_posix processor implementation leon2.rtems412_posix
properties properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255; Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms; Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true; Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS_POSIX; Deployment::Execution_Platform => LEON_RTEMS_POSIX;
end leon.rtems_posix; EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.12-2017.07.17/sparc-rtems4.12/leon2";
end leon2.rtems412_posix;
processor implementation leon3.rtems412_posix
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
Scheduler_Quantum => 0 Ms;
Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS_POSIX;
EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.12-2017.07.17/sparc-rtems4.12/leon3";
end leon3.rtems412_posix;
processor implementation gr712.rtems412_posix
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
Scheduler_Quantum => 0 Ms;
Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS_POSIX;
EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.12-2017.07.17/sparc-rtems4.12/gr712rc:CFLAGS=-DCONFIGURE_SMP_APPLICATION -DCONFIGURE_MAXIMUM_PROCESSORS=2 ";
end gr712.rtems412_posix;
processor implementation leon.ork processor implementation gr740.rtems412_posix
properties properties
Deployment::Execution_Platform => LEON_ORK; Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
end leon.ork; Priority_Range => 0 .. 255;
Scheduler_Quantum => 0 Ms;
Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS_POSIX;
EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.12-2017.07.17/sparc-rtems4.12/gr740:CFLAGS=-DCONFIGURE_SMP_APPLICATION -DCONFIGURE_MAXIMUM_PROCESSORS=4 ";
end gr740.rtems412_posix;
processor implementation gr740.rtems410_gaisler_posix
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
Scheduler_Quantum => 0 Ms;
Preemptive_Scheduler => true;
Deployment::Execution_Platform => LEON_RTEMS_POSIX;
EnvVars => "RTEMS_MAKEFILE_PATH_LEON=/opt/rtems-4.10/sparc-rtems/leon3:CFLAGS=-qngmp:LDFLAGS=-qngmp ";
end gr740.rtems410_gaisler_posix;
-- processor implementation leon.ork
-- properties
-- Deployment::Execution_Platform => LEON_ORK;
-- end leon.ork;
processor leon3 processor leon3
end leon3; end leon3;
...@@ -2214,27 +2303,27 @@ end xtratum_partition; ...@@ -2214,27 +2303,27 @@ end xtratum_partition;
virtual processor implementation xtratum_partition.generic virtual processor implementation xtratum_partition.generic
end xtratum_partition.generic; end xtratum_partition.generic;
processor implementation leon3.scoc3 -- processor implementation leon3.scoc3
properties -- properties
Deployment::Execution_Platform => LEON3_SCOC3; -- Deployment::Execution_Platform => LEON3_SCOC3;
end leon3.scoc3; -- end leon3.scoc3;
processor implementation leon3.xtratum -- processor implementation leon3.xtratum
properties -- properties
Deployment::Execution_Platform => LEON3_XTRATUM; -- Deployment::Execution_Platform => LEON3_XTRATUM;
end leon3.xtratum; -- end leon3.xtratum;
processor implementation leon3.xtratum_2partitions extends leon3.xtratum -- processor implementation leon3.xtratum_2partitions extends leon3.xtratum
subcomponents -- subcomponents
part1 : virtual processor xtratum_partition.generic -- part1 : virtual processor xtratum_partition.generic
{ Deployment::Execution_Platform => LEON3_XM3;}; -- { Deployment::Execution_Platform => LEON3_XM3;};
part2 : virtual processor xtratum_partition.generic -- part2 : virtual processor xtratum_partition.generic
{ Deployment::Execution_Platform => LEON3_XM3;}; -- { Deployment::Execution_Platform => LEON3_XM3;};
-- properties -- properties
-- ARINC653::Partition_Slots => (500ms, 500ms); -- ARINC653::Partition_Slots => (500ms, 500ms);
-- ARINC653::Slots_Allocation => (reference (part1), reference (part2)); -- ARINC653::Slots_Allocation => (reference (part1), reference (part2));
-- ARINC653::Module_Major_Frame => 1000ms; -- ARINC653::Module_Major_Frame => 1000ms;
end leon3.xtratum_2partitions; -- end leon3.xtratum_2partitions;
end ocarina_processors_leon; end ocarina_processors_leon;
package ocarina_processors_x86 package ocarina_processors_x86
...@@ -2260,50 +2349,50 @@ properties ...@@ -2260,50 +2349,50 @@ properties
end x86.win32; end x86.win32;
processor implementation x86.linux_bench -- processor implementation x86.linux_bench
properties -- properties
Scheduling_Protocol => (POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL); -- Scheduling_Protocol => (POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL);
Deployment::Execution_Platform => bench; -- Deployment::Execution_Platform => bench;
end x86.linux_bench; -- end x86.linux_bench;
processor implementation x86.linux32
properties
Deployment::Execution_Platform => Linux32;
end x86.linux32;
processor implementation x86.linux64
properties
Deployment::Execution_Platform => Linux64;
end x86.linux64;
processor implementation x86.native -- processor implementation x86.linux32
properties -- properties
Deployment::Execution_Platform => Native; -- Deployment::Execution_Platform => Linux32;
end x86.native; -- end x86.linux32;
--
processor implementation x86.native_compcert -- processor implementation x86.linux64
properties -- properties
Deployment::Execution_Platform => Native_Compcert; -- Deployment::Execution_Platform => Linux64;
end x86.native_compcert; -- end x86.linux64;
processor implementation x86.rtems -- processor implementation x86.native
properties -- properties
Deployment::Execution_Platform => X86_RTEMS; -- Deployment::Execution_Platform => Native;
end x86.rtems; -- end x86.native;
--
processor implementation x86.rtems_posix -- processor implementation x86.native_compcert
properties -- properties
Deployment::Execution_Platform => X86_RTEMS_POSIX; -- Deployment::Execution_Platform => Native_Compcert;
end x86.rtems_posix; -- end x86.native_compcert;
--
processor implementation x86.xenomai_posix -- processor implementation x86.rtems
properties -- properties
Deployment::Execution_Platform => linux32_xenomai_posix; -- Deployment::Execution_Platform => X86_RTEMS;
end x86.xenomai_posix; -- end x86.rtems;
--
processor implementation x86.xenomai_native -- processor implementation x86.rtems_posix
properties -- properties
Deployment::Execution_Platform => linux32_xenomai_native; -- Deployment::Execution_Platform => X86_RTEMS_POSIX;
end x86.xenomai_native; -- end x86.rtems_posix;
-- processor implementation x86.xenomai_posix
-- properties
-- Deployment::Execution_Platform => linux32_xenomai_posix;
-- end x86.xenomai_posix;
--
-- processor implementation x86.xenomai_native
-- properties
-- Deployment::Execution_Platform => linux32_xenomai_native;
-- end x86.xenomai_native;
end ocarina_processors_x86; end ocarina_processors_x86;
...@@ -3,7 +3,14 @@ AADL_PARSER=../../aadl_parser ...@@ -3,7 +3,14 @@ AADL_PARSER=../../aadl_parser
all: test-parse all: test-parse
test-parse: test-parse:
$(AADL_PARSER) -gw -i InterfaceView.aadl -d DataView.aadl ../common/TASTE_IV_Properties.aadl $(AADL_PARSER) -gw \
-glue \
-i InterfaceView.aadl \