Functionality assignment to partitioned multi-core...

27
Functionality assignment to partitioned multi-core architectures Florin Maticu Technical University of Denmark (DTU)

Transcript of Functionality assignment to partitioned multi-core...

Functionality assignment to partitioned multi-corearchitectures

Florin Maticu

Technical University of Denmark (DTU)

Outline∙ Safety-critical real-time systems

∙ Motivation

∙ Problem formulation∙ Mapping tool

∙ Architecture model∙ Hardware∙ AUTOSAR∙ Communication∙ Os-tasks∙ Scheduling∙ Spatial partitioning∙ Temporal partitioning∙ End-to-end protection

∙ Application model∙ Terminology & Example∙ WCET of the runnable

∙ Problem formulation∙ Formal∙ Example∙ Cost function

∙ Optimization strategy∙ Simulated annealing∙ Algorithm∙ Transform strategies

∙ Experimental Evaluation∙ Volvo use case

∙ Conclusions & Future work∙ Conclusions∙ Future work∙ Thank you

∙ Bibliography2 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Simplify the outline; leave only the 1-st level bullet points

Safety-critical real-time systemsMotivation∙ federated to integrated architectures.∙ multi-core ECUs.∙ increase complexity of software functionalities.∙ safety according to ISO 262621.∙ schedulability of tasks running of different cores.∙ bus bandwidth constraints.

Figure: ECUs interconnected inside a vehicle 2

1http://www.iso.org/iso/catalogue_detail?csnumber=434642http://www.embedded.com/print/4011425

3 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Problem formulationMapping of functionalities

Figure: Mapping tool4 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelHardware

Figure: Hardware architecture model

5 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelAUTOSAR

Figure: AUTOSAR layers, [AUT14]

Figure: “Conf System”activity in AUTOSAR,[AUT14]

6 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelCommunication

∙ sender-receiver mode with last is best semantics.

Figure: Runnablecommunication over AUTOSARRTE Figure: Types of

communication

7 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelOs-tasks

Figure: Runnables with implicitsender/receiver mapped intosame Os-task

Figure: Runnables with explicitsender/receiver mapped intosame Os-task

8 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelScheduling

AUTOSAR Multicore schedulingOS-tasks are scheduled independently on each core.

𝑈𝑐𝑜𝑟𝑒 =𝑚∑︁

𝑖=1

𝑅𝑖.𝑊𝐶𝐸𝑇

𝑅𝑖.𝑇(1)

𝑈𝑐𝑜𝑟𝑒 ≤ 0.69, [LL73] (2)

9 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Don't forget to say what WCET is.

Architecture modelSpatial partitioning∙ Spatial protection at the Os-application level.

Figure: Memory partitioning example in AUTOSAR, source:[BFWS10]

10 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
I suggest to group the slides on partitioning, and just say what spatial and temporal partitioning is, and that Autosar has features for that; for the temporal partitioning mention what's on the next slide (bullets) but do not include the diagram. Also, the figure on this slide is not needed.The figures are useful but there's the danger that you need to explain a lot about them.

Architecture modelTemporal partitioning∙ Protection against timing faults at the Os-Task level.

∙ Execution time budget.∙ Resource lock time budget.∙ Inter-arrival time budget (Time Frame).

Figure: AUTOSAR OS timing monitoring, source:[AUT14]

11 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Architecture modelEnd-to-end protection

Figure: End-to-end protection example in AUTOSAR EB tresosproduct, source: [Mat14]

12 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
I suggest to remvoe this slide.

Application modelExample

∙ AUTOSAR application composed of a set of software components.∙ Each software component contains a number of runnables(functions).

Figure: Control cruise application

13 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Application modelWCET of the runnable

∙ 𝑊𝐶𝐸𝑇𝑟𝑢𝑛𝑛𝑎𝑏𝑙𝑒 = 𝑊𝐶𝐸𝑇𝑐𝑜𝑚𝑝𝑢𝑡𝑎𝑡𝑖𝑜𝑛𝑎𝑙 + 𝑊𝐶𝐸𝑇𝑐𝑜𝑚𝑚𝑢𝑛𝑖𝑐𝑎𝑡𝑖𝑜𝑛

∙ 𝑊𝐶𝐸𝑇𝑐𝑜𝑚𝑚𝑢𝑛𝑖𝑐𝑎𝑡𝑖𝑜𝑛 overhead :

– 𝛼 = if runnables are mapped into the same OS-Task.– 𝛽0 = if runnables have the same ASIL levels and are mappedinto different OS-Tasks.– 𝛽1 = if runnables have different ASIL levels and are mappedinto different OS-Tasks.– 𝛾 = if the runnables are mapped into OS-Tasks on differentcores on the same ECU.– 𝜃 = if the runnables are mapped into OS-Tasks on differentECUs.

∙ 𝜃 > 𝛾 > 𝛽1 > 𝛽0 > 𝛼

14 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Problem formulationInput

∙ Given– Architecture model

∙ Each ECU is running on AUTOSAR framework.

Figure: Architecture model example– Application model

Figure: Application model example

15 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Problem formulationOuptut

∙ Determine– A mapping of software components to ECUs.– A mapping of runnables to OS-tasks.– A mapping of OS-tasks to cores.– A mapping of OS-tasks to OS-applications.

16 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Group "Determine" and "Such that" slides.

Problem formulationObjectives

∙ Such that– Minimize the overall communication bandwidths.– Minimize the variance of the core utilizations on the system.– Functions with different safety integrity levels are spatial andtemporal isolated.– All the constraints regarding schedulability or provided by thesoftware/system developer are met.

17 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Problem formulationExample

Figure: Mapping solution to ECUs18 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Problem formulationCost function

𝑐𝑜𝑠𝑡 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 = 𝑊1 × (𝜎)

+ 𝑊2 ×

⎛⎝ ∑︁𝑐𝑜𝑚𝑚∈{∪{𝐸𝐶𝑈.𝑐𝑜𝑚𝑚}∪{∪{𝐸𝐶𝑈.{𝐶𝑜𝑟𝑒.𝑐𝑜𝑚𝑚}}}

𝑐𝑜𝑚𝑚

⎞⎠+ 𝑝𝑒𝑛𝑎𝑙𝑡𝑦 𝑓𝑎𝑐𝑡𝑜𝑟 ×

⎛⎝ ∑︁𝑐𝑜𝑟𝑒∈{∪{𝐸𝐶𝑈.{𝑐𝑜𝑟𝑒}}}

max (0, 𝑈𝑐𝑜𝑟𝑒 − 𝑈𝑐𝑜𝑟𝑒 𝑚𝑎𝑥)

⎞⎠+ 𝑝𝑒𝑛𝑎𝑙𝑡𝑦 𝑓𝑎𝑐𝑡𝑜𝑟 ×

⎛⎝ ∑︁𝑐𝑜𝑚𝑚∈{∪{𝐸𝐶𝑈.𝑐𝑜𝑚𝑚}∪{∪{𝐸𝐶𝑈.{𝐶𝑜𝑟𝑒.𝑐𝑜𝑚𝑚}}}

⎞⎠𝑚𝑎𝑥 (0, 𝑈𝑐𝑜𝑚𝑚 − 1) .

𝜎 = 1𝑁 − 1 ×

⎛⎝ ∑︁𝑐𝑜𝑟𝑒∈{∪{𝐸𝐶𝑈.{𝑐𝑜𝑟𝑒}}}

(𝑈𝑐𝑜𝑟𝑒 − 𝜇)2

⎞⎠𝜇 = 1

𝑁×

⎛⎝ ∑︁𝑐𝑜𝑟𝑒∈{∪{𝐸𝐶𝑈.{𝑐𝑜𝑟𝑒}}}

𝑈𝑐𝑜𝑟𝑒

⎞⎠19 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
I am not sure it's useful to include these equations. My suggestion is to say that the cost function is presented in detail in the thesis, and it consists of the following terms: and then list with bullet points what each term does, e.g., what is minimized, what is a constraint, etc.Put this equation at the end of the slide deck, in case there are questions about it.

Optimization strategySimulated annealing

∙ Heuristic search method for combinatorial problems.

∙ Finds a solution closed to the optimal one.

∙ Occasionally allows jumps from a current solution to an inferior oneto avoid getting stuck in a local minimum.

Figure: Cost function values

20 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Optimization strategyAlgorithmInput:application model, architecture model, system mapping constraintscurrent temperature,minimum temperature,max steps per temperatureOutput:A mapping of software components to ECUs. A mapping of runnables to OS tasks.A mapping of OS tasks to cores. A mapping of OS tasks to OS applications.

1 foreach software component in the application model do2 randomly assigned it to an ECU3 foreach runnable in the sofware component do4 randomly assigned it to an Core on the ECU5 end6 end7 Compute current cost;8 while 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 > 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 do9 for 𝑠𝑡𝑒𝑝 := 1..𝑚𝑎𝑥 𝑠𝑡𝑒𝑝𝑠 𝑝𝑒𝑟 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 do10 Randomly choose a transformation strategy;11 Generate new solution by applying the transformation to the current solution;12 Compute new cost;13 if 𝑛𝑒𝑤 𝑐𝑜𝑠𝑡 < 𝑐𝑢𝑟𝑒𝑛𝑡 𝑐𝑜𝑠𝑡 then14 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 = 𝑛𝑒𝑤 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛15 else16 Choose a random number 𝑟 ∈ [0, 1);17 if 𝑒(𝑜𝑙𝑑 𝑐𝑜𝑠𝑡−𝑛𝑒𝑤 𝑐𝑜𝑠𝑡)/𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 > 𝑟 then18 current solution = new solution;19 else20 end21 end22 end23 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 = 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 * 𝑐𝑜𝑜𝑙𝑖𝑛𝑔 𝑓𝑎𝑐𝑡𝑜𝑟

24 end

21 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Put this slide at the end as a backup slide, don't include it in the presentation.

Optimization strategyTransform strategies

Figure: Move software componenttransformation

Figure: Move runnablesbetween cores

Figure: Move runnables into sameOs-Task

22 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Experimental EvaluationVolvo use case∙ 50 software components with 75 runnables in total.

Figure: Volvo mapping result

23 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Make sure you use the case study without the full function names, remember the email from Volvo. I will put these slides on the web.
paul
Sticky Note
This large case is difficult to follow. Maybe you can start wit the small example you have in the thesis, give the application and architecture models, and then give the result. Compare this with the optimal result and say you have also implemented code for that.Then, show also the Volvo case, but say a few things about what you get as input, maybe in terms of number of runnables, type of ECUs, etc. Briefly.Say also how long the SA algorithms run.

Conclusions & Future workConclusions

∙ Method and a tool has been proposed for the problem of mappingAUTOSAR functionalities (runnables) with different ASIL levels on adistributed network of multi-core ECUs.

∙ Simulated annealing has been chosen together with a cost functionfor the mapping of functionalities.

∙ Three use cases, each composed of an application and architecturemodel were implemented and tested.

∙ The tool has been also tested by Volvo Advanced Technology &Research in Götheborg.

24 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Conclusions & Future workFuture work

∙ Implementing new rules such that the tool provides a mappingsolution were all the end-to-end timing constraints are met will bean important addition to the current implementation.

∙ The authors in [LLP+09] have proposed new rules for mappingrunnables to Os-tasks in AUTOSAR such that to minimize theintra-ECU communication. The tool can be improved by addingthem and check if we can obtain better mapping solutions giventhe constraints.

25 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

Thank you for your attention!

26 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015

paul
Sticky Note
Have 2 backup slides about your implementation, focusing on design and testing.

BibliographyReferencesAUTOSAR_SW_OS.Specification of operating system.Technical report, AUTOSAR 4.2.1, 2014.

S. Bunzel, S. Furst, J. Wagenhuber, and F. Stappert.Safety and security related features in autosar, 2010.http://www.automotive2010.de/programm/contentdata/

Bunzel-AUTOSAR.pdf.

C. L. Liu and James W. Layland.Scheduling algorithms for multiprogramming in ahard-real-time environment.J. ACM, 20(1):46–61, January 1973.

Rongshen Long, Hong Li, Wei Peng, Yi Zhang, and MindeZhao.An approach to optimize intra-ecu communication based onmapping of autosar runnable entities.In Embedded Software and Systems, 2009. ICESS ’09.International Conference on, pages 138–143, May 2009.

Alexander Mattausch.Do AUTOSAR and functional safety rule each other out?,2014.https://d23rjziej2pu9i.cloudfront.net/wp-content/uploads/

2014/11/28025218/AUTOSAR_Functional_Safety_Do_they_rule_

each_other_out.pdf.

27 DTU Compute Functionality assignment to partitioned multi-core architectures 30.6.2015