Download presentation

Presentation is loading. Please wait.

Published byKenya Farro Modified about 1 year ago

1
Undoing the Task: Moving Timing Analysis back to Functional Models Marco Di Natale, Haibo Zeng Scuola Superiore S. Anna – Pisa, Italy McGill University – Montreal, Canada 3rd International Real-Time Scheduling Open Problems Seminar

2
Model-based Design Popular in many application domains of real-time systems –Automotive –Avionics To deal with complexity –Model everything for design (engineering) and analysis (science) –It is necessary to select a modeling language in the most natural and easy way The four tenets on the right are fundamental to model-based design by Ali Behboodian, DSP Magazine Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng No program by hand Starting point is functional model Automatic generation of implementation is key Synthesis of tasks, priorities, allocation, communication mechanisms …

3
Undoing the Task Real-time research has been looking at ways to look inside the task and find smaller granularity entities and/or models for conditional execution. Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng Examples: –Task graphs (see left) –Identify a task segment to be managed without preemption (see [1]) –Identify a task segment to be executed at a different priority level (see [2]) –… [1] M. Bertogna, G. Buttazzo, and G. Yao, “Improving feasibility of fixed priority tasks using non-preemptive regions”, RTSS 2011 [2] R. Davis and A. Wellings, “Dual Priority Scheduling” RTSS, 1995.

4
Synchronous Models: Simulink/Stateflow Synchronous FSMs are used in the most popular model-based design tools –SCADE –Simulink/Stateflow The system is a network of “dataflow” blocks and Stateflow (EFSM) blocks e1=2ms e2=5ms S1 S2 S3 e1/{action1();o1} 0.25 0.1 e1/{action3();o1} e2/{action4();o2} 0.15 0.3 e2/{action2();o2} 2 1 i1i1 i2i2 inin o1o1 o2o2 omom Where are the tasks? Timing constraints? Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng

5
Problem Statement: Input System is a network of blocks b j of two types –Regular (Dataflow): period T j (an integer multiple of a system-wide base periodT b ) inputs i j,p. at each kT j output and state are updated, with a WCET j. –State machine (Stateflow): can have multiple activation events e j,p. at any multiple of the event periods kT j,p, different transitions may be taken. each update function has a WCET labeled as j,q Order of execution –For two communicating blocks –If b j has a feedthrough semantics, then b i → b j –This partial order of execution of functions can be enforced by static code scheduling inside the task or by the scheduler –This precedence constraint can be avoided by adding a delay Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng bibi bjbj

6
Problem Statement: Input Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng zero logical execution time zero logical communication time AB 4 4 2 f c (4,2) D t v =0: A,B,D,C t v =1:A,B C 4 2 A B 3 1 t v =2: A,B,D A B 2 0 D T=1 T=2 T=4 B A C D 3 2 1 0 2 C f c (4,1)? 4 1 AB 4 2 t r =1 A B 3 1 A B 2 0 D t r =0 t r =2 C Behavior in Implementation Behavior in Simulation Order in simulation: A->B->D->C The requirement of preserving the behavior in functional model can impose additional constraints Either tighter deadline for block C Or other mechanisms (but possibly with memory overhead)

7
Problem Statement Unlike traditional manual programming, in MBD –the task (or threads) model becomes an intermediate artifact –the timing analysis becomes part of a synthesis problem (to facilitate automatic code generation) Analysis problem –deadline may depends on the function-to-task mapping –additional requirements from the correct implementation of function models Synthesis problem: –mapping functions into tasks –assigning the execution order of functions inside tasks, –assigning the task parameters (priority, deadline, offset) –assigning scheduling attributes to functions (including preemptability and preemption threshold) –designing communication Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng

8
Example Open Problem Given –functional model (composed of multiple communicating state machine blocks and dataflow blocks) –a multicore platform as the implementation architecture Find –mapping of state machine actions and block reactions onto tasks –placement of tasks onto the cores –assignment of task activation offsets and priorities Such that –functional model semantics are preserved –each block finish in time for the follower blocks Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng

9
Example Open Problem II Given –functional model (composed of multiple communicating state machine blocks and dataflow blocks) –a multicore platform as the implementation architecture Find –mapping of state machine actions and block reactions onto tasks –placement of tasks onto the cores –assignment of task activation offsets and priorities –assignment of preemption thresholds to actions inside the tasks Such that –functional model semantics are preserved –each block finish in time for the follower blocks –memory usage is minimized Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng

10
Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng Thank you! Initial discussion on the example problems [3] M. Di Natale and H. Zeng, “Task implementation of synchronous finite state machines,” in Proc. the Conference on Design, Automation, and Test in Europe, 2012. [4] H. Zeng and M. Di Natale, “Schedulability Analysis of Periodic Tasks Implementing Synchronous Finite State Machines,” in Proc. 23rd Euromicro Conference on Real-Time Systems, 2012.

11
Baseline (Single-Task) Implementation Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng S1 S2 S3 e1/{action1();o1} 0.25 0.1 e1/{action3();o1} e2/{action4();o2} 0.15 0.3 e2/{action2();o2} 2 1 e1=2ms e2=5ms i1i1 i2i2 inin o1o1 o2o2 omom The generated code runs in the context of a 1 ms task (gcd), but reactions do not occur every 1ms A single task forces the execution of all the actions at the same priority level Simple periodic model: Worst-case exec time of a reaction to any event – deadline at 1ms – quite pessimistic

12
Partitioned (Multi-task) Implementation One task for each event rate. Priority of transitions is handled by task priorities Single reaction execution by an “inhibit signal” Atomicity (state consistency) by deadlines. Undoing the Task: Moving Timing Analysis back to Functional Models M. Di Natale, H. Zeng e1=2ms e2=5ms S1 S2 S3 e1/{action1();o1} 0.25 0.1 e1/{action3();o1} e2/{action4();o2} 0.15 0.3 e2/{action2();o2} 2 1 e1=2ms e2=5ms i1i1 i2i2 inin o1o1 o2o2 omom Applicable if the priority of a transition is determined by the corresponding event

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google