Commit b1028bf4 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Merge remote-tracking branch 'origin/master' into CoRA-Zynq

parents eaad01e9 ea194629
Pipeline #1597 failed with stage
in 8 minutes and 26 seconds
# image: $CI_REGISTRY_IMAGE/taste:latest
image: taste:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
- post_build
build:
stage: build
script:
# As soon as TASTE moves from .bashrc.taste to .profile.taste this can be simplified
- echo -e "(source ~/.bashrc ; export TASTE_IN_DOCKER=1 ; make install ; make test )" > docker_workaround.sh
- chmod +x docker_workaround.sh
- ./docker_workaround.sh
artifacts:
paths:
- 'test/logs/*.err.txt'
when: on_failure
expire_in: 2 weeks
templates/build-script.tmplt
templates/skeletons/makefile.tmplt
templates/skeletons/context-parameters.tmplt
templates/skeletons/sub/trigger.tmplt
......@@ -6,13 +5,8 @@ templates/skeletons/sub/makefile-filename.tmplt
templates/skeletons/sub/function-filename.tmplt
templates/skeletons/sub/interface.tmplt
templates/skeletons/sub/makefile.tmplt
templates/skeletons/sub/function.tmplt
templates/concurrency_view/sub/filenode.tmplt
templates/concurrency_view/sub/trigger.tmplt
templates/concurrency_view/sub/filepart.tmplt
templates/concurrency_view/sub/thread.tmplt
templates/concurrency_view/sub/filethread.tmplt
templates/concurrency_view/sub/fileblock.tmplt
templates/concurrency_view/sub/pi.tmplt
templates/concurrency_view/sub/ri.tmplt
templates/concurrency_view/sub/block.tmplt
......
This diff is collapsed.
......@@ -91,7 +91,7 @@ This template is identical for Skeleton and Glue subfolders.
|Optional path to zip file
|-
|Use_POHIC
|Command line configuration
|Value of command line flag --polyorb-hi-c (or -p)
|-
|List_Of_PIs
|DOCUMENTATION MISSING
......@@ -121,7 +121,7 @@ This template is identical for Skeleton and Glue subfolders.
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|Interface view filename
|-
|ASync_PI_Param_Type
|DOCUMENTATION MISSING
......@@ -181,13 +181,13 @@ This template is identical for Skeleton and Glue subfolders.
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|Value of command line flag --check-dataview
|-
|CP_Types
|DOCUMENTATION MISSING
|-
|Other_Files
|DOCUMENTATION MISSING
|List of AADL files passed to the command line
|-
|Sync_RIs_Parent
|DOCUMENTATION MISSING
......@@ -196,7 +196,10 @@ This template is identical for Skeleton and Glue subfolders.
|DOCUMENTATION MISSING
|-
|Data_View
|DOCUMENTATION MISSING
|Data view filename
|-
|Target
|Value of command line flag --target=Target
|}
=== templates/skeletons/sub/makefile-filename.tmplt ===
This file is optional, if exists the result of parsing of this file is a name of output file for makefile.tmplt, otherwise this template will not be processed.
......@@ -284,6 +287,9 @@ This file is processed twice, first time for required interfaces of the function
|-
|Remote_Function_Names
|DOCUMENTATION MISSING
|-
|Param_Basic_Types
|DOCUMENTATION MISSING
|}
=== templates/skeletons/sub/makefile.tmplt ===
This template is processed when makefile-filename.tmplt exists.
......@@ -306,6 +312,9 @@ The output of this template is saved to the file with name returned by processin
|-
|Instance_Of
|Name of function type if instance
|-
|Has_CP
|True if context parameters are defined for this function
|}
=== templates/concurrency_view/sub/trigger.tmplt ===
This file is processed for every node. The result of this file indicates if the rest of templates for given node will be processed.
......@@ -323,36 +332,51 @@ This file is processed for every node. The result of this file indicates if the
|from kazoo configuration
|-
|No_Stdlib_Flag
|DOCUMENTATION MISSING
|Command line-flag --no-stdlib to avoid loading ocarina_components.aadl
|-
|Timer_Resolution
|DOCUMENTATION MISSING
|Value of command line --timer
|-
|Output_Dir
|DOCUMENTATION MISSING
|Value or command line -o to set the output folder
|-
|Interface_View
|DOCUMENTATION MISSING
|Interface view filename
|-
|Binary_Path
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|Value of command line flag --check-dataview
|-
|Debug_Flag
|DOCUMENTATION MISSING
|Value of command line flag --debug (or -g)
|-
|Use_POHIC
|DOCUMENTATION MISSING
|Value of command line flag --polyorb-hi-c (or -p)
|-
|Other_Files
|DOCUMENTATION MISSING
|List of AADL files passed to the command line
|-
|Deployment_View
|DOCUMENTATION MISSING
|Deployment view filename
|-
|Data_View
|Data view filename
|-
|CPU_Family
|CPU Kind (e.g. leon3)
|-
|CPU_Platform
|AADL CPU_Platform (e.g. PLATFORM_NATIVE)
|-
|CPU_Name
|CPU AADL Identifier (e.g. x86_inst)
|-
|Target
|Value of command line flag --target=Target
|-
|CPU_Classifier
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/thread.tmplt ===
......@@ -440,7 +464,7 @@ This file is processed for every thread in every partition in every node.
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|Interface view filename
|-
|IF_Property_Values
|DOCUMENTATION MISSING
......@@ -479,15 +503,30 @@ This file is processed for every thread in every partition in every node.
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|Value of command line flag --check-dataview
|-
|Use_POHIC
|DOCUMENTATION MISSING
|Value of command line flag --polyorb-hi-c (or -p)
|-
|Other_Files
|DOCUMENTATION MISSING
|List of AADL files passed to the command line
|-
|Data_View
|Data view filename
|-
|Param_Basic_Types
|DOCUMENTATION MISSING
|-
|Target
|Value of command line flag --target=Target
|-
|Priority
|DOCUMENTATION MISSING
|-
|Dispatch_Offset_ms
|DOCUMENTATION MISSING
|-
|Stack_Size_In_Bytes
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/pi.tmplt ===
......@@ -562,6 +601,9 @@ The result of every evaluation is joined to one string and passed as a parameter
|-
|Remote_Function_Names
|DOCUMENTATION MISSING
|-
|Param_Basic_Types
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/ri.tmplt ===
The template ri.tmplt is evaluated many times for every required interface.
......@@ -629,6 +671,9 @@ The result of every evaluation is koined to one string and passed as a parameter
|-
|Remote_Function_Names
|DOCUMENTATION MISSING
|-
|Param_Basic_Types
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/block.tmplt ===
This template is evaluated for every block.
......@@ -682,7 +727,7 @@ This template is evaluated for every block.
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|Interface view filename
|-
|ASync_PI_Param_Type
|DOCUMENTATION MISSING
......@@ -754,16 +799,16 @@ This template is evaluated for every block.
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|Value of command line flag --check-dataview
|-
|Use_POHIC
|DOCUMENTATION MISSING
|Value of command line flag --polyorb-hi-c (or -p)
|-
|CP_Types
|DOCUMENTATION MISSING
|-
|Other_Files
|DOCUMENTATION MISSING
|List of AADL files passed to the command line
|-
|Sync_RIs_Parent
|DOCUMENTATION MISSING
......@@ -775,12 +820,15 @@ This template is evaluated for every block.
|DOCUMENTATION MISSING
|-
|Data_View
|DOCUMENTATION MISSING
|Data view filename
|-
|Target
|Value of command line flag --target=Target
|}
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,
No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
=== templates/concurrency_view/sub/partition.tmplt ===
......@@ -893,6 +941,60 @@ This file is evaluated for every partition.
|-
|VP_Duration
|DOCUMENTATION MISSING
|-
|Device_CPU
|DOCUMENTATION MISSING
|-
|Device_Bus_Name
|DOCUMENTATION MISSING
|-
|Device_Init
|DOCUMENTATION MISSING
|-
|Device_AADL_Pkg
|DOCUMENTATION MISSING
|-
|Device_ASN1_Module
|DOCUMENTATION MISSING
|-
|Device_Port_Name
|DOCUMENTATION MISSING
|-
|Device_Config
|DOCUMENTATION MISSING
|-
|Device_Names
|DOCUMENTATION MISSING
|-
|Device_ASN1_File
|DOCUMENTATION MISSING
|-
|Device_Classifier
|DOCUMENTATION MISSING
|-
|Device_Language
|DOCUMENTATION MISSING
|-
|Device_ASN1_Sort
|DOCUMENTATION MISSING
|-
|Out_Port_Remote_Function
|DOCUMENTATION MISSING
|-
|In_Port_Queue_Size
|DOCUMENTATION MISSING
|-
|Block_FPGAConf
|DOCUMENTATION MISSING
|-
|Out_Port_Remote_Port_Name
|DOCUMENTATION MISSING
|-
|Out_Port_Remote_Partition
|DOCUMENTATION MISSING
|-
|Out_Port_Queue_Size
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/node.tmplt ===
This file is evaluated for every node. The result of this file is saved to the file with name returned by filenode.tmplt. The result is also used as a parameter for system.tmplt.
......@@ -944,6 +1046,42 @@ This file is evaluated for every node. The result of this file is saved to the f
|-
|CPU_Instance
|DOCUMENTATION MISSING
|-
|Device_CPU
|DOCUMENTATION MISSING
|-
|Device_Bus_Name
|DOCUMENTATION MISSING
|-
|Device_AADL_Pkg
|DOCUMENTATION MISSING
|-
|Device_ASN1_Module
|DOCUMENTATION MISSING
|-
|Device_Port_Name
|DOCUMENTATION MISSING
|-
|Device_Config
|DOCUMENTATION MISSING
|-
|Device_Names
|DOCUMENTATION MISSING
|-
|Device_ASN1_File
|DOCUMENTATION MISSING
|-
|Device_Classifier
|DOCUMENTATION MISSING
|-
|Device_Language
|DOCUMENTATION MISSING
|-
|Device_ASN1_Sort
|DOCUMENTATION MISSING
|-
|Device_Init
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/system.tmplt ===
This file is evaluated for every node. The result of this file is save to the file with name returned by
......@@ -1072,7 +1210,7 @@ filesys.tmplt.
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|Interface view filename
|-
|Binary_Path
|DOCUMENTATION MISSING
......@@ -1099,18 +1237,23 @@ filesys.tmplt.
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|Value of command line flag --check-dataview
|-
|Use_POHIC
|DOCUMENTATION MISSING
|Value of command line flag --polyorb-hi-c (or -p)
|-
|Other_Files
|DOCUMENTATION MISSING
|List of AADL files passed to the command line
|-
|Data_View
|Data view filename
|-
|Target
|Value of command line flag --target=Target
|-
|Device_Language
|DOCUMENTATION MISSING
|}
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,
No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
|-
|Device_Init
|DOCUMENTATION MISSING
|}
\ No newline at end of file
......@@ -15,12 +15,12 @@ begin
if Model.Configuration.Debug_Flag then
TASTE.Dump.Dump_Input_Model (Model);
Model.Dump;
end if;
if Model.Configuration.Glue then
Model.Preprocessing;
Model.Add_Concurrency_View;
Model.Add_CV_Properties;
Model.Concurrency_View.Generate_CV;
end if;
......
......@@ -13,6 +13,7 @@ with System.Assertions,
GNAT.Command_Line,
Errors,
Locations,
Ocarina.AADL_Values,
Ocarina.Namet,
Ocarina.Configuration,
Ocarina.Files,
......@@ -32,6 +33,13 @@ use Ada.Text_IO,
Ocarina.Namet,
Ocarina;
-- for the parsing of ConcurrencyView_Properties.aadl:
-- with ocarina.BE_AADL; use ocarina.BE_AADL;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Tree.Nutils;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.ME_AADL.AADL_Tree.Nutils;
package body TASTE.AADL_Parser is
function Initialize return Taste_Configuration is
......@@ -71,12 +79,15 @@ package body TASTE.AADL_Parser is
Interface_Root := Ocarina.Parser.Parse
(AADL_Language, Interface_Root, File_Descr);
-- Parse TASTE_IV_Properties.aadl
Set_Str_To_Name_Buffer ("TASTE_IV_Properties.aadl");
File_Name := Ocarina.Files.Search_File (Name_Find);
File_Descr := Ocarina.Files.Load_File (File_Name);
Interface_Root := Ocarina.Parser.Parse (AADL_Language,
Interface_Root, File_Descr);
-- Parse library of AADL files (TASTE_IV_Properties, etc.)
for Each of Interface_AADL_Lib loop
Set_Str_To_Name_Buffer (Each);
File_Name := Ocarina.Files.Search_File (Name_Find);
File_Descr := Ocarina.Files.Load_File (File_Name);
Interface_Root := Ocarina.Parser.Parse (AADL_Language,
Interface_Root,
File_Descr);
end loop;
if Interface_Root = No_Node then
raise AADL_Parser_Error with "Interface view is incorrect";
......@@ -166,6 +177,23 @@ package body TASTE.AADL_Parser is
Dataview_root := Ocarina.Parser.Parse
(AADL_Language, Dataview_root, File_Descr);
end if;
-- If present, try and parse ConcurrencyView_Properties.aadl
Set_Str_To_Name_Buffer ("ConcurrencyView_Properties.aadl");
File_Name := Ocarina.Files.Search_File (Name_Find);
if File_Name = No_Name then
Put_Debug ("No ConcurrencyView_Properties.aadl file found");
else
Put_Info ("Parsing ConcurrencyView_Properties.aadl");
File_Descr := Ocarina.Files.Load_File (File_Name);
Concurrency_Properties_Root := Ocarina.Parser.Parse
(AADL_Language, Concurrency_Properties_Root, File_Descr);
if Concurrency_Properties_Root = No_Node then
raise AADL_Parser_Error with
"Error parsing ConcurrencyView_Properties.aadl";
end if;
end if;
return Cfg;
end Initialize;
......@@ -185,13 +213,14 @@ package body TASTE.AADL_Parser is
end;
if not Result.Configuration.No_Stdlib then
AADL_Lib.Append ("ocarina_components.aadl");
Deployment_AADL_Lib.Append ("ocarina_components.aadl");
end if;
if Deployment_Root /= No_Node
and not Result.Configuration.Deployment_View.Is_Empty
then
AADL_Lib.Append (Result.Configuration.Interface_View.Element);
Deployment_AADL_Lib.Append
(Result.Configuration.Interface_View.Element);
Result.Deployment_View :=
To_Holder (Parse_Deployment_View
(Deployment_Root, Result.Interface_View));
......@@ -209,14 +238,13 @@ package body TASTE.AADL_Parser is
end if;
Ocarina.Configuration.Reset_Modules;
Ocarina.Reset;
-- Ocarina.Reset; (No: This make the CV_Properties analysis fail)
if Result.Configuration.Check_Data_View then
raise Quit_Taste;
end if;
Semantic_Check.Check_Model (Result);
return Result;
exception
when Error : AADL_Parser_Error
......@@ -487,7 +515,10 @@ package body TASTE.AADL_Parser is
Protected_Block_name => Block.Ref_Function.Name,
Node => Block.Node,
PI => PI,
Output_Ports => Get_Output_Ports (Model, F));
Output_Ports => Get_Output_Ports (Model, F),
Priority => US ("1"),
Dispatch_Offset_Ms => US ("0"),
Stack_Size_In_Bytes => US ("50000"));
begin
CV.Nodes
(Node_Name).Partitions (Partition_Name).Threads.Include
......@@ -556,6 +587,7 @@ package body TASTE.AADL_Parser is
New_Item => (Port_Name => T.Entry_Port_Name,
Thread_Name => T.Name,
Type_Name => Sort,
Queue_Size => US ("1"),
Remote_Partition_Name
=> Part.Unsafe_Just.Name));
end if;
......@@ -599,8 +631,11 @@ package body TASTE.AADL_Parser is
Type_Name => Sort,
Remote_Partition_Name =>
Part.Unsafe_Just.Name,
Remote_Function_Name =>
Remote.Function_Name,
Remote_Port_Name =>
Remote.Interface_Name));
Remote.Interface_Name,
Queue_Size => US ("1")));
else
-- Port already exists: just add this thread
Partition.Out_Ports
......@@ -961,4 +996,246 @@ package body TASTE.AADL_Parser is
Model.Deployment_View.Replace_Element (DV);
end Preprocessing;
procedure Add_CV_Properties (Model : in out TASTE_Model) is
Nodes, -- To iterate on lists of nodes
AADL_Package,
System_Impl : Node_Id := No_Node;
procedure Report_Error is
begin
Put_Info ("No valid user-defined Concurrency View properties found:");
Put_Info ("Task priorities, offset and stack size will use default");
Put_Info ("values. IMPORTANT: you should set them in the editor!");
end Report_Error;
function Port_Str (Comp : String) return String is
-- Return the port name without "inport"/"outport" prefix
-- Note, these prefixes do not exist in the AST, they are added
-- in the concurrency view output template. It is therefore wrong
-- here to assume they are here. this should be refactored
Size : constant Integer := Comp'Length;
begin
if Size >= 8 and then Comp (Comp'First + 6) = '_' then
return Comp (Comp'First + 7 .. Comp'Last);
elsif Size >= 9 and Comp (Comp'First + 7) = '_' then
return Comp (Comp'First + 8 .. Comp'Last);
else
return Comp;
end if;
end Port_Str;
begin
if Concurrency_Properties_Root = No_Node
or else Kind (Concurrency_Properties_Root) /= K_AADL_Specification
or else Is_Empty (Declarations (Concurrency_Properties_Root))
then
Report_Error;
return;
end if;
Put_Info ("Analysing user-defined Concurrency View properties");
Nodes := First_Node (Declarations (Concurrency_Properties_Root));
-- First look for the package declaration
while Present (Nodes) loop
case Kind (Nodes) is
when K_Package_Specification => AADL_Package := Nodes;
when others => null;
end case;
Nodes := Next_Node (Nodes);
end loop;
if AADL_Package = No_Node then
Report_Error;
return;
end if;
-- Then look for the system implementation
Nodes := First_Node (Declarations (AADL_Package));
while Present (Nodes) loop
case Kind (Nodes) is
when K_Component_Implementation => System_Impl := Nodes;
when others => null;
end case;
Nodes := Next_Node (Nodes);
end loop;
if System_Impl = No_Node or else Is_Empty (ATN.Properties (System_Impl))
then
Report_Error;
return;
end if;
Nodes := First_Node (ATN.Properties (System_Impl));
while Present (Nodes) loop -- Iterate over the properties
declare
Prop_Val : Node_Id := Property_Association_Value (Nodes);