------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 97 $ -- $Date: 2007-07-20 15:17:15 +0200 (Fri, 20 Jul 2007) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Text_IO; use Text_IO; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Unbounded_Strings; use Unbounded_Strings; use Unbounded_Strings.Strings_Table_Package; use Unbounded_Strings.Unbounded_String_List_Package; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; 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; 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 Ada.Exceptions; use Ada.Exceptions; with Multiprocessor_Services; use Multiprocessor_Services; with Call_Scheduling_Framework; use Call_Scheduling_Framework; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GNAT.Current_Exception; use GNAT.Current_Exception; with editor_config; use editor_config; procedure parse_Xml_Schedule is -- A set of variables required to call the framework -- Response_List : Framework_Response_Table; Sys : System; Project_File_List : Unbounded_String_List; Project_File_Dir_List : Unbounded_String_List; -- Is the command should run in verbose mode ? -- Verbose : Boolean := False; -- The file containing the event table -- xml_project_File_Name : Unbounded_String; -- The file containg the anayzed system -- xml_event_table_file_name : Unbounded_String; procedure Usage is begin Put_Line( "parse_xml_schedule is a program which read an event table (containing a scheduling computed by cheddar) in order to display it on the screen." ); New_Line; Put_Line( "Check Cheddar home page for details : http://beru.univ-brest.fr/~singhoff/cheddar " ); New_Line; New_Line; Put_Line ("Usage : parse_xml_schedule [switch] "); Put_Line (" switch can be :"); Put_Line (" -u get this help"); Put_Line (" -x XML project file name "); Put_Line (" -s XML file which contains the scheduling to display "); Put_Line (" -v verbose mode "); New_Line; end Usage; begin Copyright ("parse_xml_schedule"); call_framework.initialize(false); -- Get arguments -- loop case GNAT.Command_Line.Getopt ("u v s: x:") is when ASCII.NUL => exit; when 's' => xml_event_table_file_name := To_Unbounded_String (GNAT.Command_Line.Parameter); when 'x' => xml_project_File_Name := To_Unbounded_String (GNAT.Command_Line.Parameter); when 'v' => Verbose := True; when 'u' => Usage; OS_Exit (0); when others => Usage; OS_Exit (0); end case; end loop; loop declare S : constant String := GNAT.Command_Line.Get_Argument (Do_Expansion => True); begin exit when S'Length = 0; end; end loop; -- Read the XML file describing the analyzed system first -- Put (To_String (xml_project_File_Name)); Initialize (Project_File_List); Systems.Read_From_Xml_File (Sys, Project_File_Dir_List, xml_project_File_Name); -- And then, read/print the event table file -- Read_From_Xml_File (Framework.Sched, Sys, xml_event_table_file_name); display_scheduling(Framework.Sched); end parse_Xml_Schedule;