Library rt.implementation.global.parallel.bertogna_fp_example
Require Import rt.util.all.
Require Import rt.model.arrival.basic.job rt.model.arrival.basic.task rt.model.priority.
Require Import rt.model.schedule.global.schedulability.
Require Import rt.model.schedule.global.basic.schedule rt.model.schedule.global.basic.platform
rt.model.schedule.global.basic.interference.
Require Import rt.analysis.global.parallel.workload_bound
rt.analysis.global.parallel.interference_bound_fp
rt.analysis.global.parallel.bertogna_fp_comp.
Require Import rt.implementation.job rt.implementation.task
rt.implementation.arrival_sequence.
Require Import rt.implementation.global.basic.schedule. (* Use sequential scheduler. *)
Module ResponseTimeAnalysisFP.
Import Job Schedule SporadicTaskset Priority Schedulability Platform
Interference InterferenceBoundFP WorkloadBound
ResponseTimeIterationFP.
Import ConcreteJob ConcreteTask ConcreteArrivalSequence ConcreteScheduler.
(* In this section, we instantiate a simple example to show that the theorems
contain no contradictory assumptions. *)
Section ExampleRTA.
Let tsk1 := {| task_id := 1; task_cost := 2; task_period := 6; task_deadline := 6|}.
Let tsk2 := {| task_id := 2; task_cost := 3; task_period := 8; task_deadline := 6|}.
Let tsk3 := {| task_id := 3; task_cost := 2; task_period := 12; task_deadline := 12|}.
(* Let ts be a task set containing these three tasks (sorted by rate-monotonic priority). *)
Program Let ts := Build_set [:: tsk1; tsk2; tsk3] _.
Section FactsAboutTaskset.
Fact ts_has_valid_parameters:
valid_sporadic_taskset task_cost task_period task_deadline ts.
Fact ts_has_constrained_deadlines:
∀ tsk,
tsk \in ts →
task_deadline tsk ≤ task_period tsk.
End FactsAboutTaskset.
(* Assume there are two processors. *)
Let num_cpus := 2.
(* Recall the FP RTA schedulability test. *)
Let schedulability_test :=
fp_schedulable task_cost task_period task_deadline num_cpus.
(* Now we show that the schedulability test returns true. *)
Fact schedulability_test_succeeds :
schedulability_test ts = true.
(* Let arr_seq be the periodic arrival sequence from ts. *)
Let arr_seq := periodic_arrival_sequence ts.
(* Assume rate-monotonic priorities. *)
Let higher_priority := FP_to_JLDP job_task (RM task_period).
Section FactsAboutPriorityOrder.
Lemma ts_has_unique_priorities :
FP_is_antisymmetric_over_task_set (RM task_period) ts.
Lemma priority_is_total :
FP_is_total_over_task_set (RM task_period) ts.
End FactsAboutPriorityOrder.
(* Let sched be the work-conserving RM scheduler. *)
Let sched := scheduler job_arrival job_cost num_cpus arr_seq higher_priority.
(* Recall the definition of deadline miss. *)
Let no_deadline_missed_by :=
task_misses_no_deadline job_arrival job_cost job_deadline job_task arr_seq sched.
(* Next, we prove that ts is schedulable with the result of the test. *)
Corollary ts_is_schedulable:
∀ tsk,
tsk \in ts →
no_deadline_missed_by tsk.
End ExampleRTA.
End ResponseTimeAnalysisFP.
Require Import rt.model.arrival.basic.job rt.model.arrival.basic.task rt.model.priority.
Require Import rt.model.schedule.global.schedulability.
Require Import rt.model.schedule.global.basic.schedule rt.model.schedule.global.basic.platform
rt.model.schedule.global.basic.interference.
Require Import rt.analysis.global.parallel.workload_bound
rt.analysis.global.parallel.interference_bound_fp
rt.analysis.global.parallel.bertogna_fp_comp.
Require Import rt.implementation.job rt.implementation.task
rt.implementation.arrival_sequence.
Require Import rt.implementation.global.basic.schedule. (* Use sequential scheduler. *)
Module ResponseTimeAnalysisFP.
Import Job Schedule SporadicTaskset Priority Schedulability Platform
Interference InterferenceBoundFP WorkloadBound
ResponseTimeIterationFP.
Import ConcreteJob ConcreteTask ConcreteArrivalSequence ConcreteScheduler.
(* In this section, we instantiate a simple example to show that the theorems
contain no contradictory assumptions. *)
Section ExampleRTA.
Let tsk1 := {| task_id := 1; task_cost := 2; task_period := 6; task_deadline := 6|}.
Let tsk2 := {| task_id := 2; task_cost := 3; task_period := 8; task_deadline := 6|}.
Let tsk3 := {| task_id := 3; task_cost := 2; task_period := 12; task_deadline := 12|}.
(* Let ts be a task set containing these three tasks (sorted by rate-monotonic priority). *)
Program Let ts := Build_set [:: tsk1; tsk2; tsk3] _.
Section FactsAboutTaskset.
Fact ts_has_valid_parameters:
valid_sporadic_taskset task_cost task_period task_deadline ts.
Fact ts_has_constrained_deadlines:
∀ tsk,
tsk \in ts →
task_deadline tsk ≤ task_period tsk.
End FactsAboutTaskset.
(* Assume there are two processors. *)
Let num_cpus := 2.
(* Recall the FP RTA schedulability test. *)
Let schedulability_test :=
fp_schedulable task_cost task_period task_deadline num_cpus.
(* Now we show that the schedulability test returns true. *)
Fact schedulability_test_succeeds :
schedulability_test ts = true.
(* Let arr_seq be the periodic arrival sequence from ts. *)
Let arr_seq := periodic_arrival_sequence ts.
(* Assume rate-monotonic priorities. *)
Let higher_priority := FP_to_JLDP job_task (RM task_period).
Section FactsAboutPriorityOrder.
Lemma ts_has_unique_priorities :
FP_is_antisymmetric_over_task_set (RM task_period) ts.
Lemma priority_is_total :
FP_is_total_over_task_set (RM task_period) ts.
End FactsAboutPriorityOrder.
(* Let sched be the work-conserving RM scheduler. *)
Let sched := scheduler job_arrival job_cost num_cpus arr_seq higher_priority.
(* Recall the definition of deadline miss. *)
Let no_deadline_missed_by :=
task_misses_no_deadline job_arrival job_cost job_deadline job_task arr_seq sched.
(* Next, we prove that ts is schedulable with the result of the test. *)
Corollary ts_is_schedulable:
∀ tsk,
tsk \in ts →
no_deadline_missed_by tsk.
End ExampleRTA.
End ResponseTimeAnalysisFP.