------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with unbounded_strings; use unbounded_strings; use unbounded_strings.unbounded_string_list_package; with Messages; use Messages; with Message_Set; use Message_Set; use Message_Set.Generic_Message_Set; with Buffers; use Buffers; with Buffer_Set; use Buffer_Set; use Buffer_Set.Generic_Buffer_Set; with Tasks; use Tasks; with Task_Groups; use Task_Groups; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Task_Group_Set; use Task_Group_Set; use Task_Group_Set.Generic_Task_Group_Set; with Task_Dependencies; use Task_Dependencies; use Task_Dependencies.Half_Dep_Set; with core_units; use core_units; with Processor_Set; use Processor_Set; with Processors; use Processors; use Processor_Set.Generic_Processor_Set; use Processor_Set.Generic_core_unit_Set; with scheduler_interface; use scheduler_interface; with Caches; use Caches; with Cache_Set; use Cache_Set; with Cache_Block_Set; use Cache_Block_Set; with Cache_Access_Profile_Set; use Cache_Access_Profile_Set; with networks; use networks; with Address_Spaces; use Address_Spaces; with Address_Space_Set; use Address_Space_Set; use Address_Space_Set.Generic_Address_Space_Set; with Resource_Set; use Resource_Set; use Resource_Set.Generic_Resource_Set; with Resources; use Resources; with Network_Set; use Network_Set; use Network_Set.Generic_Network_Set; with Event_Analyzer_Set; use Event_Analyzer_Set; use Event_Analyzer_Set.Generic_Event_Analyzer_Set; with deployment_Set; use deployment_Set; with CFG_Node_Set.Basic_Block_Set; use CFG_Node_Set.Basic_Block_Set; with CFG_Node_Set; use CFG_Node_Set; with CFG_Set; use CFG_Set; with CFG_Edges; use CFG_Edges; with CFG_Edge_Set; use CFG_Edge_Set; with deployments; use deployments; with objects; use objects; package Systems is ------------------------------------------------------------------- -- Top level entity of a Cheddar ADL model ------------------------------------------------------------------- type System is tagged record Tasks : Tasks_Set; Task_Groups : Task_Groups_Set; Resources : Resources_Set; Messages : Messages_Set; Dependencies : Tasks_Dependencies_Ptr; Core_units : core_units_Set; Processors : Processors_Set; Buffers : Buffers_Set; Networks : Networks_Set; Event_Analyzers : Event_Analyzers_Set; Address_Spaces : Address_Spaces_Set; deployments : deployments_Set; Cache_Blocks : Cache_Blocks_Set; Caches : Caches_Set; CFGs : CFGs_Set; CFG_Nodes : CFG_Nodes_Set; CFG_Edges : CFG_Edges_Set; Cache_Access_Profiles : Cache_Access_Profiles_Set; -- TODO: Remove when complete experiment -- N_Preemption : Natural; N_CRPD_Total : Natural; N_Schedulable : Boolean; end record; type System_Ptr is access System; procedure Initialize (A_System : in out System); procedure Initialize (A_System : in System_Ptr); procedure Duplicate (Src : in System; Dest : in out System); ------------------------------------------------------------------- -- When a Cheddar ADL entity 'foo' has to be deleted, it may imply to remove -- many other entities that make reference to 'foo' before -- -- The subprograms bellow check if some entities that make reference -- a entity that user wants to delete. -- Those subprograms are calling one or several subprograms from -- the sets that actually store referencing entities -- If the entiti is referenced, they raise an exception to forbid entity removing -- -- When 'foo' has to be removed, the following entities must be checked : -- If 'foo' is a core : check 'foo' in not referenced in processor. -- If 'foo' is a processor : check 'foo' in not referenced in task, buffer, task_group, resource, -- address space, dependencies -- If 'foo' is a task : check 'foo' in not referenced in buffer, task_group, resources, dependencies -- If 'foo' is a dependency : check 'foo' in not referenced in buffer, resources -- If 'foo' is a network : check 'foo' in not referenced in processor -- If 'foo' is a cache : check 'foo' in not referenced in processor, core -- If 'foo' is a address space : check 'foo' in not referenced in task, buffer, resource, task_group -- If 'foo' is a message : check 'foo' in not referenced in dependencies -- If 'foo' is a buffer : check 'foo' in not referenced in dependencies -- If 'foo' is a task group : nothing to check -- -- ------------------------------------------------------------------- procedure Check_Entity_Referencing_a_core_unit (A_Sys : in System; A_core_unit : Core_Unit_Ptr); procedure Check_Entity_Referencing_a_processor (A_Sys : in System; A_Processor : Generic_Processor_Ptr); procedure Check_Entity_Referencing_a_buffer (A_Sys : in System; A_Buffer : Buffer_Ptr); procedure Check_Entity_Referencing_a_resource (A_Sys : in System; A_resource : generic_resource_Ptr); procedure Check_Entity_Referencing_a_message (A_Sys : in System; A_Message : Generic_Message_Ptr); procedure Check_Entity_Referencing_a_task (A_Sys : in System; A_Task : Generic_Task_Ptr); procedure Check_Entity_Referencing_a_task_group (A_Sys : in System; A_Task_Group : Generic_Task_Group_Ptr); procedure Check_Entity_Referencing_an_Address_Space (A_Sys : in System; An_Address_Space : Address_Space_Ptr); procedure Check_Entity_Referencing_a_cache (A_Sys : in System; A_Cache : Generic_Cache_Ptr); procedure Check_Entity_Referencing_a_network (A_Sys : in System; A_network : generic_network_Ptr); procedure Check_Entity_Referencing_a_deployment(A_Sys : in System; A_deployment : generic_deployment_ptr); procedure Delete_Task (A_Sys : in out System; A_Task : Generic_Task_Ptr) ; procedure Delete_Task_Group (A_Sys : in out System; A_Task_Group : Generic_Task_Group_Ptr; Delete_All_Entities : Boolean := true); ------------------------------------------------------------------- -- Run Integrity checks between entities of a system -- The subprograms bellow implement verification between several -- component of several types ------------------------------------------------------------------- Invalid_Parameter : exception; ---------------------------------------------------------- -- Integrity checks related to location of entities -- we check that both processor and address space location -- are consistent -- This verification must be performed for both task, resource and buffer ---------------------------------------------------------- procedure Check_entity_location (A_Sys : in System; a_entity_name : unbounded_string; a_processor_name : unbounded_string; a_addr_name : unbounded_string); ------------------------------------------------------------------- -- Integrity checks related to hierarchichal scheduling policy -- we check that an address space scheduler with a hierarchical scheduling -- policy is allowed ------------------------------------------------------------------- procedure Check_hierarchical_schedulers (A_Sys : in System; a_addr_name : unbounded_string; a_processor_name : unbounded_string; a_scheduler_type : schedulers_type); ---------------------------------------------------------- -- Integrity checks related to resource and tasks -- about critical sections ---------------------------------------------------------- procedure Check_Task_Critical_Sections (My_Tasks : in Tasks_Set; Resource_Name : in Unbounded_String; Resource_Cpu_Name : in Unbounded_String; critical_sections : in Resource_Accesses_Table); procedure Check_Task_Critical_Sections (A_sys : in system; task_name : in Unbounded_String; task_capacity : in integer; task_cpu_name : in Unbounded_String); ---------------------------------------------------------- -- Integrity checks related to buffer and tasks -- about buffer roles ---------------------------------------------------------- procedure Check_Task_buffer_roles (My_Tasks : in Tasks_Set; Buffer_Name : in Unbounded_String; roles : in Buffer_Roles_Table); procedure Check_Task_buffer_roles (A_sys : in system; task_name : in Unbounded_String; task_capacity : in integer); ------------------------------------------------------------------- -- Search an object in any of the set of an architecture model ------------------------------------------------------------------- function search_by_name(a_system : in system; name : in unbounded_string) return Generic_Object_Ptr; ------------------------------------------------------------------- -- Sub program to sort any kind of data managed by schedulers ------------------------------------------------------------------- Current_Processor_Name : Unbounded_String; function Select_Cpu (Op1 : in Generic_Task_Ptr) return Boolean; function Select_Cpu (Op1 : in Generic_Resource_Ptr) return Boolean; function Select_Cpu (Op1 : in Buffer_Ptr) return Boolean; ------------------------------------------------------------------- -- Export to XML a system ------------------------------------------------------------------- function XML_String (obj : in System; level : in Natural := 0) return Unbounded_String; function XML_String (obj : in System_Ptr; level : in Natural := 0) return Unbounded_String; ------------------------------------------------------------------- -- Display a system to the screen in different languages ------------------------------------------------------------------- procedure Put_Xml (A_System : in System); procedure Put_Aadl (A_System : in System); procedure Put (A_System : in System_Ptr); ------------------------------------------------------------------- -- I/O sub-programs : read/write a system in different languages ------------------------------------------------------------------- procedure Read_From_Aadl_File (A_System : in out System; Dir_List : in unbounded_string_list; Project_File_List : in unbounded_string_list); procedure Read_From_Xml_File (A_System : in out System; Dir_List : in unbounded_string_list; File_Name : in Unbounded_String); procedure Read_From_Xml_File (A_System : in out System; Dir_List : in unbounded_string_list; File_Name : in String); procedure Read_From_v2_Xml_File (A_System : in out System; Dir_List : in unbounded_string_list; File_Name : in Unbounded_String); procedure Read_From_v2_Xml_File (A_System : in out System; Dir_List : in unbounded_string_list; File_Name : in String); procedure Write_To_Xml_File (A_System : in System; File_Name : in Unbounded_String); procedure Write_To_Xml_File (A_System : in System; File_Name : in String); procedure Write_To_Aadl_File (A_System : in System; File_Name : in Unbounded_String); procedure Write_Aadl_Standard_Properties_Set_To_File (A_System : in System); procedure Write_Cheddar_Property_Sets_To_File (A_System : in System); function Export_Aadl_Project_Properties (A_System : in System) return Unbounded_String; function Export_Aadl_Cheddar_Properties (A_System : in System) return Unbounded_String; function Export_Aadl_User_Defined_Cheddar_Properties (A_System : in System) return Unbounded_String; function Export_Aadl_Standard_Properties (A_System : in System) return Unbounded_String; function Export_Aadl_Implementations (A_System : in System) return Unbounded_String; function Export_Aadl_Declarations (A_System : in System; Number_Of_Ht : in Natural) return Unbounded_String; end Systems;