Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
September 23, 2019 Sam Siewert
CEC 450Real-Time Systems
Lecture – RM Analysis Examples with Cheddar
Using Cheddar [Basics]Download for Windows [here] or Use “T” DriveUse “Edit” to Start
1. Start with Update Processors
2. Add it3. Update Address Spaces,
Add it4. Update Tasks, Add S1…Sn
5. Note Cheddar Runs over LCM
Sam Siewert 2
Newer Versions of the ToolCheddar 2.1 for Windows [on T drive]– Examples-2.1 for CEC450– Download of Cheddar-2.1 for win32
Cheddar 3.0 for Windows [on T drive]– Examples-3.0 for CEC450 [Tested and ported from 2.1]– Cheddar 3.0 User’s Guide - Here
Cheddar 3.1 for Windows [Download or T drive]– Examples-3.1 for CEC450 [Tested and ported from 3.0]– Cheddar 3.1 User’s Guide - Here
Cheddar 3.1 for Linux [Download]– Run on Jetson or NUC [I have not tested yet]
Local copy - http://mercury.pr.erau.edu/~siewerts/cec450/design/Cheddar-tools/
Sam Siewert 3
Use Windows 3.1
Version
Cheddar 3.1 is Latest (2019)Cheddar 3.1 has a new “look and feel”– Run it from -
T:\CEC450\Cheddar-Tools\Cheddar-3.1-win32-bin
– Examples are here -T:\CEC450\Cheddar-Tools\Cheddar-Examples-3.1
Load an XML Example
Hit the Gray Start Button (it is NOT grayed out)
QUICK START document
Sam Siewert 4
#1 - Run
#2 - Browse to Example
#3 - Hit Play and OK
#4 - Review analysis and
change parameters and
re-run as needed
Simulation 2.1Hit Simulation button to StartCalculates LCM, Runs, Produces Timing Diagram and Summary
Sam Siewert 5
Simulation Button
Timing Diagram
Summary – Note theconclusion “seems”
Simulation 3.1
Simulation button looks like grayed out arrowLoad an XML configuration and hit it anyway!E.g. Example-9, with LCM=24 - Check match
Sam Siewert 6
Example 9 Service Freq f f0 multiple Period T WCET Utility LCM/TS1 0.166667 4 T1 6 C1 1 U1 16.67% LCM = 24 4S2 0.125 3 T2 8 C2 2 U2 25.00% 3S3 0.083333 2 T3 12 C3 4 U3 33.33% LUB = 75.68% 2S4 0.041667 1 T4 24 C4 6 U4 25.00% Utot = 100.00% 1
RM Schedule 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24S1
S2
S3
S4
Simulation button in 3.1
v3.1 - Building up a new XML file for Ex 9File New, Use “Edit” to Start
1. Hardware, Core, Add it
2. Hardware, Processor, Select Core from above, Add it
3. Software, Address Space, Add it
4. Software, Tasks, Add S1…Sn
5. Run it!6. Compare7. Note Cheddar
Runs over LCM
Sam Siewert 7
Select Hardware, Software or Deployment#1
#2
#3
#4
#5
Feasibility TestHit Feasibility button to TestFor RM Policy, Cheddar Uses the RM LUBFor All Policies, Cheddar Provides Worst-Case Analysis
Change with “Edit” and Update Processors to EDF
Sam Siewert 8
RM Policy Example
Run Again with EDF to ComparePriorities are Dynamic, So Just Change Processor Scheduler Policy, Re-Run Simulation and Feasibility
Sam Siewert 9
Note EDF
Note LLF
Example-0 Timing DiagramRM, EDF, LLF Succeed, 73.33% CPU Utilization
Sam Siewert 10
Example 0 T1 2 C1 1 U1 0.5 LCM = 30T2 10 C2 1 U2 0.1T3 15 C3 2 U3 0.133 Utot = 0.733
RM Schedule 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15S1S2S3EDF ScheduleS1S2S3TTDS1 2 X 2 X 2 X 2 X 2 X 2 X 2 X 2S2 10 9 X X X X X X X X X X X X XS3 15 14 13 12 11 10 X X X X X X X X X
Example-0 Cheddar RTSSDownload Cheddar RT Analyzer, Example-0 XML
Sam Siewert 11
Cheddar Simulates over LCM (Hyperperiod)
26.66% Free Time
Example-1 Timing DiagramRM FAILS, EDF, LLF Succeed, 98.57% CPU Utilization
Sam Siewert 12
Example 1 T1 2 C1 1 U1 0.5 LCM = 70T2 5 C2 1 U2 0.2T3 7 C3 2 U3 0.285714 Utot = 0.985714
RM ScheduleS1 ????????S2 ????????S3 LATEEDF ScheduleS1S2S3TTDS1 2 X 2 X 2 X 2 X 2 XS2 5 4 X X X 5 4 3 X XS3 7 6 5 4 3 2 X 7 6 5LLF ScheduleS1S2S3LaxityS1 1 X 1 X 1 X 1 X 1 XS2 4 3 X X X 4 3 2 X XS3 5 4 3 2 2 1 X 5 4 3
Example-1 Cheddar RTSSRM Not Feasible by LUB or by Inspection over LCM
EDF?
Sam Siewert 13
Example-1 Cheddar RTSSEDF Simulation over LCM of 70
LLF Simulation over LCM of 70
Worst Case Feasibility Test– Fixed Priority (RM Policy) FAILS LUB and WC Feasibility Test
(Scheduling Point or Completion Test)– Dynamic Priority Succeeds by Two Methods
Sam Siewert 14
Example 9 – RM PolicyHarmonic Services with 100% CPU Utilization
Preemptions – 3 in Total: – @6 S1 preempts S3– @12 S1 preempts S4– @16 S2 preempts S3
Sam Siewert 15
Example 9 harmoni multiple LCM/Tf3 0.167 4 T1 6 C1 1 U1 0.167 LCM = 24 4f2 0.125 3 T2 8 C2 2 U2 0.25 3f1 0.083 2 T3 12 C3 4 U3 0.333 2f0 0.042 1 T4 24 C4 6 U4 0.25 Utot = 1 1
RM Schedule 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24S1S2S3S4
Example 9 – Cheddar RM WC Analysis and Simulation
Run WC analysisRun Simulation to Graph over Longest T or LCM
Sam Siewert 16
Example 9 – RM SimulationAutomates Hand SimulationSimpler Modification for Multiple CPUs, Policies, etc.
Sam Siewert 17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Example 9 – EDF SimulationNo Difference from RM in SimulationTies Could Be Broken Randomly [Most Often Favor Highest Frequency – Same as RM]Worst-Case Analysis However Shows “task set is schedulable”
Sam Siewert 18
EDF ScheduleS1S2S3S4TTDS1 6 X X X X X 6 X X X X X 6 X X X X X 6 X X X X XS2 8 7 6 X X X X X 8 7 X X X X X X 8 7 X X X X X XS3 12 11 10 9 8 7 6 5 X X X X 12 11 10 9 8 7 6 5 X X X XS4 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
TTD metric for dispatch results in “ties”, noted in red
LLF Schedule 2S1S2S3S4LaxityS1 5 X X X X X 5 X X X X X 5 X X X X X 5 4 3 X X XS2 6 5 5 X X X X X 6 6 X X X X X X 6 5 5 4 3 2 X XS3 8 7 6 5 5 5 5 4 X X X X 8 7 7 6 6 5 4 4 3 2 1 XS4 18 17 16 15 14 13 12 11 10 9 8 8 8 7 6 6 5 5 4 3 3 2 1 0
Example 9 – LLF SimulationLLF Hand Sim Tedious (Laxity = TTD – Time_to_go)Much Different than RM or EDFAssume Ties Favor Highest Frequency Service? - YES
Sam Siewert 19
Review Remaining Exampleshttp://mercury.pr.erau.edu/~siewerts/cec450/documents/Timing_Diagrams_Updated_2018/
As Noted in Liu and Layland, Static Priority Policy May Not be Feasible in Cases where Dynamic Priority Policy is Feasible
Are Feasibility and Safety Synonymous?
Is it Wise to have Zero Margin?
Have We Accounted for Context Switch Overhead and ISR Latency? Sam Siewert 20
Cheddar ReferencesHelp, Scheduling ReferencesReferences Used to Build Cheddar – HereGeneral References - Here
Sam Siewert 21