------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This Ada package was automatically generated by the meta CASE tool Platypus -- see http://cassoulet.univ-brest.fr/mme -- -- Any modification of this file will be lost. -- Please see the "platypus" directory instead : it contains the Cheddar's -- model and its meta-model. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a free real time scheduling tool. -- This program provides services to automatically check temporal constraints -- of real time tasks. -- -- Copyright (C) 2002-2009 Frank Singhoff -- Cheddar is developed by the LISYC Team, University of Brest -- -- 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 : F. Singhoff (singhoff@univ-brest.fr) -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ WITH Text_Io; USE Text_Io; PACKAGE BODY Scheduler.User_Defined.Generated IS PROCEDURE Run_Priority_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Si : IN OUT Scheduling_Information; Current_Time : IN Natural; Processor_Name : IN Unbounded_String; My_Dependencies : IN Tasks_Dependencies_Ptr; Msg : IN OUT Unbounded_String) IS BEGIN -- quantum:=quantum-1; My_Scheduler.Sc_Quantum:=My_Scheduler.Sc_Quantum-1; -- if quantum = 0 -- then quantum:=2; -- my_prio(previously_elected):=my_prio(previously_elected)+1; -- end if; IF My_Scheduler.Sc_Quantum = 0 THEN My_Scheduler.Sc_Quantum:=2; My_Scheduler.Sc_My_Prio(Simulations_Range( My_Scheduler.Previously_Elected)):= My_Scheduler.Sc_My_Prio(Simulations_Range( My_Scheduler.Previously_Elected))+1; END IF; END Run_Priority_Section; PROCEDURE Run_Start_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Processor_Name : IN Unbounded_String; Msg : IN OUT Unbounded_String) IS BEGIN -- quantum : integer :=3; My_Scheduler.Sc_Quantum:=3; -- my_prio:=0; FOR I IN Integer_Table'RANGE LOOP My_Scheduler.Sc_My_Prio(I):=0; END LOOP; END Run_Start_Section; PROCEDURE Run_Election_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Si : IN OUT Scheduling_Information; Current_Time : IN Natural; Processor_Name : IN Unbounded_String; My_Dependencies : IN Tasks_Dependencies_Ptr; With_Offsets : IN Boolean; With_Precedencies : IN Boolean; With_Resources : IN Boolean; Elected : IN OUT Tasks_Range; No_Task : IN OUT Boolean) IS Smallest : Integer := Integer'Last; Found : Boolean := False; I : Tasks_Range := 0; BEGIN -- return min_to_index(tasks.priority); LOOP IF (Si.Tcbs (I).Tsk.Cpu_Name = Processor_Name) THEN IF (Si.Tcbs (I).Wake_Up_Time <= Current_Time) AND (My_Scheduler.Sc_My_Prio(Simulations_Range(I)) < Smallest) AND (Si.Tcbs (I).Rest_Of_Capacity /= 0) THEN IF (With_Offsets = False) OR Check_Offset (Si.Tcbs (I), Current_Time) THEN IF (With_Precedencies = False) OR Check_Precedencies (Si, My_Dependencies, Current_Time, Si.Tcbs (I)) THEN Smallest :=My_Scheduler.Sc_My_Prio(Simulations_Range( I)); Elected := I; Found:=True; END IF; END IF; END IF; END IF; I := I + 1; EXIT WHEN Si.Tcbs (I) = NULL; END LOOP; IF NOT Found THEN No_Task := True; ELSE No_Task := False; END IF; END Run_Election_Section; END Scheduler.User_Defined.Generated ;