Slides of the lecture given at the Summer School on Cyber-Physical Systems and Internet-of-Things - CPS&IoT’2019, held in Budva, Montenegro, June 10-14, 2019
3. Introduction
▪ Model-Driven Design (MDD)
▪ High-abstraction level
▪ Mature SW engineering methodology
▪ State-of-the-Art
▪ Matlab-Simulink
▪ Proprietary, only one MoC, M language
▪ CoFluent
▪ Proprietary, a few MoCs, C/C++ language
▪ Ptolemy II
▪ Academic, any MoC, C/C++ inside a Java block
▪ …
4. Introduction
▪ UML
▪ Standard, any (user-defined) MoC, any language
▪ Natural way to capture system architecture
N2 BN1
M A
▪ Semantic lacks
▪ Domain-specific profiles
▪ MetaMorph
▪ OpenSource, any (user-defined) MoC, language agnostic
7. Model-Driven Analysis and Design of IoT Systems
▪ Programming the Internet of Everything
▪ Services provided on computing platforms of many kind
8. Model-Driven Analysis and Design for the IoE
▪ Programming the Internet of Everything
▪ Services provided on computing platforms of many kind
C/C++,…
Autosar RTE
ForTran,…
Python,…
MPI,…
Java,…
MPI,…
C/C++,…
MCAPI,…
HTML5,…
Java,…
Dalvik VM,…
UML
DC DSLs
UML
ES DSLs
UML
SmartPhone
DSLs
Service
UML
ES DSLs
UML
CPSoS DSL
9. Model-Driven Analysis and Design for the IoE
▪ Programming the Internet of Everything
▪ Services provided on computing platforms of many kind
HW
Synthesis
SW
Synthesis
(RT)OS,
Runtime,…
Corba, TCP/IP,
MPI, MCAPI,…
ForTran,
Python, Java,
HTML5,
C/C++,…
Concerns
Performance,
safety, cost,
security, size,
…
Schedulability
Analysis
Simulation
Verification
Performance
Analysis
Design-Space
Exploration
Optimization
Service
UML
CPSoS DSL
10. MD Analysis & Design: Component-Based
▪ UML/MARTE System Modeling Methodology
▪ Platform-Independent
▪ Component-Based
▪ Supporting
▪ Object-Orientation
▪ Actor-Orientation
required
interface
Component 1
Component 3
Component 2
Port 3.1
Port 3.2 Port 2.1Port 2.2
Port 1
provided
interface
required
interface
provided
interface
required
interface
OO
CB
AO
16. MD Analysis & Design: Flexibility
▪ Supporting different Models of Computation & Communication
▪ Properties of the Provided Port
▪ NotAttendedService
▪ Retry
▪ Properties of the Interface Methods
▪ concurrency
▪ exekind
▪ syncKind
▪ Properties of the Required Port
▪ queueSize
▪ FullPoolPolicy
17. MD Analysis & Design: Flexibility
▪ Function Call/RPC/RMI
▪ Rendezvous
Required Port RtService Provided Port
MoCNotAttendedService retry concurrency exekind syncKind queueSize FullPoolPolicy
infiniteWait none G or C rem.Im. sync. none none exactly once
infiniteWait none G or C rem.Im. async. none none at most once
dynamic none G or C rem.Im. sync. none none exactly once
dynamic none G or C rem.Im. async. none none at most once
timedWait 0 G or C rem.Im. sync. none none exactly once
timedWait 0 G or C rem.Im. async. none none at most once
timedWait > 0 G or C rem.Im. sync. none none at least once
timedWait > 0 G or C rem.Im. async. none none maybe once
Required Port RtService Provided Port
MoCNotAttendedService retry concurrency exekind syncKind queueSize FullPoolPolicy
infiniteWait none G or C rem.Im. rendezvous none none CSP
timedWait 0 G or C rem.Im. rendezvous none none RV
timedWait > 0 G or C rem.Im. rendezvous none none RV
18. MD Analysis & Design: Flexibility
▪ Data-Flow
▪ Discrete-Event/Time-Triggered/Timed Data-Flow
Required Port RtService Provided Port
MoCNotAttendedService retry concurrency exekind syncKind queueSize FullPoolPolicy
infiniteWait none G or C deferred async. > 0 block KPN/SDF
infiniteWait none G or C deferred async. > 0 (any other) DF
dynamic none G or C deferred async. > 0 any DF
timedWait 0 G or C deferred async. > 0 any DF
timedWait > 0 G or C deferred async. > 0 any DF
Required Port RtService Provided Port
MoCNotAttendedService retry concurrency exekind syncKind queueSize FullPoolPolicy
dynamic none G or C rem.Im. async. none none DE/TT/TDF
20. Model-Driven Performance Analysis
▪ Problem Statement
▪ Fast Simulation & Performance Analysis
▪ Before full SW Development
▪ Native Simulation
▪ Host-Compiled
21. ▪ Native Simulation
…
Overflow = 0;
s = 1L;
for (i = 0; i < L_subfr; i++) {
Carry = 0;
s = L_macNs(s, xn[i], y1[i]);
if (Overflow != 0) {
break; }}
if (Overflow == 0) {
exp_xy = norm_l(s);
if (exp_xy<=0)
xy = round(L_shr (s, -exp_xy));
else
xy = round(L_shl (s, exp_xy)); }
mutex_lock(mutex_name);
…
Global variable
int Sim_Time = 0;
Sim_Time += TB();
Sim_Time += TB();
Sim_Time += TB();
Sim_Time += TB();
Sim_Time += TB();
Sim_Time += TB();
wait included
TB() is a function of
# of binary instructions
type of instructions
# of cache misses
frequency
even
data dependencies
Sim_Time += TSYS();
TSYS() is a function of
preemptions
conflicts in the bus
Model-Driven Performance Analysis
22. ▪ CPS: Digital Behavior in a Physical World
▪ System Model (Specification)
▪ The implementation is as good as similar to the model
▪ Environment Model
▪ The model is as good as similar to reality
Model-Driven Design Verification
24. ▪ Functional synthesis
▪ ‘main’ functions
▪ Static concurrency
▪ Platform-Specific code
▪ Optimized C code for DSPs
▪ OpenCL/GL for GPUs
▪ C/C++ & OpenMP for SMPs…
C3
DSP
optimized
C code
OpenCL/GL
code for
GPU
Platform-
Independent
C code
Communication Infrastructure
Memory Space
OS
GPU
SMP
node
DSP
Model-Driven SW Synthesis
25. ▪ Communication synthesis
▪ Architectural mapping
▪ Memory space
▪ OS
▪ Processing node
▪ Communication Protocols
▪ MPI
▪ MCAPI
▪ TCP/IP…
▪ Benefits / Drawbacks
▪ Communication Speed
▪ Memory protection
▪ Memory/cache use
▪ Scheduling
▪ Parallelism…
25
Model-Driven SW Synthesis
26. Conclusions
▪ The IoE demands new CPSoS design methods and tools
▪ Model-Driven system design is a powerful candidate
▪ A CPSoS system modeling language is required
▪ Supporting Mega-Modeling
▪ Analysis & design of the whole IoE service
▪ Single-Source Approach