meta-modelling the systemc standard for component-based...

12
FZI FORSCHUNGSZENTRUM INFORMATIK Meta-Modelling the SystemC Standard for Component-based Embedded System Design Martin Küster 1 , Alexander Viehl 1 , Andreas Burger 1 , Oliver Bringmann 1,2 , Wolfgang Rosenstiel 1,2 1 FZI Forschungszentrum Informatik, 2 University of Tübingen 1 st International Workshop on Metamodelling and Code Generation for Embedded Systems Tampere, Finland, Oct 7, 2012

Upload: others

Post on 28-Aug-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

FZ

I FO

RS

CH

UN

GS

ZE

NT

RU

M

INF

OR

MA

TIK

Meta-Modelling the SystemC Standard for

Component-based Embedded System Design

Martin Küster1, Alexander Viehl1, Andreas Burger1,

Oliver Bringmann1,2, Wolfgang Rosenstiel1,2

1 FZI Forschungszentrum Informatik, 2 University of Tübingen

1st International Workshop on Metamodelling and

Code Generation for Embedded Systems

Tampere, Finland, Oct 7, 2012

Page 2: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

MDA1 focuses on a “full generation“ strategy.

We try to generate only necessary artifacts.

Requirements for a model-driven approach:

Compositional, made for reuse

Separation (but integration) of HW

and SW view

Integration into UML tool chain

But: Use Eclipse-based technology

for M2M (based on EMF)

What we need:

Semantically rich metamodel of

SystemC

Mapping to code

Model-to-model transformations for

connection to UML

Introduction Metamodel Application Related Work / Conclusion

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 2

Arch. Design

• Software

• Hardware

Existing Code

• No models!

SystemC model

• Simulation

• Performance Prediction

Code Generation

Reverse-Engineering

• Refactoring

1) MDA = OMG Model-Driven Architecture

Page 3: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Advantages of introducing a SystemC DSL instead of

UML-based profile mechanism

Efficiency and clear semantics:

Composition vs. reference

Polymorphism (inheritance of modules, overwriting of methods, etc.)

MDA: „generate all“ simply does not scale

Legacy code (e.g. existing libraries, non-SystemC, non-UML)

Instead: focus on relevant artifacts:

Architecture: Components and interactions

SC_Modules, SC_Interfaces, SC_Ports, etc.

Behavior: Processes, Methods, Threads, Events

Deployment: Mapping of software and hardware components

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 3

Introduction Metamodel Application Related Work / Conclusion

Page 4: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

SystemC Metamodel is language-independent and

models all core elements of the language.

New Classes for

encapsulation of

common features

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 4

Introduction Metamodel Application Related Work / Conclusion

Page 5: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

The SystemC-Assembly-Metamodel separates

type- from instance level and introduces Bindings.

Three binding

types for different

use cases

Module instances

are called

„AssemblyContexts“

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 5

Introduction Metamodel Application Related Work / Conclusion

Page 6: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Code generation: The EMF-based model can be

used for code generation with QVT-O

„Code is a model, too.“

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 6

class B : Bar {

int i1;

...

}

SystemC layer

Code layer

(model)

Code as text SC_MODULE (foo) {

sc_event e1;

...

}

Editing

Eclipse CDT

Abstract Syntax Tree

Refactoring

core

:SC_Module

:SC_Event

:SC_Interface

:SC_Fifo_in_out

Editor support

Legacy Code

QVT-R M2M

QVT-O M2M

Introduction Metamodel Application Related Work / Conclusion

Page 7: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Code generation strategies for module hierarchies

and binding concepts (excerpt, 1/2)

SystemC MM element Code Generation Example Comment

(Inner)Assembly /

Module Hierarchy

SC_MODULE(Top) {

Sub* sub;

SC_CTOR(Top) {

sub = new Sub("Sub_Module");

// other initialization

}

};

Indirect Sub-Module Header-

Only Implementation

ExportBinding

(binding from export

to port)

exp_A(port_B);

There must be a local

channel behind exp_A (not

depicted here)

PortBinding port_A(cX);

port_B(cY);

Direct connection or

connection via channel

(named connectivity)

Within SC_CTOR of parent

module.

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 7

Introduction Metamodel Application Related Work / Conclusion

Page 8: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Code generation strategies for module hierarchies

and binding concepts (excerpt, 2/2)

SystemC MM element Code Generation Example Comment

DelegationBinding (1) SC_CTOR(Top), A(“a”) {

port_A(port_top);

// other initialization

}

Order of connection is

important!

DelegationBinding (2)

SC_CTOR(Top), B(“b”) {

exp_top(B.expB);

// other initialization

}

Same as above, but different

order of bindings

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 8

Introduction Metamodel Application Related Work / Conclusion

Page 9: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

«allocate» «allocate» «allocate»

Example shows separation of SW and HW design

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 9

Generation of SystemC

Wrappers see:

[Zimmermann2012]

Introduction Metamodel Application Related Work / Conclusion

Page 10: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Related and Future Work

UML-based approaches (profiles)

Riccobene et. al (2005): “A SoC Design Methodology Involving a UML

2.0 Profile for SystemC” or

Riccobene et al. (2005): “A UML 2.0 Profile for SystemC: Toward High

Level SoC Design”

Mueller et al., "The SATURN Approach to SysML-Based HW/SW

Codesign“, pp.506-511, 2010 IEEE Annual Symposium on VLSI, 2010

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 10

Introduction Metamodel Application Related Work / Conclusion

Page 11: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Summary and Conclusion

Main contribution of this paper

SystemC metamodel including explicit notion of instances / assembly

Separation of software and hardware architecture with allocation

modeled in UML

Instructions for code generation (written in QVT-O)

Future Work:

Integration of legacy code is now based on simple source file / path

inclusion more comprehensive support needed

Refactoring of SystemC models: What happens to generated and hand-

written code?

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 11

Introduction Metamodel Application Related Work / Conclusion

Page 12: Meta-Modelling the SystemC Standard for Component-based ...adt.cs.upb.de/mecoes/MeCoES2012/07.pdf · From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers,

Backup: Options for module hierarchy

From: Black, Donovan: „SystemC: From the Ground Up“, Kluwer Academic Publishers, 2004, page 147

Tampere, Oct 07, 2012 Andreas Burger: Meta-Modelling the SystemC Standard for

Component-based Embedded System Design 12