Documente Academic
Documente Profesional
Documente Cultură
Analysis for
Embedded
Programs
Presented by
Bhaskar Roy
14CS60R25
Under the Guidance of
Prof. Dr. Rajib Mall
9/13/15
Topics to be discussed:
Introduction
Ordinary Programs
Task dependency in Embedded programs
Identification of task dependencies
Application
9/13/15
Introduction:
Embedded System: A microcontroller-based
9/13/15
Components of embedded
system hardware:
9/13/15
Types of Embedded
system:
Small Scale Embedded Systems:
Applications:
9/13/15
Characteristics of Embedded
systems:
Single Functioned
Tightly Constraint
Manufacturing cost
Performance, Size, Power
Real time and reactive
Car breaking system
Flights landing gear control
9/13/15
Characteristics of Embedded
systems:
Complex algorithm
Digital Camera
User interface
ATM
Multi Rate
Digital Camera
9/13/15
Challenges in Embedded
system design
Meeting
Deadlines
9/13/15
Ordinary Programs
9/13/15
10
9/13/15
11
Dependencies in Ordinary
programs :
Data dependency
Control dependency
9/13/15
12
Dependency Analysis in
Ordinary programs :
Performed through Dependence
Graph
Program Dependence Graph (PDG)
9/13/15
13
9/13/15
Dependence Graph
Dependence Graph
14
Enter
F
sum = 0
i = 1
printf(sum)
printf(i)
sum = sum + i
9/13/15
i = i + i
15
Control Dependence
Control dependence
Graph
int main() {
int sum = 0;
int i = 1;
while (i < 11) {
sum = sum + i;
i = i + 1;
}
printf(%d\n,sum);
printf(%d\n,i);
}
T
sum = 0
i = 1
T
sum = sum + i
9/13/15
qq is reached from p
if condition p is
true (T), not otherwise.
q Similar for false (F).
Enter
T
printf(sum)
printf(i)
i = i + i
16
Flow Dependence
Flow dependence
Graph
int main() {
int sum = 0;
int i = 1;
while (i < 11) {
sum = sum + i;
i = i + 1;
}
printf(%d\n,sum);
printf(%d\n,i);
}
sum = 0
i = 1
sum = sum + i
9/13/15
qValue of variable
assigned at p may be
used at q.
Enter
printf(sum)
printf(i)
i = i + i
17
sum = 0
i = 1
T
sum = sum + i
9/13/15
Control dependence
Flow dependence
Enter
T
printf(sum)
printf(i)
i = i + i
18
procedural dependences.
9/13/15
19
Call p
Call p
Enter p
9/13/15
20
9/13/15
21
sum = 0
i = 1
printf(sum)
Call add
Call add
printf(i)
sum = xout
xin = i
yin=
1
i = xout
Enter add
9/13/15
x = xinBhaskaryRoy=, 14CS60R215
x=
x+y
, Task
Dependency
yin Analysis for Embedded
Programs.
xout = x
22
Dependency in Embedded
Programs
9/13/15
23
Some Assumptions:
Tasks are statically created and are assigned
9/13/15
24
9/13/15
25
9/13/15
26
Tasks
Execution Order: 1, 2, 3
2
3
Time
Tasks
1
Execution Order: 1, 2, 3
2
3
Time
9/13/15
27
4
5
28
2
3
3
6
Time
Task Arrival
Delayed
2
3
9/13/15
Deadline Miss
3
6
Time
29
9/13/15
30
9/13/15
31
Waitin
g
Send Msg
9/13/15
j
32
Waitin
g
Send Msg
i
9/13/15
Deadline
Miss
j
33
9/13/15
34
lock sem
read var
compute var
write var
unlock sem
lock sem
write var
unlock sem
i
9/13/15
j
35
1
Time
1
Delay
2
3
Deadline
9/13/15
36
IDENTIFICATION OF
TASK EXECUTION
DEPENDENCIES
9/13/15
37
identifying execution-dependent
tasks.
1:
##
procedure IDENTIFYTD
Input
: embedded program
## Output
: set of tasks that are execution dependent on
each task in input
2: succ()
3: prior ()
4: ()
5: ()
6: for each task modified in INPUT do
/* Compute succ() */
7: for every occurrence of a join( )/wait( ) primitive in
do
8:
Determine whether any task is dependent on due to precedence
9:
succ() = ()
/*Add all to succ()
10:
end for
/*Scan input and compare priorities of the other tasks with that of
11: Determine prior ()
/* Scan input to find out matching pairs of message queues and synchronization
variables
12: Determine () and ()
13: end for
14: end procedure
9/13/15
38
IDENTIFICATION OF TASK
EXECUTION DEPENDENCIES
on task [denoted by ] is :
= succ()
prior()
()
()
39
Application
9/13/15
40
9/13/15
41
9/13/15
42
Use of RTS:
Use of an effective RTS technique can help to
9/13/15
43
9/13/15
44
9/13/15
45
9/13/15
46
9/13/15
47
References:
[2]
[4]
9/13/15
48
Questions ?
9/13/15
49
Thank You
9/13/15
50