------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 6285, Université 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: 3657 $ -- $Date: 2020-12-13 13:25:49 +0100 (dim., 13 déc. 2020) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with Gtk.Widget; use Gtk.Widget; with Gtk.Combo_Box; use Gtk.Combo_Box; with Gtk.Combo_Box_Text; use Gtk.Combo_Box_Text; with Gtk.Text_Iter; use Gtk.Text_Iter; with Gtk.Check_Button; use Gtk.Check_Button; with Gtk.Main; use Gtk.Main; with call_framework; use call_framework; with call_framework_interface; use call_framework_interface; use call_framework_interface.framework_request_package; use call_framework_interface.framework_response_package; with processors; use processors; with processor_set; use processor_set; use processor_set.generic_processor_set; with unbounded_strings; use unbounded_strings; with translate; use translate; with framework_config; use framework_config; with editor_config; use editor_config; with parameters; use parameters; with parameters.extended; use parameters.extended; use parameters.framework_parameters_table_package; with graphical_editor.user_message; use graphical_editor.user_message; with graphical_editor.message_text; use graphical_editor.message_text; package body graphical_editor.scheduling_feasibility_widget_callbacks is line_number : Integer := 0; procedure close_widget (object : access gtkada_builder_record'class) is my_widget : gobject; begin my_widget := Get_Object (object, "window1"); Destroy (gtk_widget (my_widget)); Gtk.Main.Main_Quit; end close_widget; procedure show_scheduling_feasibility (object : access gtkada_builder_record'class) is test1 : Boolean := False; test2 : Boolean := False; test3 : Boolean := False; a_processor : generic_processor_ptr; my_iterator : processors_iterator; procedure call_feasibility (processor_name : in Unbounded_String) is response_list : framework_response_table; request_list : framework_request_table; a_request : framework_request; a_param : parameter_ptr; begin initialize (response_list); initialize (request_list); if test1 then initialize (a_request); a_request.target := processor_name; a_request.statement := scheduling_feasibility_cpu_utilization; add (request_list, a_request); end if; if test2 then initialize (a_request); initialize (a_request.param); if wcrt_with_memory_interferences = no_memory_interference then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_without_memory_interferences"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_memory_interferences = dram_single_arbiter then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_DRAM_single_arbiter"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_memory_interferences = kalray_multi_arbiter then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_kalray_multi_arbiter"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_crpd = no_crpd then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_without_crpd"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_crpd = ecb_only then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_crpd_ECB_only"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_crpd = ecb_union_multiset then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_crpd_ECB_union_multiset"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_crpd = ucb_union_multiset then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_crpd_UCB_union_multiset"); a_param.boolean_value := True; add (a_request.param, a_param); end if; if wcrt_with_crpd = combined_multiset then a_param := new parameter (boolean_parameter); a_param.parameter_name := To_Unbounded_String ("wcrt_with_crpd_combined_multiset"); a_param.boolean_value := True; add (a_request.param, a_param); end if; a_request.target := processor_name; a_request.statement := scheduling_feasibility_periodic_task_worst_case_response_time; end if; if test3 then initialize (a_request); a_request.target := processor_name; a_request.statement := scheduling_feasibility_demand_bound_function; add (request_list, a_request); end if; sequential_framework_request (sys, request_list, response_list); write_title (response_list); write_text (response_list); end call_feasibility; begin if Get_Active (gtk_check_button (Get_Object (object, "checkbutton2"))) then test1 := True; end if; if Get_Active (gtk_check_button (Get_Object (object, "checkbutton3"))) then test2 := True; end if; if Get_Active (gtk_check_button (Get_Object (object, "checkbutton4"))) then test3 := True; end if; if (test1 = False) and (test2 = False) and (test3 = False) then show_message_box (lb_select_almost_one_feasilibity_test (current_language)); return; end if; a_processor := search_processor (sys.processors, To_Unbounded_String (Get_Active_Text (gtk_combo_box_text (Get_Object (object, "combobox1"))))); if not Get_Active (gtk_check_button (Get_Object (object, "checkbutton1"))) then call_feasibility (a_processor.name); else reset_iterator (sys.processors, my_iterator); loop current_element (sys.processors, a_processor, my_iterator); call_feasibility (a_processor.name); exit when is_last_element (sys.processors, my_iterator); next_element (sys.processors, my_iterator); end loop; end if; close_widget (object); end show_scheduling_feasibility; end graphical_editor.scheduling_feasibility_widget_callbacks;