Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew Research, NXP...

54
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew Research, NXP Semiconductors

Transcript of Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew Research, NXP...

Creating Embedded Platforms with MDA: Where’s the Sweet Spot?

Tim TrewResearch, NXP Semiconductors

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

2

2000BC

1650 AD

Road Transport

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

3

Embedded Software Development

1959: Jovial

1966: Coral

1972: C PL/M RTL/2

1979: C++

2009: ? Aspect Oriented Software Development Domain-Specific Languages

Meta-programming Model-Driven Architecture

1998: Components: Koala, tmCom, Fractal, …

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

4

Alan W. Brown, IBM, 2004

5

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Alan W. Brown, IBM, 2004

Where’s the sweet

spot?

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

6

Contents

Overview of NXP Semiconductors

Selling embedded software components

Styles of MDA and the search for the “sweet spot”

Examples– Feature composition – the bleeding edge of modelling – Raising the abstraction level of programming– Component integration and configuration

How to choose?

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

7

Markets for Chips+Software

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

8

TV software stack …

TV HW

AV streaming layer1.5 MLOC

MW layer0.7 MLOC

Application Layer0.3-1 MLOC

OS

0.8M

LO

C

• We only get paid for the IC – SW is free!

• Big sales opportunities

• High risk/high reward business

… and the hardware it runs on …

120M transistors

Pentium: 47M-820M

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

10

… and the hardware it runs on …

2 MIPS, 3 TriMedia VLIWs, 100 DMA channels, 2 memory busses + …

Performance is critical– Concerned with throughput and latency

= CPU cycles + cache misses + (SDRAM + bus) latency

Power is becoming important – It’s critical in a phone or MP3 player– You don’t want a fan in a TV

– Power down everything you don’t need right now– Use voltage/frequency scaling

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

11

Tuned for best performance/power/cost

Different Processor

Architectures for different

jobs

IntrinsicPower

Efficiency

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

12

Selling embedded software components

TV HW

AV streaming layer

MW layer

Application Layer

RT

OS

OSAL

API

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

13

Selling embedded software components

TV HW

AV drivers

MW layer

Application Layer

GP OS

API

DirectShowGStreamer

MMF

How to adapt to different HW –

changing dependencies for

power management

How to adapt to different streaming frameworks – all

functions have to be implemented

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

14

Selling embedded software components

TV HW

GP OS layer

Streaming FrameworkDirectShowGStreamer

MMF

Power & QoS Management

How to optimize behavior when

planned global state is in the OS?

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

15

Embedded software – it’s not just post-conditions

Intermediate hardware states are immediately visible

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

16

Embedded software – it’s not just post-conditions

Intermediate hardware states are immediately visible

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

17

Product lines aren’t the [full] answer

Product lines rule OK!

18Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Product lines aren’t the [full] answer

Does this still work?

How much effort to adapt?

Version 1 Version 2

ConfiguredAsset

ConfiguredAsset

CoreAsset

CoreAsset

ConfiguredAsset

19Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Styles of MDA

Innovation

Payback

Raising abstractionlevel

Featurecomposition

Componentintegration and

configuration

Capability

Where’s the sweet spot?

20Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Feature composition

Innovation

Payback

Raising abstractionlevel

Featurecomposition

Componentintegration and

configuration

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

21

Introduction to Program InstallationIn France

Preset list

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

22

Introduction to Program InstallationIn France

Preset list

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

23

Introduction to Program InstallationNear France

Preset list

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

24

Introduction to Program InstallationNear France

Preset list

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

25

Introduction to Program InstallationAutomatic Channel Installation

Preset list

26Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Independently-selectable features

• Variation points may be set by NXP or the customer

• It must be possible to apply transformations in any order

• Point at which the grey feature is inserted depends on whether the green feature is present.

Pass1

Preparing for Pass

SearchingFinding

PropertiesStationFound

StationNot

Found

/Store Data

Pass2

Preparing for Pass

SearchingFinding

PropertiesStationFound

Stationnot Found

/Store Data

$beforePass2

Independently-selectable features

Pass1

ACI Installation

Preparing for Pass

SearchingFinding

PropertiesStationFound

ACI Installation

StationNot

Found

Store ACI

Pass2

Preparing for Pass

SearchingFinding

PropertiesStationFound

Stationnot Found

/Store Data

$beforePass2

Independently-selectable features

region.transition.selectFirst(t|t.target.metaType ==statem::FinalState).source;

Pass1

ACI Installation

Preparing for Pass

SearchingFinding

PropertiesStationFound

ACI Installation

StationNot

Found

Store ACI

Pass2

Preparing for Pass

SearchingFinding

PropertiesStationFound

Stationnot Found

/Store Data

$beforePass2

Independently-selectable features

What metaclass should this be?

•Exit point?•Junction?•Vertex – abstract!

How do we remove this transition in XWeave?

region.transition.selectFirst(t|t.target.metaType ==statem::FinalState).source;

Pass1

ACI Installation

Preparing for Pass

SearchingFinding

PropertiesStationFound

ACI Installation

StationNot

Found

Store ACI

Pass2

Preparing for Pass

SearchingFinding

PropertiesStationFound

Stationnot Found

/Store Data

$beforePass2

Independently-selectable features

• Where do we find enough developers who can formulate pointcut expressions?

• Everyone needs to be able to do it

region.transition.selectFirst(t|t.target.metaType ==statem::FinalState).source;

31Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Raising abstraction level

Innovation

Payback

Raising abstractionlevel

Featurecomposition

Componentintegration and

configuration

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

32

Raising the abstraction level

Rhapsody (2005):• Code and diagrams are

linked to a common model – changes are reflected immediately

• Model available for verification, simulation & debugging

• Configurable object communication and synchronization

Pass1

ACI Installation

Preparing for Pass

SearchingFinding

PropertiesStationFound

ACI Installation

StationNot

Found

Store ACI

Raising the abstraction level

ACI Installation

Waiting for ACI

Entry: Start ACI TimerExit: Cancel ACI TimerOn ACI Timeout[++ACI Count < div_AciOverallTimeoutTime]/Start ACI Timer

Searching for ACI

On insEventStopAutoInstallation/defer

Writing ACI DatapgaciN_aciPresetsWriteInDataStarted():

insEventAciDataFound

pgaciN_OnAciInstallationCompleted(TRUE):insEventAciDataStored

ACI Success

ACI Not Completed

pgaciN_OnAciInstallationCompleted(FALSE):insEventAciNotCompleted

ACI Timeout[++ACI Count >= div_AciOverallTimeoutTime]

insEventStopAutoInstallation

Start ACI

Store ACI table

ACI Failed

pgaciN_OnAciInstallationCompleted(FALSE):insEventAciNotCompleted

Waiting for User ACI Selection

pacidsN_OnMultiPackageDisplayedinsEventOnMultiPackageDisplayed

Pass1

ACI Installation

Preparing for Pass

SearchingFinding

PropertiesStationFound

ACI Installation

StationNot

Found

Store ACI

Raising the abstraction level

ACI Installation

Waiting for ACI

Entry: Start ACI TimerExit: Cancel ACI TimerOn ACI Timeout[++ACI Count < div_AciOverallTimeoutTime]/Start ACI Timer

Searching for ACI

On insEventStopAutoInstallation/defer

Writing ACI DatapgaciN_aciPresetsWriteInDataStarted():

insEventAciDataFound

pgaciN_OnAciInstallationCompleted(TRUE):insEventAciDataStored

ACI Success

ACI Not Completed

pgaciN_OnAciInstallationCompleted(FALSE):insEventAciNotCompleted

ACI Timeout[++ACI Count >= div_AciOverallTimeoutTime]

insEventStopAutoInstallation

Start ACI

Store ACI table

ACI Failed

pgaciN_OnAciInstallationCompleted(FALSE):insEventAciNotCompleted

Waiting for User ACI Selection

pacidsN_OnMultiPackageDisplayedinsEventOnMultiPackageDisplayed

On insEventStopAutoInstallation/defer

insEventStopAutoInstallation

36Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Raising the abstraction level

Installation

ACI VPS PDC

Platform

OnPageFound()

«Interface»TXTPageNotifications

StartAci()StoreAciTable()Terminate()

«Interface»AciCtrl

[state!=Idle]opt

ClientAutomatic Installation

StartSfA()

NewFeatureReq()

ACI

[!ACI || Interruptible]

[ACI & !Interruptible]

alt

Terminated

Flushed()

Terminate()

Terminate

Pending

Terminated()

Flushed

Raising the abstraction level

Can we generate this protocol from the original integrated state model with sub-machines and deferred events?

Can we generate this protocol from the original integrated state model with sub-machines and deferred events?

Terminate ACI, immediate acknowledgement

Terminate ACI, asynchronous acknowledgement

Does this problem occur often enough to make the investment?

Does this problem occur often enough to make the investment?

38Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Component integration and configuration

Innovation

Payback

Raising abstractionlevel

Featurecomposition

Componentintegration and

configuration

39Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

40

ZigBee Example

For network(s) of monitoring and controlling devices

Provides:– Wireless operation

range: 5 – 500 m– Low power consumption

battery life: multi-month to years– Low cost per node– Security– Easy implementation – Reliable data-transfer

fully hand-shake protocol

41Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

ZigBee Example

IEEE 802.15.4

NXP PHY/HW

MAC Supplier

NWK 2

App Framework 2

Application

NWK 1

App Framework 1

Application 1

NWK 3

App Framework 3

Application 3

e-Metering

Interfaces are logically equivalent, but differ in

detail (component binding, parameter

passing, etc.)

Different component models, build systems, variability mechanisms

43Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Component integration and configuration

► Platform integration uses software components from several internal/external sources

► Design-in teams can’t have in-depth knowledge of them all

MAC Supplier

NXP

Tiny OS

PlatformIntegration

Design In

Design In

Design In

Customer X

e-metering

Customer Z

NWK/AppsA

e-meteringNWK/Apps

NWK/AppsC

SSCMSICM

PHY

MAC

NWK

NXP PHY

SpecificMAC

PD PLME

SpecificNWK

MCPS MLME

Glue

NXP PHY

SpecificMAC

PD PLME

SpecificNWK

MCPS MLME

MCPS MLME

Makefile

Source

Library

Makefile

Source

Library

Makefile

Source

Library

Customer ConfigurationNXP Configuration

PD PLME

MCPS MLME

Transformations from models to code

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

45

Roles – who has to know what

Create UML profile/metamodel, e.g. add «notification», «GlueComponent»,«ComponentModel»,etc. stereotypes.

– Preferably an industry standard

Create modelcode transformation per component model, interfacestyle, etc.

Use wizard to create function/parameter mappings per configuration

Use variability management tool to create product

46Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Glue Code Architecture

NWK - tmCOM

Glue

MAC - nesC

MCPS

MCPS

MLME

MLME

tmCOM interfaces

nesC interfaces

tmCOM: Dynamic component creation and

interface binding

nesC: Build-time component creation and

interface binding

47Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Glue

Glue Code Architecture

NWK - tmCOM

MAC - nesC

MCPS

MCPS

MLME

MLME

NotificationSubscriptionManagement

tmCOM interfaces

nesC interfaces

48Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Glue

Glue Code Architecture

NWK tmCOM

MAC (Meshnetics - nesC)

MCPS

MCPS

MLME

MLME

NotificationSubscriptionManagement

nesC module

nesC configurations

tmCOM interfaces

nesC interfaces

nesC: C files and component netlist

49Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Where else might this land?

Digital Car Radio

ADCs DFEBB inner Receiver

BB outerReceiver

SourceDecoder

Radio Manager

WidebandTuners

• SimuLink to heterogeneous multi-processor

• Multiple receivers/station

• Multiple standards concurrently

51Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

Application to Software-Defined Radio

DMA DMA

DMADMA

DMA DMA

• Synchronous Data Flow (SDF) for scheduling and buffer sizing

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

52

AcknowledgementsEindhoven:Octa Cota (TU/e)Yanja DajsurenHerman HartmannJos HeggeAart MatsingerRob Wieringa

Bangalore:Santosh AraballiParamesh BabuNavneet KhullarGiten Kulkarni

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

53

Acknowledgements

IBM Haifa:Ofir BruknerAlan HartmanMila KerenJulia RubinAsaf ShaarTali Yatzkar-Haham

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

54

Conclusions

Selling low-level embedded software components is different :– We have to accommodate the functional requirements of all customers– Software components have to adapt to the hardware– Components increasingly have to fit in customers’ infrastructure choices

MDA offers solutions to these challenges– Generate “custom” code for each customer from models– Change from code with the union of all variation points to composable

models

But– The largest payback requires the largest change from current practice– The tooling is not mature

Have to be really familiar with repetitive development tasks– We have to share experience and feed back to the research

community– What really pays off?

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

56

Conclusions

Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew

57