Commit 0b67bac1 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Recursively parse bus-bounded connections

parent 2139a5e9
......@@ -116,23 +116,19 @@ package body TASTE.Deployment_View is
Properties => Properties);
end Parse_Bus;
function Parse_Connections (CI : Node_Id) return Bus_Connections.Vector
procedure Rec_Parse_Connections (AADL_System : Node_Id;
Result : in out Bus_Connections.Vector)
is
use Bus_Connections;
Conn,
Bound_Bus,
SRC, DST : Node_Id;
SRC_PORT,
DST_PORT,
SRC_FUNCTION,
DST_FUNCTION : Unbounded_String;
Bound_Bus_Name,
If1_Name,
If2_Name : Name_Id;
Result : Bus_Connections.Vector;
Bound_Bus : Node_Id;
Bound_Bus_Name : Name_Id;
Subs,
Sub_System_CI : Node_Id;
begin
Conn := First_Node (Connections (CI));
Conn := First_Node (Connections (AADL_System));
while Present (Conn) loop
Put_Debug ("Parsing Connection " & AIN_Case (Conn));
-- AADL is confusing because it reverses the meaning of source
-- and destination. Source is the message receiver (the PI) and
-- destination is the message sender (the RI)
......@@ -140,47 +136,37 @@ package body TASTE.Deployment_View is
if Bound_Bus /= No_Node then
Bound_Bus_Name := Name
(Identifier (Parent_Subcomponent (Bound_Bus)));
DST := Get_Referenced_Entity (Source (Conn));
SRC := Get_Referenced_Entity (Destination (Conn));
If1_Name := Get_Interface_Name (DST); -- PI
If2_Name := Get_Interface_Name (SRC); -- RI
-- Get_Interface_Name is v1.3.5+ only
if If1_Name /= No_Name and If2_Name /= No_Name then
DST_PORT := US (Get_Name_String (If1_Name)); -- PI
SRC_PORT := US (Get_Name_String (If2_Name)); -- RI
else
-- Keep compatibility with v1.2
DST_PORT := US (Get_Name_String (Display_Name
(Identifier (SRC))));
SRC_PORT := US (Get_Name_String (Display_Name
(Identifier (DST))));
end if;
DST_FUNCTION := US (Get_Name_String
(Name (Identifier
(Parent_Subcomponent
(Parent_Component (DST))))));
SRC_FUNCTION := US (Get_Name_String
(Name (Identifier
(Parent_Subcomponent
(Parent_Component (SRC))))));
-- The source and destination function/ports are irrelevant
-- here because they may not be end-to-end connections in
-- case of a hierarchical structure. All bus connections
-- must be updated before processing the concurrency view, but
-- this can be done only using the interface view information.
Put_Debug ("Added bus connnection: ");
Put_Debug (" ... Channel: " & AIN_Case (Conn));
Put_Debug (" ... Bus: " & Get_Name_String (Bound_Bus_Name));
Result := Result
& Bus_Connection'(Channel_Name => US (AIN_Case (Conn)),
Dest_Port => DST_PORT,
Dest_Function => DST_FUNCTION,
Bus_Name =>
& Bus_Connection'(Channel_Name => US (AIN_Case (Conn)),
Bus_Name =>
US (Get_Name_String (Bound_Bus_Name)),
Source_Port => SRC_PORT,
Source_Function => SRC_FUNCTION);
others => <>);
end if;
Conn := Next_Node (Conn);
end loop;
return Result;
end Parse_Connections;
-- We now check if there are subsystems in the current system
-- and go recusively to collect all connections bound to a bus
Subs := First_Node (Subcomponents (AADL_System));
while Present (Subs) loop
Sub_System_CI := Corresponding_Instance (Subs);
if Get_Category_Of_Component (Sub_System_CI) = CC_System then
Put_Debug ("Sub node: " & AIN_Case (Sub_System_CI));
if not Is_Empty (Connections (Sub_System_CI)) then
Rec_Parse_Connections (Sub_System_CI, Result);
end if;
end if;
Subs := Next_Node (Subs);
end loop;
end Rec_Parse_Connections;
-- Find the bus that is connected to a device through a require access
procedure Find_Connected_Bus (Device : Node_Id;
......@@ -597,12 +583,20 @@ package body TASTE.Deployment_View is
CI := Corresponding_Instance (Subs);
if Get_Category_Of_Component (CI) = CC_System then -- Node
Put_Debug ("Deployment node name: " & AIN_Case (CI));
if not Is_Empty (Connections (CI)) then
Conns := Conns & Parse_Connections (CI);
-- Parse the connections that are bound to a bus
-- the connections are found in the interface view, not
-- in the nodes, because of the Actual_Connection_Binding
-- property that applies only to interface view connections
-- Since the interface view can contain nested functions,
-- the Parse_Connections has to go recursively in them
-- to find all connection that are bound to a bus
Rec_Parse_Connections (CI, Conns);
end if;
if not Is_Empty (Subcomponents (CI)) then
Node := Parse_Node (CI);
Node := Parse_Node (CI);
Node.Name := US (Get_Name_String (Name (Identifier (Subs))));
Nodes.Insert (Key => To_String (Node.Name),
New_Item => Node);
......
......@@ -26,7 +26,7 @@ FEATURES
Taste::coordinates => "110053 88536";
};
PROPERTIES
Taste::Interface_Coordinates => "123691 102645" APPLIES TO link;
Taste::Interface_Coordinates => "123563 102645" APPLIES TO link;
Deployment::Help => "Write your ASN.1 configuration here";
Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", port 5115}";
Deployment::Config => "/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn";
......@@ -60,7 +60,7 @@ FEATURES
Taste::coordinates => "165431 84480";
};
PROPERTIES
Taste::Interface_Coordinates => "158141 102645" APPLIES TO link;
Taste::Interface_Coordinates => "158013 102645" APPLIES TO link;
Deployment::Help => "Write your ASN.1 configuration here";
Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", port 5116}";
Deployment::Config => "/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn";
......@@ -78,6 +78,7 @@ PUBLIC
WITH interfaceview::IV::Level0_Appear;
WITH interfaceview::IV::Function1_ShouldNotAppear::Nested3_Appear;
WITH interfaceview::IV::Function1_ShouldNotAppear::Nested4_Appear;
WITH ocarina_processors_x86;
WITH deploymentview::DV::Node1;
WITH interfaceview::IV::Function1_ShouldNotAppear::Nested1_Appear;
......@@ -103,6 +104,9 @@ SUBCOMPONENTS
IV_Nested3_Appear : SYSTEM interfaceview::IV::Function1_ShouldNotAppear::Nested3_Appear::Nested3_Appear.others {
Taste::FunctionName => "Nested3_Appear";
};
IV_Nested4_Appear : SYSTEM interfaceview::IV::Function1_ShouldNotAppear::Nested4_Appear::Nested4_Appear.others {
Taste::FunctionName => "Nested4_Appear";
};
first_binary : PROCESS deploymentview::DV::Node1::first_binary.others {
Taste::coordinates => "97495 54172 119317 74971";
TASTE_DV_Properties::CoverageEnabled => TRUE;
......@@ -119,6 +123,7 @@ CONNECTIONS
PROPERTIES
Taste::APLC_Binding => (reference (first_binary)) APPLIES TO IV_Level0_Appear;
Taste::APLC_Binding => (reference (first_binary)) APPLIES TO IV_Nested3_Appear;
Taste::APLC_Binding => (reference (first_binary)) APPLIES TO IV_Nested4_Appear;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO first_binary;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO generic_sockets_ip_pohic;
END Node1.others;
......@@ -175,21 +180,22 @@ SUBCOMPONENTS
Taste::coordinates => "152498 47148 192474 89594";
};
ip_i : BUS ocarina_buses::ip.i {
Taste::coordinates => "118165 102645 173427 113227";
Taste::coordinates => "118037 102645 173299 113227";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
CONNECTIONS
Connection2 : BUS ACCESS ip_i -> Node1.generic_sockets_ip_pohic_ip_i {
Taste::coordinates => "110053 88536 110053 95590 123691 95590 123691 102645";
Taste::coordinates => "110053 88536 110053 95590 123563 95590 123563 102645";
};
Connection1 : BUS ACCESS ip_i -> Node2.generic_sockets_ip_pohic_ip_i {
Taste::coordinates => "165431 84480 158141 84480 158141 102645";
Taste::coordinates => "165431 84480 158013 84480 158013 102645";
};
PROPERTIES
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Function1_ShouldNotAppear.Nested3_Appear_PI_Some_Sporadic_Nested1_Appear_RI_Some_Sporadic;
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Function1_ShouldNotAppear_PI_hello_Level0_Appear_RI_I_say_hello;
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Level0_Appear_PI_final_result_Function1_ShouldNotAppear_RI_my_final_result;
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Y_Hidden_PI_Spo_in_Zshown_Function1_ShouldNotAppear_RI_RI2;
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Level0_Appear_PI_final_result_Y_Hidden_RI_final_result;
Actual_Connection_Binding => (reference (ip_i)) APPLIES TO interfaceview.Function1_ShouldNotAppear.Nested3_Appear_PI_Some_Sporadic_Nested1_Appear_RI_Some_Sporadic;
END deploymentview.others;
PROPERTIES
......
This diff is collapsed.
Supports Markdown
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