Commit e09ad2e4 authored by Maxime Perrotin's avatar Maxime Perrotin

Add end-to-end connections in AST

parent b142208a
......@@ -13,7 +13,7 @@ begin
Transformed : TASTE_Model := Transform (Model);
begin
if Model.Configuration.Debug_Flag then
TASTE.Dump.Dump_Input_Model (Transformed);
TASTE.Dump.Dump_Input_Model (Model);
Transformed.Dump;
end if;
......
......@@ -528,13 +528,11 @@ package body TASTE.Backend.Code_Generators is
Result.Funcs.Insert (Key => To_String (Each.Name),
New_Item => Func_Template (Each));
end loop;
for Each of IV.Connections loop
for C of Each loop
Result.Callers := Result.Callers & C.Caller;
Result.Callees := Result.Callees & C.Callee;
Result.RI_Names := Result.RI_Names & C.RI_Name;
Result.PI_Names := Result.PI_Names & C.PI_Name;
end loop;
for C of IV.Connections loop
Result.Callers := Result.Callers & C.Caller;
Result.Callees := Result.Callees & C.Callee;
Result.RI_Names := Result.RI_Names & C.RI_Name;
Result.PI_Names := Result.PI_Names & C.PI_Name;
end loop;
return Result;
end Interface_View_Template;
......
......@@ -293,11 +293,12 @@ package body TASTE.Interface_View is
use type Ctxt_Params.Vector;
use type Parameters.Vector;
-- use type Connection_Maps.Map;
System : Node_Id;
Success : Boolean;
Functions : Function_Maps.Map;
Routes_Map : Connection_Maps.Map;
Current_Function : Node_Id;
System : Node_Id;
Success : Boolean;
Functions : Function_Maps.Map;
Routes_Map : Connection_Maps.Map;
End_To_End_Connections : Channels.Vector;
Current_Function : Node_Id;
-- Parse a connection
function Parse_Connection (Conn : Node_Id) return Optional_Connection is
......@@ -696,6 +697,8 @@ package body TASTE.Interface_View is
end;
end loop;
-- Routes_Map contains all connections including the nested ones
-- It is used in Rec_Jump to resolve all end-to-end connections
Routes_Map.Insert (Key => "_Root",
New_Item => Parse_System_Connections (System));
......@@ -715,6 +718,13 @@ package body TASTE.Interface_View is
RI.RCM :=
Functions (To_String (Remote.Function_Name)).Provided
(To_String (Remote.Interface_Name)).RCM;
-- Update list of end to end connections with RI->PI
End_To_End_Connections := End_To_End_Connections
& (Caller => Each.Name,
Callee => Remote.Function_Name,
RI_Name => RI.Name,
PI_Name => Remote.Interface_Name);
end if;
end;
end loop;
......@@ -724,6 +734,16 @@ package body TASTE.Interface_View is
-- current function - we cannot touch the one with the remote PI.
for Each of Functions loop
for PI of Each.Provided loop
-- Add periodic PIs to the list of connections
if PI.RCM = Cyclic_Operation then
End_To_End_Connections := End_To_End_Connections
& (Caller => US ("ENV"),
Callee => Each.Name,
RI_Name => PI.Name,
PI_Name => PI.Name);
end if;
for Fn of Functions loop
for RI of Fn.Required loop
for Remote of RI.Remote_Interfaces loop
......@@ -742,7 +762,7 @@ package body TASTE.Interface_View is
return IV_AST : constant Complete_Interface_View :=
(Flat_Functions => Functions,
Connections => Routes_Map);
Connections => End_To_End_Connections);
end Parse_Interface_View;
procedure Rename_Function (IV : in out Complete_Interface_View;
......
......@@ -176,7 +176,7 @@ package TASTE.Interface_View is
type Complete_Interface_View is tagged
record
Flat_Functions : Function_Maps.Map;
Connections : Connection_Maps.Map;
Connections : Channels.Vector;
end record;
-- Function to build up the Ada AST by transforming the one from Ocarina
......
......@@ -24,7 +24,7 @@
@@-- @_Is_Type_@ : Flag, True if function is a component type
@@-- @_Instance_Of_@ : Optional name of component type
@@IF@@ @_Is_Type_@ = TRUE
@_Name_@ [shape=parallelogram, style=filled, fontsize=24, label="type @_Name_@ (@_Language_@)"];
@_Name_@ [shape=box, style=filled, fontsize=24, label="type @_Name_@ (@_Language_@)"];
@@ELSIF@@ @_Instance_Of_@ /= ""
@_Name_@ [shape=box, fillcolor=cyan, style="filled, rounded", fontsize=20, label="@_Name_@ : @_Instance_Of_@"];
@@ELSE@@
......
......@@ -7,4 +7,3 @@
@@TABLE@@
@_Callers_@ -> @_Callees_@ [fontsize=14, color=blue, headlabel="[@_Caller_RIs_@]", taillabel="[@_Callee_PIs_@]"];
@@END_TABLE@@
</InterfaceView>
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