------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2023, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR CNRS 6285, Universite de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in README.md -- -- 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$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- -- Contact : mourad.dridi@univ-brest.fr ------------------------------------------------------------------------------ -- Last update -- $Date : 20/05/2020 $ -- $Author: Mourad Dridi $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Command_Line; use Ada.Command_Line; with AADL_Config; use AADL_Config; with unbounded_strings; use unbounded_strings; with Text_IO; use Text_IO; with Ada.Exceptions; use Ada.Exceptions; with translate; use translate; with processor_set; use processor_set; with text_io; use text_io; with ada.strings.unbounded; use ada.strings.unbounded; with unbounded_strings; use unbounded_strings; with Dependencies ; use Dependencies; with Task_Dependencies; use Task_Dependencies; with Task_Dependencies; use Task_Dependencies.Half_Dep_Set; with sets; with Tasks; use Tasks; with Task_Set; use Task_Set; with Message_Set ; use Message_Set ; with Messages; use Messages ; with Systems; use Systems; with Framework; use Framework; with Call_Framework; use Call_Framework; with Call_Framework_Interface; use Call_Framework_Interface; use Call_Framework_Interface.Framework_Response_Package; use Call_Framework_Interface.Framework_Request_Package; with Call_Scheduling_Framework; use Call_Scheduling_Framework; with Multiprocessor_Services; use Multiprocessor_Services; with Multiprocessor_Services_Interface; use Multiprocessor_Services_Interface; with Multiprocessor_Services_Interface; use Multiprocessor_Services_Interface.Scheduling_Result_Per_Processor_Package; with GNAT.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with Version; use Version; with Parameters; use Parameters; use Parameters.User_Defined_Parameters_Table_Package; with Parameters.extended; use Parameters.extended; with Network_Set; use Network_Set ; with Networks; use Networks; with mesh_analysis; use mesh_analysis; with spacewire_flow_transformation; use spacewire_flow_transformation; with scheduling_simulation_test_hlfet; use scheduling_simulation_test_hlfet; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; procedure main_transfo_spacewire is res : system; dir1 : unbounded_string_list; Sys : system; Response_List : Framework_Response_Table; a_network : spacewire_network_ptr; ------------------------------------- Destination_tasks : Tasks_set ; Source_tasks : Tasks_set ; A_link_mat : links_mat ; SourceTask_position_Table : tab_Position ; DestinationTask_position_Table : tab_Position ; SourceTask_rank_table : processor_ranks ; DestinationTask_rank_table : processor_ranks ; Begin Call_Framework.initialize (False); initialize(res); initialize(sys); Read_From_Xml_File (sys, dir1, "framework_examples/transformation_algo_for_spacewire/input_Model.xmlv3" ); a_network:=Spacewire_Network_ptr(search_network(sys.networks, to_unbounded_string("Spacewire_net"))); display_system ( System2 => Sys ) ; -- afficher les tâches/ les processeurs / les messages ... du système d'entrée ----------------------------------------------- -- Compute the flow Model and used links ----------------------------------------------- compute_source_destination_task ( My_tasks => Sys.Tasks, My_Messages => Sys.messages, My_dep => Sys.dependencies, Destination_tasks => Destination_tasks, Source_tasks => Source_tasks) ; compute_spw_source_destination_task_position ( SourceTask_position_Table => SourceTask_position_Table , DestinationTask_position_Table => DestinationTask_position_Table, SourceTask_rank_table => SourceTask_rank_table , DestinationTask_rank_table => DestinationTask_rank_table , Source_tasks => Source_tasks , Destination_tasks => Destination_tasks, My_messages => Sys.messages, a_Network => a_network) ; --display_source_destination_task ( My_Messages => Sys.messages, -- Destination_tasks => Destination_tasks, -- Source_tasks => Source_tasks, -- SourceTask_position_Table => SourceTask_position_Table , -- DestinationTask_position_Table => DestinationTask_position_Table, -- SourceTask_rank_table => SourceTask_rank_table , -- DestinationTask_rank_table => DestinationTask_rank_table ) ; ------------------------------------- --- generate and display used links for each message : the function F of the flow model ------------------------------------- generate_links_spw ( A_link_mat => A_link_mat, My_messages => Sys.messages, SourceTask_position_Table => SourceTask_position_Table , DestinationTask_position_Table => DestinationTask_position_Table , SourceTask_rank_table => SourceTask_rank_table, a_Network => a_network ) ; display_used_links (My_messages => Sys.messages, A_link_mat => A_link_mat ) ; ------------------------------------- --- transforme the input model into the output model (Modèle d'analyse) --- selon la méthode SpaceWire Communication Model ... ------------------------------------- flow_to_task_spw ( My_processors => Sys.Processors, My_tasks => Sys.Tasks, My_messages => Sys.messages, My_Dependencies => Sys.dependencies, A_link_mat => A_link_mat, Destination_tasks => Destination_tasks, Source_tasks => Source_tasks, a_Network => A_network, result => res ) ; -- the outputfile (Modèle d'analyse) is framework_examples/transformation_algo_for_spacewire/output_Model.xmlv3 --initialize(Sys1); --Read_From_Xml_File (Sys1, dir1, "framework_examples/transformation_algo_for_spacewire/output_Model.xmlv3" ); --display_system ( System2 => Sys1 -- ) ; -- afficher les tâches/ les processeurs / les messages ... du système de sortie --compute_scheduling_of_tasks(200, Sys1,To_Unbounded_String("framework_examples/transformation_algo_for_spw/Scheduling_Result"),true); end main_transfo_spacewire; ---