Schedulers Module

Copyright (C) 2017 Philip Axer, Jonas Diemer, Johannes Schlatow
TU Braunschweig, Germany
All rights reserved.
See LICENSE file for copyright and license details.
Authors:
  • Jonas Diemer
  • Philip Axer
  • Johannes Schlatow

Description

Local analysis functions (schedulers)

class pycpa.schedulers.CorrelatedDeltaMin(em, m, offset)[source]

Computes the correlated event model \delta^-_j from Lemma 2 in [Rox2010].

class pycpa.schedulers.RoundRobinScheduler[source]

Round-Robin Scheduler

task.scheduling_parameter is the respective slot size

b_plus(task, q, details=None, **kwargs)[source]

Maximum Busy-Time for q activations of a task.

This default implementation assumes that all other tasks disturb the task under consideration, which is the behavior of a “random priority preemptive” scheduler or a “least-remaining-load-last” scheduler. This is a conservative bound for all work-conserving schedulers.

Warning

This default implementation should be overridden for any scheduler.

Parameters:
  • task (model.Task) – the analyzed task
  • q (boolean) – the number of activations
  • details – reference to a dict of details on the busy window (instead of busy time)
Return type:

integer (max. busy-time for q activations)

class pycpa.schedulers.SPNPScheduler(priority_cmp=<function <lambda>>, ctx_switch_overhead=0, cycle_time=1e-09)[source]

Static-Priority-Non-Preemptive Scheduler

Priority is stored in task.scheduling_parameter, by default numerically lower numbers have a higher priority

Policy for equal priority is FCFS (i.e. max. interference).

b_plus(task, q, details=None, **kwargs)[source]

Return the maximum time required to process q activations

spnp_busy_period(task, w)[source]

Calculated the busy period of the current task

stopping_condition(task, q, w)[source]

Check if we have looked far enough compute the time the resource is busy processing q activations of task and activations of all higher priority tasks during that time Returns True if stopping-condition is satisfied, False otherwise

class pycpa.schedulers.SPPScheduler(priority_cmp=<function <lambda>>)[source]

Static-Priority-Preemptive Scheduler

Priority is stored in task.scheduling_parameter, by default numerically lower numbers have a higher priority

Policy for equal priority is FCFS (i.e. max. interference).

b_plus(task, q, details=None, **kwargs)[source]

This corresponds to Theorem 1 in [Lehoczky1990] or Equation 2.3 in [Richter2005].

class pycpa.schedulers.SPPSchedulerActivationOffsets(priority_cmp=<function <lambda>>)[source]

Static-Priority-Preemptive Scheduler which considers activation offsets assuming all tasks are activated synchronously with the given offsets/phases (phi).

Assumptions:
  • implicit or constrained deadlines

We exclude/shift interferers whose phase is larger than the task under analysis iff the interferers period is equal or smaller.

b_plus(task, q, details=None, **kwargs)[source]

This corresponds to Theorem 1 in [Lehoczky1990] or Equation 2.3 in [Richter2005].

class pycpa.schedulers.SPPSchedulerCorrelatedRox(priority_cmp=<function <lambda>>)[source]

SPP scheduler with dmin correlation. Computes the approximate response time bound as presented in [Rox2010].

b_plus(task, q, details=None, task_results=None)[source]

This corresponds to Theorem 1 in [Lehoczky1990] or Equation 2.3 in [Richter2005].

b_plus_busy(task, q, details=None, task_results=None)[source]

Implements Case 1 in [Rox2010].

b_plus_idle(task, q, details=None, task_results=None)[source]

Implements Case 2 in [Rox2010].

class pycpa.schedulers.SPPSchedulerCorrelatedRoxExact(priority_cmp=<function <lambda>>)[source]

SPP scheduler with dmin correlation based on [Rox2010]. This is the exact version which performs an extensive search of busy window candidates.

b_plus(task, q, details=None, task_results=None)[source]

This corresponds to Theorem 1 in [Lehoczky1990] or Equation 2.3 in [Richter2005].

class pycpa.schedulers.SPPSchedulerRoundRobin(priority_cmp=<function <lambda>>)[source]

SPP scheduler with non-preemptive round-robin policy for equal priorities

b_plus(task, q, details=None, **kwargs)[source]

This corresponds to Theorem 1 in [Lehoczky1990] or Equation 2.3 in [Richter2005].

class pycpa.schedulers.TDMAScheduler[source]

TDMA scheduler task.scheduling_parameter is the slot size of the respective task

b_plus(task, q, details=None, **kwargs)[source]

Maximum Busy-Time for q activations of a task.

This default implementation assumes that all other tasks disturb the task under consideration, which is the behavior of a “random priority preemptive” scheduler or a “least-remaining-load-last” scheduler. This is a conservative bound for all work-conserving schedulers.

Warning

This default implementation should be overridden for any scheduler.

Parameters:
  • task (model.Task) – the analyzed task
  • q (boolean) – the number of activations
  • details – reference to a dict of details on the busy window (instead of busy time)
Return type:

integer (max. busy-time for q activations)