Slide 1

Document Sample
Slide 1 Powered By Docstoc
					Period Optimization
for Hard Real-time
Distributed Automotive Systems

Abhijit Davare1, Qi Zhu1,
Marco Di Natale2, Claudio Pinello3,
Sri Kanajan2, Alberto Sangiovanni-Vincentelli1

                             1 EECS, UC Berkeley
                             2 General Motors Research

                             3 Cadence Research Labs
Motivation: Active Safety Applications




                           [Source: G. Leen, D. Heffernan,
                           “Expanding Automotive Electronic
                           Systems”, IEEE Computer, 35(1),
                           1/02, pg. 88-93]

                                                              2
Design Flow
                   Application                            Architecture
            IR                 150 ms                          CAN1
          Sensor                                       ECU1           ECU2
 Wheel              Fusion       Object    Brake
 Sensor              Task       ID Task   Actuator                      CAN2
           Nav.
                                                               ECU3
           Task                           Throttle
                                          Actuator
                                                                       ECU4
                             225 ms



                                                     Allocation
                             Mapping
                                                     Priorities
                    Implementation                   Periods
                                                                               3
Contributions
 In industry today, all stages in mapping are
     typically carried out manually

 1. Capture the period assignment problem
    with mathematical programming
      Flexibility to add additional constraints for system-
       specific situations
 2. Construct an approximation to efficiently
    solve the problem
      Iterative approach to reduce approx. error

                                                               4
System Model
  ECU        Bus        Tasks allocated to ECUs
   Task 1
             Message       Preemptive execution
                1
                           Scheduling: static priorities
   Task 2
             Message    Messages allocated to buses
                2
                           Non-preemptive transmission
    …          …           Scheduling: static priorities

 Periodic task/message activation
   No synchronization between
                                         Task             Message
    ECUs/buses
 Communication                                 1-place
                                                Buffer
   Read latest data value from buffer
   Overwrite old data values
                                                                    5
Problem Inputs
 System: Directed Graph           1.       Resource assignment
    Nodes are objects             2.       Worst case processing time (not shown)
     (EITHER tasks or messages)    3.       Priority
    Edges are communication       4.       Utilization bounds
     links (1-place buffers)       5.       End-to-End latency constraints


                                                                                100 ms
     T1            M1              T2                  M2              T3
      1              1               1                      2           1
    ECU1          CAN1            ECU2                               ECU3

     T5            M3              T4
        2             3              2
    [0.7]         [0.6]           [0.8]                              [0.5]
                                                                                280 ms
     T6            M4              T7                  M5              T8
          3             4               3                   5               2
                                                                                     6
Problem Statement

     Assign activation periods for
       all tasks and messages
               such that:
  1. Set of objects must be schedulable
  2. Stay within utilization bounds
  3. Satisfy end-to-end latency constraints


                                              7
1. Object Schedulability
 Ensure that all objects are processed before their
  subsequent activations

                        Period (ti)
                Response Time (ri)
    oi

         Interference from other objects on the same resource




                                                                8
2. Utilization Bounds
 Resource utilization
    Fraction of time the resource (either ECU or bus)
     spends processing its objects (either tasks or
     messages)
 Utilization bounds less than 100%
    To allow for future extensibility
 Intuition: Larger periods  lower utilization

                         ci 
                             uj   R j  R
                 i:o  R ti 
                 i j 

                                                         9
3. End-to-End Latency
                     R1              R2                  R3
                o1              o2                  o3
           t1   …          t2    …             t3   …


           t1        r1
  o1
                                t2        r2
  o2
                                                    t3   r3
  o3
                     End-to-End Latency

 For each object in the path, add
   Period (ti)
   Worst case response time (ri)
                                                              10
Worst Case Response Times
Response time (ri) = Processing time (ci) + Interference time (wi)


        Tasks                              Messages
    Pre-emption                  Blocking (bi) + Pre-emption
    (pi)                         (pi)

         z c
        jhp ( i )
                     ij   j                       z c
                                                 jhp ( i )
                                                              ij   j



                  ri                                ri  ci 
                                                            
                 t j                                tj 

                                                                       11
Periods and Response Times

    Tasks:


Messages:


 Intuition: decreasing the period of an object
    Decreases its own contribution to path latency
    Increases the response times of lower priority objects
     on the same resource


                                                              12
Approach: Mathematical Programming
 What?
   Problem represented with:
     • Set of decision variables
     • Constraints
     • Objective function
 Why?
   Modifying an object period affects:
     • Schedulability of the object
     • Utilization of the resource
     • Latencies of other paths passing through same resource
   Additional constraints due to legacy tasks and messages
 Challenge:
   Capture the problem and obtain efficient runtimes
                                                                13
Geometric Programming
 Standard Form:


 x = (x1, x2, …, xn) are positive
 g is a set of monomial functions

 f is a set of posynomial functions
   Sum of monomials
 Variables:
   Integer & real-valued  Intractable
   Real-valued  Efficiently solvable (convex
    programming)
                                                 14
Approximation
 Rationale
   Exact formulation needs integer variables (ceiling
    function)
   MIGP gives no solution even after 6 hours for case study
 Approximate the ceiling function
   Constant parameter: 0 ≤ αi ≤ 1
   Approximated worst case response time: si




                                                               15
Approximation Example
                         Task       T1
                                Priority   c   t
                         T1     1          3   t1
                         T2     2
                                    T2     2   8
                         T3     3          1   20
                                    T3


                  Impact on r3 as t1
r3                 changes
                  Lower bound:
                    =0
                  Upper bound:
                    =1
                    If all αi = 1, si ≥ ri
         t1                                         16
Geometric Programming Formulation
 Sets                                   Parameters
      Paths:                             Computation time: c
      Objects: =                       Variables
      Resources:                          Periods: t
                                           Approx. response times: s
      Minimize the sum of
   approx. response times
           Meet end-to-end
         latency deadlines
    Transformed equations
for approx. response times

            Ensure schedulability

              Meet utilization bounds

   Lower and upper bounds for periods
                                                                        17
Iterative Procedure to Reduce Error
 Iteratively change αi                   Start

 Parameters                            all αi = 1;
                                      ItCount = 0;
      maxIt – max. # iterations
      errLim – max. permissible       ItCount++;
       relative error between        (s, t) = GP(α);
                                      Calculate r;
       r and s                       ei = (si – ri)/ri;



                (GP)               max(|ei|) < errLim
 s                     =1                OR
                                                          No   αi = αi - ei
                                    ItCount > maxIt
r                       = 0.6
       (Fixpoint)                              Yes
                                           End
                t                                                        18
Case Study: GM Experimental Vehicle
 Functionality                            -




   92 tasks
                                                       .




   196 messages
 Architecture
                                                           .




                                                   .               .




   38 ECUs                           .
                                                                       .




   4 buses
                                               .


                                                               .




                    End-to-end latency constraints
                      12 source-sink task pairs
                      222 total paths
                      Deadlines range from 100ms to
                       300ms
                                                                           19
Experiments: Manual vs. Period Opt.




 GP feasible with all α = 1 in 1st iteration
 Solution time: 24s                            20
Experiments: Iterative Procedure




 Max. error reduced from 58% to 0.56% in 15 iterations
 Avg. error (not shown) reduced from 6.98% to 0.009%
                                                          21
Conclusions
 Problem
   Period assignment for the design of distributed
    automotive applications
 Approach
   Flexible: Approximate period assignment with GP
   Effective: Iterate to reduce approximation error
 Results for industrial case studies
   Experimental vehicle: 0.56% max. error
    after 6 minutes
   Fault tolerant vehicle: 45% reduction in
    average path latency
                                                       22
Questions?



             23

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1
posted:9/16/2012
language:Latin
pages:23