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

Task Dependency Analysis for Embedded Programs

Embed Size (px)

DESCRIPTION

This is my pdf report on Task dependency analysis for embedded Programs.

Citation preview

Page 1: Task Dependency Analysis for Embedded Programs

SEMINAR REPORT

SPRING SEMESTER 2014-2015

Task Dependency Analysis for Embedded Programs

Submitted ByBHASKAR ROY

ROLL NO. - 14CS60R25

GUIDED BYProf. RAJIB MALL

FACULTY ADVISERProf. CHITTARANJAN MANDAL

DEPARTMENT OF COMPUTER SCIENCE &ENGINEERING

INDIAN INSTITUTE OF TECHNOLOGYKHARAGPUR

F

Page 2: Task Dependency Analysis for Embedded Programs

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

Task Dependency Analysis for EmbeddedPrograms

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

F

Abstract—Execution dependencies arise among the tasks ofan embedded program due to issues such as task priority, taskprecedence, and intertask communication.Ordinary programsare designed to do a task as fast as possible, but they are nottime bounded. Embedded programs are rather time bouned, sowe need to take care of other dependencies present in embed-ded programs. To accurately estimate time bounds, it is essentialto model the dependency model for embedded programs. In thisreport, i discuss how task execution dependencies among real-time tasks can be identified from static code analysis.

Keywords—Embedded systems, intertask communica-tion,ordinary programs,dependencies, real-time, task executiondependencies,Worst Case Execution Time.

1 INTRODUCTION

AN embedded system contains processor(s)running speci

c application programs which communicatewith an external environment in a timelyfashion.systems are now extensively beingdeployed in safety-critical applicationssuch as automotive, avionics, health-careinstrumentation. These application programsthus have real-time requirements, i.e., thereare hard deadlines on the execution time ofsuch software. Unlike traditional programs,the failures of an embedded program arisefrom both functional errors as well as timingbugs. Therefore, in addition to functionalcorrectness of an embedded application, itis also necessary to guarantee its timingcompleteness.The timing analysis deals withprediction of wcet for tasks, the aim ofexecution dependency analysis is to identify

• Bhaskar Roy is with the Department of Computer Science &Engineering, IIT Kharagpur, IndiaE-mail: [email protected]

all those tasks in an application which canaffect the timing behavior of a given task.

Besides control and data dependencies, ad-ditional dependencies arise among tasks dueto precedence relations, task priorities, and in-tertask communications. These are called taskdependencies. We call these task execution de-pendencies. Upon a code change, task exe-cution dependencies can cause delays to thecompletion times of the dependent tasks orcause altered task execution sequences. So itis important to ensure that performance con-straints of real-time tasks are still satisfied afterminor modifications are made to an embeddedprogram.

2 TYPES OF EMBEDDED SYSTEM

There are different types of embedded systemare present on the basis of size and computationpower.

1) Small Scale Embedded Systems8 bit or 16 bit processor.Calculator can bethe simplest example.

2) Medium Scale Embedded Systems16 bit or 32 bit processor. example, Wash-ing Machine , Microwave Oven.

3) Sophisticated Embedded Systems32 bit or more processor.example, FlightLanding Gear Systems, 32 bit or 64 bitprocessor Car Braking Systems, MilitaryApplications, Robots.

Page 3: Task Dependency Analysis for Embedded Programs

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

Fig. 1. Small Scale Embedded Systems

Fig. 2. medium Scale Embedded Systems

Fig. 3. Sophisticated Scale Embedded Systems

3 CHARACTERISTICS OF EMBEDDEDSYSTEMS

• Single Functioned

• Tightly Constraint

• Real time and reactive

• Complex algorithm

• User interface

Fig. 4. Single Functioned

Fig. 5. Tightly Constraint

Fig. 6. Real time and reactive

Fig. 7. Complex algorithm

Fig. 8. User interface

4 ORDINARY PROGRAMS

Programs consist of sequence of instructions,written to perform a specified task with a com-puter. There are mainly two types of dependen-cies present in embedded programs, namelydata dependency and control dependency. De-pendency analysis of ordinary programs areperformed through dependence graph, namelyprogram dependence graph(PDG) and systemdependence graph(SDG).

1) Program dependence graph(PDG)Program dependence graph analysis de-pendency within a program i.e it is in-traprocedural. PDG is union of controldependence graph(CDG) and data de-pendence graph(DDG).

2) System dependence graph(PDG)System dependence graph is a combi-nation of more than one PDG. It willanalysis the whole system. So it is interprocedural.

Page 4: Task Dependency Analysis for Embedded Programs

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

Fig. 9. control flow graph(CFG)

Fig. 10. control dependence graph(CDG)

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

5 EXECUTION D EPENDENCIESAMONG TASKS IN EMBEDDEDPROGRAMSIn addition the dependencies present inordinary programs there is another type of

Fig. 12. Program dependence graph(PDG)

Fig. 13. sample program for SDG

Fig. 14. SDG for sample program in previousfigure

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

Page 5: Task Dependency Analysis for Embedded Programs

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

assigned static pri- ority values

• the tasks are periodic in nature andare scheduled using a priority-drivenpreemptive task scheduler

• the tasks communicate using eithershared memory or message passingprimitives. Furthermore, any access toa shared variable is permitted throughthe use of some syn- chronizationprimitives such as semaphore, lock, etc.

Reason behind task dependencies in Embeddedprograms-• Task Priority

• Task precedence

• nter task communication

◦ Shared Memory

◦ Message Passing

5.1 Task Execution Dependency Due to Pri-orityExecution dependencies among tasks can im-plicitly arise due to task priorities because adelay to the completion time of a higher pri-ority task may delay a lower priority task.Execution dependencies among tasks arisingdue to priorities are transitive.

5.2 Task Execution Dependency Due toPrecedencesA precedence relation between two tasks ariseswhen one task is dependent on some ac-tions or results produced by the other task.Precedence relationship defines a partial orderamong tasks.

5.3 Task Execution Dependency Due toMessage PassingSynchronous message passing gives rise to ex-ecution dependencies among the communicat-ing tasks in an embedded program. When two

Fig. 15. Task execution dependency due topriority

Fig. 16. Precedence relation in tasks

Fig. 17. Task execution dependency due toprecedence

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

Page 6: Task Dependency Analysis for Embedded Programs

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

sitive in nature under the synchronous messagepassing model as both the sender and the re-ceiver tasks can delay each other.

5.4 Task Execution Dependency Due to theAccess of Shared ResourcesIn this task model assumes that access to sharedresources is guarded using synchronizationprimitives such as semaphores or locks. In thiscase, a task locking a synchronization variablefor an unusually long duration may delay othertasks sharing the same variable. Task executiondependencies arising due to access to sharedresources are transitive and symmetric.

6 IDENTIFICATION OF TASK EXE-CUTION DEPENDENCIESConsidering all possible types of task executiondependencies, the set of tasks that are executiondependent on task ti[denoted as TD(ti)] asTD(ti) = succ(ti) ∩ prior(ti) ∩ ITCmp(ti) ∩ITCsyn(ti)

Execution dependencies existing among a setof tasks in an embedded application can au-tomatically be computed by performing staticanalysis on the source code. The pseudocodefor identification of all the tasks which areexecution dependent on a task ti is shown infig.18.

7 APPLICATION

One of the application of this task depen-dency model is Regretion test selection(RTS)for embedded programs. Regression testingisa type of softwaretestingthat seeks to uncovernew software bugs, or regressions, in existingfunctional and non-functional areas of a systemafter changes have been made to them. RTSconcerns selection of a subset of valid test casesfrom an initial test suite that tests the affectedbut unmodified parts of a program. ProceduralRTS techniques usually select regression testcases based on data and control dependencyanalysis. Therefore, these techniques may notbe effective for RTS of embedded programsas they ignore execution dependencies amongtasks. This could be the reason why in industry,regression test cases for embedded programs

Fig. 18. Algorithm 1. Pseudocode for identifyingexecution-dependent tasks.

are either selected ad-hoc or based on expertjudgment or through some form of manualprogram analysis. But if we follow this taskdependency model for regretion selection testthen we get successfully many test cases whichare valid and error rates become much less.

CONCLUSION

The task model which is presented in this re-port is act as a important role for embeddedsystems. As most of the embedded systemsare time bounded their behavoir inside theprogram need to identified so that we can makean embedded system much more reliable. Ex-ecution dependencies arise among tasks of anembedded program on account of task prece-dence ordering, task priorities, and intertaskcommunication.. One of the applivation of thistask model is RTS which is used to find outtest cases of embedded systems at the time oftesting. This model help RTS to find out moreaccurate bugs in less cost.

REFERENCES[1] Swarnendu Biswas, Graduate Student Member, IEEE, Ra-

jib Mall, Senior Member, IEEE, and Manoranjan Satpathy;Task Dependency Analysis for Regression Test Selectionof Embedded Programs.

Page 7: Task Dependency Analysis for Embedded Programs

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

[2] SWARNENDU BISWAS and RAJIB MALL, Indian Insti-tute of Technology Kharagpur MANORANJAN SATPA-THY, GM India Science Lab; A Regression Test SelectionTechnique for Embedded Software.

[3] Susan Horwitz, Thomas Reps, and DavidBinkley;Interprocedural Slicing Using DependenceGraphs.

[4] Todd M. Austin and Gurindar S. Sohi; Dynamic Depen-dency Analysis of Ordinary Programs.

[5] S. Biswas, Model-Based Regression Test Selection and Op-timization for Embedded Programs, Masters thesis, IndianInst. Technol., Kharagpur, India, Jun. 2011.