Presentation Tim Trew

advertisement
Creating Embedded Platforms with MDA:
Where’s the Sweet Spot?
Tim Trew
Research, NXP Semiconductors
Road Transport
2000BC
1650 AD
2
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Embedded Software Development
1959: Jovial
1966: Coral
1972: C PL/M RTL/2
1979: C++
1998: Components: Koala, tmCom, Fractal, …
2009: ?
Aspect Oriented Software Development
Domain-Specific Languages
Meta-programming
Model-Driven Architecture
3
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Alan W. Brown, IBM, 2004
4
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Where’s
the sweet
spot?
Alan W. Brown, IBM, 2004
5
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
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?
6
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Markets for Chips+Software
7
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
TV software stack …
• We only get paid for
the IC – SW is free!
0.3-1 MLOC
Application Layer
• Big sales
opportunities
MW layer
1.5 MLOC
AV streaming layer
0.8MLOC
• High risk/high
reward business
OS
0.7 MLOC
TV HW
8
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
… and the hardware it runs on …
120M transistors
Pentium: 47M-820M
… 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
10
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Tuned for best performance/power/cost
Intrinsic
Power
Efficiency
Different
Processor
Architectures
for different
jobs
11
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Selling embedded software components
RT OS
Application Layer
MW layer
API
AV streaming layer
O
S
A
L
TV HW
12
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Selling embedded software components
Application Layer
MW layer
API
DirectShow
GStreamer
MMF
GP OS
How to adapt to
different streaming
frameworks – all
functions have to be
implemented
AV drivers
TV HW
How to adapt to
different HW –
changing
dependencies for
power management
13
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Selling embedded software components
GP OS layer
DirectShow
GStreamer
MMF
Streaming Framework
Power & QoS Management
TV HW
How to optimize
behavior when
planned global state
is in the OS?
14
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Embedded software – it’s not just
post-conditions
Intermediate hardware states are immediately visible
15
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Embedded software – it’s not just
post-conditions
Intermediate hardware states are immediately visible
16
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Product lines aren’t the [full] answer
Product lines rule OK!
17
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Product lines aren’t the [full] answer
How much effort to adapt?
Core
Asset
Core
Asset
Configured
Asset
Version 1
Configured
Asset
Configured
Asset
Version 2
Does this still work?
18
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Styles of MDA
Feature
composition
Capability
Payback
Component
andspot?
Where’sintegration
the sweet
configuration
Raising abstraction
level
Innovation
19
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Feature composition
Feature
composition
Payback
Component
integration and
configuration
Raising abstraction
level
Innovation
20
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Introduction to Program Installation
In France
Preset list
21
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Introduction to Program Installation
In France
Preset list
22
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Introduction to Program Installation
Near France
Preset list
23
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Introduction to Program Installation
Near France
Preset list
24
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Introduction to Program Installation
Automatic Channel Installation
Preset list
25
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Independently-selectable features
• Point at which the grey
feature is inserted
depends on whether
the green feature is
present.
• Variation points may
be set by NXP or the
customer
• It must be possible to
apply transformations
in any order
26
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Independently-selectable features
Pass1
Preparing for
Pass
Searching
Station
Found
/Store Data
Station
Not
Found
Pass2
Preparing for
Pass
Searching
Station
not Found
$beforePass2
Station
Found
/Store Data
Finding
Properties
Finding
Properties
Independently-selectable features
Pass1
Preparing for
Pass
Searching
Station
Not
Found
Station
Found
Finding
Properties
ACI Installation
region.transition.selectFirst(t|t.target.metaType
==statem::FinalState).source;
ACI Installation
Store ACI
Pass2
Preparing for
Pass
Searching
Station
not Found
$beforePass2
Station
Found
/Store Data
Finding
Properties
Independently-selectable features
Pass1
Preparing for
Pass
Searching
Station
Found
Finding
Properties
Station
Not
Found
ACI Installation
region.transition.selectFirst(t|t.target.metaType
==statem::FinalState).source;
What metaclass
should this be?
•Exit point?
•Junction?
•Vertex – abstract!
ACI Installation
Store ACI
Pass2
Preparing for
Pass
Searching
Station
not Found
$beforePass2
Station
Found
/Store Data
Finding
Properties
How do we remove
this transition in
XWeave?
Independently-selectable features
Pass1
Preparing for
Pass
Searching
Station
Found
Finding
Properties
Station
Not
Found
ACI Installation
region.transition.selectFirst(t|t.target.metaType
==statem::FinalState).source;
ACI Installation
Store ACI
Pass2
Preparing for
Pass
Searching
Station
not Found
$beforePass2
Station
Found
/Store Data
Finding
Properties
• Where do we find
enough developers
who can formulate
pointcut expressions?
• Everyone needs to be
able to do it
Raising abstraction level
Feature
composition
Payback
Component
integration and
configuration
Raising abstraction
level
Innovation
31
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
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
32
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Raising the abstraction level
Pass1
Preparing for
Pass
ACI Installation
Searching
Station
Not
Found
Store ACI
ACI Installation
insEventStopAutoInstallation
Waiting for ACI
Store ACI table
ACI Not Completed
ACI Timeout[++ACI Count >= div_AciOverallTimeoutTime]
Searching for ACI
Start ACI
Entry: Start ACI Timer
Exit: Cancel ACI Timer
On ACI Timeout[++ACI Count <
div_AciOverallTimeoutTime]/Start ACI Timer
pacidsN_OnMultiPackageDisplayed
insEventOnMultiPackageDisplayed
Waiting for User
ACI Selection
pgaciN_OnAciInstallationCompleted(FALSE):
insEventAciNotCompleted
pgaciN_aciPresetsWriteInDataStarted():
insEventAciDataFound
Writing ACI Data
On insEventStopAutoInstallation/defer
pgaciN_OnAciInstallationCompleted(TRUE):
insEventAciDataStored
pgaciN_OnAciInstallationCompleted(FALSE):
insEventAciNotCompleted
ACI Failed
ACI Success
Station
Found
Finding
Properties
ACI Installation
Raising the abstraction level
Pass1
Preparing for
Pass
ACI Installation
Station
Finding
insEventStopAutoInstallation
Found
Properties
Searching
Station
Not
Found
ACI Installation
Store ACI
ACI Installation
insEventStopAutoInstallation
Waiting for ACI
Store ACI table
On insEventStopAutoInstallation/defer
Searching for ACI
Start ACI
ACI Not Completed
ACI Timeout[++ACI Count >= div_AciOverallTimeoutTime]
Entry: Start ACI Timer
Exit: Cancel ACI Timer
On ACI Timeout[++ACI Count <
div_AciOverallTimeoutTime]/Start ACI Timer
pacidsN_OnMultiPackageDisplayed
insEventOnMultiPackageDisplayed
Waiting for User
ACI Selection
pgaciN_OnAciInstallationCompleted(FALSE):
insEventAciNotCompleted
pgaciN_aciPresetsWriteInDataStarted():
insEventAciDataFound
Writing ACI Data
On insEventStopAutoInstallation/defer
pgaciN_OnAciInstallationCompleted(TRUE):
insEventAciDataStored
pgaciN_OnAciInstallationCompleted(FALSE):
insEventAciNotCompleted
ACI Failed
ACI Success
Raising the abstraction level
Installation
«Interface»
AciCtrl
StartAci()
StoreAciTable()
Terminate()
ACI
VPS PDC
«Interface»
TXTPageNotifications
OnPageFound()
Platform
36
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Client
Raising the
abstraction level
Automatic
Installation
ACI
StartSfA()
NewFeatureReq()
Can we generate this protocol
from the original integrated
state model with sub-machines
and deferred events?
opt
Terminate()
alt
Does this problem occur often
enough to make the
investment?
[state!=Idle]
[!ACI || Interruptible]
Terminated
Terminate ACI,
immediate
acknowledgement
Flushed()
[ACI & !Interruptible]
Terminate
Pending
Terminated()
Flushed
Terminate ACI,
asynchronous
acknowledgement
Component integration and configuration
Feature
composition
Payback
Component
integration and
configuration
Raising abstraction
level
Innovation
38
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
39
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
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
40
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
ZigBee Example
Different component
models, build systems,
variability mechanisms
e-Metering
Application 1
Application
Application 3
App Framework 1
App Framework 2
App Framework 3
NWK 1
NWK 2
NWK 3
Interfaces are logically
equivalent, but differ in
detail (component
binding, parameter
passing, etc.)
MAC Supplier
IEEE 802.15.4
NXP PHY/HW
41
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Component integration and configuration
NWK/Apps
A
e-metering
NWK/Apps
NWK/Apps
C
MAC Supplier
Platform
Integration
NXP
Design In
Customer X
Design In
e-metering
Design In
Customer Z
…
Tiny OS
►
►
Platform integration uses software components from
several internal/external sources
Design-in teams can’t have in-depth knowledge of
them all
43
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Transformations from models to code
Specific
NWK
NWK
Specific
NWK
Makefile
MCPS
MLME
Glue
MCPS
MLME
MCPS
MLME
MCPS
Specific
MAC
MAC
Library
Source
MLME
Specific
MAC
Makefile
Library
Source
PD
PLME
PHY
SICM
PD
PLME
NXP PHY
PD
PLME
NXP PHY
SSCM
Makefile
Library
Source
NXP Configuration
Customer Configuration
Roles – who has to know what
Create UML
profile/metamodel,
e.g. add «notification»,
«GlueComponent»,
«ComponentModel»,
etc. stereotypes.
Use wizard to create
function/parameter mappings per
configuration
– Preferably an industry standard
Use variability management tool
to create product
Create modelcode
transformation
per component
model, interface
style, etc.
45
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Glue Code Architecture
NWK - tmCOM
MCPS
MLME
tmCOM: Dynamic
component creation and
interface binding
tmCOM
interfaces
Glue
nesC
interfaces
nesC: Build-time
component creation and
interface binding
MCPS
MLME
MAC - nesC
46
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Glue Code Architecture
NWK - tmCOM
MCPS
MLME
tmCOM
interfaces
Notification
Glue
Subscription
Management
MCPS
nesC
interfaces
MLME
MAC - nesC
47
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Glue Code Architecture
NWK tmCOM
MCPS
MLME
nesC: C files and
component netlist
tmCOM
interfaces
Notification
Glue
Subscription
Management
nesC module
MCPS
nesC
interfaces
MLME
MAC (Meshnetics - nesC)
nesC
configurations
48
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Where else might this land?
49
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Digital Car Radio
Radio Manager
Wideband
Tuners
ADCs
DFE
BB inner
Receiver
BB outer
Receiver
Source
Decoder
• SimuLink to heterogeneous
multi-processor
• Multiple receivers/station
• Multiple standards
concurrently
Application to Software-Defined Radio
DMA
DMA
DMA
DMA
DMA
DMA
• Synchronous Data Flow
(SDF) for scheduling and
buffer sizing
51
Creating Embedded Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Acknowledgements
Eindhoven:
Octa Cota (TU/e)
Yanja Dajsuren
Herman Hartmann
Jos Hegge
Aart Matsinger
Rob Wieringa
Bangalore:
Santosh Araballi
Paramesh Babu
Navneet Khullar
Giten Kulkarni
52
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Acknowledgements
IBM Haifa:
Ofir Brukner
Alan Hartman
Mila Keren
Julia Rubin
Asaf Shaar
Tali Yatzkar-Haham
53
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
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?
54
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Conclusions
56
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
57
Creating
Embedded
Creating Embedded Platforms with MDA: Where's
the Sweet
Spot? Platforms with MDA: Where’s the Sweet Spot? Tim Trew
Download