Commit d53b2816 authored by Maxime Perrotin's avatar Maxime Perrotin

Complete AADL support for bus connections

parent 924596ab
......@@ -537,6 +537,10 @@ package body TASTE.Concurrency_View is
Device_ASN1_Filename,
Device_ASN1_Typename,
Device_ASN1_Module : Vector_Tag; -- Device drivers
Connect_From_Partition, -- Partition to bus connections
Connect_Port_Name,
Connect_Via_Bus : Vector_Tag;
Found : Boolean := False;
begin
-- Prepare the template tags of system.aadl with the busses
for Bus of CV.Deployment.Busses loop
......@@ -548,6 +552,35 @@ package body TASTE.Concurrency_View is
Bus_Classifier := Bus_Classifier & Bus.Classifier;
end loop;
-- Bus connections: we need the output port name, partition and
-- bus name to make the AADL construct. Check Bus_Connection type
-- in deployment_view.ads if anything else is needed. It does not
-- directly provide the partition name of the function so we have
-- to retrieve it here
for BC : Bus_Connection of CV.Deployment.Connections loop
Connect_Via_Bus := Connect_Via_Bus & BC.Bus_Name;
Connect_Port_Name := Connect_Port_Name & BC.Source_Port;
Found := False;
for Node of CV.Deployment.Nodes loop
exit when Found;
for Part of Node.Partitions loop
exit when Found;
if Part.Bound_Functions.Contains
(To_String (BC.Dest_Function))
then
Connect_From_Partition :=
Connect_From_Partition & Part.Name;
Found := True;
end if;
end loop;
end loop;
if not Found then
raise Concurrency_View_Error with
"Could not find partition of function "
& To_String (BC.Dest_Function);
end if;
end loop;
for Node in CV.Nodes.Iterate loop
declare
Node_Name : constant String := CV_Nodes.Key (Node);
......@@ -722,7 +755,10 @@ package body TASTE.Concurrency_View is
& Assoc ("Device_Port_Name", Device_Accessed_Port_Name)
& Assoc ("Device_ASN1_File", Device_ASN1_Filename)
& Assoc ("Device_ASN1_Sort", Device_ASN1_Typename)
& Assoc ("Device_ASN1_Module", Device_ASN1_Module);
& Assoc ("Device_ASN1_Module", Device_ASN1_Module)
& Assoc ("Connect_From_Part", Connect_From_Partition)
& Assoc ("Connect_Via_Bus", Connect_Via_Bus)
& Assoc ("Connect_Port_Name", Connect_Port_Name);
Create_Path (CV_Out_Dir);
Create (File => Output_File,
Mode => Out_File,
......
......@@ -32,6 +32,9 @@
@@-- @_Device_ASN1_File_@
@@-- @_Device_ASN1_Sort_@
@@-- @_Device_ASN1_Module_@ : Device drivers (vector tag)
@@-- @_Connect_From_Part_@ : Vector tag - bus connection: partition source
@@-- @_Connect_Via_Bus_@ |_ bus name
@@-- @_Connect_Port_Name_@ |_ port name
@@-- And all the system configuration obtained from the command line:
@@-- Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
@@-- Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
......@@ -58,6 +61,10 @@ public
@@TABLE@@
with @_CAPITALIZE:Target_Packages_@;
@@END_TABLE@@
@@-- If there is at least one bus, add ocarina_buses
@@IF@@ @_Bus_Names'Length_@ > 0
with ocarina_buses;
@@END_IF@@
@@-- POHIC-only: declare protected objects to have runtime mutex
@@IF@@ @_Use_POHIC_@
......@@ -151,6 +158,10 @@ properties
@@TABLE'ALIGN_ON("applies")@@
Actual_Processor_Binding => (reference (@_CAPITALIZE:Device_Node_Name_@_@_Device_CPU_@)) applies to @_Device_Node_Name_@_@_Device_Names_@;
@@END_TABLE@@
@@-- Specify connection bindings (from partition to bus)
@@TABLE'ALIGN_ON("applies")@@
Actual_Connection_Binding => (reference (@_Connect_Via_Bus_@)) applies to @_Connect_From_Part_@_@_Connect_Port_Name_@;
@@END_TABLE@@
@@-- TSP: specify the time allocated to each node and on each partition
@@TABLE'ALIGN_ON("applies")@@
@@IF@@ @_Node_Major_Frame_@ /= ""
......
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