Commit 0dd820b1 authored by Maxime Perrotin's avatar Maxime Perrotin

Groupe routes in a map

parent 6f17e64b
...@@ -247,7 +247,7 @@ package body Buildsupport_Utils is ...@@ -247,7 +247,7 @@ package body Buildsupport_Utils is
-------------------------------------------- --------------------------------------------
function Get_Properties_Map (D : Node_Id) return Property_Maps.Map is function Get_Properties_Map (D : Node_Id) return Property_Maps.Map is
properties : constant List_Id := AIN.Properties (D); properties : constant List_Id := AIN.Properties (D);
result : Property_Maps.Map := Empty_Map; result : Property_Maps.Map := Property_Maps.Empty_Map;
property : Node_Id := AIN.First_Node (properties); property : Node_Id := AIN.First_Node (properties);
prop_value : Node_Id; prop_value : Node_Id;
single_val : Node_Id; single_val : Node_Id;
...@@ -405,8 +405,10 @@ package body Buildsupport_Utils is ...@@ -405,8 +405,10 @@ package body Buildsupport_Utils is
use type Ctxt_Params.Vector; use type Ctxt_Params.Vector;
use type Interfaces.Vector; use type Interfaces.Vector;
use type Parameters.Vector; use type Parameters.Vector;
use type Connection_Maps.Map;
Funcs : Functions.Vector := Functions.Empty_Vector; Funcs : Functions.Vector := Functions.Empty_Vector;
Routes : Channels.Vector; -- := Channels.Empty_Vector; Routes : Channels.Vector; -- := Channels.Empty_Vector;
Routes_Map : Connection_Maps.Map;
Current_Function : Node_Id; Current_Function : Node_Id;
-- Parse a connection -- Parse a connection
...@@ -616,7 +618,9 @@ package body Buildsupport_Utils is ...@@ -616,7 +618,9 @@ package body Buildsupport_Utils is
end loop; end loop;
end if; end if;
Routes := Routes & Parse_System_Connections (CI); -- Routes := Routes & Parse_System_Connections (CI);
Routes_Map.Insert (Key => Name,
New_Item => Parse_System_Connections (CI));
if No (AIN.Subcomponents (CI)) or Res = Functions.Empty_Vector if No (AIN.Subcomponents (CI)) or Res = Functions.Empty_Vector
then then
...@@ -640,16 +644,23 @@ package body Buildsupport_Utils is ...@@ -640,16 +644,23 @@ package body Buildsupport_Utils is
Current_Function := AIN.Next_Node (Current_Function); Current_Function := AIN.Next_Node (Current_Function);
end loop; end loop;
Routes := Routes & Parse_System_Connections (System); -- Routes := Routes & Parse_System_Connections (System);
for Each of Routes loop Routes_Map.Insert (Key => "_Root",
Put_Line (To_String (Each.Caller) & "." & To_String (Each.RI_Name) New_Item => Parse_System_Connections (System));
& " -> " & To_String (Each.Callee) & "." & for C in Routes_Map.Iterate loop
To_String (Each.PI_Name)); Put_Line ("Routes of Function " & Connection_Maps.Key (C));
for Each of Connection_Maps.Element (C) loop
Put_Line (" " & To_String (Each.Caller)
& "." & To_String (Each.RI_Name)
& " -> " & To_String (Each.Callee) & "." &
To_String (Each.PI_Name));
end loop;
end loop; end loop;
return IV_AST : constant Complete_Interface_View := return IV_AST : constant Complete_Interface_View :=
(Flat_Functions => Funcs, (Flat_Functions => Funcs,
Connections => Routes); End_To_End_Conn => Routes,
Nested_Conn => Routes_Map);
end AADL_to_Ada_IV; end AADL_to_Ada_IV;
end Buildsupport_Utils; end Buildsupport_Utils;
...@@ -175,11 +175,15 @@ package Buildsupport_Utils is ...@@ -175,11 +175,15 @@ package Buildsupport_Utils is
end record; end record;
package Channels is new Indefinite_Vectors (Natural, Connection); package Channels is new Indefinite_Vectors (Natural, Connection);
package Connection_Maps is new Indefinite_Ordered_Maps (String,
Channels.Vector,
"=" => Channels."=");
type Complete_Interface_View is type Complete_Interface_View is
record record
Flat_Functions : Functions.Vector; Flat_Functions : Functions.Vector;
Connections : Channels.Vector; End_To_End_Conn : Channels.Vector;
Nested_Conn : Connection_Maps.Map;
end record; end record;
-- Function to build up the Ada AST by transforming the one from Ocarina -- Function to build up the Ada AST by transforming the one from Ocarina
......
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