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

Detect binding errors with nested systems

parent e3bbcf15
......@@ -5,6 +5,7 @@
with Ada.Exceptions,
GNAT.OS_Lib,
GNAT.Traceback.Symbolic,
TASTE,
TASTE.AADL_Parser,
TASTE.Parser_Utils,
......@@ -44,6 +45,10 @@ exception
when TASTE.Quit_TASTE =>
GNAT.OS_Lib.OS_Exit (1);
when Error : others =>
Put_Error ("Ending application because of the following error:");
Put_Error (Ada.Exceptions.Exception_Message (Error));
Put_Debug (Ada.Exceptions.Exception_Information (Error));
Put_Debug ("Symbolic Traceback (use gdb for better output): "
& GNAT.Traceback.Symbolic.Symbolic_Traceback (Error));
GNAT.OS_Lib.OS_Exit (1);
end Kazoo;
......@@ -840,6 +840,14 @@ package body TASTE.AADL_Parser is
Timer_Manager.Provided.Insert (Key => Manager_Name,
New_Item => Tick_PI);
for Function_Name : String of Partition.Bound_Functions loop
if not Model.Interface_View.Flat_Functions.Contains
(Function_Name)
then
raise AADL_Parser_Error with
"Function """ & Function_Name
& """ is bound to a partition but is not found "
& "as terminal in the interface view";
end if;
for Timer_Name : String of
Model.Interface_View.Flat_Functions (Function_Name).Timers
loop
......
......@@ -630,6 +630,7 @@ package body TASTE.Concurrency_View is
VP_Classifiers : Vector_Tag;
Block_Names, -- All blocks of a node
Block_Languages,
Block_Is_Passive, -- If the block only has synchronous PIs
Block_Instance_Of : Vector_Tag;
begin
for Partition in CV.Nodes (Node_Name).Partitions.Iterate loop
......@@ -644,6 +645,20 @@ package body TASTE.Concurrency_View is
To_String (B.Ref_Function.Name);
Block_Languages := Block_Languages
& TASTE.Backend.Language_Spelling (B.Ref_Function);
-- Flag blocks that are purely passive (no cyclic,
-- no sporadics, no timers). Useful for some backends.
declare
Is_Passive : Boolean := True;
begin
for PI of B.Ref_Function.Provided loop
if PI.RCM = Sporadic_Operation
or PI.RCM = Cyclic_Operation
then
Is_Passive := False;
end if;
end loop;
Block_Is_Passive := Block_Is_Passive & Is_Passive;
end;
Block_Instance_Of := Block_Instance_Of
& B.Ref_Function.Instance_Of.Value_Or (US (""));
end loop;
......@@ -670,6 +685,7 @@ package body TASTE.Concurrency_View is
& Assoc ("Node_Name", Node_Name)
& Assoc ("Block_Names", Block_Names)
& Assoc ("Block_Languages", Block_Languages)
& Assoc ("Block_Is_Passive", Block_Is_Passive)
& Assoc ("Block_Instance_Of", Block_Instance_Of)
& Assoc ("CPU_Name",
CV.Nodes (Node_Name).Deployment_Node.CPU_Name)
......
......@@ -215,9 +215,9 @@ package body TASTE.Deployment_View is
-- 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));
-- 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)),
......@@ -233,7 +233,7 @@ package body TASTE.Deployment_View is
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));
-- 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;
......
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