Library prosa.analysis.facts.model.multiprocessor
Require Import prosa.util.all.
Require Export prosa.model.processor.multiprocessor.
Require Export prosa.model.schedule.parallelism.
Require Import prosa.analysis.facts.behavior.service.
Require Export prosa.model.processor.multiprocessor.
Require Export prosa.model.schedule.parallelism.
Require Import prosa.analysis.facts.behavior.service.
Unit Service on Multiprocessors
Consider any job type and per-core processor model.
Each core is a uniprocessor that provides unit service.
Hypothesis H_cores_are_uniprocessors : uniprocessor_model core_state.
Hypothesis H_unit_service : unit_service_proc_model core_state.
Hypothesis H_unit_service : unit_service_proc_model core_state.
Construct a multiprocessor with any number of these cores.
Variable num_cores : nat.
Let PState := multiproc_state Job core_state H_cores_are_uniprocessors num_cores.
#[local] Existing Instance PState.
Let PState := multiproc_state Job core_state H_cores_are_uniprocessors num_cores.
#[local] Existing Instance PState.
Consider a schedule in which no job executes on two cores at once.
Variable sched : schedule PState.
Hypothesis H_no_parallelism : no_intra_job_parallelism sched.
Local Transparent service_on.
Hypothesis H_no_parallelism : no_intra_job_parallelism sched.
Local Transparent service_on.
At most one core can provide service to a job, so the per-core
unit-service bound also bounds its total service at each instant.
Lemma multiprocessor_has_unit_service :
unit_service_schedule sched.
Proof.
move⇒ j t.
case: (boolP (scheduled_at sched j t)) ⇒ [/existsP[c ON]|OFF].
- rewrite /service_at /service_in (bigD1 c) //=.
rewrite big1 ?addn0.
+ move⇒ c' NE.
change (service_on j (sched t) c' = 0).
apply: service_on_implies_job_on.
apply/negP ⇒ ON'.
by move: NE; rewrite (H_no_parallelism j t c' c ON' ON) eqxx.
+ exact: H_unit_service.
- by rewrite not_scheduled_implies_no_service.
Qed.
End UnitService.
unit_service_schedule sched.
Proof.
move⇒ j t.
case: (boolP (scheduled_at sched j t)) ⇒ [/existsP[c ON]|OFF].
- rewrite /service_at /service_in (bigD1 c) //=.
rewrite big1 ?addn0.
+ move⇒ c' NE.
change (service_on j (sched t) c' = 0).
apply: service_on_implies_job_on.
apply/negP ⇒ ON'.
by move: NE; rewrite (H_no_parallelism j t c' c ON' ON) eqxx.
+ exact: H_unit_service.
- by rewrite not_scheduled_implies_no_service.
Qed.
End UnitService.
We register this implication so that unit service can be established
from the per-core bound and the schedule's restriction on parallelism.
Global Hint Resolve multiprocessor_has_unit_service : basic_rt_facts.