real-time scheduling on multi/many-processor: from...
TRANSCRIPT
Real-time scheduling on multi/many-processor: from specification to real-time execution
Eric Noulard – [email protected] Centre de Toulouse
DTIM/LAPSE T R 2 0 1 5 , A u g u s t , 2 4 – 2 8 t h 2 0 1 5
ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Summary
• Part 1 : The ROSACE Case Studyhttps://svn.onera.fr/schedmcore/branches/ROSACE_CaseStudy/
ROSACE = Research Open-Source Avionics and Control Engineering• Pagetti C, Saussié D, Gratia R, Noulard E, Siron P (2014) The ROSACE
case study: From Simulink specification to multi/many-core execution. In: 20th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS’14)http://sites.onera.fr/schedmcore/ROSACE
• Part 2 : Tools• SchedMCore toolbox : http://sites.onera.fr/schedmcore/node/1• Prelude : https://forge.onera.fr/projects/prelude • Lustre : https://cavale.enseeiht.fr/redmine/projects/lustrec
ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
The ROSACE Case Study
Romain Gratia5, Thomas Loquen1, Eric Noulard1, Claire Pagetti1,4, David Saussie2 and Pierre Siron3
1ONERA - Toulouse, France 2Polytechnique - Montreal, Canada
3ISAE - Toulouse, France4INPT/ENSEEIHT - Toulouse, France5TELECOM ParisTech - Paris, France
4 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
ROSACE: outline
● Introduction
● ROSACE (Research Open-Source Avionics and Control Engineering) case study
● Simulink specifications
● Checker
● Examples of implementation
● Perspectives
5 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Trends in avionic domain
Control design level
COTS hardware integration
- Steps: non linear linearization around a flight condition controller synthesis digitalization (sampling periods)
- Tools: Matlab / Simulink
- Coding of elementary blocks: Scade, Lustre, Signal…- Coding of multi-periodic assembly: home made language, manual coding, …
Implementation level
- Automatic code generator- Manual code- Low level services
6 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Avionic use case: Longitudinal Flight Controller 1/2
Longitudinal motion of a medium-range civil aircraft in en-route phase – Cruise: maintains a constant altitude h and a constant airspeed Va– Change of cruise level subphases:
commands a constant vertical speed Vz (rate of climb) • Ex: FL300 → FL320 → FL340 → FL360• FL300 = pressure altitude of 30000 ft
7 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Avionic use case: Longitudinal Flight Controller 2/2
Performance requirements for change of cruise levels- P1 settling time: time required to settle within 5% of the steady-state value- P2 overshoot: maximum value attained minus the steady-state value- P3 rise time: time to rise from 10% to 90% of the steady-state value- P4 steady-state error: difference between the input and the output at t → ∞.
8 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
ROSACE Open Source : Why ?
● Offer realistic (evolving) control command avionic case studyOffer research community a way to compare methods and tools in the domain of time-critical avionic application :
● Code analysis● Code generator● Schedulability analysis● Embedded runtime● ...
● Propose reference implementations in various language :● Matlab/Simulink● Prelude manual assembly + C● Generated Prelude + Generated Lustre
● Make every piece of it accessible and modifiable :● https://svn.onera.fr/schedmcore/branches/ROSACE_Case_Study • Prelude compiler : https://forge.onera.fr/projects/prelude • Lustre compiler : https://cavale.enseeiht.fr/redmine/projects/lustrec• SchedMCore toolbox : http://sites.onera.fr/schedmcore
9 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
ROSACE: outline
● Introduction
● ROSACE (Research Open-Source Avionics and Control Engineering) case study
● Simulink specifications
● Checker
● Examples of implementation
● Perspectives
10 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Longitudinal flight controller architecture
engine
elevator
200 Hz aircraft_dynamics
200 Hz
Vz_control50 Hz
Va_control
50 Hz
altitude_hold50 Hz
h_filter100 Hz
Va_filter
100 Hz
Vz_filter
100 Hz
q_filter
100 Hz
az_filter
100 Hz
h_c
10 Hz
Va_c10 Hz
Controller
Environment simulationT
δ
e
δec
δthc
Vzc
Vz
h
az
q
Va
azf
hf
Vzf
qf
Vaf
Flight condition: h = 10000 m, Va = 230 m/s
- 5 filters consolidate the measured outputs provided by the sensors- 3 controllers track accurately: altitude (hc), vertical speed (Vzc) and airspeed commands (Vac) - rate choices
1. for controllers:- closed-loop system with the continuous-time controller can tolerate a pure time
delay of 1 s before destabilizing → sampling period ≤ 1 Hz- Performances → sampling period ≤ 10 Hz
2. for environment: 200 Hz to model a continuous-time phenomenon
11 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Validation objective (and analysis at Simulink level)
Analysis of Va and Vz loops with separate step demands
Airspeed (Vac) variation of 5 m/s
vertical speed (Vzc)
demand of 2.5m/s
12 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Validation objective (and analysis at Simulink level)
Results for decoupled approach :
13 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Validation objective (and analysis at Simulink level)
Analysis of P4: input is a step climb altitude change of 1000 m- first phase: constant vertical speed demand- second phase: altitude reaching
14 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
ROSACE: outline
● Introduction
● ROSACE (Research Open-Source Avionics and Control Engineering) case study
● Simulink specifications
● Checker
● Examples of implementation
● Perspectives
15 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Python script : check_result.py
https://svn.onera.fr/schedmcore/branches/ROSACE_CaseStudy/checker/
• Goal: verify that a tracing of a given simulation is compliant with the time-domain performance requirements of the previous table
• Input format: CSV (comma separated value) file • 3 property checking:
(1) Decoupled scenarios in Va (2) Decoupled scenario in Vz(3) Step climb
• Possibility to draw the performances• For a new implementation, the user must
(1) Trace exactly the same variables. Which variables must be traced is detailed at the beginning of simulink-run- scenarioX-results.csv.
(2) apply the same input step to the controller. (3) store the simulation (or execution) tracings in a .csv file. (4) call the property checker
16 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
ROSACE: outline
● Introduction
● ROSACE (Research Open-Source Avionics and Control Engineering) case study
● Simulink specifications
● Checker
● Examples of implementation
● Perspectives
17 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : “hand-written” Prelude + C
Control design level
COTS hardware integration
- Identification of performance requirements
- Coding of multi-periodic assembly: Prelude- Analyse several multi-periodic assemblies wrt to the performance requirements and real-time efforts
Implementation level
- A predictable execution model in ZOL- Compliance with the high level requirements
18 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : “hand-written” Prelude + C
• Coding of the basic blocks • Discretization and manual coding in C• Forward Euler method for the environment• Forward difference for the controllers• Zero-order hold approximation for the filters
• Coding of the assembly in Prelude
19 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : Prelude in a nutshell
• Prelude: a real-time synchronous language. Allow to express real-time behaviours in a synchronous style• By using relaxed synchronous hypothesis (Curic 2005)
• By adding the notion of real-time periodic clock
• By generating dependent task sets with extended precedence constraints
• By reusing Sofronis et al. communication protocol
• SchedMcore framework (we will see that in part 2)• Simulation of Prelude programs• Script that verifies if a trace fulfils the requirements
A clock α=(ti) is strictly periodic iff∃n N∈ ∗, i N, t∀ ∈ i+1 − ti = n
α)=n is the period, (α)=t0 is the offset.eg: (120, 1/2) is the clock of period 120 and offset 60.
F (10, 5, 10, 0)S (40, 15, 40, 0)F[4k] S[k]S[k] F[4k+4]
20 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : First Prelude version
node assembly (h_c, Va_c: real rate (1000,0)) returns (delta_e_c, delta_th_c : real)var Va, Vz, q, az, h: real; Va_f, Vz_f, q_f, az_f, h_f : real; Vz_c, delta_e, T : real;let h_f = h_filter(h/^2); Va_f = Va_filter(Va/^2); Vz_f = Vz_filter(Vz/^2); q_f = q_filter(q/^2); az_f = az_filter(az/^2); Vz_c = altitude_hold (h_f/^2, h_c*^5); delta_th_c = Va_control (Va_f/^2, Vz_f/^2, q_f/^2, Va_c*^5); delta_e_c = Vz_control (Vz_f/^2, Vz_c, q_f/^2, az_f/^2); T = engine (delta_th_c*^4); delta_e = elevator (delta_e_c*^4); (Va, Vz, q, az, h)= aircraft_dynamics ((0.018645918123716 fby delta_e), (43219.8575 fby
T));tel
aircraft_dynamics
h_filter
altitude_hold
Vz_control
elevator
Basic clock (1,0) at 100 µs( c o m p l i a n t w i th F i g u r e 3 ) :
N o d e F r e q u e n c y C l o c k N o d e F r e q u e n c y C l o c k
a l t i tu d e _ h o l d 5 0 H z ( 2 0 0 , 0 ) h _ fi l te r 1 0 0 H z ( 1 0 0 , 0 )V a _ fi l te r 1 0 0 H z ( 1 0 0 , 0 ) q _ fi l te r 1 0 0 H z ( 1 0 0 , 0 )a z _ fi l te r 1 0 0 H z ( 1 0 0 , 0 ) V a _ c o n t r o l 5 0 H z ( 2 0 0 , 0 )V z _ c o n t r o l 5 0 H z ( 2 0 0 , 0 ) e n g i n e 2 0 0 H z ( 5 0 , 0 )e l e v a to r 2 0 0 H z ( 5 0 , 0 ) a c _ d y n a m i c s 2 0 0 H z ( 5 0 , 0 )
C . V a r i a t i o n s i n th e a s s e m b l y to r e l a x r e a l - t i m e c o n s tr a i n ts
T h i s fi r s t s p e c i fi c a t i o n i s v e r y c o n s tr a i n e d i n te r m o f r e a l -t i m e a n d th e e f f o r t o f i n te g r a t i o n w i l l b e s t r i n g e n t . I n d e e d , w eh a v e r e d u c e d th e f r e q u e n c i e s b y i m p l e m e n t i n g a m u l t i - p e r i o d i cc o n tr o l l e r i n s te a d o f d e s i g n i n g a m o n o - p e r i o d i c th a t r u n s a t2 0 0 H z . T h i s d e c r e a s e s th e C P U u s a g e b u t th e p r e c e d e n c ec o n s tr a i n ts i m p o s e d b y th e c o m m u n i c a t i o n f o r c e s e v e r a l ta s k sto e x e c u te i n a v e r y s h o r t i n te r v a l . F o r i n s ta n c e , th e f u n c t i o n a lc h a i n h → h f → V z c → δ e c → δ e p r o d u c e s th e e x e c u t i o ns h o w n i n F i g u r e 6 . T h e s e q u e n c e o f ta s k s a i r c r a f t _ d y n a m i c s ,h _ fi l te r , a l t i tu d e _ h o l d , V z _ c o n t r o l , e l e v a to r m u s t e x e c u te i nl e s s th a n 5 m s e v e r y 2 0 m s .
a i r c r a f t _ d y n a m i c s
h _ f i l t e r
a l t i t u d e _ h o l d
V z _ c o n t r o l
e l e v a t o r
F i g u r e 6 . F u n c t i o n a l c h a i n i n th e s p e c i fi c a t i o n
R e l a x i n g p r e c e d e n c e s . T o r e l a x th e e f f o r t o f i n te g r a t i o n , th es e c o n d p r e c e d e n c e p a t te r n s i n F i g u r e 7 a r e b e t te r s u i te d . I n d e e d ,th e s y s te m b e c o m e s m o r e p a r a l l e l i s a b l e a n d / o r W C E T o f ta s k sw i th l o w e r f r e q u e n c y c a n b e i n c r e a s e d . T h e u n i q u e d i f f e r e n c ef o r c o d i n g th e a s s e m b l y i n P R E L U D E ( n a m e d i n th a t c a s ea s s e m b l a g e _ v 2 ) s ta n d s i n th e tw o e q u a t i o n s :T = e n g i n e ( ( 1 . 6 4 0 2 2 2 2 9 6 1 6 2 3 1 6 f b y d e l t a _ t h _ c ) ∗ ^ 4 ) ;d e l t a _ e = e l e v a t o r ( ( 0 . 0 1 8 6 4 5 9 1 8 1 2 3 7 1 6 f b y d e l t a _ e _ c ) ∗ ^ 4 ) ;
N o te th a t p r o d u c i n g th e s a m e b e h a v i o u r i n S I M U L I N K i s r a th e rc o m p l e x . N o te a l s o th a t b r e a k i n g th e d e p e n d e n c i e s i s d o n ew i th th e f b y o p e r a to r , b o r r o w e d f r o m L U C I D S Y N C H R O N E
[ 1 8 ] , th a t d e l a y s a fl o w b y o n e p e r i o d .
h _ f i l t e r
a l t i t u d e _ h o l d
V z _ c o n t r o l
e l e v a t o r
F i g u r e 7 . R e l a x e d f u n c t i o n a l c h a i n
R e l a x i n g p e r i o d s . A s i l l u s tr a te d p r e v i o u s l y , m o d i f y i n g th ea s s e m b l y i s v e r y e a s y i n P R E L U D E . S i n c e i t i s a l s o s i m p l e to
g e n e r a te th e tr a c i n g s , th e c o n tr o l e n g i n e e r c a n e a s i l y v e r i f y i fth e c o n t r o l l e r p e r f o r m a n c e s a r e f u l fi l l e d . T h i s o p e n s th e r o o mf o r te s t i n g m a n y s o l u t i o n s .
I n th i s p a p e r , w e w i l l t r y th r e e m o r e a s s e m b l i e s th a tr e d u c e p e r i o d s a n d p r e c e d e n c e s . N e x t a s s e m b l y ( n a m e d a s s e m -b l a g e _ v 3 ) r e d u c e s s o m e f r e q u e n c i e s : h _ fi l te r , V a _ fi l te r , V z _ fi l te ra r e a t 5 0 H z a n d a l t i tu d e _ h o l d i s a t 1 0 H z . F o r th e th r e e fi l te r s ,w e h a v e to c h a n g e th e r a te o f th e i n p u t fl o w a s f o l l o w s :
h _ f = h _ f i l t e r ( h / ^ 4 ) ;
F o r a l t i tu d e _ h o l d , th e e q u a ti o n b e c o m e sV z _ c = a l t i t u d e _ h o l d ( h _ f / ^ 5 , h _ c ) ;
T h e e q u a t i o n o f V z _ c o n t r o l h a s a l s o to b e m o d i fi e d a s f o l l o w :d e l t a _ e _ c = V z _ c o n t r o l ( V z _ f , V z _ c ∗ ^ 5 , q _ f / ^ 2 , a z _ f / ^ 2 ) ;
I n th i s v e r s i o n , d e p e n d e n c i e s a r e d i r e c t a s i n F i g u r e 6 , w h i l ea s s em b l a g e _ v 4 r e u s e s th o s e o f F i g u r e 7 . I n a s s em b l a g e _ v 4 1 ,w e c h a n g e d th e d e p e n d e n c i e s w h i l e k e e p i n g th e f r e q u e n c i e s .I n a s s em b l a g e _ v 5 , w e p u t V z _ c o n t r o l a n d V a _ c o n t r o l a t 2 5 H z .
D . V a l i d a t i o n o f th e c o d i n g
A l l th e p r e v i o u s a s s e m b l i e s h a v e b e e n s i m u l a te d o n a P Cu s i n g S C H E D M C O R E f r a m e w o r k . T o d o s o , w e r e l y o n th es i m u l a to r l s c m _ r u n - n o r t p r o v i d e d w i th S C H E D M C O R E 5 . T oa s s e s s th e c o r r e c tn e s s o f th e v a r i o u s a s s e m b l i e s , w e c o m p a r e dth e t i m e - r e s p o n s e s to th e s a m e s te p c l i m b s i m u l a te d . F i g u r e 8s u p e r i m p o s e s th e r e s u l t s o f S I M U L I N K ( F i g u r e 5 ) a n d th o s e o fa l l th e a s s e m b l i e s f o r th e s a m e a u to p i l o t i n s t r u c t i o n s . O v e r a l l ,th e r e i s n o s i g n i fi c a n t d e g r a d a t i o n a n d o n l y th e s e t t l i n g t i m ei s s l i g h t l y i m p a c te d b y th e m o d i fi c a t i o n s . I n d e e d , w e p l a y o nth e r a te s a n d p r e c e d e n c e s th a t i m p a c t th e r e s p o n s e - t i m e s b u tn o t th e f u n c t i o n a l v a l u e s ( n o s i g n i fi c a n t i m p a c t o n p r o p e r t i e sP 2 a n d P 3 ) . F i n a l l y , w e o b s e r v e th a t th e c o n tr o l l e r i s r o b u s tto th e r e l a x a t i o n s . S i n c e a l l r e s u l t s a r e s a t i s f y i n g , th e d i f f e r e n ta s s e m b l i e s c a n b e i n te g r a te d o n th e ta r g e t a n d a s s e s s e d a t th i sl e v e l .
I V . E X P E R I M E N T S
T h i s s e c t i o n i l l u s t r a te s th e f e a s i b i l i ty o f i m p l e m e n t i n g th ep a r a l l e l fl i g h t c o n t r o l l e r o n a m u l t i / m a n y - c o r e . T h i s s h o w sth a t th e a b s t r a c t h y p o th e s e s m a d e a t th e S I M U L I N K a n d th eP R E L U D E l e v e l s a r e r e a s o n a b l e . I n p a r t i c u l a r , th e b a s i c c l o c k ,th e r e l a x e d s y n c h r o n o u s h y p o th e s i s a n d th e c o m m u n i c a t i o n p r o -to c o l c a n b e i m p l e m e n te d . W e th e r e f o r e d e s c r i b e i n th i s s e c t i o nth e p o r t i n g o f th e c o d e o n th e T I L E R A T I L E M P O W E R G X - 3 6 .W e i m p o s e a n e x e c u t i o n m o d e l to e n f o r c e p r e d i c ta b i l i ty o n th ep l a t f o r m i n o r d e r to r e s p e c t a s m u c h a s p o s s i b l e th e s a f e tya v i o n i c s ta n d a r d s .
A . T I L E R A d e s c r i p t i o n
T h e p l a t f o r m i s e q u i p p e d w i th a t i l e d m i c r o p r o c e s s o rc o m p o s e d o f 3 6 t i l e s . E a c h t i l e c a n c o m m u n i c a te w i th o th e rt i l e s , th e p e r i p h e r a l s a n d th e e x te r n a l m e m o r y th r o u g h a n e tw o r ko n c h i p ( N o C ) . T h e e x te r n a l m e m o r y i s c o m p o s e d o f 3 2 G B i t s
5 S C H E D M C O R E i s a v a i l a b l e o n th e s v n r e p o s i to r y h t tp s : / / s v n . o n e r a . f r /s c h e d m c o r e / b r a n c h e s / s c h e d m c o r e - R T A S 2 0 1 4
( c o m p l i a n t w i th F i g u r e 3 ) :
N o d e F r e q u e n c y C l o c k N o d e F r e q u e n c y C l o c ka l t i tu d e _ h o l d 5 0 H z ( 2 0 0 , 0 ) h _ fi l te r 1 0 0 H z ( 1 0 0 , 0 )V a _ fi l te r 1 0 0 H z ( 1 0 0 , 0 ) q _ fi l te r 1 0 0 H z ( 1 0 0 , 0 )a z _ fi l t e r 1 0 0 H z ( 1 0 0 , 0 ) V a _ c o n t r o l 5 0 H z ( 2 0 0 , 0 )V z _ c o n t r o l 5 0 H z ( 2 0 0 , 0 ) e n g i n e 2 0 0 H z ( 5 0 , 0 )e l e v a to r 2 0 0 H z ( 5 0 , 0 ) a c _ d y n a m i c s 2 0 0 H z ( 5 0 , 0 )
C . V a r i a t i o n s i n th e a s s em b l y to r e l a x r e a l - t i m e c o n s tr a i n ts
T h i s fi r s t s p e c i fi c a t i o n i s v e r y c o n s tr a i n e d i n te r m o f r e a l -t i m e a n d th e e f f o r t o f i n t e g r a t i o n w i l l b e s t r i n g e n t . I n d e e d , w eh a v e r e d u c e d th e f r e q u e n c i e s b y i m p l e m e n t i n g a m u l t i - p e r i o d i cc o n tr o l l e r i n s te a d o f d e s i g n i n g a m o n o - p e r i o d i c th a t r u n s a t2 0 0 H z . T h i s d e c r e a s e s th e C P U u s a g e b u t th e p r e c e d e n c ec o n s tr a i n ts i m p o s e d b y th e c o m m u n i c a t i o n f o r c e s e v e r a l ta s k sto e x e c u te i n a v e r y s h o r t i n te r v a l . F o r i n s ta n c e , th e f u n c t i o n a lc h a i n h → h f → V z c → δ e c → δ e p r o d u c e s th e e x e c u t i o ns h o w n i n F i g u r e 6 . T h e s e q u e n c e o f ta s k s a i r c r a f t_ d y n a m i c s ,h _ fi l te r , a l t i tu d e _ h o l d , V z _ c o n t r o l , e l e v a to r m u s t e x e c u te i nl e s s th a n 5 m s e v e r y 2 0 m s .
a i r c r a f t _ d y n a m i c s
h _ f i l t e r
a l t i t u d e _ h o l d
V z _ c o n t r o l
e l e v a t o r
F i g u r e 6 . F u n c t i o n a l c h a i n i n th e s p e c i fi c a t i o n
R e l a x i n g p r e c e d e n c e s . T o r e l a x th e e f f o r t o f i n te g r a t i o n , th es e c o n d p r e c e d e n c e p a t te r n s i n F i g u r e 7 a r e b e t te r s u i te d . I n d e e d ,th e s y s te m b e c o m e s m o r e p a r a l l e l i s a b l e a n d / o r W C E T o f ta s k sw i th l o w e r f r e q u e n c y c a n b e i n c r e a s e d . T h e u n i q u e d i f f e r e n c ef o r c o d i n g th e a s s e m b l y i n P R E L U D E ( n a m e d i n th a t c a s ea s s em b l a g e _ v 2 ) s ta n d s i n th e tw o e q u a t i o n s :T = e n g i n e ( ( 1 . 6 4 0 2 2 2 2 9 6 1 6 2 3 1 6 f b y d e l t a _ t h _ c ) ∗ ^ 4 ) ;d e l t a _ e = e l e v a t o r ( ( 0 . 0 1 8 6 4 5 9 1 8 1 2 3 7 1 6 f b y d e l t a _ e _ c ) ∗ ^ 4 ) ;
N o te th a t p r o d u c i n g th e s a m e b e h a v i o u r i n S I M U L I N K i s r a th e rc o m p l e x . N o te a l s o th a t b r e a k i n g th e d e p e n d e n c i e s i s d o n ew i th th e f b y o p e r a to r , b o r r o w e d f r o m L U C I D S Y N C H R O N E
[ 1 8 ] , th a t d e l a y s a fl o w b y o n e p e r i o d .
h _ f i l t e r
a l t i t u d e _ h o l d
V z _ c o n t r o l
e l e v a t o r
F i g u r e 7 . R e l a x e d f u n c t i o n a l c h a i n
R e l a x i n g p e r i o d s . A s i l l u s t r a te d p r e v i o u s l y , m o d i f y i n g th ea s s e m b l y i s v e r y e a s y i n P R E L U D E . S i n c e i t i s a l s o s i m p l e to
g e n e r a te th e t r a c i n g s , th e c o n tr o l e n g i n e e r c a n e a s i l y v e r i f y i fth e c o n tr o l l e r p e r f o r m a n c e s a r e f u l fi l l e d . T h i s o p e n s th e r o o mf o r te s t i n g m a n y s o l u t i o n s .
I n th i s p a p e r , w e w i l l t r y th r e e m o r e a s s e m b l i e s th a tr e d u c e p e r i o d s a n d p r e c e d e n c e s . N e x t a s s e m b l y ( n a m e d a s s e m -b l a g e _ v 3 ) r e d u c e s s o m e f r e q u e n c i e s : h _ fi l te r , V a _ fi l te r , V z _ fi l te ra r e a t 5 0 H z a n d a l t i tu d e _ h o l d i s a t 1 0 H z . F o r th e th r e e fi l te r s ,w e h a v e to c h a n g e th e r a te o f th e i n p u t fl o w a s f o l l o w s :
h _ f = h _ f i l t e r ( h / ^ 4 ) ;
F o r a l t i tu d e _ h o l d , th e e q u a t i o n b e c o m e sV z _ c = a l t i t u d e _ h o l d ( h _ f / ^ 5 , h _ c ) ;
T h e e q u a t i o n o f V z _ c o n tr o l h a s a l s o to b e m o d i fi e d a s f o l l o w :d e l t a _ e _ c = V z _ c o n t r o l ( V z _ f , V z _ c ∗ ^ 5 , q _ f / ^ 2 , a z _ f / ^ 2 ) ;
I n th i s v e r s i o n , d e p e n d e n c i e s a r e d i r e c t a s i n F i g u r e 6 , w h i l ea s s em b l a g e _ v 4 r e u s e s th o s e o f F i g u r e 7 . I n a s s e m b l a g e _ v 4 1 ,w e c h a n g e d th e d e p e n d e n c i e s w h i l e k e e p i n g th e f r e q u e n c i e s .I n a s s e m b l a g e _ v 5 , w e p u t V z _ c o n t r o l a n d V a _ c o n t r o l a t 2 5 H z .
D . V a l i d a t i o n o f th e c o d i n g
A l l th e p r e v i o u s a s s e m b l i e s h a v e b e e n s i m u l a te d o n a P Cu s i n g S C H E D M C O R E f r a m e w o r k . T o d o s o , w e r e l y o n th es i m u l a to r l s c m _ r u n - n o r t p r o v i d e d w i th S C H E D M C O R E 5 . T oa s s e s s th e c o r r e c tn e s s o f th e v a r i o u s a s s e m b l i e s , w e c o m p a r e dth e t i m e - r e s p o n s e s to th e s a m e s te p c l i m b s i m u l a te d . F i g u r e 8s u p e r i m p o s e s th e r e s u l t s o f S I M U L I N K ( F i g u r e 5 ) a n d th o s e o fa l l th e a s s e m b l i e s f o r th e s a m e a u to p i l o t i n s t r u c t i o n s . O v e r a l l ,th e r e i s n o s i g n i fi c a n t d e g r a d a t i o n a n d o n l y th e s e t t l i n g t i m ei s s l i g h t l y i m p a c te d b y th e m o d i fi c a t i o n s . I n d e e d , w e p l a y o nth e r a te s a n d p r e c e d e n c e s th a t i m p a c t th e r e s p o n s e - t i m e s b u tn o t th e f u n c t i o n a l v a l u e s ( n o s i g n i fi c a n t i m p a c t o n p r o p e r t i e sP 2 a n d P 3 ) . F i n a l l y , w e o b s e r v e th a t th e c o n tr o l l e r i s r o b u s tto th e r e l a x a t i o n s . S i n c e a l l r e s u l t s a r e s a t i s f y i n g , th e d i f f e r e n ta s s e m b l i e s c a n b e i n t e g r a te d o n th e ta r g e t a n d a s s e s s e d a t th i sl e v e l .
I V . E X P E R I M E N T S
T h i s s e c t i o n i l l u s t r a te s th e f e a s i b i l i t y o f i m p l e m e n t i n g th ep a r a l l e l fl i g h t c o n tr o l l e r o n a m u l t i / m a n y - c o r e . T h i s s h o w sth a t th e a b s tr a c t h y p o th e s e s m a d e a t th e S I M U L I N K a n d th eP R E L U D E l e v e l s a r e r e a s o n a b l e . I n p a r t i c u l a r , th e b a s i c c l o c k ,th e r e l a x e d s y n c h r o n o u s h y p o t h e s i s a n d th e c o m m u n i c a t i o n p r o -to c o l c a n b e i m p l e m e n te d . W e th e r e f o r e d e s c r i b e i n th i s s e c t i o nth e p o r t i n g o f th e c o d e o n th e T I L E R A T I L E M P O W E R G X - 3 6 .W e i m p o s e a n e x e c u t i o n m o d e l to e n f o r c e p r e d i c ta b i l i t y o n th ep l a t f o r m i n o r d e r to r e s p e c t a s m u c h a s p o s s i b l e th e s a f e tya v i o n i c s ta n d a r d s .
A . T I L E R A d e s c r i p t i o n
T h e p l a t f o r m i s e q u i p p e d w i th a t i l e d m i c r o p r o c e s s o rc o m p o s e d o f 3 6 t i l e s . E a c h t i l e c a n c o m m u n i c a te w i th o th e rt i l e s , th e p e r i p h e r a l s a n d th e e x te r n a l m e m o r y th r o u g h a n e tw o r ko n c h i p ( N o C ) . T h e e x te r n a l m e m o r y i s c o m p o s e d o f 3 2 G B i ts
5 S C H E D M C O R E i s a v a i l a b l e o n th e s v n r e p o s i to r y h t tp s : / / s v n . o n e r a . f r /s c h e d m c o r e / b r a n c h e s / s c h e d m c o r e - R T A S 2 0 1 4
21 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : Other Prelude coding
T = engine ((1.640222296162316 fby delta_th_c)*^4);delta_e = elevator ((0.018645918123716 fby delta_e_c)*^4);
h_filter
altitude_hold
Vz_control
elevator
aircraft_dynamics
h_f = h_filter(h/^4);Va_f = Va_filter(Va/^4);Vz_f = Vz_filter(Vz/^4); Vz_c = altitude_hold (h_f/^5, h_c); delta_th_c = Va_control (Va_f, Vz_f, q_f/^2, Va_c*^5); delta_e_c = Vz_control (Vz_f, Vz_c*^5, q_f/^2, az_f/^2);
• Relaxing precedences:
• Relaxing periods, h_filter, Va_filter, Vz_filter at 50Hz; altitude_hold at 10Hz:
22 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 : Functional Simulation
• Objective: • Simulation of the specification• Real-time constraints are
assumed correct• Input:
• Prelude program• Code of imported nodes
• Results• no significant degradation and
only the settling time is slightly impacted by the modifications.
23 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
On the Tilera Gx36 target
Timing issues•local time-stamp counter•cores start independently => unpredictable offsets
36 tiles– Single core clocked at 1.2 GHz– 32 KB program memory (L1P)– 32 KB data memory (L1D)– 256 KB level 2 memory (L2)
NoC (network on chip)- five full-duplex sub-networks- Shared Dynamic Network (SDN) for
exchanging data between tiles, e.g., for cache coherency
- reQuest Dynamic Network (QDN) for write requests to the DDR
- Response Dynamic (RDN) Network for read requests to the DDR
Development environment- Zero Overhead Linux (ZOL): no non-
user interrupts- Shared memory with cache homing
policy
24 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Predictable rules for the Tilera
• Stressing benchmarks to assess the variability of the platform• impact on the execution times when several tiles access concurrently the
shared resources (read and write), such as DDR, local caches and NoC.• time to access the local clock
• Mapping rules1.No more than 10 tiles must simultaneously access in writing the same
[shared] cached memory location 2.No more than 5 tiles must simultaneously access in writing the DDR3.No more than 30 tiles must simultaneously access in reading the same
[shared] cached memory location4.Offline partitioned non preemptive schedule5.Memory footprint fits in the local caches
Puffitsch W., Noulard E. and Pagetti C., Off-Line Mapping of Multi-Rate Dependent Task Sets to Many-Core Platforms, Real-Time Systems, September 2015, Volume 51, Issue 5, pp 526-565http://dx.doi.org/10.1007/s11241-015-9232-1
Find better and general rules in :
25 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Mapping the flight controller on the Tilera 1/2
• WCET in isolation
• offline mapping (manual computation)• One -core to one task
Tile 1
Tile 2
Tile 3
200µs
300µs 500µs 700µs
800µs
Aircraft_dynamics
h_filter az_filter Vz_filter q_filter Va_filter
altitude_hold Vz_control Va_control
elevator engine
26 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Mapping the flight controller on the Tilera 2/2
• Tick-based scheduling • Decisions taken only at discrete instants
• Communication delay on the NoC
• Clock precision
→ Enforce WCET
Puffitsch W., Noulard E. and Pagetti C., Off-Line Mapping of Multi-Rate Dependent Task Sets to Many-Core Platforms, Real-Time Systems, September 2015, Volume 51, Issue 5, pp 526-565http://dx.doi.org/10.1007/s11241-015-9232-1
W. Puffitsch, E. Noulard, and C. Pagetti, “Mapping a multi-rate synchronous language to a many-core processor,” in 19th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS 2013), 2013, pp. 293–302.
27 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Tilera execution results
• Objective: • Run on the Tilera• WCET extended with tick gap
• Input:• Prelude program• Code of imported nodes• Mapping rules
• Results• Almost the same as those
obtained by the functional ones
28 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 1 on Tilera : summary
Control design level
COTS hardware integration
- Identification of performance requirements
- Coding of multi-periodic assembly: Prelude- Analyse several multi-periodic assemblies wrt to the performance requirements and real-time efforts
Implementation level
- A predictable execution model in ZOL- Compliance with the high level requirements
• Design of a parallel avionic longitudinal controller on a multi/many-core target• Illustration of discussion between control engineers and integrators can be
leveraged, in order to find a compromise between both sides constraints.
29 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Implementation 2 : “Generated” Prelude + Lustre
Control design level
Implementation level
SchedMcoreSchedMcore
node voter (s1, s2, s3: real)returns (sensor: real);let : : :tel Imported node voter ((s1, s2, s3: real)
returns (sensor: real) wcet 5;node ex (i1 : rate(8,0); i2 : rate(20,0)) returns (01, 02);let : : :tel
ONERA Sim2LustrePrelude toolbox (Matlab) – open source – on demandGenerator coming soon at : https://forge.onera.fr/projects/sim2preludelustre
See generated implementation in ROSACE:https://svn.onera.fr/schedmcore/branches/ROSACE_CaseStudy/prelude_implementations/prelude_lustre/
30 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Perspective : the big picture
31 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Perspectives: Use ROSACE ! Go ahead it’s open !!
• Go to the ROSACE page on SchedMCore site
http://sites.onera.fr/schedmcore/ROSACE
• Use the provided implementation and try your own
• Do no hesitate to report bugs or propose contribution/alternate implementation on the forge of the project:
https://forge.onera.fr/projects/rosace-case-study
32 ETR2015 – August, 24–28th 2015 – Eric NOULARD – [email protected]
Questions?