Modeling Heterogeneous Embedded Systems with TTool Daniela Genius, - - PowerPoint PPT Presentation

modeling heterogeneous embedded systems with ttool
SMART_READER_LITE
LIVE PREVIEW

Modeling Heterogeneous Embedded Systems with TTool Daniela Genius, - - PowerPoint PPT Presentation

Modeling Heterogeneous Embedded Systems with TTool Daniela Genius, Ludovic Apvrille, Letitia W. Li, Marie-Minerve Lou erat, Fran cois P echeux, Haralampos Stratigopoulos Daniela.Genius@lip6.fr IDM, GDR GPL Context Method Case Study


slide-1
SLIDE 1

Modeling Heterogeneous Embedded Systems with TTool Daniela Genius, Ludovic Apvrille, Letitia

  • W. Li, Marie-Minerve Lou¨

erat, Fran¸ cois Pˆ echeux, Haralampos Stratigopoulos Daniela.Genius@lip6.fr IDM, GDR GPL

slide-2
SLIDE 2

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Design Methodology of an Embedded System

System Partitioning between HW and SW

◮ Functions → execution nodes ◮ Communications between functions → communication

and storage nodes

◮ Commonly ”system-level partitioning” with (very)

abstract models

2/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-3
SLIDE 3

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Design Methodology of an Embedded System

System Partitioning between HW and SW

◮ Functions → execution nodes ◮ Communications between functions → communication

and storage nodes

◮ Commonly ”system-level partitioning” with (very)

abstract models

Software and hardware design

◮ Software and hardware are designed independently ◮ Integration phase

2/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-4
SLIDE 4

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Problem: Late Discovery of Bad Partitioning

Final software code VHDL/Verilog Integration Partitioning Hardware design Software Design

◮ Usually focused on one modeling aspect: difficult to iterate

between partitioning and design

◮ Objective: model-based approach with close interaction

between partitioning and software design

3/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-5
SLIDE 5

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Related Work

◮ Ptolemy II (Ptolemy.org 2014) ◮ METROPOLIS (Balarin et al. 2003) ◮ Sesame and Daedalus (Thompson et al. 2007) ◮ MARTE with generation for Simics (Taha et al. 2010) ◮ MDGen (SODIUS) ◮ B method, Event-B (Abrial 2010) ◮ AADL (Feiler et al. 2012)

4/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-6
SLIDE 6

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Overall Method

Final software code Refinements VHDL/Verilog Software Design and Prototyping (AVATAR) Deployment view ... ... Hardware design Abstractions Abstractions Reconsideration

  • f partitioning

decisions Simulation and Verification : safety, security and performance Mapping view Functional view Architecture view Software Component Hardware model Partitioning with Design Space Exploration techniques (DIPLODOCUS)

5/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-7
SLIDE 7

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Partitioning Method

6/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

Safety (UPPAAL) Safety (Internal Model-checker)

Reachability Safety deadlocks

Safety (Internal Model-checker) Security (Proverif) Performance (internal SystemC-like simulator)

Mapping view Functional view (structure and behavior) Architecture view

slide-8
SLIDE 8

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Design Method

7/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design Deployment view Reconsideration

  • f partitioning

decisions

Safety (Internal Model-checker, UPPAAL) Functional simulation Security (ProVerif) Executable

  • Soft. code

SoCLib Topcell Application code OS (MutekH) Avatar SocLib lib. ldscript

Binary code SocLib simulation Software Components (stucture and behavior)

slide-9
SLIDE 9

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Virtual Prototyping with SoCLib

◮ Open platform for virtual prototyping of multi-processors

System on Chip (MP-SoC)

◮ Started in 2006 as an ANR project with 11 research labs and

6 industrial partners: LIP6, Bull, CEA-LETI, INRIA, STMicro, . . .

◮ Public domain library of SystemC models of hardware

components

◮ Operating systems: NetBSD, MutekH, GIET, ALMOS, ... ◮ Different levels of modeling and simulation

◮ Transaction Level (TLM) ◮ Transaction Level with Time (TLM-T) ◮ Cycle Accurate Bit Accurate (CABA) 8/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-10
SLIDE 10

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Case Study: Rover

Autonomous vehicle for disaster relief efforts (earthquake)

◮ Telemetric sensors to detect obstacles and navigate terrain

autonomously

◮ No obstacles in proximity → decrease sampling rate ◮ Obstacle detected in close proximity → increase sampling rate

◮ Temperature and pressure sensors ◮ Avoid collisions → set time frame → impose maximal latency

9/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-11
SLIDE 11

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Functional View

MainControl

+ state : Natural; + calculateTraj : Natural; + calculateDistance : Natural;

DistanceSensor

+ samplingRate : Natural;

T emperatureSensor

+ samplingRate : Natural; + sensorOn : Boolean;

MotorControl

+ calculateCommand : Natural; startT emp tempData ultrasonicData samplingRate changeRate motorCommand newCommand stopT emp

10/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-12
SLIDE 12

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Mapping View

<<CPU>> CPU0 Rover::MotorControl Rover::T emperatureSensor Rover::DistanceSensor Rover::MainControl Rover::MainControl <<MEMORY>> Memory0 <<BUS>> Bus0

11/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-13
SLIDE 13

Context Method Case Study Latencies Heterogeneous Extension Conclusion

CPU Configuration

12/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-14
SLIDE 14

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Components: Block Diagram

<<block>> MainControl

  • state : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate: int;
  • temp : int;
  • leftVelocity: int;
  • rightVelocity : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;

~ out motorCommand(int leftVelocity, ...) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in ultrasonicData(int distanceLeft, ...)

<<block>> DistanceSensor

  • samplingRate : int;
  • distance : int;

~ out ultrasonicData(...) ~ in changeRate(int samplingRate)

<<block>> T emperatureSensor

  • sensorOn = false : bool;
  • temp : int;

~ in control(bool sensorOn) ~ out tempData(int temp)

<<block>> MotorControl

  • rightVelocity : int;
  • leftVelocity : int;

~ in motorCommand(...)

13/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-15
SLIDE 15

Context Method Case Study Latencies Heterogeneous Extension Conclusion

State Machine Diagrams

<<block>> MainControl
  • state = 0 : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate = 1 : int;
  • rateLow = 10 : int;
  • rateMed = 4 : int;
  • rateHigh = 1 : int;
  • temp : int;
  • leftVelocity = 0 : int;
  • rightVelocity = 0 : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;
  • speedLow = 2 : int;
  • speedNormal = 5 : int;
~ out motorCommand(int leftVelocity, int rightVelocity) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in sensorData(int distanceLeft, int distanceFront, int dista... ~ out changeRate(int samplingRate) <<block>> DistanceSensor
  • samplingRate = 10 : int;
  • distance : int;
  • distanceFront : int;
  • distanceLeft : int;
  • distanceRight : int;
~ out sensorData(int distanceLeft, int di... ~ in changeRate(int samplingRate) <<block>> T emperatureSensor
  • sensorOn = false : bool;
  • temp = 0 : int;
  • samplingRate = 5 : int;
~ in control(bool sensorOn) ~ out tempData(int temp) <<block>> MotorControl
  • rightVelocity = 0 : int;
  • leftVelocity = 0 : int;
~ in motorCommand(int leftCommand, int rightCom...

control(sensorOn) control(sensorOn) setVelocity motorCommand(leftVelocity, rightVelocity) dodgeObstacle sendMotorCommand turnLeft turnRight startController sensorData(distanceLeft, distanceFront, distanceLeft) state0 state2 state1 tempData(temp) measureT emp calculateDistance changeRate changeRate(samplingRate) controlT empSensor [ samplingRate!=newRate] after (10,20) state=2 newRate=rateHigh computeFor (10,20) computeFor (2,5) [ else] [distanceFront<3 ] [ distanceFront>8] computeFor (1,10) after (20,30) computeFor (20,30) [ state==2] state=0 newRate=rateLow leftVelocity=speedNormal rightVelocity=speedNormal state=1 newRate=rateMed leftVelocity=speedLow rightVelocity=speedLow rightVelocity=1 leftVelocity=speedLow leftVelocity=1 rightVelocity=speedLow [ else] [ distanceLeft>distanceRight] [else ] [ state!=2] [ state==2] sensorOn=true [ state<2] sensorOn=false [else ] computeFor (1,5) after (2,10) after (1,5)

14/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-16
SLIDE 16

Context Method Case Study Latencies Heterogeneous Extension Conclusion

State Machine Diagrams

<<block>> MainControl
  • state = 0 : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate = 1 : int;
  • rateLow = 10 : int;
  • rateMed = 4 : int;
  • rateHigh = 1 : int;
  • temp : int;
  • leftVelocity = 0 : int;
  • rightVelocity = 0 : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;
  • speedLow = 2 : int;
  • speedNormal = 5 : int;
~ out motorCommand(int leftVelocity, int rightVelocity) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in sensorData(int distanceLeft, int distanceFront, int dista... ~ out changeRate(int samplingRate) <<block>> DistanceSensor
  • samplingRate = 10 : int;
  • distance : int;
  • distanceFront : int;
  • distanceLeft : int;
  • distanceRight : int;
~ out sensorData(int distanceLeft, int di... ~ in changeRate(int samplingRate) <<block>> T emperatureSensor
  • sensorOn = false : bool;
  • temp = 0 : int;
  • samplingRate = 5 : int;
~ in control(bool sensorOn) ~ out tempData(int temp) <<block>> MotorControl
  • rightVelocity = 0 : int;
  • leftVelocity = 0 : int;
~ in motorCommand(int leftCommand, int rightCom...

distanceLeft = RANDOM[dmin,dmax] distanceFront = RANDOM[dmin, dmax] distanceRight = RANDOM[dmin, dmax] startSensor changeRate(samplingRate) ultrasonicData(distanceLeft, distanceFront, distanceRight) after (t1,t2) after (t1,t2) after (t1,t2) after (samplingRate,samplingRate) computeFor(tmin,tmax)

15/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-17
SLIDE 17

Context Method Case Study Latencies Heterogeneous Extension Conclusion

State Machine Diagrams

<<block>> MainControl
  • state = 0 : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate = 1 : int;
  • rateLow = 10 : int;
  • rateMed = 4 : int;
  • rateHigh = 1 : int;
  • temp : int;
  • leftVelocity = 0 : int;
  • rightVelocity = 0 : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;
  • speedLow = 2 : int;
  • speedNormal = 5 : int;
~ out motorCommand(int leftVelocity, int rightVelocity) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in sensorData(int distanceLeft, int distanceFront, int dista... ~ out changeRate(int samplingRate) <<block>> DistanceSensor
  • samplingRate = 10 : int;
  • distance : int;
  • distanceFront : int;
  • distanceLeft : int;
  • distanceRight : int;
~ out sensorData(int distanceLeft, int di... ~ in changeRate(int samplingRate) <<block>> T emperatureSensor
  • sensorOn = false : bool;
  • temp = 0 : int;
  • samplingRate = 5 : int;
~ in control(bool sensorOn) ~ out tempData(int temp) <<block>> MotorControl
  • rightVelocity = 0 : int;
  • leftVelocity = 0 : int;
~ in motorCommand(int leftCommand, int rightCom...

startMotor motorCommand(leftVelocity, rightVelocity) after (tmin,tmax)

16/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-18
SLIDE 18

Context Method Case Study Latencies Heterogeneous Extension Conclusion

State Machine Diagrams

<<block>> MainControl
  • state = 0 : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate = 1 : int;
  • rateLow = 10 : int;
  • rateMed = 4 : int;
  • rateHigh = 1 : int;
  • temp : int;
  • leftVelocity = 0 : int;
  • rightVelocity = 0 : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;
  • speedLow = 2 : int;
  • speedNormal = 5 : int;
~ out motorCommand(int leftVelocity, int rightVelocity) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in sensorData(int distanceLeft, int distanceFront, int dista... ~ out changeRate(int samplingRate) <<block>> DistanceSensor
  • samplingRate = 10 : int;
  • distance : int;
  • distanceFront : int;
  • distanceLeft : int;
  • distanceRight : int;
~ out sensorData(int distanceLeft, int di... ~ in changeRate(int samplingRate) <<block>> T emperatureSensor
  • sensorOn = false : bool;
  • temp = 0 : int;
  • samplingRate = 5 : int;
~ in control(bool sensorOn) ~ out tempData(int temp) <<block>> MotorControl
  • rightVelocity = 0 : int;
  • leftVelocity = 0 : int;
~ in motorCommand(int leftCommand, int rightCom...

start tempData(temp) control(sensorOn) temp = RANDOM0[minT emp, maxT emp] [ sensorOn] after (samplingRate,samplingRate)

17/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-19
SLIDE 19

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Components: Simulation

18/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-20
SLIDE 20

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Deployment View

<<CPU>> CPU0 Design::MotorControl Design::T emperatureSensor Design::DistanceSensor Design::MainControl <<TTY>> TTY0 <<RAM>> Memory0 MainControl/in ultrasonicData MainControl/out motorCommand MainControl/in tempData <<VGSB>> Bus0

Deployment Diagram

◮ Tasks mapped to model of target system ◮ Generating software elements (tasks, main program) ◮ Hardware elements built from the deployment information

19/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-21
SLIDE 21

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Design View: CPU configuration

20/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-22
SLIDE 22

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SoCLib Virtual Prototype

21/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-23
SLIDE 23

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Capturing Performance Information

◮ Logging probes (“spies”) can be set on interfaces between

interconnect, CPU and memories

◮ SoCLib allows cycle precise logging ◮ Python-based scripts generate curves

22/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-24
SLIDE 24

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Typical Performance Information

Partitioning Level: Global Assumptions

◮ Overhead due to context switching (Cycles per Instruction) ◮ Memory access latency

◮ Data and instruction cache miss

◮ Bus and NoC contention ◮ Buffer overflow/underflow

Software Design Level & Virtual Prototype

Confirm or correct assumptions made on higher level

Partitioning and Software Design Level

◮ Latencies: establish formal relation between levels

23/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-25
SLIDE 25

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Overall Method

Functional Level

Partitioning Software Design

Task1 Task3 Task2

Behavior Model

Operator1 Complexity Operator2 ...

Abstract Hardware Components

Logical Time Latency

Mapping Level

Task3 Task1 Task2 Physical Time

Reachability Graph Execution trace

Min, Max Latency Min, Max, Average Latency Execution Traces

Software Level

Task1' Task2_1 Task2_2

Behavior Model

Operator1' Time Function Operator2' ...

Latency

Code Generation

Reconsideration

  • f Partitioning

Model if significant discrepancies in corresponding latencies

Deployment Level Virtual Prototyping Precise simulation → Precise latencies Execution

  • n Target

Task1' Task2_1 Task2_2

Simulation (no HW)

Formal Verification Simulation

Estimated Latencies

Latency Handling through the Embedded System Design Process

24/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-26
SLIDE 26

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-27
SLIDE 27

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Model

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-28
SLIDE 28

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Operators

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-29
SLIDE 29

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Execution Environment

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-30
SLIDE 30

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Mapping

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-31
SLIDE 31

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Abstraction Levels and Latencies

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Hardware Nodes

25/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-32
SLIDE 32

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Correspondence between Latencies

◮ Relate operators of different abstraction levels ◮ Correspondence relation C(op) between operators of two

abstraction levels u (upper) and l (lower) ∀opMl,tl, noted opl, C(opl) =

  • pu

φ

  • therwise

Latencies can be related when opl,1 and opl,2 of Ml have both a non empty correspondence in Mu

26/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-33
SLIDE 33

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Refinement Relation R

Mu Eu(Mu, Hu, mtu, mcu) Models Execution env.

Upper abstraction level Lower abstraction level

Ml El(Ml, Hl, mtl, mcl)

C R

lEu

u,min/max/mean, opl1, opl2

lEl

l,min/max/mean, opl1, opl2

  • pu1 opu2
  • pl1 opl2

Refinement Relation

27/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-34
SLIDE 34

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Partitioning

Functional Level: Behavior

◮ Control Operators: loops, choices, ... ◮ Communication Operators: channel and events read/write ◮ Complexity operators

Latency = logical time between complexity operators

Mapping Level: Architecture Model

◮ Communication Nodes ◮ Storage Nodes ◮ Execution Nodes

Latency = physical time for latencies defined at funct. level

28/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-35
SLIDE 35

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Design

Model transformations realizing the Refinement relation R

◮ Tasks can be split into subtasks ◮ Complexity operators replaced by sub-behavior ◮ Communications related to split tasks may be added

Significant discrepancies → error in one of the models

◮ Estimation for computation complexities for certain algorithms

may be wrong

◮ Inaccurate architecture modeling : cache miss, CPI, etc

29/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-36
SLIDE 36

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Rover Functional and Software Model

MainControl

+ state : Natural; + calculateTraj : Natural; + calculateDistance : Natural;

DistanceSensor

+ samplingRate : Natural;

T emperatureSensor

+ samplingRate : Natural; + sensorOn : Boolean;

MotorControl

+ calculateCommand : Natural; startT emp tempData ultrasonicData samplingRate changeRate motorCommand newCommand stopT emp

<<block>> MainControl

  • state = 0 : int;
  • sensorOn : bool;
  • newRate : int;
  • samplingRate = 1 : int;
  • rateLow = 10 : int;
  • rateMed = 4 : int;
  • rateHigh = 1 : int;
  • temp : int;
  • leftVelocity = 0 : int;
  • rightVelocity = 0 : int;
  • distanceLeft : int;
  • distanceRight : int;
  • distanceFront : int;
  • speedLow = 2 : int;
  • speedNormal = 5 : int;

~ out motorCommand(int leftVelocity, int rightVelocity) ~ out control(bool sensorOn) ~ in tempData(int temp) ~ in sensorData(int distanceLeft, int distanceFront, int dista... ~ out changeRate(int samplingRate) <<block>> DistanceSensor

  • samplingRate = 10 : int;
  • distance : int;
  • distanceFront : int;
  • distanceLeft : int;
  • distanceRight : int;

~ out sensorData(int distanceLeft, int di... ~ in changeRate(int samplingRate) <<block>> T emperatureSensor

  • sensorOn = false : bool;
  • temp = 0 : int;
  • samplingRate = 5 : int;

~ in control(bool sensorOn) ~ out tempData(int temp) <<block>> MotorControl

  • rightVelocity = 0 : int;
  • leftVelocity = 0 : int;

~ in motorCommand(int leftCommand, int rightCom...

30/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-37
SLIDE 37

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Mapping: Functional and Software Design Level

<<CPU>> CPU0 Rover::MotorControl Rover::T emperatureSensor Rover::DistanceSensor Rover::MainControl Rover::MainControl <<MEMORY>> Memory0 <<BUS>> Bus0

<<CPU>> CPU0 Design::MainControl Design::DistanceSensor Design::T emperatureSensor Design::MotorControl <<RAM>> Memory0 MainControl/in tempData MainControl/out motorCommand MainControl/in ultrasonicData <<VGSB>> Bus0 <<TTY>> TTY0

31/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-38
SLIDE 38

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Latencies and Checkpoints in TTool

Algorithm Complexity

Functional Model

Channel Transit Time Channel Operator Event Operator Algorithm Execution Time Latency Channel Operator Algorithm Time Function Of sub behavior Latency

Mapping Model Software Design Prototyping Model

Partitioning

Software Model

Channel Transit Time

32/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-39
SLIDE 39

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Behaviour Diagrams

evt changeRate() chl samplingRate(1) chl ultrasonicData(1) samplingRate Loop for ever [ ] [ ]

chl ultrasonicData(1) chl ultrasonicData(1) chl ultrasonicData(1) [ state==0] [state==2 ] [state==1 ] evt newCommand() chl motorCommand(1) state 0: obstacles far away state 1: obstacles intermediate distance away state 2: obstacles in close proximity calculateDistance Loop for ever inside loop exit loop chl tempData(1) Depending on the distance to obstacle, calculate motor command and new state evt newCommand() chl motorCommand(1) calculateDistance evt newCommand() chl motorCommand(1) calculateDistance distanceLeft = RANDOM[dmin,dmax] distanceFront = RANDOM[dmin, dmax] distanceRight = RANDOM[dmin, dmax] startSensor changeRate(samplingRate) ultrasonicData(distanceLeft, distanceFront, distanceRight) after (t1,t2) after (t1,t2) after (t1,t2) after (samplingRate,samplingRate) computeFor(tmin,tmax)

motorCommand(leftVelocity, rightVelocity) sendMotorCommand startController ultrasonicData(distanceLeft, distanceFront, distanceLeft) after (tsmin,tsmax) computeFor (tcmin,tcmax) computeFor (t1,t2) calculation of motor command

33/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-40
SLIDE 40

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Latency Checkpoints

evt changeRate() chl samplingRate(1) chl ultrasonicData(1) samplingRate Loop for ever [ ] [ ]

chl ultrasonicData(1) chl ultrasonicData(1) chl ultrasonicData(1) [ state==0] [state==2 ] [state==1 ] evt newCommand() chl motorCommand(1) state 0: obstacles far away state 1: obstacles intermediate distance away state 2: obstacles in close proximity calculateDistance Loop for ever inside loop exit loop chl tempData(1) Depending on the distance to obstacle, calculate motor command and new state evt newCommand() chl motorCommand(1) calculateDistance evt newCommand() chl motorCommand(1) calculateDistance distanceLeft = RANDOM[dmin,dmax] distanceFront = RANDOM[dmin, dmax] distanceRight = RANDOM[dmin, dmax] startSensor changeRate(samplingRate) ultrasonicData(distanceLeft, distanceFront, distanceRight) after (t1,t2) after (t1,t2) after (t1,t2) after (samplingRate,samplingRate) computeFor(tmin,tmax)

motorCommand(leftVelocity, rightVelocity) sendMotorCommand startController ultrasonicData(distanceLeft, distanceFront, distanceLeft) after (tsmin,tsmax) computeFor (tcmin,tcmax) computeFor (t1,t2) calculation of motor command

34/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-41
SLIDE 41

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Latency Annotations

chl ultrasonicData(1) chl ultrasonicData(1) chl ultrasonicData(1) [ state==0] [state==2 ] [state==1 ] evt newCommand() chl motorCommand(1) state 0: obstacles far away state 1: obstacles intermediate distance away state 2: obstacles in close proximity calculateDistance Loop for ever inside loop exit loop chl tempData(1) Depending on the distance to obstacle, calculate motor command and new state evt newCommand() chl motorCommand(1) calculateDistance evt newCommand() chl motorCommand(1) calculateDistance writeChannel:ultrasonicData

52

writeChannel: motorCommand

8

motorCommand(leftVelocity, rightVelocity) sendMotorCommand startController ultrasonicData(distanceLeft, distanceFront, distanceLeft) after (tsmin,tsmax) computeFor (tcmin,tcmax) computeFor (t1,t2) calculation of motor command sendSignal:ultrasonicData 35/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-42
SLIDE 42

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Heterogeneous Extension

Embedded hardware is increasingly heterogeneous

◮ Digital/analog integrated circuits, sensors, actuators ◮ Robotics, automotive, autonomous systems

Heterogeneous Features

◮ Analog/mixed signal (AMS) features ◮ Radio frequency (RF) features

36/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-43
SLIDE 43

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Rover Revisited: Functional Model

MainControl

+ state : Natural; + calculateTraj : Natural; + calculateDistance : Natural;

DistanceSensor

...

T emperatureSensor

+ samplingRate : Natural; + sensorOn : Boolean;

MotorControl

... + interval : Natural; startT emp tempData ultrasonicData samplingRate changeRate motorCommand newCommand stopT emp

⇒ Modeling not realistic ⇒ Requires more adapted representation

37/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-44
SLIDE 44

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Partitioning Level

<<CPU>> CPU0 Rover::MainControl Rover::MainControl Rover::MotorControl Rover::MotorControl <<MEMORY>> Memory0 <<BUS>> Bus0 <<HWA>> DistanceSensor Rover::DistanceSensor Rover::DistanceSensor <<HWA>> T emperatureSensor Rover::T emperatureSensor Rover::T emperatureSensor

Hardware/Software partitioning of the rover using the Virtual Coprocessor mechanism of SoCLib

38/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-45
SLIDE 45

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Software Design Level

<<CPU>> CPU0 Design::MainControl Design::MotorControl <<TTY>> TTY0 <<RAM>> Memory0 MainControl/in tempData MainControl/out motorCommand MainControl/in sensorData <<VGSB>> Bus0 <<HWA>> Sensor1 Design::T emperatureSensor <<HWA>> Sensor0 Design::DistanceSensor

Virtual Prototype with (Hardware) Sensors

39/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-46
SLIDE 46

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Extensions

◮ Recent standard describing an extension of SystemC with

AMS and RF features (2019, 2013 v2.0)

◮ Modeling formalisms:

◮ Discrete Event DE ◮ Timed data Flow TDF ◮ Electrical Linear Networks ELN ◮ Consortium includes Fraunhofer IIS, TU Vienna, EPFL, NXP,

Infineon, LIP6

SocLib components can be reused

◮ Both are based on SystemC ◮ SystemC is a set of C++ class libraries ◮ SoCLib digital components are DE modules and can be

simulated together with TDF modules

40/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-47
SLIDE 47

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Contribution of 2017/2018 LIP6 Project

First steps towards an integrated modeling and simulation tool for verification and virtual prototyping of heterogeneous embedded systems on different abstraction levels and different models of computation (MoC)

◮ Methodology to integrate heterogenity into TTool ◮ SystemC AMS clusters in SysML in TTool panel ◮ Automated handling of synchronization issues between MoC

(L. Andrade 2015, C. BenAoun 2017)

◮ Code generation for heterogeneous simulation

41/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-48
SLIDE 48

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Related Work

Non SystemC based

◮ Ptolemy II (Ptolemy.org 2014) ◮ METROPOLIS (Balarin et al. 2003) ◮ METRO II (Davare et al. 2007)

SystemC based

◮ HetSC (Herrera et al. 2007) ◮ HetMoC (Zhu et al. 2010) ◮ ForSyDe (Niaki et al. 2012)

42/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-49
SLIDE 49

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Extensions

◮ TDF module

◮ time step Tm ◮ processing function

◮ TDF port

◮ time step Tp ◮ rate R ◮ delay D

◮ Consistency of time step assignment and propagation

◮ Tm = Tpin ∗ Rin = Tpout ∗ Rout 43/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-50
SLIDE 50

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Extensions

samplingRate ultrasonicData bitStream Ultrasonic sensor Analog to digital converter sensorIn soclibIn soclibOut sensorOut

SystemC AMS representation of the distance sensor (overview)

44/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-51
SLIDE 51

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Representation

template <i n t NBits> c l a s s a d c o n v e r t e r : p u b l i c s c a t d f : : sca module { p u b l i c : typedef s c d t : : s c i n t <NBits> d a t a t y p e ; s c a t d f : : sca de : : s c a i n <double> s e n s o r I n ; s c a t d f : : sca de : : s c a i n <data type > s o c l i b I n ; s c a t d f : : sca de : : sca out <data type > s o c l i b O u t ; co nver ter <NBits >:: a d c o n v e r t e r ( s c c o r e : : sc module name nm) : s e n s o r I n ( "in" ) , s o c l i b I n ( "soclibIn" ) , s o c l i b O u t ( "soclibOut" ) {} p r o t e c t e d : void s e t a t t r i b u t e s ( ) { s e n s o r I n . s e t r a t e ( 1 ) ; s e n s o r I n . s e t d e l a y ( 0 ) ; s o c l i b I n . s e t r a t e ( 1 ) ; s o c l i b I n . s e t d e l a y ( 0 ) ; s o c l i b O u t . s e t r a t e ( 1 ) ; s o c l i b O u t . s e t d e l a y ( 0 ) ; }

45/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-52
SLIDE 52

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Representation (2)

void p r o c e s s i n g ( ) { d a t a t y p e r e s ; i n t s = s o c l i b I n . read ( ) ; i n t step ; u si n g namespace std ; f o r ( step =0; step < s ; step++){ double i n = s e n s o r I n . read ( ) ; } s c d t : : s c i n t <NBits> r e s = lround (( i n / maxVoltage )∗((1<<( NBits −1)) −1)); s o c l i b O u t . w r i t e ( r e s ) ; } }

46/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-53
SLIDE 53

Context Method Case Study Latencies Heterogeneous Extension Conclusion

SystemC AMS Panel Elements for TTool

◮ SESI M1 project

47/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-54
SLIDE 54

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Conclusion

◮ Model-driven environment for handling performance issues at

different abstraction levels

◮ Backtracing of performance information to higher abstraction

levels

◮ Integration of system-level design space exploration and

prototyping in the same toolkit

◮ Push-button approach to verification and simulation ◮ Outline of a method to integrate analog components

48/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-55
SLIDE 55

Context Method Case Study Latencies Heterogeneous Extension Conclusion

Future Work

◮ Design Space Exploration, with automatically suggested

modifications

◮ More detailed performance profiles (cache misses, processor

workload, buffer fill state etc.)

◮ Library of SystemC-AMS blocks ◮ Software parts running on (digital) general-purpose processors

under a (light) operating system with SystemC-AMS simulation of analog and RF components

49/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design

slide-56
SLIDE 56

Context Method Case Study Latencies Heterogeneous Extension Conclusion

References

TTool: ttool.telecom-paristech.fr SoCLib: www.soclib.fr

Genius, D., Li, L. W., Apvrille, L.: Model-Driven Performance Evaluation and Formal Verification for Multi-level Embedded System Design, Model-Driven Engineering and Software Development, Porto, Portugal (bes paper award, 2017) Genius, D., Li, L. W., Apvrille, L.: Multi-level Latency Evaluation with an MDE Approach, Model-Driven Engineering and Software Development, Funchal, Portugal (2018)

  • D. Genius, M.-M. Lou¨

erat, F. Pˆ echeux, L. Apvrille, H. Stratigopoulous:

  • deling Heterogeneous Embedded Systems with TTool, 5th Workshop on

Design Automation for Understanding Hardware Designs (DUHDe), Dresden, Germany (2018)

50/50 5.4.2018 Paris Sorbonne Universit´ e, Institut Mines-Telecom Model-Driven Embedded System Design