WCET - Worst Case Execution Timings Calculator

WCET Calculator & Analyser

Quite many systems is available out there - even quite expencive and heavely complex ones ... Most of these tools are looking at the realized code - the assembler instructions and so ...

This is not my intention! I rely on your input as developer. I rely on your measurements min/typ/max for a task, for a ISR for your scheduler to process a msg, a semaphore, for the scheduling between two tasks ...

Why make it more complex than needed! Basically this is all about collecting exiting data and format these acording some commonly known scenarious.

So - Tra-da-da - I have descided to develop my own tool for analysing the many various aspects on this.

 

  • Pure task based.
  • Pure ISR based.
  • Interrupt and task based.
  •  all above with priorty based per task ...

 

But also taking into consideration the timesots, cyclic and periodic tasks, the interrupt and rtos scheduling timing for isr--->scheduler-->task

Here you apply your warning and critical levels - say the deviation you accept for a cyclic task!
If it more than 22mSec delayed - it an error. But if its below 15 msec youl accept it! 

 

An example on the current code (VS2008) looks like this :

This program will calculate wcet for the tasks applied by you.The various scenarios and definitions are associated with a simple graphic presentation!
Menu/sectons :

- 1.0   Common parts calculations.

- 1.1   List task data.
- 1.2   Example drawings.

- 2.0   RTOS scheduling calculations - pure tasks NO interrupts(ISR).
- 2.1   Normal Scheduling.
- 2.1.1 ISR-to-Task
- 2.1.2 Task-to-Task

- 3.0   None Interruptable calculations - RTOS, ISR and a mixture. But all/only those marked as none-interruptable!
- 3.1   Pure Scheduler.
- 3.1.1 Timing on tasks.
- 3.1.2 All Tasks in same timeslot.
- 3.1.3 All Tasks in same timeslot - Prioritized.
- 3.2   Pure ISR.
- 3.2.1 Timing On ISR.
- 3.2.2 All ISR in same TimeSlot.
- 3.2.3 All ISR in same TimeSlot - Prioritized.
- 3.3   ISR signalling to prioritized tasks
- 3.4   Combined Schedule And ISR
- 3.5   All task prioritized - All triggered by ISR.
- 3.6   Combined Schedule And ISR

- 4.0   Scheduling paused-resumed calculations.
- 4.1   Earlist Dead Line First.
- 4.2   Time Multiplexed.
- 4.3   Shortest Job First.

 

 

and for the input :

Task List (input data):


-------------------------------------------------------------------------------------------------------------------------------------------------------------             
Task                                            wcet                                     Warning & Error Level      Operation  Trigger   Interrupt   Count/sec 
#      Name     Subname  Prio          Min          Typ          Max          -            -                   Mode          Mode  Accept Block                uSec
------------------------------------------------------------------------------------------------------------------------------------------------------------- 
0     Task 0   Demo Task     1       10.000       30.000       50.000     120.000      240.000      Task Cyclic    -    Yes    No     1.500     666666 
a 1  Task 1    Task Sub       1       11.000       31.000       51.000     122.000      245.000      Task Cyclic    -    Yes    No     1.000    1000000
a 2  Task 2    Task Sub     2       12.000       32.000       52.000     230.000     1000.000       Task Cyclic    -    Yes    No     2.000     500000
a 3    Task 3    Task Sub     3       13.000       33.000       53.000     230.000      400.000      Task Cyclic    -    Yes    No     3.000     333333
a 4    Task 4    Task Sub     4       14.000       34.000       54.000      35.000       50.000      Task trigger    6    Yes    No     4.000     250000
a 5    Task 5    Task Sub     5       15.000       35.000       55.000      80.000       90.000        Task Cyclic    -    Yes    No     5.000     200000
a 6     ISR 6    Task Sub     5        3.000        4.000        5.000      60.000      150.000           ISR Cyclic    -    Yes    No     5.000     200000
a 7     ISR 7    Task Sub     5        5.000        6.000        8.000      40.000       60.000                     ISR    -    Yes    No    50.000      20000
a 8     ISR 8    Task Sub     5        7.000       13.000       17.000      80.000      190.000  Unknown mode    -    Yes    No    60.000      16666
a 9     ISR 9    Task Sub     5       19.000       35.000       55.000      80.000       90.000          ISR Cyclic    -    Yes    No    60.000      16666
a10    ISR 10    Task Sub     5       29.000       35.000       55.000      80.000       90.000         ISR Cyclic    -    Yes    No    60.000      16666

-------------------------------------------------------------------------------------------------------------------------------------------------end-

 

START-OF:

Calc_3_0_NoneInterruptable():

----------------------------------*** NONE INTERRUPTABLE *** .

Testing the timing and analysing on tasks/ISR where they cannot be interrupted in their execution.It does not mean we dont allow interrupts, just that any IRQ serviced returns to the task interrupted!The interrupted task get to run-to-complete!

** Calc_3_1_PureScheduler():

 Calculate timings purely related to scheduler and scheduling activities.Not involving ISR!.


*** Calc_3_1_1_TimingOnTask():  

PURE TASK Scheduling - ALL tasks with same prio, no interruption - basically randomly!Commonly known as 'Round Robin'

Example: 2 [DRAWING_SCHEDULER_TASK] 

Tick       |0        |10       |20       |30       |40       |50       |60       |70

 Task1      |-----|                            |--|                     |----|                 |-----|

 Task2              |------|                       |---|                      |---|                    |---

 Task3                       |--------|                 |--|                       |----|

 Task4                                  |------|             |------|                     |---|


With the activated [Cyclic/Single/Async/Sync]tasks, the wcet is calculated to be:   

wcet-min       =       51.000   

wcet-typ        =      131.000   

wcet-max      =      211.000

 

-----------------------------------------------------------------------------------------------------------

Variation per task (activated). NOT ISR's and not task triggered by ISR's!!

  #  TaskName        Min           Max         wcet-max(last task to run)
-----------------------------------------------------------------------------------------------------------

  1    Task 1        11.000        51.000       160.000   * wcet: Warning level (122.000) reached

  2    Task 2        12.000        52.000       159.000

  3    Task 3        13.000        53.000       158.000

  5    Task 5        15.000        55.000       156.000   * wcet: Error level (90.000) reached
-------------------------------------------------------------------------------------------------------------------------------------------------end-

 

*** Calc_3_1_3_AllTaskInSameTimeSlot_Prioritized():  

All Task Executed in same timeslot - but now according their individual priority.Process each priority-level and find wcet per priority level!

Priority Level    Tasks with same PRIOrity                                           Min           Typ           Max

---------------------------------------------------------------------------------------------------------------------------------     

1    Tasks[  1, ]                                                              11.000        31.000        51.000     

2    Tasks[  2, ]                                                              12.000        32.000        52.000     

3    Tasks[  3, ]                                                              13.000        33.000        53.000     

4    Tasks[  4, ]                                                              14.000        34.000        54.000     

5    Tasks[  5,   6,   7,   8,   9,  10, ]                                78.000       128.000       195.000 

All priorities processed - if active - incl ISRs
-------------------------------------------------------------------------------------------------------------------------------------------------end-

 

Calc_3_2_Pure_ISR():

 
-->Calculate timings purely related to ISR activities.Not involving scheduler tasks!.
With the activated [ISR/ISR_Cyclic/ALL]tasks, the wcet is calculated to be:

  wcet-min        =       56.000
  wcet-typ         =       78.000
  wcet-max       =      121.000
-----------------------------------------------------------------------------------------------------------
Variation per ISR (activated).
  #  ISR/TaskName    Min           Max         wcet-max(last task to run)
-----------------------------------------------------------------------------------------------------------
  6      ISR 6            3.000          5.000       116.000   * wcet: Warning level (60.000) reached
  7      ISR 7            5.000          8.000       113.000   * wcet: Error level (60.000) reached
  9      ISR 9           19.000        55.000        66.000
 10     ISR 10         29.000        53.000        68.000

 

 

 

START-OF:

Calc_4_0_SuspendResume():

---------------------------------- 
*** INTERRUPTABLE (as in 'scheduled' and later 're-scheduled' in ... generally known as paused-resumed!) NOT interruptable as if using ISR/IRQ's *** .
Testing the timing & analysing on tasks/ISR where they CAN be interrupted in their execution.
This means, we allow any (prioritized) interrupt to reschedule and/or discontinue current task - starting another higher priority tasks up!
The interrupted task gets 'parked' while executing other ...!
This is also commonly know as timeslicing OR Event-Prioritized-Scheduling ...

Interrupting and finally resuming original task (prioritized task scheduling).
Task gets interrupted by ISR, which signals to another task. This task is scheduled before first task is finally resumed!
Example: 9 [DRAWING_TASK_ISR_SIGNALLING_PRIORITIZED_TASK]


 Tick       |0        |10       |20       |30       |40       |50       |60       |70 

Task 1     |-----|                                           |-xxxxxxxxxxxxxx|---|
                                                                *1                         ^ *2
 Task 2           |------|      |---|               |-----|       |-------------|
                                                                          ^
 ISR-1                                                           |---|

   *1   Task1 executing , get interrupted by ISR1, which signals to Task2.
   *2   After Task2 completes Task1 is resumed

 

 

 

 

 

Articles Panel

  Article Posted By Date Reads
WCET - Worst Case Execution Timings Calculator
Tools
johnk
28-06-2015 19:2912104
Embedded-Tracer-System
Tools
johnk
16-03-2015 18:221779
NuttX - Step-By-Step
Tools
johnk
30-12-2013 17:184925
Tools used
Tools
johnk
27-10-2013 12:132891
List of my robots
My robots
johnk
19-07-2013 08:442655
JoKaBot - Home build from scratch
My robots
johnk
19-07-2013 08:045051
C-Sharp (references and projects)
Oldies
johnk
18-07-2013 19:192993
Home communications
Technology
johnk
18-07-2013 18:233256
Various links
My Collection
johnk
17-07-2013 09:046330
ARM - ARM7/9/11 + Cortex
Technology
johnk
17-07-2013 08:493247
AVR32
Technology
johnk
17-07-2013 08:413335
Raspberry PI
Technology
johnk
17-07-2013 08:368658
Robotics Links
Tools
johnk
17-07-2013 08:366729
Robotics in general
Robotics
johnk
17-07-2013 08:352561
Renesas processors (V850, RL78...)
Technology
johnk
17-07-2013 08:113131

Total Articles: 54 :: Total Article Categories: 16
 

Articles

My Collection (1) My robots (2)
Oldies (5)
Old Projects - very old
Process & Methods (7)
Projects (12) Robotics (1)
Technology (6) Testing (1)
Tools (12) Working on ... (7)
Projects Im currently working on
Render time: 0.02 seconds
637,863 unique visits