Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the...

23
Wolfgang Pree University of Salzburg, Austria www.SoftwareResearch.net A joint project of W. Pree, G. Stieglbauer and C. Kirsch Model-based Development with Giotto@Simulink Universität Salzburg

Transcript of Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the...

Page 1: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

Wolfgang PreeUniversity of Salzburg, Austriawww.SoftwareResearch.net

A joint project ofW. Pree, G. Stieglbauer and C. Kirsch

Model-based Development withGiotto@Simulink

UniversitätSalzburg

Page 2: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 2Universität

Salzburg

Contents

Giotto@Simulink tool chain

� S/G Translator:model transformation,Giotto code generation

� illustrated by the development of athrottle control system

Page 3: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 3Universität

Salzburg

Giotto-based development process

generated

code

(from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003)

S/G Translator generates a

SL model with Giotto semantics

for simulation

Page 4: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 4Universität

Salzburg

Case study: code generation from a Giotto@Simulinkmodel of a throttle control system

Page 5: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 5Universität

Salzburg

S/G Translator

� model transformation for simulation

� model transformation for functionality codegeneration

� generation of Giotto program

Page 6: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 6Universität

Salzburg

S/G Tranlsator tool

SL model

SL model withGiotto semantics

Giotto program

SL model with driversfor integration with E-machine

Page 7: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 7Universität

Salzburg

Step 1: S/G model for simulation

(from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003)

S/G Translator generates a

SL model with Giotto semantics

for simulation

Step 1

Page 8: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 8Universität

Salzburg

required input for the S/G translator

Plant

GiottoProgram

controls

GiottoTask1..*

SL Block*

modeled using any

SL blocks

Page 9: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 9Universität

Salzburg

Example: two Giotto tasks with differentfrequencies

Page 10: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 10Universität

Salzburg

S/G translator is fully compliant with the current SLsyntax

Page 11: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 11Universität

Salzburg

Step 2a: S/G model for the generation of functionalitycode that seamlessly integrates with the E-machine

(from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003)

S/G Translator:

generates a SL model with

Giotto semantics

for simulation

Step 1

Step 2a:SL model for

generating glue code

Page 12: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 12Universität

Salzburg

S/G Tranlsator tool

SL model

SL model withGiotto semantics

SL model with driversfor integration with E-machine

Page 13: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 13Universität

Salzburg

preparation for linking timing code andfunctionality code (I)

Functionality program(SL → C code)

Timing program(Giotto program)

E codeFunctionality

wrappers

Giottocompiler

E machine

interprets calls

Functionality library

C compiler

call

Page 14: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 14Universität

Salzburg

preparation for linking timing code andfunctionality code (II)

� Giotto program segmenttask GiottoTask1( … )output ( … ) state ( …) {

schedule GiottoTask1();

}

� Functionality wrappervoid task_GiottoTask1() {

GiottoTask1();

}

� Functionality codevoid GiottoTask1(void) {

local_GiottoTask1_output_1=GiottoTask1_input1+GiottoTask_input_2;

}

Page 15: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 15Universität

Salzburg

preparation for linking timing code andfunctionality code (III)

transport and convert values between task ports:

� via global variables (Simulink/RTW)

� via the Giotto driver concept

Giottodrivers

Giottotask

Giottotask

Giotto drivers are called by the E-machine

Page 16: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 16Universität

Salzburg

Step 2b: generation of the Giotto program

(from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003)

S/G Translator:

generates a SL model with

Giotto semantics

for simulation

Step 1

Step 2a:SL model for

generating glue code

Step 2b:Giotto program

Page 17: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 17Universität

Salzburg

S/G Tranlsator tool

SL model

SL model withGiotto semantics

Giotto program

SL model with driversfor integration with E-machine

Page 18: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 18Universität

Salzburg

Step 2c: generation of the functionality program withthe RTW Embedded Coder

(from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003)

S/G Translator:

generates a SL model with

Giotto semantics

for simulation

Step 1

Step 2a:SL model for

generating glue code

Step 2b:Giotto program

Step 2c:C program

Page 19: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 19Universität

Salzburg

throttle control system @ work

Page 20: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 20Universität

Salzburg

how long it took to ...

� upgrade the S/G Translator: 4 p. months� a redesign that streamlines the architecture and

makes the tool fully compliant with SL syntax: 2.5 m� generation of SL model for glue code generation: 1m� reimplementation of the C# version in Java: 0.5 m

� implement the ETC case study: 0.7 p. months

Page 21: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 21Universität

Salzburg

Future plans

Page 22: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 22Universität

Salzburg

Next steps

short term:

� illustrate composition and time safety checks inthe realm of the ETC case study

� integration of Giotto modes into Simulink

mid-term:

� S/G-based prototype implementations of morecomplex control system components

� concepts for control system product families

Page 23: Giotto@SimulinkStep 2b: generation of the Giotto program (from the Giotto paper published in the IEEE Control Systems Magazine, Feb. 2003) S/G Translator: generates a SL model with

© 2003, W. Pree, G. Stieglbauer, C. Kirsch 23Universität

Salzburg

The end

Thank you for your attention!