Commit 1b541f68 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Verify that all functions are bound to a partition

parent d4baa069
......@@ -7,6 +7,7 @@ with System.Assertions,
Ada.Exceptions,
Ada.Text_IO,
Ada.Directories,
Ada.Strings.Equal_Case_Insensitive,
GNAT.Command_Line,
Errors,
Locations,
......@@ -201,6 +202,7 @@ package body TASTE.AADL_Parser is
| No_RCM_Error
| Deployment_View_Error
| Data_View_Error
| Semantic_Check.Semantic_Error
| Device_Driver_Error =>
Put_Error (Exception_Message (Error));
raise Quit_Taste;
......@@ -225,12 +227,14 @@ package body TASTE.AADL_Parser is
F : Unbounded_String)
return Option_Partition.Option is
use Option_Partition;
function Is_Equal (Left, Right : String) return Boolean
renames Ada.Strings.Equal_Case_Insensitive;
Function_Name : constant String := To_String (F);
begin
for Node of Model.Deployment_View.Nodes loop
for Each of Node.Partitions loop
for Binding of Each.Bound_Functions loop
if Binding = Function_Name then
if Is_Equal (Binding, Function_Name) then
return Just (Each);
end if;
end loop;
......
package TASTE.Parser_Version is
Parser_Release : constant String :=
"5dfb5ca ; Commit Date: Fri Mar 23 12:57:52 2018 ";
"d4baa06 ; Commit Date: Fri Mar 23 15:18:01 2018 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from r2a52334)";
end TASTE.Parser_Version;
\ No newline at end of file
......@@ -9,13 +9,13 @@ use Ada.Strings.Unbounded,
package body TASTE.Semantic_Check is
procedure Check_Model (Model : TASTE_Model) is
use Option_Partition;
Opt_Part : Option_Partition.Option;
begin
if Model.Configuration.Glue then
for Each of Model.Interface_View.Flat_Functions loop
Opt_Part := Model.Find_Binding (Each.Name);
-- Check that each function is placed on a partition
if not Each.Is_Type
and then Model.Find_Binding (Each.Name) = Nothing
then
if not Each.Is_Type and then not Opt_Part.Has_Value then
raise Semantic_Error with
"In the deployment view, the function " & To_String (Each.Name)
& " is not bound to any partition!";
......
......@@ -23,7 +23,6 @@ PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::Worker;
WITH interfaceview::IV::Son;
WITH interfaceview::IV::Daughter;
WITH ocarina_processors_x86;
WITH deploymentview::DV::Node1;
......@@ -39,9 +38,6 @@ SUBCOMPONENTS
IV_Worker : SYSTEM interfaceview::IV::Worker::Worker.others {
Taste::FunctionName => "Worker";
};
IV_Son : SYSTEM interfaceview::IV::Son::Son.others {
Taste::FunctionName => "Son";
};
IV_Daughter : SYSTEM interfaceview::IV::Daughter::Daughter.others {
Taste::FunctionName => "Daughter";
};
......@@ -54,7 +50,6 @@ SUBCOMPONENTS
};
PROPERTIES
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Worker;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Son;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Daughter;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO demo;
END Node1.others;
......
AADL_PARSER=../../aadl_parser
all: test-parse
cd output && make
test-parse: clean
$(AADL_PARSER) --gw \
......@@ -12,6 +11,7 @@ test-parse: clean
-c DeploymentView.aadl \
-d DataView.aadl \
../common/ocarina_components.aadl \
2>&1 | tail -1 | diff expected -
clean:
rm -rf output
......
[ERROR] In the deployment view, the function Son is not bound to any partition!
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