Commit a0595e2b authored by julien.delange's avatar julien.delange
Browse files

Ocarina scenario files can now specify to use gprof




git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1405 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent f405b074
...@@ -15,6 +15,13 @@ property set Ocarina_Config is ...@@ -15,6 +15,13 @@ property set Ocarina_Config is
Generator : Ocarina_Config::Generator_Type applies to (system); Generator : Ocarina_Config::Generator_Type applies to (system);
-- The code generator that will be used for the current application -- The code generator that will be used for the current application
Generator_Options_Type : type enumeration
(gprof,
ASN1);
Generator_Options : list of Ocarina_Config::Generator_Options_Type applies to (system);
-- Code generation options.
AADL_Files : list of aadlstring applies to (system); AADL_Files : list of aadlstring applies to (system);
-- List of the AADL source files used by the current application -- List of the AADL source files used by the current application
......
...@@ -429,6 +429,15 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -429,6 +429,15 @@ package body Ocarina.Backends.PO_HI_C is
return Generate_ASN1_Deployment; return Generate_ASN1_Deployment;
end Use_ASN1_Deployment; end Use_ASN1_Deployment;
-------------------------------
-- Set_Performance_Analysis --
-------------------------------
procedure Set_Performance_Analysis (Use_It : Boolean) is
begin
Add_Performance_Analysis := Use_It;
end Set_Performance_Analysis;
--------------------------------- ---------------------------------
-- Visit_Architecture_Instance -- -- Visit_Architecture_Instance --
--------------------------------- ---------------------------------
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2008, GET-Telecom Paris. -- -- Copyright (C) 2008-2010, European Space Agency (ESA). --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify -- -- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the -- -- it under terms of the GNU General Public License as published by the --
...@@ -52,6 +52,10 @@ package Ocarina.Backends.PO_HI_C is ...@@ -52,6 +52,10 @@ package Ocarina.Backends.PO_HI_C is
function Use_Performance_Analysis return Boolean; function Use_Performance_Analysis return Boolean;
-- Specify if we use performance analysis or not. -- Specify if we use performance analysis or not.
procedure Set_Performance_Analysis (Use_It : Boolean);
-- Indicate to the generator if we use performance
-- analysis or not.
function Use_ASN1_Deployment return Boolean; function Use_ASN1_Deployment return Boolean;
-- Just returns a boolean to indicate if the user -- Just returns a boolean to indicate if the user
-- wants the ASN1 deployment information. -- wants the ASN1 deployment information.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2009, GET-Telecom Paris. -- -- Copyright (C) 2004-2010, European Space Agency (ESA). --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify -- -- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the -- -- it under terms of the GNU General Public License as published by the --
...@@ -55,6 +55,7 @@ with Ocarina; use Ocarina; ...@@ -55,6 +55,7 @@ with Ocarina; use Ocarina;
with Ocarina.AADL_Values; use Ocarina.AADL_Values; with Ocarina.AADL_Values; use Ocarina.AADL_Values;
with Ocarina.Analyzer; use Ocarina.Analyzer; with Ocarina.Analyzer; use Ocarina.Analyzer;
with Ocarina.Backends; use Ocarina.Backends; with Ocarina.Backends; use Ocarina.Backends;
with Ocarina.Backends.PO_HI_C;
with Ocarina.Backends.Execution_Tests; with Ocarina.Backends.Execution_Tests;
use Ocarina.Backends.Execution_Tests; use Ocarina.Backends.Execution_Tests;
with Ocarina.Configuration; use Ocarina.Configuration; with Ocarina.Configuration; use Ocarina.Configuration;
...@@ -632,14 +633,15 @@ procedure Ocarina_Cmd is ...@@ -632,14 +633,15 @@ procedure Ocarina_Cmd is
-- "rma.aadl" and "software_ada.aadl". -- "rma.aadl" and "software_ada.aadl".
procedure Parse_Scenario_Files is procedure Parse_Scenario_Files is
AADL_Root : Node_Id := No_Node; AADL_Root : Node_Id := No_Node;
Instance_Root : Node_Id := No_Node; Instance_Root : Node_Id := No_Node;
Root_System : Node_Id := No_Node; Root_System : Node_Id := No_Node;
Source_Files : List_Id; Source_Files : List_Id;
Ref_Files : List_Id; Ref_Files : List_Id;
Needed_PS : List_Id; Needed_PS : List_Id;
Dirname : Name_Id; Used_Generator_Options : List_Id;
Success : Boolean := False; Dirname : Name_Id;
Success : Boolean := False;
The_Backend : Name_Id := No_Name; The_Backend : Name_Id := No_Name;
-- The current code generator -- The current code generator
...@@ -662,6 +664,8 @@ procedure Ocarina_Cmd is ...@@ -662,6 +664,8 @@ procedure Ocarina_Cmd is
:= Get_String_Name (Ocarina_Config & "::referencial_files"); := Get_String_Name (Ocarina_Config & "::referencial_files");
The_Generator : constant Name_Id The_Generator : constant Name_Id
:= Get_String_Name (Ocarina_Config & "::generator"); := Get_String_Name (Ocarina_Config & "::generator");
Generator_Options : constant Name_Id
:= Get_String_Name (Ocarina_Config & "::generator_options");
Predefined_PS : constant Name_Id Predefined_PS : constant Name_Id
:= Get_String_Name := Get_String_Name
(Ocarina_Config & "::needed_property_sets"); (Ocarina_Config & "::needed_property_sets");
...@@ -783,6 +787,7 @@ procedure Ocarina_Cmd is ...@@ -783,6 +787,7 @@ procedure Ocarina_Cmd is
package OIQ renames Ocarina.Instances.Queries; package OIQ renames Ocarina.Instances.Queries;
F : Types.Int; F : Types.Int;
N : Node_Id;
begin begin
Current_Scenario_Dirname := No_Name; Current_Scenario_Dirname := No_Name;
...@@ -881,6 +886,40 @@ procedure Ocarina_Cmd is ...@@ -881,6 +886,40 @@ procedure Ocarina_Cmd is
Needed_PS := No_List; Needed_PS := No_List;
end if; end if;
-- Extract the generator options.
if Is_Defined_List_Property (Root_System, Generator_Options) then
Used_Generator_Options
:= Get_List_Property (Root_System, Generator_Options);
else
Used_Generator_Options := No_List;
end if;
-- Process options.
if not Is_Empty (Used_Generator_Options) then
N := First_Node (Used_Generator_Options);
while Present (N) loop
declare
P : Name_Id;
Option : constant String
:= Image (Value (N), Quoted => False);
begin
Set_Str_To_Name_Buffer (Option);
P := Name_Find;
if P = Get_String_Name ("gprof") then
Ocarina.Backends.PO_HI_C.Set_Performance_Analysis (True);
end if;
N := Next_Node (N);
end;
end loop;
end if;
-- Extract the AADL version -- Extract the AADL version
if Is_Defined_Enumeration_Property (Root_System, AADL_Version) then if Is_Defined_Enumeration_Property (Root_System, AADL_Version) then
......
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