------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Cheddar is a GNU GPL real time scheduling analysis tool.
-- This program provides services to automatically check performances
-- of real time architectures.
--
-- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand
--
-- The Cheddar project was started in 2002 by
-- the LISyC Team, University of Western Britanny.
--
-- Since 2008, Ellidiss technologies also contributes to the development of
-- Cheddar and provides industrial support.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
--
-- Contact : cheddar@listes.univ-brest.fr
--
-----------------------------------------------------------------------------
-- Last update :
-- $Rev: 541 $
-- $Date: 2012-10-08 22:23:24 +0200 (Mon, 08 Oct 2012) $
-- $Author: singhoff $
------------------------------------------------------------------------------
------------------------------------------------------------------------------
with Text_IO; use Text_IO;
with Scheduler_Interface; use Scheduler_Interface;
with AADL_Parsers; use AADL_Parsers;
with v2_Xml_Parsers;
with Xml_generic_Parsers;
with Xml_generic_Parsers.architecture;
with Input_Sources.File; use Input_Sources.File;
with Sax.Readers; use Sax.Readers;
with Offsets; use Offsets;
with integer_util; use integer_util;
with Tasks; use Tasks;
use Tasks.Generic_Task_List_Package;
with initialize_framework; use initialize_framework;
package body Systems is
procedure Delete_Task (A_Sys : in out System; A_Task : Generic_Task_Ptr) is
begin
Delete_Task (A_Sys.Resources, A_Task.name);
Delete_Task (A_Sys.Buffers, A_Task.name);
Delete_All_Task_Dependencies (A_Sys.Dependencies, A_Task);
delete (A_Sys.Tasks, A_Task);
end Delete_Task;
procedure Delete_Task_Group (A_Sys : in out System; A_Task_Group : Generic_Task_Group_Ptr; Delete_All_Entities : Boolean := true) is
A_Task : Generic_Task_Ptr;
Searched_Task : Generic_Task_Ptr;
Task_List_Iterator : Generic_Task_Iterator;
begin
if (not is_empty(A_Task_Group.task_list)) then
reset_head_iterator
(A_Task_Group.task_list,
Task_List_Iterator);
loop
current_element
(A_Task_Group.task_list,
A_Task,
Task_List_Iterator);
-- Remove this and replace below parameters with A_Task, when deep_copy is implemented
Searched_Task := Search_Task(A_Sys.Tasks, A_Task.name);
if (Delete_All_Entities) then
delete_task(A_Sys, Searched_Task);
else
delete(A_Sys.Tasks, Searched_Task);
end if;
if is_tail_element
(A_Task_Group.task_list,
Task_List_Iterator)
then
exit;
end if;
next_element
(A_Task_Group.task_list,
Task_List_Iterator);
end loop;
end if;
delete (A_Sys.Task_Groups, A_Task_Group);
end Delete_Task_Group;
procedure Delete_Buffer (A_Sys : in out System; A_Buffer : Buffer_Ptr) is
begin
Delete_All_Task_Dependencies (A_Sys.Dependencies, A_Buffer);
delete (A_Sys.Buffers, A_Buffer);
end Delete_Buffer;
procedure Delete_Message
(A_Sys : in out System;
A_Message : Generic_Message_Ptr)
is
begin
Delete_All_Task_Dependencies (A_Sys.Dependencies, A_Message);
delete (A_Sys.Messages, A_Message);
end Delete_Message;
procedure Delete_Processor
(A_Sys : in out System;
A_Processor : Generic_Processor_Ptr)
is
begin
Delete_Processor_All_Task_Dependencies
(A_Sys.Dependencies,
A_Processor.name);
Delete_Processor (A_Sys.Resources, A_Processor.name);
Delete_Processor (A_Sys.Buffers, A_Processor.name);
Delete_Processor (A_Sys.Tasks, A_Processor.name);
Delete_Processor (A_Sys.Address_Spaces, A_Processor.name);
delete (A_Sys.Processors, A_Processor);
end Delete_Processor;
procedure Delete_core_unit
(A_Sys : in out System;
A_core_unit : Core_Unit_Ptr)
is
begin
delete (A_Sys.Core_units, A_core_unit);
end Delete_core_unit;
procedure Delete_Address_Space
(A_Sys : in out System;
An_Address_Space : Address_Space_Ptr)
is
begin
Delete_Address_Space_All_Task_Dependencies
(A_Sys.Dependencies,
An_Address_Space.name);
Delete_Address_Space (A_Sys.Resources, An_Address_Space.name);
Delete_Address_Space (A_Sys.Buffers, An_Address_Space.name);
Delete_Address_Space (A_Sys.Tasks, An_Address_Space.name);
delete (A_Sys.Address_Spaces, An_Address_Space);
end Delete_Address_Space;
procedure Delete_Cache
(A_Sys : in out System;
A_Cache : Generic_Cache_Ptr)
is
begin
Delete_Cache(A_Sys.Caches,A_Cache.name);
end Delete_Cache;
procedure Duplicate (Src : in System; Dest : in out System) is
begin
duplicate (Src.Tasks, Dest.Tasks);
duplicate (Src.Task_Groups, Dest.Task_Groups);
duplicate (Src.Resources, Dest.Resources);
duplicate (Src.Messages, Dest.Messages);
duplicate (Src.Dependencies, Dest.Dependencies);
duplicate (Src.Core_units, Dest.Core_units);
duplicate (Src.Processors, Dest.Processors);
duplicate (Src.Buffers, Dest.Buffers);
duplicate (Src.Networks, Dest.Networks);
duplicate (Src.Event_Analyzers, Dest.Event_Analyzers);
duplicate (Src.Address_Spaces, Dest.Address_Spaces);
duplicate (Src.deployments, Dest.deployments);
end Duplicate;
function XML_String
(obj : in System;
level : in Natural := 0)
return Unbounded_String
is
result : Unbounded_String := empty_string;
begin
result := result & "" & ASCII.LF;
if not is_empty (obj.Core_units) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Core_units, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Address_Spaces) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Address_Spaces, 2) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Processors) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Processors, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Tasks) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Tasks, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Task_Groups) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Task_Groups, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Resources) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Resources, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Messages) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Messages, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Networks) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Networks, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Buffers) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Buffers, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Event_Analyzers) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & xml_root_string (obj.Event_Analyzers, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if obj.dependencies/=null then
if not is_empty (obj.Dependencies.Depends) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & XML_root_String (obj.Dependencies, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
end if;
if not is_empty (obj.deployments) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & XML_root_String (obj.deployments, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
if not is_empty (obj.Caches) then
result := result & ASCII.HT & "" & ASCII.LF;
result := result & XML_root_String (obj.Caches, 1) & ASCII.LF;
result := result & ASCII.HT & "" & ASCII.LF;
end if;
result := result & "" & ASCII.LF;
return result;
end XML_String;
function XML_String
(obj : in System_Ptr;
level : in Natural := 0)
return Unbounded_String
is
begin
return XML_String (obj.all, level);
end XML_String;
procedure Put_v2_Xml
(A_System : in System;
Graphic_Properties_Flag : Boolean := True)
is
begin
Put (to_string (export_XML (A_System)));
end Put_v2_Xml;
procedure Put_Xml
(A_System : in System)
is
begin
Put (To_String (XML_String (A_System)));
end Put_Xml;
procedure Put_Aadl (A_System : in System) is
begin
New_Line;
-- Export AADL standard properties and Cheddar's properties
--
-- Put_Line(To_String(Export_Aadl_Standard_Properties(A_System)));
-- Put_Line(To_String(Export_Aadl_Project_Properties(A_System)));
-- Put_Line(To_String(Export_Aadl_Cheddar_Properties(A_System)));
-- Export the system itself
--
Put_Line (To_String (Export_Aadl_Implementations (A_System)));
New_Line;
end Put_Aadl;
procedure Put (A_System : in System) is
begin
Put_Line ("***** LIST OF PROCESSORS *****");
put (A_System.Processors);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF TASKS *****");
put (A_System.Tasks);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF TASK GROUPS *****");
put (A_System.Task_Groups);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF RESSOURCES *****");
put (A_System.Resources);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF BUFFERS *****");
put (A_System.Buffers);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF MESSAGES *****");
put (A_System.Messages);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF DEPENCENCIES *****");
Put (A_System.Dependencies);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF NETWORKS *****");
put (A_System.Networks);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF EVENTS ANALYZERS *****");
put (A_System.Event_Analyzers);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF ADDRESS SPACES *****");
put (A_System.Address_Spaces);
New_Line;
New_Line;
New_Line;
Put_Line ("***** LIST OF CACHES *****");
put (A_System.Caches);
New_Line;
New_Line;
New_Line;
end Put;
procedure Put (A_System : in System_Ptr) is
begin
Put (A_System.all);
end Put;
------------------------------------------------
procedure Initialize (A_System : in out System) is
begin
check_initialize;
reset (A_System.Networks);
reset (A_System.Tasks);
reset (A_System.Task_Groups);
reset (A_System.Messages);
reset (A_System.Resources);
if A_System.Dependencies /= null then
Free (A_System.Dependencies);
end if;
A_System.Dependencies := new Tasks_Dependencies;
Reset (A_System.Dependencies);
reset (A_System.Buffers);
reset (A_System.Processors);
reset (A_System.core_units);
reset (A_System.Event_Analyzers);
reset (A_System.Address_Spaces);
reset (A_System.Caches);
reset (A_System.deployments);
end Initialize;
procedure Initialize (A_System : in System_Ptr) is
begin
Initialize (A_System.all);
end Initialize;
procedure Read_From_Xml_File
(A_System : in out System;
Dir_List : in unbounded_string_list;
File_Name : in String)
is
begin
Read_From_Xml_File
(A_System,
Dir_List,
To_Unbounded_String (File_Name));
end Read_From_Xml_File;
procedure Read_From_v2_Xml_File
(A_System : in out System;
Dir_List : in unbounded_string_list;
File_Name : in String)
is
begin
Read_From_v2_Xml_File
(A_System,
Dir_List,
To_Unbounded_String (File_Name));
end Read_From_v2_Xml_File;
procedure Read_From_v2_Xml_File
(A_System : in out System;
Dir_List : in unbounded_string_list;
File_Name : in Unbounded_String)
is
use v2_Xml_Parsers;
Read : File_Input;
My_Reader : v2_xml_parsers.Xml_project_Parser;
Name_Start : Natural;
S : constant String := To_String (File_Name);
begin
-- Base file name should be used as the public Id
--
Name_Start := S'Last;
while Name_Start >= S'First and then S (Name_Start) /= '/' loop
Name_Start := Name_Start - 1;
end loop;
Set_Public_Id (Read, S (Name_Start + 1 .. S'Last));
Set_System_Id (Read, S);
Open (S, Read);
-- xmlns:* attributes will be reported in Start_Element
--
Set_Feature (My_Reader, Namespace_Prefixes_Feature, False);
Set_Feature (My_Reader, Validation_Feature, True);
Parse (My_Reader, Read);
A_System := Get_Parsed_System (My_Reader);
Close (Read);
exception
when XML_Fatal_Error =>
Close (Read);
raise Xml_Read_Error;
end Read_From_v2_Xml_File;
procedure Read_From_Xml_File
(A_System : in out System;
Dir_List : in unbounded_string_list;
File_Name : in Unbounded_String)
is
use Xml_generic_Parsers;
use Xml_generic_Parsers.architecture;
Read : File_Input;
My_Reader : Xml_architecture_Parser;
Name_Start : Natural;
S : constant String := To_String (File_Name);
begin
-- Base file name should be used as the public Id
--
Name_Start := S'Last;
while Name_Start >= S'First and then S (Name_Start) /= '/' loop
Name_Start := Name_Start - 1;
end loop;
Set_Public_Id (Read, S (Name_Start + 1 .. S'Last));
Set_System_Id (Read, S);
Open (S, Read);
-- xmlns:* attributes will be reported in Start_Element
--
Set_Feature (My_Reader, Namespace_Prefixes_Feature, False);
Set_Feature (My_Reader, Validation_Feature, True);
Parse (My_Reader, Read);
A_System := Get_Parsed_System (My_Reader);
Close (Read);
exception
when XML_Fatal_Error =>
Close (Read);
raise Xml_Read_Error;
end Read_From_Xml_File;
procedure Write_To_v2_Xml_File
(A_System : in System;
File_Name : in String;
Graphic_Properties_Flag : Boolean := True)
is
begin
Write_To_v2_Xml_File
(A_System,
To_Unbounded_String (File_Name),
Graphic_Properties_Flag);
end Write_To_v2_Xml_File;
procedure Write_To_Xml_File
(A_System : in System;
File_Name : in String)
is
begin
Write_To_Xml_File
(A_System,
To_Unbounded_String (File_Name));
end Write_To_Xml_File;
procedure Write_To_v2_Xml_File
(A_System : in System;
File_Name : in Unbounded_String;
Graphic_Properties_Flag : Boolean := True)
is
Into : File_Type;
begin
-- Open file and Write DTD/XML Header
--
Create (Into, Mode => Out_File, Name => To_String (File_Name));
Put (Into, To_String (Export_Xml (A_System, Graphic_Properties_Flag)));
Close (Into);
end Write_To_v2_Xml_File;
procedure Write_To_Xml_File
(A_System : in System;
File_Name : in Unbounded_String) is
Into : File_Type;
begin
-- Open file and Write DTD/XML Header
--
Create (Into, Mode => Out_File, Name => To_String (File_Name));
Put_Line (Into, " ");
Put_Line (Into, "");
Put_Line
(Into,
"");
New_Line (Into, 2);
Put (Into, To_String (Xml_string (A_System)));
Close (Into);
end Write_To_Xml_File;
procedure Read_From_Aadl_File
(A_System : in out System;
Dir_List : in unbounded_string_list;
Project_File_List : in unbounded_string_list)
is
My_Reader : AADL_Project_Parser;
begin
Parse (My_Reader, Dir_List, Project_File_List);
A_System := Get_Parsed_System (My_Reader);
end Read_From_Aadl_File;
procedure Write_To_Aadl_File
(A_System : in System;
File_Name : in Unbounded_String)
is
Into : File_Type;
begin
-- Open file and Write aadl specification
--
Create (Into, Mode => Out_File, Name => To_String (File_Name));
New_Line (Into);
-- Export AADL standard customized properties
--
-- Put_Line(Into, To_String(Export_Aadl_Standard_Properties(A_System)));
-- Put_Line(Into, To_String(Export_Aadl_Project_Properties(A_System)));
-- Put_Line(Into, To_String(Export_Aadl_Cheddar_Properties(A_System)));
-- Export the system itself
--
Put_Line (Into, To_String (Export_Aadl_Implementations (A_System)));
New_Line (Into);
Close (Into);
end Write_To_Aadl_File;
procedure Write_Aadl_Standard_Properties_Set_To_File
(A_System : in System)
is
Into : File_Type;
begin
-- Open file and Write aadl specification
--
Create (Into, Mode => Out_File, Name => "AADL_Properties.aadl");
New_Line (Into);
Put_Line
(Into,
To_String (Export_Aadl_Standard_Properties (A_System)));
New_Line (Into);
Close (Into);
end Write_Aadl_Standard_Properties_Set_To_File;
procedure Write_Cheddar_Property_Sets_To_File (A_System : in System) is
Into : File_Type;
begin
-- Open file and Write aadl specification
--
Create (Into, Mode => Out_File, Name => "AADL_Project.aadl");
New_Line (Into);
Put_Line (Into, To_String (Export_Aadl_Project_Properties (A_System)));
New_Line (Into);
Close (Into);
Create (Into, Mode => Out_File, Name => "Cheddar_Properties.aadl");
New_Line (Into);
Put_Line (Into, To_String (Export_Aadl_Cheddar_Properties (A_System)));
New_Line (Into);
Close (Into);
Create
(Into,
Mode => Out_File,
Name => "User_Defined_Cheddar_Properties.aadl");
New_Line (Into);
Put_Line
(Into,
To_String (Export_Aadl_User_Defined_Cheddar_Properties (A_System)));
New_Line (Into);
Close (Into);
end Write_Cheddar_Property_Sets_To_File;
------------------------------------------------
function Export_Aadl_User_Defined_Cheddar_Properties
(A_System : in System)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
Tmp : Unbounded_String := empty_string;
begin
-- Export user's defined properties
--
Tmp := Export_Aadl_User_Defined_Properties (A_System.Tasks);
Tmp := Tmp & Export_Aadl_User_Defined_Properties (A_System.Messages);
Result := Result &
To_Unbounded_String
("property set User_Defined_Cheddar_Properties is") &
unbounded_lf &
unbounded_lf;
if Tmp = empty_string then
Result := Result &
"Dummy_User_Defined_Cheddar_Properties : aadlboolean" &
unbounded_lf &
"applies to (thread, thread group);";
else
Result := Result & Tmp;
end if;
Result := Result &
unbounded_lf &
To_Unbounded_String ("end User_Defined_Cheddar_Properties;") &
unbounded_lf &
unbounded_lf;
return Result;
end Export_Aadl_User_Defined_Cheddar_Properties;
function Export_Aadl_Standard_Properties
(A_System : in System)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
begin
Result := Result &
ASCII.LF &
To_Unbounded_String(
" --****************************************************** ");
Result := Result &
ASCII.LF &
To_Unbounded_String (" -- AADL Standard AADL_V1.0 ");
Result := Result &
ASCII.LF &
To_Unbounded_String (" -- Appendix A (normative) ");
Result := Result &
ASCII.LF &
To_Unbounded_String (" -- Predeclared Property Sets ");
Result := Result & ASCII.LF & To_Unbounded_String (" -- 03Nov04 ");
Result := Result &
ASCII.LF &
To_Unbounded_String
(" -- Update to reflect current standard on 28Mar06 ");
Result := Result &
ASCII.LF &
To_Unbounded_String(
" --****************************************************** ");
Result := Result &
ASCII.LF &
To_Unbounded_String (" property set AADL_Properties is ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Activate_Deadline: Time applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Activate_Execution_Time: Time_Range applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Activate_Entrypoint: aadlstring applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Active_Thread_Handling_Protocol: inherit Supported_Active_Thread_Handling_Protocols => value(Default_Active_Thread_Handling_Protocol) applies to (thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Active_Thread_Queue_Handling_Protocol: inherit enumeration (flush, hold) => flush applies to (thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Actual_Connection_deployment: inherit list of reference (bus, processor, device) applies to (port connections, thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Actual_Latency: Time applies to (flow); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Actual_Memory_deployment: inherit reference (memory) applies to (thread, thread group, process, system, processor, data port, event data port, subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Actual_Processor_deployment: inherit reference (processor) applies to (thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Actual_Subprogram_Call: reference (server subprogram) applies to (subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Actual_Subprogram_Call_deployment: inherit list of reference (bus, processor, memory, device) applies to (subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Actual_Throughput: Data_Volume applies to (flow); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Aggregate_Data_Port: aadlboolean => false applies to (port group); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Access_Protocol: list of enumeration (Memory_Access, Device_Access) applies to (bus); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Connection_deployment: inherit list of reference (bus, processor, device) applies to (port connections, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Connection_deployment_Class: inherit list of classifier (processor, bus, device) applies to (port connections, thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Connection_Protocol: list of enumeration (Data_Connection, Event_Connection, Event_Data_Connection, Data_Access_Connection, Server_Subprogram_Call) applies to (bus, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Dispatch_Protocol: list of Supported_Dispatch_Protocols applies to (processor); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Memory_deployment: inherit list of reference (memory, system, processor) applies to (thread, thread group, process, system, device, data port, event data port, subprogram, processor); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Memory_deployment_Class: inherit list of classifier (memory, system, processor) applies to (thread, thread group, process, system, device, data port, event data port, subprogram, processor); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Allowed_Message_Size: Size_Range applies to (bus); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Period: list of Time_Range applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Processor_deployment: inherit list of reference (processor, system) applies to (thread, thread group, process, system, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Processor_deployment_Class: inherit list of classifier (processor, system) applies to (thread, thread group, process, system, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Subprogram_Call: list of reference (server subprogram) applies to (subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Allowed_Subprogram_Call_deployment: inherit list of reference (bus, processor, device) applies to (subprogram, thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Assign_Time: Time applies to (processor, bus); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Assign_Byte_Time: Time applies to (processor, bus); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Assign_Fixed_Time: Time applies to (processor, bus); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Available_Memory_deployment: inherit list of reference (memory, system) applies to (system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Available_Processor_deployment: inherit list of reference (processor, system) applies to (system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Base_Address: access aadlinteger 0 .. value(Max_Base_Address) applies to (memory); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Client_Subprogram_Execution_Time: Time applies to (subprogram); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Clock_Jitter: Time applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Clock_Period: Time applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Clock_Period_Range: Time_Range applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Compute_Deadline: Time applies to (thread, device, subprogram, event port, event data port); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Compute_Entrypoint: aadlstring applies to (thread, subprogram, event port, event data port); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Compute_Execution_Time: Time_Range applies to (thread, device, subprogram, event port, event data port); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Concurrency_Control_Protocol: Supported_Concurrency_Control_Protocols => NoneSpecified applies to (data); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Connection_Protocol: Supported_Connection_Protocols applies to (connections); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Data_Volume: type aadlinteger 0 bitsps .. value(Max_Aadlinteger) units (bitsps, Bps => bitsps * 8, Kbps => Bps * 1000, Mbps => Kbps * 1000, Gbps => Mbps * 1000 ); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Deactivate_Deadline: Time applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Deactivate_Execution_Time: Time_Range applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Deactivate_Entrypoint: aadlstring applies to (thread); ")
;
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Deadline: inherit Time => value(Period) applies to (thread, thread group, process, system, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Dequeue_Protocol: enumeration (OneItem, AllItems) => OneItem applies to (event port, event data port); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Device_Dispatch_Protocol: Supported_Dispatch_Protocols => Aperiodic applies to (device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Device_Register_Address: aadlinteger applies to (port, port group); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Dispatch_Protocol: Supported_Dispatch_Protocols applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Expected_Latency: Time applies to (flow); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Expected_Throughput: Data_Volume applies to (flow); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Finalize_Deadline: Time applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Finalize_Execution_Time: Time_Range applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Finalize_Entrypoint: aadlstring applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Hardware_Description_Source_Text: inherit list of aadlstring applies to (memory, bus, device, processor, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Hardware_Source_Language: Supported_Hardware_Source_Languages applies to (memory, bus, device, processor, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Initialize_Deadline: Time applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Initialize_Execution_Time: Time_Range applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Initialize_Entrypoint: aadlstring applies to (thread); ")
;
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Latency: Time applies to (flow, connections); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Load_Deadline: Time applies to (process, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Load_Time: Time_Range applies to (process, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Memory_Protocol: enumeration (read_only, write_only, read_write) => read_write applies to (memory); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Not_Collocated: list of reference (data, thread, process, system, connections) applies to (data, thread, process, system, connections); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Overflow_Handling_Protocol: enumeration (DropOldest, DropNewest, Error) => DropOldest applies to (event port, event data port, subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Period: inherit Time applies to (thread, thread group, process, system, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Process_Swap_Execution_Time: Time_Range applies to (processor); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Propagation_Delay: Time_Range applies to (bus); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Provided_Access : access enumeration (read_only, write_only, read_write, by_method) => read_write applies to (data, bus); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Queue_Processing_Protocol: Supported_Queue_Processing_Protocols => FIFO applies to (event port, event data port, subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Queue_Size: aadlinteger 0 .. value(Max_Queue_Size) => 0 applies to (event port, event data port, subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Read_Time: list of Time_Range applies to (memory); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Recover_Deadline: Time applies to (thread, server subprogram); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Recover_Execution_Time: Time_Range applies to (thread, server subprogram); ")
;
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Recover_Entrypoint: aadlstring applies to (thread); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Required_Access : access enumeration (read_only, write_only, read_write, by_method) => read_write applies to (data, bus); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Required_Connection : aadlboolean => true applies to (port); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Runtime_Protection : inherit aadlboolean => true applies to (process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Scheduling_Protocol: list of Supported_Scheduling_Protocols applies to (processor); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Server_Subprogram_Call_deployment: inherit list of reference (thread, processor) applies to (subprogram, thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Size: type aadlinteger 0 B .. value (Max_Memory_Size) units Size_Units; ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String (" Size_Range: type range of Size; ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Code_Size: Size applies to (data, thread, thread group, process, system, subprogram, processor, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Data_Size: Size applies to (data, subprogram, thread, thread group, process, system, processor, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Source_Heap_Size: Size applies to (thread, subprogram); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Language: inherit Supported_Source_Languages applies to (subprogram, data, thread, thread group, process, bus, device, processor, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Name: aadlstring applies to (data, port, subprogram, parameter); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Stack_Size: Size applies to (thread, subprogram, processor, device); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Source_Text: inherit list of aadlstring applies to (data, port, subprogram, thread, thread group, process, system, memory, bus, device, processor, parameter, port group); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Startup_Deadline: inherit Time applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Subprogram_Execution_Time: Time_Range applies to (subprogram); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Supported_Source_Language: list of Supported_Source_Languages applies to (processor, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Synchronized_Component: inherit aadlboolean => true applies to (thread, thread group, process, system); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Thread_Limit: aadlinteger 0 .. value(Max_Thread_Limit) => value(Max_Thread_Limit) applies to (processor); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Thread_Swap_Execution_Time: Time_Range applies to (processor, system); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Throughput: Data_Volume applies to (flow, connections); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Time: type aadlinteger 0 ps .. value(Max_Time) units Time_Units; ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String (" Time_Range: type range of Time; ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Transmission_Time: list of Time_Range applies to (bus); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Type_Source_Name: aadlstring applies to (data, port, subprogram); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Urgency: aadlinteger 0 .. value(Max_Urgency) applies to (port); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Word_Count: aadlinteger 0 .. value(Max_Word_Count) applies to (memory); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Word_Size: Size => 8 bits applies to (memory); ");
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String(
" Word_Space: aadlinteger 1 .. value(Max_Word_Space) => 1 applies to (memory); "
);
Result := Result &
ASCII.LF &
ASCII.HT &
To_Unbounded_String
(" Write_Time: list of Time_Range applies to (memory); ");
Result := Result &
ASCII.LF &
To_Unbounded_String (" end AADL_Properties;");
Result := Result & unbounded_lf & unbounded_lf & unbounded_lf;
return Result;
end Export_Aadl_Standard_Properties;
function Export_Aadl_Project_Properties
(A_System : in System)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
begin
Result := Result &
To_Unbounded_String ("property set AADL_Project is") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Default_Active_Thread_Handling_Protocol : constant Supported_Active_Thread_Handling_Protocols => abort;"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Aadlinteger : constant aadlinteger => 2#1#e32;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Memory_Size : constant aadlinteger Size_Units => 2#1#e32 B;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Queue_Size : constant aadlinteger => 512;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Base_Address : constant aadlinteger => 512;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Max_Urgency : constant aadlinteger => 12;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Time : constant aadlinteger Time_Units => 1000 Hr;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Thread_Limit : constant aadlinteger => 32;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Word_Count : constant aadlinteger => 64000;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Max_Word_Space : constant aadlinteger => 64;") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Active_Thread_Handling_Protocols : type enumeration (abort, complete_one_flush_queue, complete_one_transfer_queue, complete_one_preserve_queue, complete_all);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Connection_Protocols : type enumeration (UDP, TCP);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Dispatch_Protocols : type enumeration (Periodic, Background, Poisson_Process, Sporadic, User_Defined);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Concurrency_Control_Protocols : type enumeration (No_Protocol, Priority_Ceiling_Protocol, Immediate_Priority_Ceiling_Protocol, Priority_Inheritance_Protocol);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Hardware_Source_Languages : type enumeration (VHDL);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Scheduling_Protocols : type enumeration (");
for I in Schedulers_Type'First .. Schedulers_Type'Last loop
Result := Result & To_Unbounded_String (Schedulers_Type'Image (I));
if I /= Schedulers_Type'Last then
Result := Result & To_Unbounded_String (", ");
else
Result := Result & To_Unbounded_String (");") & unbounded_lf;
end if;
end loop;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Queue_Processing_Protocols : type enumeration (FIFO);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Supported_Source_Languages : type enumeration (Ada95, C);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Time_Units : type units (ps, Ns => ps * 1000, Us => Ns * 1000, Ms => Us * 1000, Sec => Ms * 1000, Min => Sec * 60, Hr => Min * 60);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Size_Units : type units (Bits, B => Bits * 8, KB => B * 1000, MB => KB * 1000, GB => MB * 1000);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String ("end AADL_Project;") &
unbounded_lf;
return Result;
end Export_Aadl_Project_Properties;
-- Export cheddar's specific properties
--
function Export_Aadl_Cheddar_Properties
(A_System : in System)
return Unbounded_String
is
Result : Unbounded_String;
begin
Result := Result &
unbounded_lf &
To_Unbounded_String ("property set Cheddar_Properties is") &
unbounded_lf;
-- Thread and thread group properties
--
Result := Result &
To_Unbounded_String
(ASCII.HT & "Dispatch_Seed_is_Predictable : aadlboolean") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Context_Switch_Overhead : inherit Time") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result :=
Result &
ASCII.HT &
To_Unbounded_String(
"Source_Text : inherit list of aadlstring applies to (process, processor, thread, system);"
) &
unbounded_lf &
To_Unbounded_String
(ASCII.HT &
"-- Source_Text specifies the name of .sc files. This property can contains several .sc file names."
&
ASCII.LF &
ASCII.HT &
"-- In this case, the file names are separeted by a comma. " &
ASCII.LF &
ASCII.HT &
"-- The .sc files contain pieces of code which can be interpreted by the " &
ASCII.LF &
ASCII.HT &
"-- scheduling engine of Cheddar. These part of code are part of user-defined schedulers. With such .sc files, "
&
ASCII.LF &
ASCII.HT &
"-- one can design and perform simulations with specific thread dispatching protocols or specific scheduling protocols."
&
ASCII.LF &
ASCII.HT &
"-- " &
ASCII.LF);
Result := Result &
ASCII.HT &
To_Unbounded_String(
"Automaton_Name : inherit list of aadlstring applies to (process, processor, thread);"
) &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Dispatch_Seed_Value : aadlinteger") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Dispatch_Absolute_Time : inherit Time ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String (ASCII.HT & "Criticality : aadlinteger") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"Bound_On_Data_Blocking_Time : inherit Time ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Dispatch_Jitter : inherit Time ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Fixed_Priority : aadlinteger 0..255") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
"POSIX_Scheduling_Policy : enumeration (SCHED_FIFO, SCHED_RR, SCHED_OTHERS)") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
for I in Offsets_Range'Range loop
Result :=
Result &
To_Unbounded_String
(ASCII.HT &
"Dispatch_Offset_Value_" &
To_String (integer_util.format (Integer (I))) &
" : aadlinteger") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
Result :=
Result &
To_Unbounded_String
(ASCII.HT &
"Dispatch_Offset_Time_" &
To_String (integer_util.format (Integer (I))) &
" : inherit Time ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (thread, thread group);") &
unbounded_lf;
end loop;
-- System properties
--
Result := Result &
To_Unbounded_String
(ASCII.HT & "Task_Precedencies : list of aadlstring") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (system);") &
unbounded_lf;
-- Processor properties
--
Result := Result &
unbounded_lf &
To_Unbounded_String
(ASCII.HT & "Scheduler_Quantum : inherit Time ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (processor, process);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Preemptive_Scheduler : aadlboolean") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (processor, process);") &
unbounded_lf &
unbounded_lf;
Result := Result &
unbounded_lf &
To_Unbounded_String
(ASCII.HT &
"Scheduling_Protocol : list of Supported_Scheduling_Protocols ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (processor, process);") &
unbounded_lf;
-- Data properties
--
Result := Result &
unbounded_lf &
To_Unbounded_String
(ASCII.HT & "Data_Concurrency_State : aadlinteger") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (data);") &
unbounded_lf &
unbounded_lf;
-- Process properties
--
Result := Result &
To_Unbounded_String
(ASCII.HT & "Critical_Section : list of aadlstring") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT &
ASCII.HT &
"applies to (process, thread, data);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Source_Global_Heap_Size : Size ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (process);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Source_Global_Stack_Size : Size ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (process);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Source_Global_Text_Size : Size ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (process);") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & "Source_Global_Data_Size : Size ") &
unbounded_lf;
Result := Result &
To_Unbounded_String
(ASCII.HT & ASCII.HT & "applies to (process);") &
unbounded_lf &
unbounded_lf;
Result := Result &
To_Unbounded_String ("end Cheddar_Properties;") &
unbounded_lf &
unbounded_lf;
return Result;
end Export_Aadl_Cheddar_Properties;
function Export_Aadl_Implementations
(A_System : in System)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
Tmp : Unbounded_String := empty_string;
begin
-- Export all sub-components of the system
--
Result := Result & Export_Aadl_Implementations (A_System.Resources);
Result := Result &
Export_Aadl_Implementations
(A_System.Tasks,
A_System.Resources);
Result := Result &
Export_Aadl_Implementations
(A_System.Address_Spaces,
A_System.Tasks,
A_System.Resources);
Result := Result & Export_Aadl_Implementations (A_System.Buffers);
Result := Result & Export_Aadl_Implementations (A_System.Messages);
Result := Result & Export_Aadl_Implementations (A_System.Networks);
Result := Result & Export_Aadl_Implementations (A_System.Processors);
-- Export the system composition
--
Result := Result &
unbounded_lf &
To_Unbounded_String ("system Cheddar") &
unbounded_lf;
Result := Result &
To_Unbounded_String ("end Cheddar;") &
unbounded_lf;
Result := Result & unbounded_lf;
Result := Result &
To_Unbounded_String ("system implementation Cheddar.Impl") &
unbounded_lf;
Result := Result &
To_Unbounded_String (ASCII.HT & "subcomponents") &
unbounded_lf;
-- List all processors, processes and networks
--
Result := Result & Export_Aadl_Declarations (A_System.Networks, 2);
Result := Result & Export_Aadl_Declarations (A_System.Processors, 2);
Result := Result &
Export_Aadl_Declarations (A_System.Address_Spaces, 2);
-- Properties related to the global system : processor and bus
--connections, event
-- analyzers, task precedencies
--
Tmp := Export_Aadl_Properties (A_System.Address_Spaces, 2);
Tmp := Tmp & Export_Aadl_Properties (A_System.Event_Analyzers, 2);
Tmp := Tmp & Export_Aadl_Properties (A_System.Dependencies, 2);
if Tmp /= empty_string then
Result := Result &
To_Unbounded_String (ASCII.HT & "properties") &
unbounded_lf &
Tmp;
end if;
Result := Result &
To_Unbounded_String ("end Cheddar.Impl;") &
unbounded_lf &
unbounded_lf;
return Result;
end Export_Aadl_Implementations;
function Export_Aadl_Declarations
(A_System : in System;
Number_Of_Ht : in Natural)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
begin
return Result;
end Export_Aadl_Declarations;
function Export_Xml
(A_System : in System;
Graphic_Properties_Flag : Boolean := True)
return Unbounded_String
is
Result : Unbounded_String := empty_string;
begin
Result := Result & To_Unbounded_String ("") & unbounded_lf;
-- Call each export part of the system
--
Result := Result & Export_Xml (A_System.Processors);
Result := Result & Export_Xml (A_System.Address_Spaces);
Result := Result &
Export_Xml (A_System.Tasks, Graphic_Properties_Flag);
Result := Result & Export_Xml (A_System.Task_Groups);
Result := Result & Export_Xml (A_System.Networks);
Result := Result &
Export_Xml (A_System.Buffers, Graphic_Properties_Flag);
Result := Result &
Export_Xml (A_System.Messages, Graphic_Properties_Flag);
Result := Result & Export_Xml (A_System.Resources);
Result := Result & Export_Xml (A_System.Dependencies);
Result := Result & Export_Xml (A_System.Event_Analyzers);
Result := Result &
To_Unbounded_String ("") &
unbounded_lf &
unbounded_lf;
Result := Result & unbounded_lf & unbounded_lf;
return Result;
end Export_Xml;
end Systems;