33
CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved. Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi, Ltd., Takeshi Fukuda、Tasuku Ishigooka, Fumio Narisawa Hitachi Automotive Systems, Ltd., Toru Irie, Takafumi Suzuki 2 nd Workshop on Certifiable Multicore Avionics and Automotive Systems

Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

Embed Size (px)

Citation preview

Page 1: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Multicore Migration Study in Automotive Powertrain Domain

21/Apr/2017 Hitachi, Ltd.,

Takeshi Fukuda、Tasuku Ishigooka, Fumio Narisawa Hitachi Automotive Systems, Ltd.,

Toru Irie, Takafumi Suzuki

2nd Workshop on Certifiable Multicore Avionics and Automotive Systems

Page 2: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

1

Page 3: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Hitachi corporate data

© Hitachi, Ltd. 2016. All rights reserved.

Hitachi, Ltd.

Incorporated 1st February 1920 [Founded 1910]

Head Office Marunouchi 1-6-6, Chiyoda-ku, Tokyo, JAPAN

Hitachi Group (Consolidated) FY2015

Revenues JPY 10,343 billion

R&D expenditure JPY 333.7 billion [3.3% of revenue]

No. of subsidiaries 1,056 companies [262 domestic; 794 overseas]

No. of employees 335,244 [187,936 domestic; 147,308 overseas]

Page 4: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Electronic Systems & Equipment

21%

10% 7%

14%

9%

6%

3%

Revenues (FY2015)

10,343 billion

(JPY)

19% 11%

Smart Life & Ecofriendly Systems

Information & Telecommunication

Systems

Others

(Logistics and

Other services)

High Functional

Materials & Components

Financial Services

Automotive Systems

Social Infrastructure & Industrial Systems

Construction Machinery

Business portfolio

Page 5: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

System solutions that Hitachi Automotive Systems will provide for progress in “Environment”, ”Safety” and ”Information” field.

Business Description of Automotive Dep.

Page 6: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Offering environment-friendly and high-efficiency engine management systems for reduction in CO2 and prevention of air pollution.

[Environment] Engine Management Systems

Injector

ECU: Engine control unit

High-pressure fuel pump

Piston

Valve Timing Control

Airflow sensor

Variable Valve Event and Lift Control System

Balancer

Electronic throttle body

Water pump

Oil pump

Ignition coil (Hitachi Automotive Systems Hanshin)

Transmission control unit

Page 7: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

6

Page 8: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved. 7

Background: Trend of Exhaust Gas Regulation

7

0.10

0.20

Euro4

0

Euro3

ULEV LEV

New short term

New long term

Euro5 TLEV

North America

Japan Europe

SULEV

0.30

Euro6

Today

1980s 1990s 2000s 2010s 1970s

’53 regulation

Muskie Act

Global worming problem

Air pollution problem

Exhaust Gas Regulation about

HC [g/km]

The performance requirements of automotive engine control are increasing, for

instance to comply the exhaust emission regulations and reduce gasoline consumption.

Page 9: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Trend of Microcontroller for Powertrain

8

Current electronic controller unit requests high performance

microcontroller.

ECU: Electric Control Unit

Single Core

‘20 ‘10 ‘15

Perf

orm

ance

High performance trend

Core * 3 - Core * 2

■Trend of Microcontroller for Powertrain Systems

300

400

200

100

[MHz] Clock

[Year]

Page 10: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Our study

9

Our study: To migrate legacy source code to multicore platform.

PC, Smart phone Television Automotive engine

Data Dependency Loosely coupled Loosely coupled Complicated

Mailer

Text editor Web

browser

Broad- casting

Recording

1

2

3

4

5

6

7

8

9

10

11

12

1

3

6

8

2

4

5

7

Core1 Core2 Core3 Core1 Core2 Core1? Core2?

Injection control

Air-fuel ratio control

1 Task + Execution order

Dataflow

1

2

3 4 5

6

9

7

8

10

■Comparison with other products

Page 11: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Our study

10

Our study: To migrate legacy source code to multicore platform.

PC, Smart phone Television Automotive engine

Data Dependency Loosely coupled Loosely coupled Complicated

mailer

power point Web

browser

Broad- casting

Recording

1

2

3

4

5

6

7

8

9

10

11

12

1

3

6

8

2

4

5

7

Core1 Core2 Core3 Core1 Core2 Core1? Core2?

Injection control

Air-fuel ratio control

1 Task + Execution order

Dataflow

1

2

3 4 5

6

9

7

8

10

■Comparison with other products

A potion of dataflow of engine control software

【Cite】 M. Panić, S. Kehr, E. Quiñones, B. Boddecker, J. Abella and F. J. Cazorla, RunPar: An Allocation Algorithm for Automotive Applications Exploiting Runnable Parallelism in Multicores, International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS’14), Oct. 2014.

Page 12: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

11

Page 13: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Dataflow of Control Software

12

E.g. Dataflow of fuel injection

(1)Sensing airflow (2)Calculating air volume (3)Fitting fuel volume (4)Calculating timing of fuel injection

Task in microcontroller

(2) (3)

(4)

(1) Task in AD convertor

Dataflow

Dataflow of control software roughly consists of sensing,

calculating, and actuating.

Notes

Injector

Airflow sensor ECU

Page 14: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Cyclic Execution of Control Software

13

Time chart(single core processor)

(1)250μ

(2)1ms task

(4)Interrupt

based on rpm

(3)2ms task

AD convertor

ECU

T+1 T+2 T+3 T+4 T [ms]

Tasks are executed periodically with each cyclic time or executed

sporadically based on event like an engine rotation speed.

(2) (3)

(4)

(1)

Wait time by fixed priority scheduling

Page 15: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Issue of parallelization

14

10ms task

10ms task A

10ms task B

Single core

Core 2

Inter-core synchronization

Para

lleliz

ation

Multicore Core 1

A large number of inter-core communication data causes high

frequent inter-core synchronization between cores.

Page 16: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Issue of parallelization (Cont’d)

15

Issue: Long wait time is frequently happened when one core is

interrupted by other high priority tasks due to frequent inter-core

synchronization.

Core 2

Inter-core synchronization

Multicore Core 1

1ms task

Interrupt

1ms task

Wait time Wait time

Wait time

10ms task A

10ms task B

Page 17: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Issue of parallelization (Cont’d)

16

Issue: Long wait time is frequently happened when one core is

interrupted by other high priority tasks due to frequent inter-core

synchronization.

Core 2

Inter-core synchronization

Multicore Core 1

1ms task

Interrupt

1ms task

Wait time Wait time

Wait time

10ms task A

10ms task B

【Our Goal 】 In order to achieve high parallelization, our goal is to reduce a number of inter-core synchronization.

Page 18: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

17

Page 19: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Overview of our method

18

We proposed parallelization method with performance

requirements of system control.

Feature of our method is to identify the inter-core data which

doesn’t need inter-core synchronization according to the

requirements of “Data Delay Time”.

(1)Program analysis Dataflow

(2)Detecting inter-core data

Strategy of core allocation

Control SW for single core

intra-core communication

data

inter-core communication

data

(3)Categorizing data

Data without synchronization

Data with synchronization

Requests for data delay

Page 20: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Data delay time

19

(1)250μ

(2)1ms task

(3)2ms task

AD convertor

Core 1

T+1 T+2 T+3 T+4 T [ms] Core 2

Synchronization

between cores

Time chart 1 Data delay Data delay

Wait time Wait time

Synchronization

between cores

Data delay time is one kind of end-to-end path latency, especially,

from start time of sensing task to start time of other task which

has data dependence with sensing task. With synchronization between cores

Page 21: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Data delay time (cont’d)

20

Time chart 2

(1)250μ

(2)1ms task

(3)2ms task

AD convertor

Core 1

T+1 T+2 T+3 T+4 T [ms]

Core 2

Data delay Data delay

No wait time

Without synchronization between cores

Page 22: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Idea

21

With synchronization Without synchronization

Input data Same timing data Previous task data

Wait time Long Zero

Parallelization Low High

Data delay time Short Long

WCRT of data

delay time

Short Long

Our idea: we select the parallelization option which is without

synchronization between cores when we can allow a

WCRT(Worst Case Response Time) of data delay time.

(𝑅 𝜏𝑖 + 𝑛 𝑇 𝜏𝑖+1 − 𝑟(𝜏𝑖+1

𝑁−1

𝑖=1

) + 𝑆(𝜏𝑁)

【Cite】 Balsini, A., Melani, A., Buonocunto, P. and Natale, Ki, M.: FMTV 2016: Where is the Actual Challenge?, 3rd Challenge on Formal Method for Timing Verification (FMTV), International Workshop on Analyais Tools and Methodologies for Embedded and Real-Time Systems (WATERS 2016), (2016)

Page 23: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

22

Page 24: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Overview of evaluation

23

【Engine control SW】 included aprox. 10000 control signals 【ECU】 two cores

HILS (Hardware-in-the-loop Simulation)

API

Core1

Periodic Task Crank Event Task

Core2

Periodic BSW

Event (rpm)

OS OS

Core2: Sporadic tasks (regarding engine rotation speed)

Core 1: Cyclic tasks (E. g. 1ms, 2ms, 10ms tasks)

API

Inter -Core COM

ECU (Engine Controller Unit)

We migrated whole legacy engine control software to multicore

ECU which has two cores. And evaluated it with HILS.

Page 25: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

(1)Program analysis Dataflow

(2)Detecting inter-core data

Strategy of core allocation

Control SW for single core

intra-core communication

data

inter-core communication

data

(3)Selecting data

Data without synchronization

Data with synchronization

Requests for data delay

Requests for input data set

Total amount of Inter-core communication data

24

API

Core1

Periodic Task Crank Event Task

Core2

Periodic

BSW

Event

(Crank)

Single

Core OS

Single

Core OS

コア2:クラセンコア (Quick REFタスク)

コア1:周期タスクコア (1,2,4,10,20,100ms タスク)

API

Inter -Core

COM

Function

Data depencency

Dataflow(portion) the result of program analysis

List of Inter-core communication data the result of detecting inter-core data

We found that a total amount of inter-core communication data

is approx. 600 in our process step two.

Page 26: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

(1)Program analysis Dataflow

(2)Detecting inter-core data

Strategy of core allocation

Control SW for single core

intra-core communication

data

inter-core communication

data

(3)Selecting data

Data without synchronization

Data with synchronization

Requests for data delay

Requests for input data set

API

Core1

Periodic Task Crank Event Task

Core2

Periodic

BSW

Event

(Crank)

Single

Core OS

Single

Core OS

コア2:クラセンコア (Quick REFタスク)

コア1:周期タスクコア (1,2,4,10,20,100ms タスク)

API

Inter -Core

COM

The results

25

Our method indicated that more than 90% out of approx. 600

inter- core communication data don’t need synchronization.

1

10

100

1000

10000

# of control data

Total amount of controls data

Our method with program analysis

Page 27: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Evaluation with HILS(Hardware-in-the-loop Simulator)

26

Multi core (Core 2)

Engine rotation speed [rpm]

Multi core (Core 1)

CPU load[%

]

0%

5%

10%

15%

20%

25%

30%

35%

40%

45%

50%

55%

0 1000 2000 3000 4000 5000 6000 7000 8000

CPU load vs. Engine rotation speed

Increasing depends on rpm

Constant CPU load

Result of HILS evaluation indicated that our method is

(1)useful for parallelizing engine control software

(2)

(3)

Page 28: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Evaluation with HILS(Hardware-in-the-loop Simulator)

27

Engine rotation speed [rpm]

Multi core (Core 2)

Single core

0%

5%

10%

15%

20%

25%

30%

35%

40%

45%

50%

55%

0 1000 2000 3000 4000 5000 6000 7000 8000

CPU load[%

]

Multi core (Core 1)

Max. CPU load 51%

CPU load 16%

CPU load 44%

Result of HILS evaluation indicated that our method is

(1)useful for parallelizing engine control software

(2)able to distribute CPU load to cores

(3)

CPU load vs. Engine rotation speed

Page 29: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Evaluation with HILS(Hardware-in-the-loop Simulator)

28

Engine rotation speed [rpm]

Multi core (Core 2)

Single core

0%

5%

10%

15%

20%

25%

30%

35%

40%

45%

50%

55%

0 1000 2000 3000 4000 5000 6000 7000 8000

CPU load[%

]

Multi core (Core 1)

Result of HILS evaluation indicated that our method is

(1)useful for parallelizing engine control software

(2)able to distribute CPU load to cores

(3)Keeping hard real-time deadline. e.g. fuel infection

CPU load vs. Engine rotation speed

Max. CPU load 51%

CPU load 16%

CPU load 44%

Page 30: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

© Hitachi, Ltd. 2017. All rights reserved. CMAAS 2017

Contents

1. Outline of Hitachi

2. Background

3. Control Software and Issue

4. Our Method

5. Evaluation with Engine Control Software

6. Summary and Discussion

29

Page 31: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Summary

30

【Proposed method】 ・Parallelization method for control software ・The feature of our method is -identify the inter-core data which doesn’t need core synchronization according to the requirement of “Data Delay Time” 【Evaluation】 ・We apply our method to whole legacy engine control software. 【Results】 ・More than 90% of data out of approximately 600 inter-core communication data don’t need synchronization mechanism. ・The evaluation results with HILS indicated that the parallelized software satisfied requirements of real-time performance.

Page 32: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017 © Hitachi, Ltd. 2017. All rights reserved.

Discussion

31

【 Discussion 】 ・Process and Method to decide requirement time of data delay with control engineer is required. It is tough issue to decide it which doesn’t cause a bad effect for the performance of systems. It is a nonsense if multicore migration decrease engine performance like fuel efficiency. ・Precise WCRT analysis method is required. The result of WCRT analysis for data delay time is too pessimistic.

Page 33: Multicore Migration Study in Automotive Powertrain …rtsl-edge.cs.illinois.edu/CMAAS17/media/talk_4.pdf · Multicore Migration Study in Automotive Powertrain Domain 21/Apr/2017 Hitachi,

CMAAS 2017

Thank you!