0% found this document useful (0 votes)
47 views24 pages

EE-522: Lecture-2: Basics of Real-Time Scheduling

Uploaded by

junaid ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views24 pages

EE-522: Lecture-2: Basics of Real-Time Scheduling

Uploaded by

junaid ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

© Adeel Pasha, LUMS, Spring 2018

EE-522: Lecture-2

Basics of Real-Time Scheduling


© Adeel Pasha, LUMS, Spring 2017

Recap

Safety and Reliability

2 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Safety and Reliability: A Closer Look


 Non-RT systems: Safety and Reliability are independent
 A word processing software (might be unreliable but safe)
 A handgun (might be reliable but unsafe)
 Fail-Safe State
 If system enters this state upon failure, no damage would be done
 Every non-RT system has ≥1 fail-safe state(s)
 It makes an unreliable & unsafe system into a safe & reliable system
 Examples:
 MS Word when crashes, saves the last modifications
 Traffic signals
 Fail-safe state??
 Every RT-system does not necessarily have a fail-safe state
 Failure of the system can cause severe damage  safety-critical

3 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Safety and Reliability: A Closer Look


 Safety-critical
 Safety can only be ensured through increased reliability
 Standard reliability criterion for a flight-control computer?
 1 failure per 109 (1 Giga) flying hours
 How to achieve Reliability?
 Error avoidance (formal verification) C1
V
 Error detection and correction (EDAC) O
 Fault-tolerance C2
T
I
 Built-In Self Test (BIST) N
 Triple Modular Redundancy (TMR) G
C3

4 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Safety and Reliability: A Closer Look


 Software Fault-Tolerance Techniques
 N-Version Programming
 Similar to TMR for HW faults
 Have N different versions of a program developed by different teams
 @ runtime, these N versions give results and majority voting is used
 There could still be failures due to statistical co-relation
 If an exam question is difficult for you, it would be difficult for
everybody (conditional statement btw !)
 Recovery Blocks
 Check-pointing and Roll-back

5 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Safety and Reliability: A Closer Look

Recovery Blocks

Source: Real-time Systems: Theory and Practice by Rajib Mall


6 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2017

Taxonomy of Real-Time Tasks

7 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Types of RT Tasks 100%


Deadline

Utility

 Hard RT task 0
Response Time

 Considered failed if deadline is surpassed


 Collision detection & avoidance tasks for a robot

 Firm RT task
 There is a defined deadline
 But failure to meet deadline doesn’t mean system failure
 Live video streaming
 Temperature monitoring using sensor networks
8 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Types of RT Tasks 100%


Deadline

Utility
 Soft RT task 0
Response Time
 The timing constraints are not absolute
 Average response time is measured
 Internet connectivity (in general), web browsing

 Non-RT task
 Any example!

9 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Events in RT-System
 Stimulus Events
 Generated by environment and used by system
 Periodic, Aperiodic

 Response Events
 Produced by system and used by environment

 Example: dial-tone reception on lifting the receiver


 Stimulus: detaching the hand-set receiver
 Response: dial-tone generation
10 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Types of Timing Constraints


 Delay constraint
Δ ≥ delay
 Minimum time (delay) must pass
between two events
t(e1) delay t(e2)
t =0
 Deadline constraint
 Maximum permissible separation
between two events should not Δ ≤ deadline
be surpassed
t(e1) t(e2)
deadline
 Duration constraint t =0
 An event must occur for a certain
duration of time
11 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints: EFSM*


 Case Study of a Land-Line Telephone System
Stimulus Event

Person Telephone
(Environment) (System)

Response Event
* EFSM: Extended Finite State Machine
12 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints


 Deadline Constraints
 Stimulus-Response (S-R) Type
 Also called Performance Constraint Await
1st Digit
Await
Dial-Tone/
Dial-
Set Timer (30s)
Tone

Timer
Await
Receiver Expired/
Receiver
Lifted/ Beeping
Replacement
13 EE-522: Embedded Systems
Set Timer (3s) 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints


 Deadline Constraints
 Response-Stimulus (R-S) Type
Await
 Also called Behavioral Constraint
2nd Digit

Await 1st Digit/


1st Digit Set Timer (3s)

Timer Await
Dial-Tone/ Expired/ Receiver
Set Timer (30s) Beeping Replacement
14 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints


 Deadline Constraints
 Stimulus-Stimulus (S-S) Type
Await 3rd
Digit
2nd Digit/
Await
Set Timer (3s)
2nd Digit

Timer Expired/
Await
1stDigit/ Beeping
Receiver
Set Timer (3s) Replacement
15 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints


 Deadline Constraints
 Response-Response (R-R) Type Await
Call
Pick-UP
Await
Ring-Back/
Ring-Back
Set Timer (1 min)
Tone

Timer
Await
Ring-Tone to Expired/
Receiver
Callee/ Beeping
Replacement
Set Timer (3s)
16 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints


 Delay Constraints
 Stimulus-Stimulus (S-S) Type Await 3rd
Timer Expired Digit
Await
2nd
Digit

2nd Digit/Beeping
Await
1st Digit/ Receiver
Set Timer (50ms) Replacement

17 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Modeling Timing Constraints

Timing
Constraints

Performance Behavioral

Delay/Deadline Duration Delay/Deadline Duration

S-R R-R R-S S-S

18 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2017

Basics of Real-Time Task Scheduling

19 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Important Notions
 Task Instance
 Every stimulus event triggers a response event
 A piece of code has to be run, etc.
 Could be periodic or aperiodic
 Ti(j)  Jth instance of Task i

 Most of the tasks are deadline-constrained tasks

 Relative vs. Absolute Deadline


 Absolute: Measured with the help of a real clock
 Relative: referenced to some other event
20 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Important Notions
 Relative vs. Absolute Deadline

Relative Deadline of Ti = di

Absolute Deadline of Ti (1) = φi + di

φi
Ti (1) Ti (2)

0
Arrival or activation of Ti (1)
21 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2018

Important Notions
 Task Precedence
 If a task must be completed before another task to start
 It’s recurring
 Defines partial ordering among tasks

T1 T3

T4 T2

22 EE-522: Embedded Systems 1/25/2018


© Adeel Pasha, LUMS, Spring 2018

Important Notions
 Data Sharing
 Tasks often need to share data
 Example: A temperature sensing and processing node
 Data sharing can imply a task precedence
 But not mandatory
 Task precedence without data sharing or data sharing without
precedence?
T1 T3

T4 T2
23 EE-522: Embedded Systems 1/25/2018
© Adeel Pasha, LUMS, Spring 2017

Tasks Classification

24 EE-522: Embedded Systems 1/25/2018

You might also like