with Text_IO; use Text_IO; with Translate; use Translate; with unbounded_strings; use unbounded_strings; with Scheduler; use Scheduler; with Scheduling_Analysis; use Scheduling_Analysis; use Scheduling_Analysis.Double_Tasks_Parameters_Package; with Tasks; use Tasks; use Tasks.Generic_Task_List_Package; with Task_Set; use Task_Set; with Tmp_Task; use Tmp_Task; with Tmp_Transaction; use Tmp_Transaction; package body Feasibility_Test.Wort_Case_Response_Time is -- Compute the significant S for a i-j task pair -- function Audsley_Compute_S (Current_Group : in Generic_Task_Group_Ptr; Taski : in Generic_Task_Ptr; Taskj : in Generic_Task_Ptr; Q : in Natural ) return Double is S, kj, Tj, Oj, Jj, Oi, Ji : Double; begin --put_Line("Group period: "); --put_line(Double'Image(Double (Transaction_Ptr (Current_Group).period))); --put_Line(""); Tj := Double (Transaction_Ptr (Current_Group).period); Oj := Double (Taskj.offsets.Entries(0).offset_value); Jj := Double (PTask_Ptr (Taskj).jitter); Oi := Double (Taski.offsets.Entries(0).offset_value); Ji := Double (PTask_Ptr (Taski).jitter); kj := Double'Ceiling((Jj + Oj - Oi - Ji) / Tj); S := (Double(Q) + kj) * Tj - Oj - Jj + Oi + Ji; return S; end; function Audsley_Compute_WiS_preemptive --Audsley's tasks are premptive (My_Task_Groups: in Task_Groups_Set; --all the task Current_Group : in Generic_Task_Group_Ptr; Current_Task : in Generic_Task_Ptr; --the task examine S : in Double) return Double is Iterator_Taskj, Iterator_Taskk : Generic_Task_Iterator; Iterator_Group : Task_Groups_Iterator; Taskj, Taskk : Generic_Task_Ptr; Transt : Generic_Task_Group_Ptr; WiS, WiSn, Ci, Bi, ai, Ij, Ht, Hta, Max_WiS, Wt, Oi, Ji: Double; Oj, Jj, Tj, Cj, aj, Ok, Jk, Ck, Tk, Tmp_WiS, Tmp_WiSa : Double; begin Ci := Double(Current_Task.capacity); Bi := Double(Current_Task.blocking_time); ai := Double'Floor(S / Double(Transaction_Ptr (Current_Group).period)); Oi := Double(Current_Task.offsets.Entries(0).offset_value); Ji := Double(PTask_Ptr (Current_Task).jitter); WiS := Ci + ai * Ci + Bi; --WiS := Ci; loop WiSn := Ci + ai * Ci + Bi; --Compute Sum Ij -- reset_head_iterator(Current_Group.task_list, Iterator_Taskj); loop -- Selection of the task j -- current_element (Current_Group.task_list, Taskj, Iterator_Taskj); -- Only process task with higher priority -- if (Taskj.priority < Current_Task.priority) then Oj := Double (Taskj.offsets.Entries(0).offset_value); Jj := Double (PTask_Ptr (Taskj).jitter); Tj := Double (Transaction_Ptr (Current_Group).period); Cj := Double (Taskj.capacity); aj := Double'Floor ((S - Oi - Ji + Oj + Jj) / Tj); Ij := Double'Ceiling ((WiS - S + Oi - Oj + Ji + aj * Tj) / Tj) * Cj; WiSn := WiSn + Ij; end if; exit when is_tail_element(Current_Group.task_list, Iterator_Taskj); next_element (Current_Group.task_list, Iterator_Taskj); end loop; -- Compute Sum Ht -- Max_WiS := WiSn; reset_iterator(My_Task_Groups, Iterator_Group); loop -- Selection of a task group -- current_element(My_Task_Groups, Transt, Iterator_Group); -- Don't process the group task i belong to -- It is already taken care of with Ij if (Transt /= Current_Group) then reset_head_iterator(Transt.task_list, Iterator_Taskj); loop -- Selection of task j -- current_element(Transt.task_list, Taskj, Iterator_Taskj); Ht := 0.0; Tmp_WiS := WiSn; Tmp_WiSa := WiSn; -- Only process tasks with higher priority -- if (Taskj.priority < Current_Task.priority) then Oj := Double (Taskj.offsets.Entries(0).offset_value); Jj := Double (PTask_Ptr (Taskj).jitter); Wt := Oj + Jj; reset_head_iterator(Transt.task_list, Iterator_Taskk); loop -- Selection of task k -- current_element(Transt.task_list, Taskk, Iterator_Taskk); Ok := Double(Taskk.offsets.Entries(0).offset_value); Jk := Double(PTask_Ptr (Taskk).jitter); Ck := Double(Taskk.capacity); Tk := Double(Transaction_Ptr (Transt).period); if (Ok + Jk >= Wt) then Ht := Double'Ceiling((WiS + Wt - Ok) / Tk) * Ck; Hta := 0.0; else Hta := Double'Ceiling((WiS + Wt - Ok - Tk) / Tk) * Ck; Ht := 0.0; end if; Tmp_WiS := Tmp_WiS + Ht; Tmp_WiSa := Tmp_WiSa + Hta; exit when is_tail_element(Transt.task_list, Iterator_Taskk); next_element(Transt.task_list, Iterator_Taskk); end loop; if (Tmp_WiS > Max_WiS) then Max_WiS := Tmp_WiS; end if; if (Tmp_WiSa > Max_WiS) then Max_WiS := Tmp_WiSa; end if; end if; exit when is_tail_element(Transt.task_list, Iterator_Taskj); next_element(Transt.task_list, Iterator_Taskj); end loop; WiSn := Max_WiS; end if; exit when is_last_element(My_Task_Groups, Iterator_Group); next_element(My_Task_Groups, Iterator_Group); end loop; exit when WiS = WiSn or WiS > Max_Response_time; WiS := WiSn; end loop; return WiS; end Audsley_Compute_WiS_preemptive; procedure Audsley_Compute_Offset_Response_Time (My_Task_Groups : in Task_Groups_Set; Processor_Name : in Unbounded_String; Msg : in out Unbounded_String; Response_Time : out Response_Time_Table) is Tmp : Generic_Task_Group; Iterator_Group : Task_Groups_Iterator; Groupi : Generic_Task_Group_Ptr; Iterator_Taski, Iterator_Taskj : Generic_Task_Iterator; Taski, Taskj : Generic_Task_Ptr; I : Response_Time_Range := 0; Ri, WiS, S, Ji, Ti : Double := 0.0; Q : Integer; Q_stop : Boolean := false; begin initialize (Response_Time); Current_Processor_Name := Processor_Name; -- Set priority according to the scheduler -- But there is no scheduler (bottom-up)? Assume the tasks already have -- priority assigned to it reset_iterator (My_Task_Groups, Iterator_Group); loop current_element (My_Task_Groups, Groupi, Iterator_Group); sort(Groupi.task_list, Decreasing_Priority'Access); exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; -- Bibliographical references -- Nothing for now -- compute response time for each tasks -- reset_iterator (My_Task_Groups, Iterator_Group); loop -- Selection of the current group -- current_element (My_Task_Groups, Groupi, Iterator_Group); reset_head_iterator (Groupi.task_list, Iterator_Taski); loop -- Selection of the current task (i) -- current_element (Groupi.task_list, Taski, Iterator_Taski); -- Initialize response time for task i -- Response_Time.entries (I).data := 0.0; Response_Time.entries (I).item := Taski; Response_Time.nb_entries := Response_Time.nb_entries + 1; -- Ji := Double (PTask_Ptr (Taski).jitter); Ti := Double (Transaction_Ptr (Groupi).period); -- Find the maximum for Ri in [0..Q] -- Q := 0; loop Q_stop := true; -- Calculate the significant S -- reset_head_iterator(Groupi.task_list, Iterator_Taskj); loop -- Selection of task j -- current_element(Groupi.task_list, Taskj, Iterator_Taskj); -- only process tasks with higher priority if (Taskj.priority <= Taski.priority) then -- Compute response time -- S := Audsley_Compute_S(Groupi, Taski, Taskj, Q); WiS := Audsley_Compute_WiS_preemptive(My_Task_Groups, Groupi, Taski, S); Ri := WiS + Ji - S; if (Ri > Response_Time.entries(I).data) then Response_Time.entries(I).data := Ri; end if; if (Ri > Ti) then Q_stop := false; end if; end if; exit when is_tail_element(Groupi.task_list, Iterator_Taskj); next_element(Groupi.task_list, Iterator_Taskj); end loop; exit when Q_stop; Q := Q + 1; end loop; I := I + 1; exit when is_tail_element (Groupi.task_list, Iterator_Taski); next_element (Groupi.task_list, Iterator_Taski); end loop; exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; end Audsley_Compute_Offset_Response_Time; function Tindell_Compute_Wiq_preemptive (My_Task_Groups : in Task_Groups_Set; Current_Group : in Generic_Task_Group_Ptr; Current_Task : in Generic_Task_Ptr; Q : in Natural; Wtg : in Double) return Double is Wiq, Wiqn : Double := 0.0; Cc, Bc, Oc, Jc, Oj, Jj, Jk, Ok, Iit, Tmp_Iit, Kjt, Vjt, Ej, Cj, Tj, Wt, Tmp_Wt : Double; Iterator_Group: Task_Groups_Iterator; Iterator_Taski, Iterator_Taskj, Iterator_Taskk: Generic_Task_Iterator; Transt : Generic_Task_Group_Ptr; Taskj, Taskk : Generic_Task_Ptr; begin Cc := Double(Current_Task.capacity); Bc := Double(Current_Task.blocking_time); Oc := Double(Current_Task.offsets.entries(0).offset_value); Jc := Double(PTask_Ptr (Current_Task).jitter); Wiq := Cc; loop Wiqn := Bc + Double(Q + 1) * Cc; -- equation 13 -- Compute Sum Iit -- reset_iterator(My_Task_Groups, Iterator_Group); loop -- Selection of a task group -- current_element(My_Task_Groups, Transt, Iterator_Group); reset_head_iterator(Transt.task_list, Iterator_Taskj); Iit := 0.0; if (Current_Group /= Transt) then Tmp_Iit := 0.0; -- Find Wt that maximalize Iit -- See equation 18 reset_head_iterator(Transt.task_list, Iterator_Taskk); loop -- Selection of task k -- current_element(Transt.task_list, Taskk, Iterator_Taskk); Ok := Double(Taskk.offsets.Entries(0).offset_value); Jk := Double(PTask_Ptr (Taskk).jitter); Tmp_Wt := Ok + Jk; Tmp_Iit := 0.0; --calculate Iit, see equation 8 reset_head_iterator(Transt.task_list, Iterator_Taskj); loop -- Selection of task j -- current_element(Transt.task_list, Taskj, Iterator_Taskj); -- only process task with higher priority if (Current_Task.priority >= Taskj.priority) then Oj := Double(Taskj.offsets.Entries(0).offset_value); Jj := Double(PTask_Ptr (Taskj).jitter); Cj := Double(Taskj.capacity); Tj := Double(Transaction_Ptr (Transt).period); Ej := Double(PTask_Ptr (Taskj).every); Vjt := Double'Ceiling((Tmp_Wt - Oj - Jj)/ Tj); Kjt := Double'Ceiling((Tmp_Wt + Wiq - Oj - Vjt * Tj) / (Ej * Tj)); Tmp_Iit := Tmp_Iit + Kjt * Cj; end if; exit when is_tail_element(Transt.task_list, Iterator_Taskj); next_element(Transt.task_list, Iterator_Taskj); end loop; if (Tmp_Iit > Iit) then Iit := Tmp_Iit; Wt := Tmp_Wt; end if; exit when is_tail_element(Transt.task_list, Iterator_Taskk); next_element(Transt.task_list, Iterator_Taskk); end loop; else Wt := Wtg; loop -- Selection of task j -- current_element(Transt.task_list, Taskj, Iterator_Taskj); -- Only process tasks with higher priority -- if (Taskj.priority < Current_Task.priority) then --calculate Iit, see equation 8 Oj := Double(Taskj.offsets.Entries(0).offset_value); Jj := Double(PTask_Ptr (Taskj).jitter); Cj := Double(Taskj.capacity); Tj := Double(Transaction_Ptr (Transt).period); Ej := Double(PTask_Ptr (Taskj).every); Vjt := Double'Ceiling((Wt - Oj - Jj)/ Tj); Kjt := Double'Ceiling((Wt + Wiq - Oj - Vjt * Tj) / (Ej * Tj)); Iit := Iit + Kjt * Cj; end if; exit when is_tail_element(Transt.task_list, Iterator_Taskj); next_element(Transt.task_list, Iterator_Taskj); end loop; end if; Wiqn := Wiqn + Iit; exit when is_last_element(My_Task_Groups, Iterator_Group); next_element(My_Task_Groups, Iterator_Group); end loop; exit when Wiq = Wiqn or Wiqn > Max_Response_time; Wiq := Wiqn; end loop; if (Wiqn > Max_Response_time) then Wiq := Max_Response_time; end if; return Wiq; end Tindell_Compute_Wiq_preemptive; procedure Tindell_Compute_Offset_Response_Time --tractable (My_Task_Groups : in Task_Groups_Set; Processor_Name : in Unbounded_String; Msg : in out Unbounded_String; Response_Time : out Response_Time_Table) is Iterator_Group : Task_Groups_Iterator; Groupi : Generic_Task_Group_Ptr; Iterator_Taski, Iterator_Taskj : Generic_Task_Iterator; Taski, Taskj : Generic_Task_Ptr; I : Response_Time_Range := 0; Ri, Wiq, Viti, Ji, Tti, Oi, Oj, Jj, Ei, Wt, Kj : Double := 0.0; Q : Integer; Q_stop : Boolean := false; begin initialize (Response_Time); Current_Processor_Name := Processor_Name; -- Set priority according to the scheduler -- But there is no scheduler (bottom-up)? Assume the tasks already have -- priority assigned to it reset_iterator (My_Task_Groups, Iterator_Group); loop current_element (My_Task_Groups, Groupi, Iterator_Group); sort(Groupi.task_list, Decreasing_Priority'Access); exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; -- Bibliographical references -- Nothing for now -- compute response time for each tasks -- reset_iterator (My_Task_Groups, Iterator_Group); loop -- Selection of the current group -- current_element (My_Task_Groups, Groupi, Iterator_Group); reset_head_iterator (Groupi.task_list, Iterator_Taski); loop -- Selection of the current task (i) -- current_element (Groupi.task_list, Taski, Iterator_Taski); -- Initialize response time for task i -- Response_Time.entries (I).data := 0.0; Response_Time.entries (I).item := Taski; Response_Time.nb_entries := Response_Time.nb_entries + 1; -- Ji := Double (PTask_Ptr (Taski).jitter); Oi := Double (Taski.offsets.Entries(0).offset_value); Ei := Double (PTask_Ptr (Taski).every); Tti := Double (Transaction_Ptr (Groupi).period); -- Tractable analysis: find the maximum for Ri in [0..Q] -- Q := 0; loop Q_stop := true; reset_head_iterator(Groupi.task_list, Iterator_Taskj); loop -- Selection of task j -- current_element(Groupi.task_list, Taskj, Iterator_Taskj); -- Compute response time -- Wt := Double(Taskj.offsets.Entries(0).offset_value + PTask_Ptr(Taskj).jitter); Viti := Double'Ceiling((Wt - Oi - Ji) / Tti); Wiq := Tindell_Compute_Wiq_preemptive(My_Task_Groups, Groupi, Taski, Q, Wt); Ri := Wiq + Wt - Tti * (Double(Q) * Ei + Viti) - Oi; if (Wiq = Max_Response_time) then put("The task"); put(Natural'Image(Natural(Taski.priority))); put(" can't be scheduled: Wiq exceeded Max_Response_time value"); exit; end if; if (Ri > Response_Time.entries(I).data) then Response_Time.entries(I).data := Ri; end if; -- stop condition - see equation (20) if (Wiq + Wt > Tti * (Double(Q + 1) * Ei + Viti) + Oi) then Q_stop := false; end if; exit when is_tail_element(Groupi.task_list, Iterator_Taskj); next_element(Groupi.task_list, Iterator_Taskj); end loop; exit when Q_stop; Q := Q + 1; end loop; I := I + 1; exit when is_tail_element (Groupi.task_list, Iterator_Taski); next_element (Groupi.task_list, Iterator_Taski); end loop; exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; end Tindell_Compute_Offset_Response_Time; function Palencia_Phi (Groupi : Generic_Task_Group_Ptr; Task_ab : Generic_Task_Ptr; Task_ac : Generic_Task_Ptr) return Double is Ta, sphi_ab, sphi_ac, Jac : Natural; begin Ta := Transaction_Ptr(Groupi).period; sphi_ab := Task_ab.offsets.Entries(0).offset_value mod Ta; sphi_ac := Task_ac.offsets.Entries(0).offset_value mod Ta; Jac := PTask_Ptr(Task_ac).jitter; return Double(Ta - (sphi_ac + Jac - sphi_ab) mod Ta); end Palencia_Phi; function Palencia_W_ik (Group_i : Generic_Task_Group_Ptr; Task_ab : Generic_Task_Ptr; Task_ik : Generic_Task_Ptr; T : Double) return Double is Iterator_Task_ij : Generic_Task_Iterator; Task_ij : Generic_Task_Ptr; W_ik, Jij, Ti, Phi_ijk, Cij : Double := 0.0; begin -- Loop & evaluate all task ij of higher priority than task ab -- reset_head_iterator(Group_i.task_list, Iterator_Task_ij); loop -- Selection of task ij current_element(Group_i.task_list, Task_ij, Iterator_Task_ij); Cij := Double(Task_ij.capacity); Jij := Double(PTask_Ptr(Task_ij).jitter); Ti := Double(Transaction_Ptr(Group_i).period); if (Task_ij.priority > Task_ab.priority) then Phi_ijk := Palencia_Phi(Group_i, Task_ij, Task_ik); W_ik := W_ik + (Double'Floor((Jij + Phi_ijk)/Ti) + Double'Ceiling((T - Phi_ijk)/Ti)) * Cij; end if; exit when is_tail_element(Group_i.task_list, Iterator_Task_ij); next_element(Group_i.task_list, Iterator_Task_ij); end loop; return W_ik; end Palencia_W_ik; function Palencia_Labc (My_Task_Groups : Task_Groups_Set; Group_a : Generic_Task_Group_Ptr; Task_ab : Generic_Task_Ptr; Task_ac : Generic_Task_Ptr; P0 : Double; Phi_abc : Double) return Double is L_abc, L_abcn, W_ac, W_i, W_ik, Bab, Cab, Sum_wi, Ta : Double := 0.0; Iterator_Group : Task_Groups_Iterator; Group_i : Generic_Task_Group_Ptr; Iterator_Task_ik : Generic_Task_Iterator; Task_ik : Generic_Task_Ptr; C : Character; begin Bab := Double(Task_ab.blocking_time); Cab := Double(Task_ab.capacity); Ta := Double(Transaction_Ptr(Group_a).period); L_abc := 0.0; loop W_ik := Palencia_W_ik(Group_a, Task_ab, Task_ac, L_abc); put_line(""); put("W_ac"); put(Double'Image(W_ik)); L_abcn := Bab + (Double'Ceiling((L_abc - Phi_abc)/Ta) - P0 + 1.0) * Cab + Palencia_W_ik(Group_a, Task_ab, Task_ac, L_abc); -- Loop & calculate Wi* for all group i <> group a -- reset_iterator(My_Task_Groups, Iterator_Group); loop current_element(My_Task_Groups, Group_i, Iterator_Group); if (Group_i /= Group_a) then -- Find all task k of higher priority than task ab & calculate W_ik reset_head_iterator(Group_i.task_list, Iterator_Task_ik); W_i := 0.0; loop current_element(Group_i.task_list, Task_ik, Iterator_Task_ik); if (Task_ik.priority <= Task_ab.priority) then W_ik := Palencia_W_ik(Group_i, Task_ab, Task_ik, L_abc); if (W_ik > W_i) then W_i := W_ik; end if; end if; exit when is_tail_element(Group_i.task_list, Iterator_Task_ik); next_element(Group_i.task_list, Iterator_Task_ik); end loop; L_abcn := L_abcn + W_i; end if; exit when is_last_element(My_Task_Groups, Iterator_Group); next_element(My_Task_Groups, Iterator_Group); end loop; exit when L_abcn = L_abc or L_abcn > Max_Response_time; put ("vai ca sida L_abc:"); put(Double'Image(L_abc)); put("L_abcn:"); put(Double'Image(L_abcn)); Get_Immediate(C); L_abc := L_abcn; end loop; return L_abc; end Palencia_Labc; function Palencia_w_abc (My_Task_Groups : Task_Groups_Set; Group_a : Generic_Task_Group_Ptr; Task_ab : Generic_Task_Ptr; Task_ac : Generic_Task_Ptr; P : Double; P0: Double) return Double is Iterator_Group : Task_Groups_Iterator; Iterator_Task_ik : Generic_Task_Iterator; Task_ik : Generic_Task_Ptr; Group_i : Generic_Task_Group_Ptr; Bab, Cab, w_abc, w_abcn, Wac, W_ik, W_i : Double := 0.0; begin Bab := Double(Task_ab.blocking_time); Cab := Double(Task_ab.capacity); w_abc := 0.0; loop w_abcn := Bab + (P- P0 + 1.0) * Cab + Palencia_W_ik(Group_a, Task_ab, Task_ac, w_abc); -- Iterate & calculate W_i* - see equation 27 reset_iterator(My_Task_Groups, Iterator_Group); loop -- Selection of group i -- current_element(My_Task_Groups, Group_i, Iterator_Group); -- Only process group different from Group a if (Group_i /= Group_a) then -- Calculate W_i* by selecting the maximum W_ik -- See equation 27 -- W_i := 0.0; reset_head_iterator(Group_i.task_list, Iterator_Task_ik); loop current_element(Group_i.task_list, Task_ik, Iterator_Task_ik); -- Only process tasks with higher priority than task ab -- if (Task_ik.priority <= Task_ab.priority) then W_ik := Palencia_W_ik(Group_i, Task_ab, Task_ik, w_abc); if (W_ik > W_i) then W_i := W_ik; end if; end if; exit when is_tail_element(Group_i.task_list, Iterator_Task_ik); next_element(Group_i.task_list, Iterator_Task_ik); end loop; w_abcn := w_abcn + W_i; end if; exit when is_last_element(My_Task_Groups, Iterator_Group); next_element(My_Task_Groups, Iterator_Group); end loop; exit when w_abc = w_abcn or w_abcn > Max_Response_time; w_abc := w_abcn; end loop; return w_abc; end Palencia_w_abc; procedure Palencia_Compute_Offset_Response_Time --exact first, tractable later? (My_Task_Groups : in Task_Groups_Set; Processor_Name : in Unbounded_String; Msg : in out Unbounded_String; Response_Time : out Response_Time_Table) is Iterator_Group : Task_Groups_Iterator; Group_a : Generic_Task_Group_Ptr; Iterator_Task_ab, Iterator_Task_ac : Generic_Task_Iterator; Task_ab, Task_ac : Generic_Task_Ptr; I : Response_Time_Range := 0; Rab, Labc, P0abc, PLabc, Phi_abc, Jab, Ta, Oab, Oac, Jac, P : Double := 0.0; begin initialize (Response_Time); Current_Processor_Name := Processor_Name; --task model in Palencia is a little different: --T_ab = a task in transaction a, which is indexed with b while ordered by increasing offset --should the tasks be sorted in increasing offset value? reset_iterator (My_Task_Groups, Iterator_Group); loop current_element (My_Task_Groups, Group_a, Iterator_Group); sort(Group_a.task_list, Decreasing_Priority'Access); exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; -- compute response time for each tasks -- reset_iterator (My_Task_Groups, Iterator_Group); loop -- Selection of the current group -- current_element (My_Task_Groups, Group_a, Iterator_Group); reset_head_iterator (Group_a.task_list, Iterator_Task_ab); loop -- Selection of the current task (T_ab) -- current_element (Group_a.task_list, Task_ab, Iterator_Task_ab); -- Initialize response time for task ab -- Response_Time.entries (I).data := 0.0; Response_Time.entries (I).item := Task_ab; Response_Time.nb_entries := Response_Time.nb_entries + 1; Jab := Double(PTask_Ptr(Task_ab).jitter); Oab := Double(Task_ab.offsets.Entries(0).offset_value); Ta := Double(Transaction_Ptr(Group_a).period); reset_head_iterator (Group_a.task_list, Iterator_Task_ac); loop -- Selection of Task_ac -- current_element(Group_a.task_list, Task_ac, Iterator_Task_ac); if (Task_ac.priority <= Task_ab.priority) then -- The first activation # -- Note that it can be a negative value! -- See equation 29 P0abc := - Double'Floor((Jab + Phi_abc)/Ta) + 1.0; Phi_abc := Palencia_Phi(Group_a, Task_ab, Task_ac); -- Calculation of the length of the busy period started with Task_ac -- See equation 30 put_line(""); put("sida..."); put(Natural'Image(Natural(task_ac.priority))); put(" phi_abc="); put(Double'Image(Phi_abc)); put(" P0abc="); put_line(Double'Image(P0abc)); Labc := Palencia_Labc(My_Task_Groups, Group_a, Task_ab, Task_ac, P0abc, Phi_abc); put(" Labc = "); put_line(Double'Image(Labc)); -- From the Labc, calculate the maximum number of jobs need to be checked -- See equation 31 PLabc := Double'Ceiling((Labc - Phi_abc / Ta)); -- Find the maximum Rabc from all jobs p P := P0abc; PLabc := PLabc + P; --for counting loop -- Find the maximum of all Rabc(p) -- see equation 32 - 33 Rab := Palencia_w_abc(My_Task_Groups, Group_a, Task_ab, Task_ac, P, P0abc) - Phi_abc - P - 1.0 * Ta + Oab; if (Rab > Response_Time.entries(I).data) then Response_Time.entries(I).data := Rab; end if; exit when P >= PLabc; P := P + 1.0; end loop; end if; exit when is_tail_element (Group_a.task_list, Iterator_Task_ac); next_element(Group_a.task_list, Iterator_Task_ac); end loop; exit when is_tail_element (Group_a.task_list, Iterator_Task_ab); next_element (Group_a.task_list, Iterator_Task_ab); I := I + 1; end loop; exit when is_last_element (My_Task_Groups, Iterator_Group); next_element (My_Task_Groups, Iterator_Group); end loop; end Palencia_Compute_Offset_Response_Time; end Feasibility_Test.Wort_Case_Response_Time;