Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
York University
Computer Science
1 Introduction
1.2 Overview
1.3 Definitions
The behavior of a RT system can be defined by listing stimuli, associated responses and
the time at which the response must be made. There are, in general, two types of stimuli:
Periodic and aperiodic.
The RT software architecture should guarantee a transfer of control to the appropriate
modules as soon as a stimulus is received. This is normally achieved by designing t eh
system as a set of concurrent, cooperative processes. Part of the RT system is deducted to
managing these processes.
Actuator Actuator
Actuator
Design process (Stimulus/Response)
∗ Identify stimuli and associated responses
∗ Identify timing constraints for each pair
∗ Aggregate the stimuli and response processing into a number of concurrent
processes
∗ Associate a process with each class of stimulus and response:
1.5 RT Executable
∗ Responsible for process management & resource allocation
∗ Start appropriate process after receiving stimuli
∗ Allocate process and memory
∗ Analogous to OS
∗ Components:
1. RT clock
2. Interrupt handler, manages aperiodic requests
3. Scheduller
4. Resource Manager, given a process scheduled for execution it allocates memory
and processor
5. Dispatcher, starting the execution
6. Configuration Manager, dynamic reconfiguration of the system
7. Fault Manager, detecting hardware and software faults and tacking appropriate
actions.
Design challenges
∗ Software often encapsulates domain expertise, such as control engineering, sensors,
etc. It requires understanding of the domain and supporting technology, such as
signal processing.
∗ Network capability, which introduces significant complications such as
downloadable modules.
∗ Existing software design techniques aren’t suitable. Embedded s/w is often designed
by engineers who are classically trained in the domain.
∗ Reliability = 1 − Pfail = 1 − å π (ξ )i
i∈Failure Set
Plain English: 8 to 6 CPUs are alive à 2 triads, 2 to 5 CPUs are alive à 1 triad; 0 to 2
CPUs are alive à system is down. To calculate total throughput, sum up the performances
in all cases multiplied by probability of each case.
Assume a Poisson distribution for the failure mechanism with rate λ. Failures are
permanent. With Markov diagram we can show different states of a system, starting with 9
processors.
Side notes
• Markov chains: A sequence of random variables X1…Xn if:
Prob(Xn+l=xn+l | X1=x1, X2=x2,…Xn=xn)
=Prob(Xn+l=xn+l | Xn=xn)
Xi is the state of the Markov chain at discrete time i. Plain English: Future state
of the chain depends only on the present state, not the past.
∗ The process is a discrete-time process, i.e. there are countably many random
variables which define the process.
∗ The state space is countable or finite.
2.4 Performability
∗ Ties computer performance with process performance.
∗ Includes the relation between different subsystems.
∗ Controlled process performance is defined with sever Accomplishments Levels.
∗ Each AL is related with execution of a certain set of control tasks.
∗ The performability of the RT system is defined as the Pr. That the system will allow
each AL to be met. If there are n ALs of A1, A2…An, the performability of the RT
system is:
(P(A1), P(A2), … P(An)),
P(Ai): Pr that the system allow the controlled process reach AL Ai.
∗ With Performability the performance quality of the controlled process, as seen by
the user, is linked to the technical performance of the RT system.
SA=[-b, +b]
State vector: Σ=(x, V, a), coordinate, velocity, acceleration.
Controller: Produce enough thrust to keep the particle within SA.
Hard deadline and Cost Functions are functions of the process state (x, V, a).
ς(0,0,0) à deadline: ∞
ς(x,0,0) à deadline: ∞
ς(+b,V,0) à deadline: 0
3.3 Encapsulation
• Specification and development of software subcomponents, with well defined
function inter-connections and interfaces.
• If the specification of the entire software system can be verified based on the specs
of immediate subcomponents the decomposition is compositional, e.g. in sequential
programs.
• Class construct: OOP and languages, used for object abstraction.
o Object abstraction: harder to design and analyze.
o Process abstraction: More applicable to RT systems
Software Interfaces
• Specify interfaces that each subsystem furnishes.
• Detail the application programming interface (API) by specifying function calls,
data structures, and global data used in each subsystem’s interface.
• Create header files with function prototypes, data structure declarations, class
declarations, so on.
• Example: button monitoring subsystem needs one interface function, which waits till
a button is pressed and then returns a value identifying the button.
#define Button_up 0
#define Button_down 1
#define Button_power 2
int GetButtonPress(void);
Task:
Acting to consume resources and producing one or more results.
Precedence Graph:
Representing precedence relations between tasks. Notation:
α(T) Precedence-task set of T.
Rules: Ti must precede Tj
iαj iαj & jαkÞi&k
• Each task has resource requirements, and requires some exec time.
• A resource must be exclusively held by a task.
Release The time at which all the data that are required to begin the
time task are available.
Deadline The time by which the task must complete its execution.
Relative The absolute deadline minus the release time (total time
deadline available per operation).
Ex: A feasible preemptive schedule for the periodic process executions p0, p1, p2 and the
asynchronous process executions a0, a1, a2 within the finite time interval [0, 56]. a1
preempts p1 at time 27, and a2 preempts p2 at time 50.
ì W (t ) ü
Max í Min i ý ≤ 1 for i ∈ {1..n}, t ∈ Ti
2. If
î
i∈{1.. n } t∈τ i t þ then the entire set Ti
i∈{1..n} is RM-schedulable.