Task Dependency Analysis for Embedded Programs

Embed Size (px)

DESCRIPTION

Embedded programs are very safety critical programs. Testing of embedded programs is very difficult due real time nature of embedded systems. Task dependency is a new type of dependency defined on embedded systems which increase testing accuracy of embedded systems.

Citation preview

PowerPoint Presentation

Task Dependency Analysis for Embedded ProgramsPresented by Bhaskar Roy14CS60R25

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 1Under the Guidance ofProf. Dr. Rajib Mall1Topics to be discussed: Introduction

Ordinary Programs

Task dependency in Embedded programs

Identification of task dependencies

Application 30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 2Introduction:Embedded System: A microcontroller-based control system which processes a fixed set of programmed instructions to control electromechanical equipment which may be part of an even larger system.

Embedded programs are programs that are embedded in a system to perform a dedicated function.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 3Components of embedded system hardware:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 4

Types of Embedded system:Small Scale Embedded Systems: 8 bit or 16 bit processorCalculator can be the simplest example

Medium Scale Embedded Systems:16 bit or 32 bit processorWashing Machine , Microwave Oven

Sophisticated Embedded Systems:32 bit or 64 bit processorFlight Landing Gear Systems, Car Braking Systems, Military Applications, Robots.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 5

Applications:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 6

Characteristics of Embedded systems:Single Functioned

Tightly ConstraintManufacturing cost Performance, Size, Power

Real time and reactive Car breaking system Flights landing gear control

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 7

Characteristics of Embedded systems:Complex algorithmDigital Camera

User interfaceATM

Multi RateDigital Camera

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 8

Challenges in Embedded system design30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 9

Meeting DeadlinesOrdinary Programs30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 10Programs for general purpose ComputerPrograms consist of sequence of instructions, written to perform a specified task with a computer.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 11Dependencies in Ordinary programs :Data dependency

Control dependency

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 12Dependency Analysis in Ordinary programs :Performed through Dependence GraphProgram Dependence Graph (PDG)Dependencies within one procedureIntraproceduralSystem Dependence Graph (SDG)Dependencies within entire systemInterprocedural

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 13Program Dependence Graph (PDG)

Control Flow Graph (CFG)PDG is union of:Control Dependence Graph

Flow Dependence Graph30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 1430-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 15Control Flow GraphEntersum = 0i = 1while(i < 11)printf(sum)printf(i)sum = sum + ii = i + iTFint main() {int sum = 0;int i = 1;while (i < 11) {sum = sum + i;i = i + 1;}printf(%d\n,sum);printf(%d\n,i);}30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 16q is reached from pif condition p istrue (T), not otherwise.Control Dependence GraphControl dependencepqTpqFSimilar for false (F).Entersum = 0i = 1while(i < 11)printf(sum)printf(i)sum = sum + ii = i + iTTTTTTTTint main() {int sum = 0;int i = 1;while (i < 11) {sum = sum + i;i = i + 1;}printf(%d\n,sum);printf(%d\n,i);}30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 17Flow Dependence Graphint main() {int sum = 0;int i = 1;while (i < 11) {sum = sum + i;i = i + 1;}printf(%d\n,sum);printf(%d\n,i);}Entersum = 0printf(sum)printf(i)sum = sum + ii = i + iFlow dependencepqValue of variableassigned at p may beused at q.i = 1while(i < 11)30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 18Program Dependence Graph (PDG)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);}Entersum = 0i = 1while(i < 11)printf(sum)printf(i)sum = sum + ii = i + iTTTTTControl dependenceFlow dependenceTTTSystem Dependence Graph (SDG)

combine PDGs to model inter-procedural dependences.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 1930-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 20System Dependence Graph (SDG)Enter mainCall pCall pEnter p30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 21A Program With Auxiliary Procedure int main() {int sum = 0;int i = 1;while (i < 11) { sum = add(sum,i); i = add(i,1);}printf(%d\n,sum);printf(%d\n,i);}int add(int x, int y) {return x + y;}30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 22SDG for the Sum ProgramEnter mainsum = 0i = 1while(i < 11)printf(sum)printf(i)Call addCall addxin = sumyin = isum = xoutxin = iyin= 1i = xoutEnter addx = xiny = yinx = x + yxout = xDependency in Embedded ProgramsIn addition the dependencies present in ordinary programs there is another type of dependency present called task dependency .

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 23Some Assumptions:Tasks are statically created and are assigned static priority values

The tasks are periodic in nature and are scheduled using a priority-driven preemptive task scheduler

Tasks communicate using either shared memory or message passing primitives30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 24Reason behind task dependencies in Embedded programs:Task Priority

Task precedence

Inter task communicationShared MemoryMessage Passing30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 25Task execution dependencies due to priorities:A delay to the completion of higher priority task may delay a lower priority task30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 26Task execution dependencies due to priorities:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 2712pri(3)>pri(2)>pri(1)3TasksTasksExecution Order: 1, 2, 31TimeTime23Execution Order: 1, 2, 3Task execution dependencies due to precedencies:A precedence relation between two tasks arises when one task is dependent on some actions or results produced by the other task.Precedence relation defines a partial order(PO) among tasks.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 2813245Task execution dependencies due to precedencies:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 29123TimeTask Arrival368123TimeTask Arrival368DelayedDeadline MissDeadlineTask execution dependencies due to Inter task communication:Message Passing.

Shared Memory.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 30Task execution dependencies due to Message Passing:When two tasks communicate using a message passing strategy a delay to one of the task can delay to the other task.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 31Task execution dependencies due to Message Passing:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 32Some ComputationSend MsgWaitingijTask execution dependencies due to Message Passing:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 33Some ComputationSend MsgWaitingijModificationsDeadline MissTask execution dependencies due to Shared Memory:Accessing of shared memory is synchronized through semaphore or locks.

If a task lock a synchronization variable for an unusually long time , then it will affect the execution of other tasks. 30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 34Task execution dependencies due to Shared Memory:30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 35lock semwrite varunlock semlock semread varcompute varwrite varunlock semvarijTiming dependency among tasks.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 36123Time123DeadlineDelayIDENTIFICATION OF TASK EXECUTION DEPENDENCIES30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 37Algorithm: Pseudo code for identifying execution-dependent tasks.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 38IDENTIFICATION OF TASK EXECUTION DEPENDENCIES30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 39Application30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 40APPLICATION OF TASK EXECUTION DEPENDENCE ANALYSIS :Regression Test Selection For Embedded Programs.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 41Regression Test Selection For Embedded Programs :Regression testingis a type of softwaretestingthat seeks to uncover new software bugs, orregressions, 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.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 42Use of RTS:Use of an effective RTS technique can help to substantially reduce the testing costs in environments in which a program undergoes frequent modifications.

30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 43

Testing Real Time Embedded Systems30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 44Difficulty In Testing Real Time Embedded SystemsThe timing constraints and concurrency features in multitasking causes embedded systems to produce non-deterministic outputs.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 45Defining Coverage Metric For Real-Time Embedded System 30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 46Coverage Metrics In Real-Time Embedded SystemsIn addition to the metrics used in normal programs some new types of metrics are needed to cover embedded real-time dependencies present in real-time embedded systems30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 47References: [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.

[2] SWARNENDU BISWAS and RAJIB MALL, Indian Institute of Technology Kharagpur MANORANJAN SATPATHY, GM India Science Lab; A Regression Test Selection Technique for Embedded Software.

[3] Susan Horwitz, Thomas Reps, and David Binkley;Interprocedural Slicing Using Dependence Graphs.

[4] Todd M. Austin and Gurindar S. Sohi; Dynamic Dependency Analysis of Ordinary Programs.30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 48Questions ?30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 49Thank You30-Jun-15Bhaskar Roy , 14CS60R215 , Task Dependency Analysis for Embedded Programs. 50