Sunteți pe pagina 1din 7

SEMINAR REPORT

SPRING SEMESTER 2014-2015


Task Dependency Analysis for Embedded Programs

Submitted By
BHASKAR ROY
ROLL NO. - 14CS60R25
GUIDED BY
Prof. RAJIB MALL
FACULTY ADVISER
Prof. CHITTARANJAN MANDAL
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
INDIAN INSTITUTE OF TECHNOLOGY
KHARAGPUR

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

Task Dependency Analysis for Embedded


Programs
Bhaskar Roy, Student, IIT Kharagpur, Roll No - 14CS60R25

AbstractExecution dependencies arise among the tasks of


an embedded program due to issues such as task priority, task
precedence, and intertask communication.Ordinary programs
are designed to do a task as fast as possible, but they are not
time bounded. Embedded programs are rather time bouned, so
we need to take care of other dependencies present in embedded programs. To accurately estimate time bounds, it is essential
to model the dependency model for embedded programs. In this
report, i discuss how task execution dependencies among realtime tasks can be identified from static code analysis.
KeywordsEmbedded systems, intertask communication,ordinary programs,dependencies, real-time, task execution
dependencies,Worst Case Execution Time.

I NTRODUCTION

embedded system contains processor(s)


running speci
c application programs which communicate
with an external environment in a timely
fashion.systems are now extensively being
deployed
in
safety-critical
applications
such as automotive, avionics, health-care
instrumentation. These application programs
thus have real-time requirements, i.e., there
are hard deadlines on the execution time of
such software. Unlike traditional programs,
the failures of an embedded program arise
from both functional errors as well as timing
bugs. Therefore, in addition to functional
correctness of an embedded application, it
is also necessary to guarantee its timing
completeness.The timing analysis deals with
prediction of wcet for tasks, the aim of
execution dependency analysis is to identify

Bhaskar Roy is with the Department of Computer Science &


Engineering, IIT Kharagpur, India
E-mail: vaskarroy.19@gmail.com

all those tasks in an application which can


affect the timing behavior of a given task.
Besides control and data dependencies, additional dependencies arise among tasks due
to precedence relations, task priorities, and intertask communications. These are called task
dependencies. We call these task execution dependencies. Upon a code change, task execution dependencies can cause delays to the
completion times of the dependent tasks or
cause altered task execution sequences. So it
is important to ensure that performance constraints of real-time tasks are still satisfied after
minor modifications are made to an embedded
program.

T YPES OF E MBEDDED SYSTEM

There are different types of embedded system


are present on the basis of size and computation
power.
1)
2)
3)

Small Scale Embedded Systems


8 bit or 16 bit processor.Calculator can be
the simplest example.
Medium Scale Embedded Systems
16 bit or 32 bit processor. example, Washing Machine , Microwave Oven.
Sophisticated Embedded Systems
32 bit or more processor.example, Flight
Landing Gear Systems, 32 bit or 64 bit
processor Car Braking Systems, Military
Applications, Robots.

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

Fig. 1. Small Scale Embedded Systems

Fig. 2. medium Scale Embedded Systems

Fig. 6. Real time and reactive

Fig. 7. Complex algorithm

Fig. 3. Sophisticated Scale Embedded Systems

C HARACTERISTICS OF E MBEDDED

Fig. 8. User interface

SYSTEMS

Single Functioned

O RDINARY PROGRAMS

Tightly Constraint
Real time and reactive
Complex algorithm
User interface

Programs consist of sequence of instructions,


written to perform a specified task with a computer. There are mainly two types of dependencies present in embedded programs, namely
data dependency and control dependency. Dependency analysis of ordinary programs are
performed through dependence graph, namely
program dependence graph(PDG) and system
dependence graph(SDG).
1)

Fig. 4. Single Functioned

2)

Fig. 5. Tightly Constraint

Program dependence graph(PDG)


Program dependence graph analysis dependency within a program i.e it is intraprocedural. PDG is union of control
dependence graph(CDG) and data dependence graph(DDG).
System dependence graph(PDG)
System dependence graph is a combination of more than one PDG. It will
analysis the whole system. So it is inter
procedural.

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

Fig. 9. control flow graph(CFG)

Fig. 12. Program dependence graph(PDG)

Fig. 10. control dependence graph(CDG)

Fig. 13. sample program for SDG

Fig. 11. Flow/Data dependence graph(CDG)

Fig. 14. SDG for sample program in previous


figure

5 EXECUTION D EPENDENCIES
AMONG TASKS IN EMBEDDED
PROGRAMS
In addition the dependencies present in
ordinary programs there is another type of

dependency present called task dependency .


This dependency model is called Task model.
Some assumptions releted to this model

the tasks are statically created and are

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

assigned static pri- ority values


the tasks are periodic in nature and
are scheduled using a priority-driven
preemptive task scheduler
the tasks communicate using either
shared memory or message passing
primitives. Furthermore, any access to
a shared variable is permitted through
the use of some syn- chronization
primitives such as semaphore, lock, etc.
Reason behind task dependencies in Embedded
programs Task Priority

Fig. 15.
priority

Task execution dependency due to

Task precedence
nter task communication

Shared Memory

Message Passing

5.1 Task Execution Dependency Due to Priority


Execution dependencies among tasks can implicitly arise due to task priorities because a
delay to the completion time of a higher priority task may delay a lower priority task.
Execution dependencies among tasks arising
due to priorities are transitive.
5.2 Task Execution Dependency Due to
Precedences
A precedence relation between two tasks arises
when one task is dependent on some actions or results produced by the other task.
Precedence relationship defines a partial order
among tasks.
5.3 Task Execution Dependency Due to
Message Passing
Synchronous message passing gives rise to execution dependencies among the communicating tasks in an embedded program. When two

Fig. 16. Precedence relation in tasks

Fig. 17. Task execution dependency due to


precedence
tasks communicate using a message queue, a
delay to one of the tasks can delay the other.
Task execution dependencies arising due to
message passing are both symmetric and tran-

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

sitive in nature under the synchronous message


passing model as both the sender and the receiver tasks can delay each other.
5.4 Task Execution Dependency Due to the
Access of Shared Resources
In this task model assumes that access to shared
resources is guarded using synchronization
primitives such as semaphores or locks. In this
case, a task locking a synchronization variable
for an unusually long duration may delay other
tasks sharing the same variable. Task execution
dependencies arising due to access to shared
resources are transitive and symmetric.

6 IDENTIFICATION OF TASK EXECUTION DEPENDENCIES


Considering all possible types of task execution
dependencies, the set of tasks that are execution
dependent on task ti [denoted as TD(ti )] as
T D(ti ) = succ(ti ) prior(ti ) IT Cm p(ti )
IT Cs yn(ti )
Execution dependencies existing among a set
of tasks in an embedded application can automatically be computed by performing static
analysis on the source code. The pseudocode
for identification of all the tasks which are
execution dependent on a task ti is shown in
fig.18.

A PPLICATION

One of the application of this task dependency model is Regretion test selection(RTS)
for embedded programs. Regression testingis
a type of softwaretestingthat seeks to uncover
new software bugs, or regressions, in existing
functional and non-functional areas of a system
after changes have been made to them. RTS
concerns selection of a subset of valid test cases
from an initial test suite that tests the affected
but unmodified parts of a program. Procedural
RTS techniques usually select regression test
cases based on data and control dependency
analysis. Therefore, these techniques may not
be effective for RTS of embedded programs
as they ignore execution dependencies among
tasks. This could be the reason why in industry,
regression test cases for embedded programs

Fig. 18. Algorithm 1. Pseudocode for identifying


execution-dependent tasks.
are either selected ad-hoc or based on expert
judgment or through some form of manual
program analysis. But if we follow this task
dependency model for regretion selection test
then we get successfully many test cases which
are valid and error rates become much less.

C ONCLUSION
The task model which is presented in this report is act as a important role for embedded
systems. As most of the embedded systems
are time bounded their behavoir inside the
program need to identified so that we can make
an embedded system much more reliable. Execution dependencies arise among tasks of an
embedded program on account of task precedence ordering, task priorities, and intertask
communication.. One of the applivation of this
task model is RTS which is used to find out
test cases of embedded systems at the time of
testing. This model help RTS to find out more
accurate bugs in less cost.

R EFERENCES
[1]

Swarnendu Biswas, Graduate Student Member, IEEE, Rajib Mall, Senior Member, IEEE, and Manoranjan Satpathy;
Task Dependency Analysis for Regression Test Selection
of Embedded Programs.

SEMINAR REPORT- TASK DEPENDENCY ANALYSIS FOR EMBEDDED PROGRAMS, 2014-2015

[2]

[3]

[4]
[5]

SWARNENDU BISWAS and RAJIB MALL, Indian Institute of Technology Kharagpur MANORANJAN SATPATHY, GM India Science Lab; A Regression Test Selection
Technique for Embedded Software.
Susan
Horwitz,
Thomas
Reps,
and
David
Binkley;Interprocedural Slicing Using Dependence
Graphs.
Todd M. Austin and Gurindar S. Sohi; Dynamic Dependency Analysis of Ordinary Programs.
S. Biswas, Model-Based Regression Test Selection and Optimization for Embedded Programs, Masters thesis, Indian
Inst. Technol., Kharagpur, India, Jun. 2011.

S-ar putea să vă placă și