SW Synthesis from UML/MARTE

38
Modeling and SW Synthesis for Heterogeneous Embedded Systems Heterogeneous Embedded Systems in UML/MARTE Tutorial SD1: High-Level Specifications to Cope With Design Complexity Hector Posadas, Pablo Peñil, Alejandro Nicolás, Eugenio Villar Alejandro Nicolás, Eugenio Villar University of Cantabria Spain

description

System-level specifications are the key entry point to many design flows, as well as the golden reference model throughout the design lifecycle. As such, their quality dramatically impacts the potential quality of the designed product. Specifications have to expose sufficient parallelism and orthogonally capture computation and communication to allow exploring a wide range of target platforms. On top of functional accuracy to capture the designer’s intent, they have to be expressive enough to allow extracting performance requirements and describe system-wide constraints (e.g. application quality metrics). In this presentation at the ASP-DAC 2014 Tutorial "High-Level Specifications to Cope With Design Complexity", organized by Prof. Gunar Schirner, opportunities and methods to describe, simulate and automatically generate the SW stacks on heterogeneous platforms using UML/MARTE are highlighted.

Transcript of SW Synthesis from UML/MARTE

Page 1: SW Synthesis from UML/MARTE

Modeling and SW Synthesis for Heterogeneous Embedded SystemsHeterogeneous Embedded Systems in UML/MARTETutorial SD1: High-Level Specifications to Cope With Design Complexity

Hector Posadas, Pablo Peñil, Alejandro Nicolás, Eugenio VillarAlejandro Nicolás, Eugenio Villar

University of CantabriaSpainp

Page 2: SW Synthesis from UML/MARTE

MotivationMotivation

D i d ti it Design productivity gap Raising the abstraction level

Multi-Processing &H t l tfHeterogeneous platforms

Increasing SW content SW centric design methodologies SW-centric design methodologies

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 2

Page 3: SW Synthesis from UML/MARTE

Usual SW development flowUsual SW development flow

M A

HW/SW platform Architectural Design

B

M A

HW/SW platform N2 BN1

Architectural mapping

OS1OS2

GPU DSP

Ad/Hoc SW development System calls OS1 GPU DSP System calls Communication functions I/O functions & drivers I/O functions & drivers

Verification & Debug Costly fixing of wrong design decisions

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 3

Page 4: SW Synthesis from UML/MARTE

Usual SW development flowUsual SW development flow

M A

Lack of reusability Ad hoc code B

M A

Ad-hoc code

Large re-engineering effortN2 BN1

OS3OS1

OS2GPU DSP

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 4

Page 5: SW Synthesis from UML/MARTE

OutlineOutline

I t d ti Introduction State of the Art The PHARAON approach

Design FlowgModeling Methodology SW Synthesis SW Synthesis

Conclusions

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 5

Page 6: SW Synthesis from UML/MARTE

IntroductionIntroduction

Model-Driven Architecture (MDA) High-abstraction level High abstraction levelMature SW engineering methodology

UML language Application to embedded systems design Application to embedded systems design

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 6

Page 7: SW Synthesis from UML/MARTE

IntroductionIntroduction

Why UML? Natural way to capture system architecture Natural way to capture system architecture Standard way

M A

N2 BN1

N.P N.O

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 7

Page 8: SW Synthesis from UML/MARTE

IntroductionIntroduction

Why UML? Natural way to capture system architecture Natural way to capture system architecture Standard way

UML language UML language Semantics lacks

What is each component? What is each component? What kind or interaction each link actually means?

Domain-specific profilesp p UML/MARTE

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 8

Page 9: SW Synthesis from UML/MARTE

IntroductionIntroduction

MARTE Standard UML profile for real-time embedded systems Standard UML profile for real time embedded systems

Platform-Independent Model (PIM) Platform Description Model (PDM) Platform-Specific Model (PSM)

Rich semantics content Single-source approach Analysis Simulation

VerificationParallelization

Performance Analysis

Design-Space Architectural

Optimization

g pExplorationSystem

Synthesis

Architectural Mapping

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 9

Page 10: SW Synthesis from UML/MARTE

State-of-the-ArtState of the Art

Discussion System modeling in MARTE System modeling in MARTE

Methods based on specific MoCs and/or profiles Requiring additional semanticsq g Non-standard

SW Synthesis Commercial code generation available Limited support for heterogeneity Limited flexibility for different architectural mappings Limited support for the MARTE semantics Limited support for the MARTE semantics

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 10

Page 11: SW Synthesis from UML/MARTE

PHARAON Single-Source Design FlowPHARAON Single Source Design Flow

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 11

Page 12: SW Synthesis from UML/MARTE

PHARAON Single-Source Design FlowPHARAON Single Source Design Flow

S i

HW/SWPlatform

ArchitecturalMappings

C/C++

Scenarios

PIM (App)C

SW Synthesis (SWSyn)

M2T Tools

CompilersLinkers

y ( y )

+

SW stacks

HWAcceleratorsHW

AcceleratorsHWAcceleratorsHW

Accelerators

CPUs/DSPs/ASIPs GP-GPUs

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 12

Page 13: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

M i f t Main featuresMDD concepts

Separation of Concerns

CBE: Component-Based Engineering approachSW i SW centric

StandardMARTE fil MARTE profile

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 13

Page 14: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

D t T f C i ti I t f Data Types for Communication Interfaces Primitive Types

Bit Arrays

Data Structures

Arrays

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 14

Page 15: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Component model Hierarchical functional encapsulation Hierarchical functional encapsulation Ports

provided or requiredprovided or required

C2C2.1 C2.2

C2.3

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 15

Page 16: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Component Interfaces

C2C2.1 C2.2

C2.3

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 16

Page 17: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Component model Interfaces Interfaces

sequential, guarded or concurrent, Max. threads available argument sizes (data splitting), Num. of incoming channels

C2C2.1 C2.2

C2.3

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 17

Page 18: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Component model Channels manage communications Channels manage communications

BlockingFunctionCall, BlockingFunctionReturn, both or none Timeout Priority

C2C2.1 C2.2

Buffer Size Buffer Size ResMult C2.3

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 18

Page 19: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

The Platform Description Model HW/SW Components using MARTE stereotypes HW/SW Components using MARTE stereotypes

Software Components OS, HdS, Drivers, …

Hardware Components Processors, Memories, Buses, Custom HW, I/O

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 19

Page 20: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Platform-Specific ModelMemory spaces mapped to platform resourcesMemory spaces mapped to platform resourcesMapping of functional components

to memory spaces and/or platform resourcesto memory spaces and/or platform resources

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 20

Page 21: SW Synthesis from UML/MARTE

PHARAON Modeling MethodologyPHARAON Modeling Methodology

Architectural Design

Code reuse and/or development

HW/SW platform

p platform independent

HW/SW platform

Architectural mapping

SW Synthesis

Architectural mapping

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 21

Fast design optimization

Page 22: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

System heterogeneity Full support for Full support for

any architectural mapping decided for each component any specific processing resource selected any specific processing resource selected any processing resource type any memory space any memory space any OS used by the processing resource

i ti i f t t any communication infrastructure

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 22

Page 23: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Functional synthesisOne executable per memory-spaceOne executable per memory space Platform-Independent (C/C++) code

Highest reusabilityHighest reusability Non-recommended explicit calls to platform services

communication, concurrency, etc. Platform services should derived from the UML/MARTE model POSIX and/or OpenMP as alternatives Static execution flows Static execution flows

<<SwSchedulableResource>>

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 23

Page 24: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Functional synthesis Platform-Specific code

DSP optimized

C code

OpenCL/GL code for

GPU

Platform-Independent

C code Platform Specific code Optimized C code for DSPs OpenCL/GL for GPUs

C codeGPUC code

OpenMP for SMPs… C3

Configuration Original Optimized Code

Memory Space

OS GPU

ARM 908.28 sec 572.92 sec

ARM-NEON 325.81 sec 255.28 sec

ARM+DSP 206 01 sec 193 45 sec GPUSMPnode

DSP

blocking call 206.01 sec 193.45 sec

ARM+DSPnon-blocking call 895.98 sec 431.68 sec

ARM NEON+DSPCommunication Infrastructure

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 24

ARM-NEON+DSPnon-blocking call 247.93 sec 215.96 sec

Page 25: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Essential activity in heterogeneous SW synthesis Essential activity in heterogeneous SW synthesis Client-Server paradigm Dependent on the architectural mapping Dependent on the architectural mapping

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 25

Page 26: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Architectural mapping Architectural mapping

Same memory space Same OS Different processing nodes

Benefits / Drawbacks Communication Speed

Memory protection Memory protection Memory/cache use Schedulingg Parallelism…

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 26

Page 27: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis 3 Layers automatically inserted in service calls 3 Layers automatically inserted in service calls

Layer 1: communication semantics Allocation independent

L 2 t f ll ti d d t i ti Layer 2: management for allocation-dependent communications Thread generation, data splitting, synchronization

Layer 3: Low-level communicationsy Inter-thread, Inter-process, distributed communication

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 27

Page 28: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Layer1: Independent of architectural mapping Layer1: Independent of architectural mapping

Channel properties RPC

T

BlockingFunctionCall (T)BlockingFunctionReturn (T)

T M Ta

MTa

TbTb

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 28

Page 29: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Layer1: Independent of architectural mapping Layer1: Independent of architectural mapping

Channel properties Pipeline

T

BlockingFunctionCall (F)BlockingFunctionReturn (T)

Ta

M

T MTa

TbTb

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 29

Page 30: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Layer1: Independent of architectural mapping Layer1: Independent of architectural mapping

Channel properties Pipeline & Parallel

T

BlockingFunctionCall (F)BlockingFunctionReturn (F)

Ta

MTb

T MTa

Tb

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 30

Page 31: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Layer1: Independent of architectural mapping Layer1: Independent of architectural mapping

Interface properties Data splitting

TTa

M1Tb

T MTa

M2

Tb

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 31

Page 32: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Communication synthesis Layer1: Independent of architectural mapping Layer1: Independent of architectural mapping

Interface properties Data splitting

TTa

Tb

T MTa

M1 M2

Tb

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 32

Page 33: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Implementation alternatives Channel semantics can be implemented in multiple ways Channel semantics can be implemented in multiple ways

Different OS services shared memory message queue socket file file...

Performance is highly dependent on platform and OS Synthesis enables fast exploration Synthesis enables fast exploration

optimal channel implementation for specific platform and code

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 33

Page 34: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

MultiCore Association APIs Standard APIs for communication and synchronization Standard APIs for communication and synchronization Closely distributed embedded systems

MCAPI - communicationMCAPI communication MRAPI - synchronization MTAPI - task generation

Independence from OSOS-agnostic channel implementation

Components treated as MCAPI nodes Ports treated as MCAPI endpoints

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 34

Page 35: SW Synthesis from UML/MARTE

SW SynthesisSW Synthesis

Platform Inputs & Outputs Drivers associated to environmental components Drivers associated to environmental components

Environment ModelPLC

Test-Benchcode

CameraTest-Bench

code

P1

System Model

P2

codecodePLC

driverCamera 1

driver

Camera 2

OS1

Memory Space

driver

PLCSMPNode

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 35

Communication Infrastructure

Page 36: SW Synthesis from UML/MARTE

ConclusionsConclusions

UML/MARTE Powerful modeling methodology Powerful modeling methodology Single-Source approach Platform-Independent Modeling Platform Independent ModelingMaximizing reusability

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 36

Page 37: SW Synthesis from UML/MARTE

ConclusionsConclusions

SW Synthesis Functional modeling Functional modeling Functional synthesis Communication synthesis Communication synthesis Platform Inputs & Outputs

Actually enables platform-independent code Reduces in depth knowledge of platforms Reduces in-depth knowledge of platforms Support shorter design optimization cycles

wider design exploration wider design exploration shorter code generation on heterogeneous platforms

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 37

Page 38: SW Synthesis from UML/MARTE

Additional InformationAdditional Information

http://www.teisa.unican.es/gim/en/proyecto?id=95 H. Posadas, P. Peñil, A. Nicolás, E. Villar

"Automatic synthesis of embedded SW for evaluating physical implementation alternatives y g p y pfrom UML/MARTE models supporting memory space separation“Microelectronics Journal, in press, doi: 10.1016/j.mejo.2013.11.003.

H. Posadas, E. Villar, et al.O f"EU FP7-288307 PHARAON project: Parallel and heterogeneous architecture for real-time

applications“Euromicro Conference on Digital System Design, DSD 2013, IEEE, doi: 10 1109/DSD 2013 4710.1109/DSD.2013.47.

H. Posadas, P. Peñil, A. Nicolás, E. Villar"System synthesis from UML/MARTE models: The PHARAON approach“,Electronic System Level Synthesis Conference, ESLsyn, 2013, IEEE.

P. Peñil, H. Posadas, A. Nicolás, E. Villar"Automatic synthesis from UML/MARTE models using channel semantics“International Workshop on Model-Based Arquitecting and Construction of E b dd d S t ACES MB 2012 d i 10 1145/2432631 2432640Embedded Systems, ACES-MB 2012, doi: 10.1145/2432631.2432640.

January 20, 2014Tutorial SD1: High-Level Specifications to Cope With Design ComplexityASP-DAC 2014, Singapore 38