API

This part of the documentation covers all the interfaces of End-to-End Analyzer Framework.

Task Object

class eelaf.Task(name, period, priority, exetime)[source]

System task.

C[source]

Alias for task \(t_i\) execution time (\(C_i\)).

HB[source]

Set of tasks belonging to same Component C with priorities higher than itself one.

\[\begin{split}HB(s) = \{ T_k \in C \mid P(k) > P(s) \}\end{split}\]
P[source]

Alias for task \(t_i\) period (\(P(i)\)).

static alpha(i)[source]

Calculate time of i-th activation.

\[\alpha_r(i) = r_{start} + i * P(r)\]
Parameters:i – Activation number.
Returns:Activation time.
blocking_time[source]

Task deadline (\(b_i\)).

Warning

Currently always returns 0.

deadline[source]

Task deadline.

Note

Currently deadline==period.

static delta(i)[source]

Calculate response time of i-th activation.

Parameters:i – Activation number.
Returns:Response time of i-th activation.

Note

In our case we always return task response time.

See also

response_time()

freq[source]

Task frequency \(f(t_i) = 1/P(t_i)\).

static ialpha(t)[source]

Calculate previous activation for given time.

\[\alpha^{-1}_r(t) = \lfloor {t - r_{start}\over{P(r)}} \rfloor\]
Parameters:t – Current time.
Returns:int – activation number.
p[source]

Alias for task \(t_i\) priority (\(p(i)\)).

plan(time)[source]

Returns True if the task should be scheduled at given time.

static rbf(t)[source]

The request bound function.

It computes the maximum cumulative execution requests that could be generated from the time that task is released up to time t.

\[rbf_i(t) = C_i + b_i + \sum_{\tau_k \in HP(i)} {t\over{T_k}} * C_k\]
Parameters:t – Time limit for execution requests.

See also

[Inam2548:2011] formula (2).

response_time[source]

Task response time.

\[\begin{split}RS(i) = t \mid \exists t : 0 < t <= D_i , rbf_i(t) <= sbf_C(t)\end{split}\]
status(time)[source]

Returns textual representation of task status at given time.

utilization[source]

Calculates utilization.

Component (Subsystem) Object

class eelaf.Component(name, period, priority, budget, scheduler='EDF', payback=False)[source]

System servers / components.

Bl[source]

The maximum blocking imposed to a this subsystem.

\[Bl(s) = max\{ X(k) \mid S_k \in LPS(s) \}\]

See also

[Inam2548:2011] formula (10).

HPS[source]

Set of subsystems of System S with priority higher than itself (\(S_s\)).

\[\begin{split}HSP(s) = \{ S_k \in S \mid P(k) > P(s) \}\end{split}\]

See also

Used in formula (9) in [Inam2548:2011].

LPS[source]

Set of subsystems of System S with priority lower than itself (\(S_s\)).

\[\begin{split}LSP(s) = \{ S_k \in S \mid P(k) < P(s) \}\end{split}\]

See also

Used in formula (10) in [Inam2548:2011].

P[source]

Alias for Component period.

Q[source]

Alias for Component budget.

RBF(t)[source]

Request Bound Function

See also

[Inam2548:2011] formula (9) and (11).

X[source]

The maximum execution-time that any subsystem-internal task may lock a shared global resource.

Warning

Currently always returns 0.

deadline[source]

The function returns Component deadline.

Currently the self.deadline==self.period.

f1(t)[source]

Implementation of helper formula f1.

Parameters:t – time

See also

[Inam2548:2011] formula (5).

f2(t)[source]

Implementation of helper formula f2.

Parameters:t – time

See also

[Inam2548:2011] formula (6).

freq[source]

The function calculates Component frequency.

static sbf(t)[source]

Supply Bound Function.

If payback is True then this method depends on f1() and f2():

return max(min(f1(t), f2(t)), 0)
Parameters:t – time

See also

[Inam2548:2011] formula (3) and (4).

schedulability[source]

Component schedulability condition.

for t in C_{tasks}:
    schedulable <- False
    for i in [1..P(t)]:
        if rbf_t(i) <= sbf_C(i):
            schedulable <- True
            break
        end if
    end for
    if not schedulable:
        return False
    end if
end for
return True

See also

[Inam2548:2011] formula (13).

utilization[source]

Returns Component utilization as product of its frequency and budget.

System Object

class eelaf.System(scheduler='FPS', resolution=1000, components=None)[source]

Models a physical system with instances of Component.

B(t)[source]

Blocking time left at given time.

Warning

Currently always returns 0.

static TP_first(possible_paths)[source]

Set of all non-duplicate, reachable timed paths, for which no timed path exists that shares the same start instance of the first task and has an earlier end instance of the last task.

\[\begin{split}\mathbb{TP}^{first} = \{ \vec{tp} \in \mathbb{TP}^{reach} \mid \neg \exists \vec{tp}' \in \mathbb{TP}^{reach} : tp'_1 = tp_1 \land tp'_n < tp_n \}\end{split}\]
function earlier(tp, tp'):
    # index -1 gets last element in array
    return tp'[0] == tp[0] and tp'[-1] < tp[-1]
end function

out <- list()
TP_reach_paths <- TP_reach(possible_paths)
for tp in TP_reach_paths:
    if not any(map(partial(earlier, tp), TP_reach_paths))):
        out.append(tp)
    end if
end for
return out

See also

[Feiertag:08] formula (11).

static TP_reach(possible_paths)[source]

It obtains the set of all paths and returns only all reachable timed path (\(\mathbb{TP}^{reach}\)).

out <- list()
for all path in possible_paths:
    if reach_path(path):
        out.append(path)
    end if
end for
return out

See also

[Feiertag:08] formula (9).

addComponent(component)[source]

Adds new Component instance to the system.

It stores reference of the system to added component.

Parameters:component (Component) – New system subsystem.
static att(w, i, r, j)[source]

It returns True if “activation time travel” occurs (\(att( t_w (i) \rightarrow t_r (j))\)).

The activation time travel occurs when the reader is activated before the writer (\(\alpha_r(i)\) is equivalent to alpha() on t()).

\[\begin{split}att( t_w (i) \rightarrow t_r (j)) = \alpha_r (j) < \alpha_w (i)\end{split}\]
Parameters:
  • w – Index of writer task in data path.
  • i – Activation index of writer task.
  • r – Index of reader task in data path.
  • j – Activation index of reader task.

See also

[Feiertag:08] formula (3)

static crit(w, i, r, j)[source]

The “critical function” determines if writer and reader overlap in execution even in case of non-activation time travel (\(crit( t_w (i) \rightarrow t_r (j))\)).

\[\begin{split}crit( t_w (i) \rightarrow t_r (j)) = \alpha_r (j) < \alpha_w (i) + \delta_w (i)\end{split}\]
Parameters:
  • w – Index of writer task in data path.
  • i – Activation index of writer task.
  • r – Index of reader task in data path.
  • j – Activation index of reader task.

See also

[Feiertag:08] formula (4)

delta_FF(ls)[source]

Find maximum of First-to-First path delays.

See also

[Feiertag:08] formula (17).

delta_FF_path(path, tp_reach)[source]

Calculate First-to-First path delay.

\[\Delta^{FF}(\vec{tp}) = \Delta^{LF}(\vec{tp}) + \alpha_1(tp_1) - \alpha_1(pred(\vec(tp)))\]
Parameters:
  • path – Array with task activation numbers.
  • tp_reach – List of reachable paths.
Fixme :

remove dependency on tp_reach parameter.

See also

[Feiertag:08] formula (16).

delta_FL(ls)[source]

Find maximum of First-to-Last path delays.

See also

[Feiertag:08] formula (15).

delta_FL_path(path, tp_reach)[source]

Calculate First-to-Last path delay (uses pred()).

\[\Delta^{FL}(\vec{tp}) = \Delta^{LL}(\vec{tp}) + \alpha_1(tp_1) - \alpha_1(pred(\vec(tp)))\]
Parameters:
  • path – Array with task activation numbers.
  • tp_reach – List of reachable paths.
Fixme :

remove dependency on tp_reach parameter.

See also

[Feiertag:08] formula (14).

static delta_LF(ls)[source]

The maximum “Last-to-First” timed path delay.

\[\Delta^{LF}(p) = max\{ \Delta(\vec(tp)) \mid \vec(tp) \in \mathbb{TP}^{first} \}\]

See also

[Feiertag:08] formula (12).

static delta_LL(possible_paths)[source]

Returns maximum latency over all reachable paths (TP_reach()).

\[\Delta^{LL}(possible_paths) = max\{\Delta(path) \mid path \in \mathbb{TP}^{reach}\}\]
# map .. calls function for each element in list
# max .. returns maximal element from list
return max(map(delta_path, TP_reach(possible_paths)))

See also

[Feiertag:08] formula (10).

delta_LL_path(path)[source]

Calculate Last-to-Last path delay using delta_path().

delta_path(path)[source]

Calculate end-to-end path delay.

\[\Delta(path) = \alpha_n(path_n) + \delta_n(path_n) - \alpha_1(path_1)\]

See also

[Feiertag:08] formula (2).

static forw(w, i, r, j)[source]

It determines the forward reachability of the two task instances \(t_w\) and \(t_r\).

\[forw( t_w (i) \rightarrow t_r (j)) = \neg att( t_w (i) \rightarrow t_r (j)) \wedge ( \neg crit( t_w (i) \rightarrow t_r (j)) \lor wait( t_w (i) \rightarrow t_r (j)))\]
Parameters:
  • w – Index of writer task in data path.
  • i – Activation index of writer task.
  • r – Index of reader task in data path.
  • j – Activation index of reader task.

See also

[Feiertag:08] formula (6)

generate_paths(index, start, stop)[source]

Generator of possible paths for given task in path.

It yields tuples with task activation index starting from `index`th task in defined path.

paths <- list()
task <- tasks_in_path.pop(0)  # assign and remove first task from the path
loop i from task.ialpha(start) to task.ialpha(stop):
    # find a time range for next task
    if length(tasks_in_path) > 0:
        time <- task.alpha(i)
        next_task <- tasks_in_path[0]  # next task in path
        j <- next_task.ialpha(time)  # closest activation index
        new_start <- next_tasks.alpha(j)  # closest activation time
        # find posible paths for next task in path from new start.
        for all path in generate_paths(new_start, stop, tasks_in_path):
            # join current activation index with found tuple
            paths.append( path.prepend(i) )
        end for
    else:
        paths.append( list(i) )  # list with only one index
    end if
end loop
return paths
pred(path, tp_reach)[source]

Temporal distance to the start of the latest previous “last-to-x” path.

See also

[Feiertag:08] formula (13).

static reach(w, i, r, j)[source]

The output of an instance \(t_w (i)\) is overwritten by instance \(t_w (i+1)\) when both instances can forward reach the same reading task instance \(t_r (j)\). In other words, \(t_w (i)\) can reach \(t_r (j)\) if and only if the following function returns True:

\[\begin{split}reach( t_w (i) \rightarrow t_r (j)) = (forw(t_w (i) -> t_r (j)) \land \neg forw(t_w (i+1) -> t_r (j)))\end{split}\]
Parameters:
  • w – Index of writer task in data path.
  • i – Activation index of writer task.
  • r – Index of reader task in data path.
  • j – Activation index of reader task.

See also

[Feiertag:08] formula (7).

static reach_path(path)[source]

Check path rechability.

path_length <- length(path)
for i in [0..path_length-1):
    tp_i  <- path[i]
    tp_i1 <- path[i+1]
    if reach(t_w(tpi) -> t_{w+1}(tp_i1)):
        return False
    end if
end for
return True

See also

[Feiertag:08] formula (8).

schedulability[source]

This method checks the global schedulability condition.

for C in components:
    # P(C) .. period of component C
    schedulable <- False
    for t in [0..P(C)]:
        if RBF(C, t) <= t:
            schedulable <- True
            break
        end if
    end for
    if not schedulable:
        return False
    end if
end for
return True

See also

[Inam2548:2011] formula (8).

t(i)[source]

Get i-th Task instance (\(t_i\)).

Parameters:i – The index of system task starting from 0.
Returns:Instance of Task.
tasks[source]

All system tasks.

tasks_in_path[source]

List of tasks in data path.

utilization[source]

Returns system utilization calculated as sum of component utilizations.

static wait(w, i, r, j)[source]

It determines if the writer finishes first, because the reader has to wait due to its priority in case of overlapped but not time-traveling execution (\(wait( t_w (i) \rightarrow t_r (j))\)).

\[\begin{split}wait( t_w (i) \rightarrow t_r (j)) = p(t_r) < p(t_w)\end{split}\]
Parameters:
  • w – Index of writer task in data path.
  • i – Activation index of writer task.
  • r – Index of reader task in data path.
  • j – Activation index of reader task.

See also

[Feiertag:08] formula (5)

Project Versions

Table Of Contents

Previous topic

Quickstart

Next topic

Licence

This Page