improving embedded software productivity with auto code ... · improving embedded software...

19
Embedded Systems | Aug 21, 2013 Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj Rajendrakumar & Ganesh Parthiban Embedded Systems Renault Nissan Technology Business Centre India

Upload: others

Post on 03-Nov-2019

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

Embedded Systems | Aug 21, 2013

Improving Embedded Software Productivity

with Auto Code Generation in Model Based

Development approach

By

Nithinraj Rajendrakumar & Ganesh Parthiban Embedded Systems

Renault Nissan Technology Business Centre India

Page 2: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 2

RNTBCI – Brief Introduction

Engine Management System - MBD approach

Preparing for Auto Code Generation (ACG)

Model Migration

ACG – Impact on Productivity

Pilot Project

Lessons learnt from Pilot project

Results - Auto code generation on live project

Conclusion & Next steps

INDEX

Page 3: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 3

Renault Nissan Technology and Business Centre India Private Limited, is a

50:50 Joint Venture established under the Renault Nissan Alliance

We cater to local & global needs of Nissan and Renault in various

research and automotive technologies

We have an in-house Software Development Centre

Headquarters France

Date of Establishment 1898 (114 years back)

Global presence 118 countries

No. of employees 128,332

Brands Renault, Dacia & Renault Samsung

Design Centres 5 countries

Manufacturing facility 17 countries

2011 Group sales volume 2.7 Million Vehicles

2011 Group turnover 52,059 Million USD (apprx.)

2011 Group net income 2,555 Million USD (apprx.)

Headquarters Japan

Date of Establishment 1933 (79 years back)

Global presence 160 countries

No. of employees 155,099 (apprx.)

Brands Nissan and Infiniti

Design Centres 11 countries

Manufacturing facility 20 countries

2011 Group sales volume 4.7 Million Vehicles

2011 Group turnover 118,950 Million USD (apprx.)

2011 Group net income 4,320 Million USD (apprx.)

RNTBCI – Brief introduction

Page 4: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 4

Legacy EMS Architecture is already modular – No Auto code generation

Applicative SW Architecture

Basic SW: SW encapsulation of hardware and services

ECU Hardware

Interface : Applicative /Basic SW

EMS2010

Applicative SW

(Re usable

code)

Platform

(Supplier)

Engine Management System – MBD approach

Page 5: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 5

ECU Supplier

RNTBCI

(INDiA)

RENAULT FRANCE

validation System plan

Modélisation

Of SWC

=>

=> Architecture functional SWC

=> Models

Validations

MIL SWC

Validations MIL ECU

Validations

System

Validations

System

Validations HIL ECU

Validations

SIL SWC

validation SWC Plan

validation ECU plan

Coding SWC

Coding EC U complet

Integration SWC

MBD

# Archi requirements

# requirements HW

# requirements BSW

Software

architecture

ECU

requirements

System

requirements

MBD - Responsibilities

Requirements allocated

to the application scope

Page 6: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 6

• Rules for MBD Strategies Rules for Coding Customization

Global Standard

Rules

(MAAB, Misra…)

Customized rules ~ 5 % of rules adaptation

to Renault specificities

~ 75 % of rules coming

from Global standards

Optimized rules ~ 20 % of rules optimized

for automatic code

generation

• Renault specific architecture

• Multi Target Support (32 Bit)

• Re-Use Library API

• Arithmetic APIs

• Multi configuration support

• Fixed point code generation

Suppliers:

MBD Tools

MBD – Need for model migration

Page 7: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 7

MBD Tools

Suppliers:

• Rules for MBD Strategies Rules for Coding Customization

Global Standard

Rules

(MAAB, Misra…)

Customized rules ~ 5 % of rules adaptation

to Renault specificities

~ 75 % of rules coming

from Global standards

Optimized rules ~ 20 % of rules optimized

for automatic code

generation

• Renault specific architecture

• Multi Target Support

• 32 Bit Controller

• Re-Use Library API

• Arithmetic APIs

• Multi configuration support

• Fixed point code generation

Refining MBD Rule

• Specifications are compliant with MIL & SIL environments

• Specifications are compliant with automatic coding tools (RTW-EC)

• Specifications are still compliant with manual coding

MBD – Preparation for ACG

Page 8: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 8

• Migration process is to apply all MBD rules and EMS software architecture on APL modules to be ACG compliance

• Customized “Model Examiner Tool” used to apply and verify model with respect to rules retaining the exact functionality

Model

Examiner tool

MBD

Rules

Module

Compliance

with MBD Rules

EMS2010 EMS2012

Model Migration (EMS2010 EMS2012)

Page 9: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 9

Input EMS2012 module

Requirement/Impact Analysis

Fixed point data typing

Generate Auto Code

Compilation and static analysis

Perform Unit Testing

(Coverage Testing)

Execute SIL Testing

(Functional Testing)

Analysis Test Results

Delivery of Code and SIL report

Conventional

method data typing

Renault coding rules

customization tool

1. Verifying all inputs

2. Tool compliance version

Renault specific tools to check

coding architecture compliance

Test Case Generation

using Reactis / SLDV

Functional

Test Vectors

• Impact on productivity

– HIGH

– MEDIUM

– LOW

– NO CHANGE

ACG – Impact on Productivity

Page 10: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 10

• Impact on productivity

– HIGH

– MEDIUM

– LOW

– NO CHANGE

Input EMS2012 module

Requirement/Impact Analysis

Fixed point data typing

Generate Auto Code

Compilation and static analysis

Perform Unit Testing

(Coverage Testing)

Execute SIL Testing

(Functional Testing)

Analysis Test Results

Delivery of Code and SIL report

Conventional

method data typing

Renault coding rules

customization tool

1. Verifying all inputs

2. Tool compliance version

Renault specific tools to check

coding architecture compliance

Test Case Generation

using Reactis / SLDV

Functional

Test Vectors

ACG – Productivity target

Page 11: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 11

• Process duration*

* Not to the scale

Pilot Project

Page 12: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 12

CHALLENGES: WORK AROUNDS:

Floating point Algorithm Restriction on block usage (ex gain block) due to

Floating point to Fixed point conversion

64 bit data typing

Data loss manipulation due to magic numbers

Short term Certification process introduced

Limiting Data type to 32 bit and manually code is

implemented based for 64 bit data typing

Data typing for magic number also to minimize data loss

RAM/ROM Demands Scope for Model Designs optimization

Data Typing in slope and Bias (high precision resolution

and range)

Creation of RTW inline function while code generations

Re-Use library block for code generation

Short term Certification process introduced

Solution under investigation

Introduced TFL for all arithmetic calculations, but still for

few arithmetic combinations RTW inline function is

created.

S-Function block is replaced while code generations for

better reuse of library API

Adherence to Legacy development practices Fixed point tool box for data typing due to slope and

bias

Specification range saturation

Adaptation of Renault coding architecture

Manual data typing being performed

RTW was not saturating code based on specification

requirement but with respect to data typing, so saturation

block was added.

Customization in RTW-EC code generation tool.

Lessons learnt on Pilot Project

Page 13: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 13

• Restriction on Gain block usage

• Possible data loss during Floating point to Fixed point conversion.

• There is no standard rule to define the data type for the parameter value.

Lesson 1: Floating point algorithm

Page 14: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 14

• RAM/ROM consumption had an average increase of 35% to 40% in ACG

compared to manual code

• Targeting to bring down memory consumption by

– Optimizing the model design

– Refining rules for optimized code generation

Example: Scope for Model Designs optimization

11 lines of code 3 lines of code

Lesson 2: RAM/ROM Demands

Page 15: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 15

So, Manual addition of saturation block is necessary to comply

with Auto Code Generation

The generated code does not limit the data to max value of 200

as mentioned in the signal attributes

Lesson 3: Reworking on models

Page 16: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 16

Basic SW: SW encapsulation of hardware and services

ECU Hardware

Interface : Applicative /Basic SW

CM was chosen as a first module for deploying ACG process

EMS2010

Applicative SW

(Re usable

code)

Platform

(Supplier)

ACG implementation on Live Project

Page 17: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 17

0.00%

10.00%

20.00%

30.00%

40.00%

50.00%

60.00%

70.00%

80.00%

90.00%

100.00%

0

20

40

60

80

100

120

140

1 2 3 4 5 6 7 8 9 10

Estimated Manual Effort (PDs) Actual ACG Effort (PDs) Productivity gains

Average Productivity improvement achieved for coding & Unit

Testing is 59% for 10 modules on live project

Results – Auto code generation on Live Project

Page 18: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 18

Next planned improvements:

- Introduction of SLDV

- Using Fixed point tool box

- Extension of ACG process to other ECU sw development

Overall experience with ACG process resulted in satisfactory Productivity improvement and brought out other areas of

further improvements.

Conclusion & Next steps

Page 19: Improving Embedded Software Productivity with Auto Code ... · Improving Embedded Software Productivity with Auto Code Generation in Model Based Development approach By Nithinraj

| 19

Thank You !