Using ModelSim, Matlab/Simulink and NS for Simulation of...

Preview:

Citation preview

IIS

Fraunhofer InstitutIntegrierte Schaltungen

U. Hatnik, S. Altmann

Fraunhofer Gesellschaft EAS/IIS

SDA 20048. September 2004

Using ModelSim, Matlab/Simulink and NS forSimulation of Distributed Systems

2

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Outline

• Motivation

• Requirements

• Object Oriented Simulation

• Objects and Object Structure

• Open Model Interface

• Object Communication Versions

• Conclusions

3

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Motivation

Analysis of communication systems through abstract network simulation

• Analysis of workload, bottlenecks,

reserves and configurations

• Guarantee of the Quality of Service

• Effects of distributed services

• Development of new protocols

• Error simulation

Server

Network(WAN, LAN)

Clients

4

IIS

Fraunhofer InstitutIntegrierte Schaltungen

z−1 +

0 k

z−1 +

1k kk 0 1

+ +

Motivation

Detailed simulation of single components of a distributed system

• Development of new soft- and hardware

e.g. network adapter, protocol accelerator,

signal processing algorithms

• Exploration of existing components

e.g. with hardware debugger

• Simplification of the design process

• Validation and test

• Fault diagnostics

5

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Motivation

Network Simulator NS-2:

• Based on abstract models, without real reference data

• Provided with extensive libraries (e.g. protocols, transmission lines)

• Not well suited for circuit simulation (absence of libraries, languages, tools)

VHDL/Verilog Simulator ModelSim:

• Modelling with low abstraction level possible

• Provided with extensive circuit libraries

• Not well suited to simulate communication networks

6

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Motivation

Matlab/Simulink

• Models mainly based on differential and difference equations

• More and more libraries and toolboxes available (e. g. for signal processing)

• Not well suited to simulate circuits or for protocol development

Real system components, e. g. User-Mode Linux:

• If no model available

• If real stimuli data necessary

• For validation and test (comparison of real components and models)

7

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Requirements for a Suitable Simulation Environment

• Combination of models with different abstraction levels

• Less restrictions in terms of modelling languages

• Good extensibility (models, simulation algorithms)

• High flexibility at low complexity of the framework

• Integration of soft- und hardware components

• Distributed simulation

=> Coupling of Simulators

8

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Obj. 2.2Obj. 2.1

Obj. 3.2Obj. 3.1

Obj. 1

Interface

Sim. Algorithm

Object

other Objects

Model

The Object Oriented Approach

• Partitioning of the system

• Object is equivalent to subsystem

• Object = Model + Simulator + Interface

• Object can use further objects

• Object encapsules implementation details

=> Simple replacement of objects

=> Object implementation can be changed easily

=> Integration of real soft- and hardware possible

9

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Top Level View

Network Model

Server

Network(WAN, LAN)

Clients

S SS

C CC

Server Models

Client Models

10

IIS

Fraunhofer InstitutIntegrierte Schaltungen

The Network Simulator NS Version 2

• LAN, WAN, mobile- and satellit networks

• Simulator- and model implementation with oTcl and C++

• Library and examples (protocols, network types etc.)

• Dynamic scenarios

• Animation tool NAM

• Free software, source code available

11

IIS

Fraunhofer InstitutIntegrierte Schaltungen

The Network Simulator NS Version 2

NetworkSimulatorNS-2

C C C

S S S

Top Level System Model

12

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Top Level Object

Interface

NetworkSimulator

Top Level System Model

NS-2

C C C

S S S

13

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Detailed Simulation of a single Component

I1I2

I3

I4I5

O1

O2

Network Model

S SS

C CC

14

IIS

Fraunhofer InstitutIntegrierte Schaltungen

ModelSim Object

E1E2

E3

E4E5

A1

A2

VHDL / VerilogSimulatorModelSim

hardwarecomponent

15

IIS

Fraunhofer InstitutIntegrierte Schaltungen

ModelSim Object

Interface

VHDL / VerilogSimulatorModelSim

E1E2

E3

E4E5

A1

A2

hardwarecomponent

16

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Matlab/Simulink Object

Matlab/Simulink

signal processing

17

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Matlab/Simulink Object

Matlab/Simulink

signal processing

Interface

18

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Applications

User Mode LinuxSystem 1

Virtual Network Module

Applications

User Mode LinuxSystem 2

Linux System

User Mode Linux Object

19

IIS

Fraunhofer InstitutIntegrierte Schaltungen

User Mode Linux Object

Interface

Applications

User Mode LinuxSystem 1

Virtual Network Module

Applications

User Mode LinuxSystem 2

Linux System

20

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object StructureInterface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

21

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Structure

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

22

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Structure

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

System

Applications

User Mode LinuxSystems

Software

23

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Structure

Interface

E1E2

E3

E4E5

A1

A2ModelSim

Interface

Matlab/Simulink Signal Processing

Hardware

Algorithm

Component

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

System

Applications

User Mode LinuxSystems

Software

24

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Structure

Interface

E1E2

E3

E4E5

A1

A2ModelSim

Interface

Matlab/Simulink Signal Processing

Hardware

Algorithm

Component

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

System

Applications

User Mode LinuxSystems

Software

Interface

System Hardware FPGA

25

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Structure

Interface

E1E2

E3

E4E5

A1

A2ModelSim

Interface

Matlab/Simulink Signal Processing

Hardware

Algorithm

Component

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Interface

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

Interface

System

Applications

User Mode LinuxSystems

Software

Interface

System Hardware FPGA

26

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Open Model Interface (OMI)

• IEEE standard

• Object oriented approach

• Open and independent interface

• Dynamic simulation control

• Intellectual property (IP) protection

• Visibility of intern signals

• Licence and version management

• Flexible model creation

• Model query functions

Properties:

27

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Basic Structure of the Open Model Interface

Model Manager

OMILibrary

Model 1

Model 2

Instance 1 Instance 2 Instance 3

Application

28

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Basic Structure of the Open Model Interface

Model Manager

OMILibrary

Model 1

Model 2

Instance 1 Instance 2 Instance 3

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

29

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Basic Structure of the Open Model Interface

Model Manager

OMI

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

System

Applications

User Mode LinuxSystems

SoftwareMatlab/Simulink Signal Processing

Algorithm

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

Library

Model 1

Model 2

30

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Basic Structure of the Open Model Interface

Model Manager

OMI

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

System

Applications

User Mode LinuxSystems

SoftwareMatlab/Simulink Signal Processing

Algorithm

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

31

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Basic Structure of the Open Model Interface

Model Manager

OMI

TCP/IP-Sockets

E1E2

E3

E4E5

A1

A2ModelSim HardwareComponent

System

Applications

User Mode LinuxSystems

SoftwareMatlab/Simulink Signal Processing

Algorithm

Interface

NetworkSimulatorNS-2

Top Level System Model

C C C

S S S

(PVM, CORBA, HLA)

32

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Object Communication Versions

• TCP/IP-Sockets(high effort, dependent on platform)

• Parallel Virtual Machine (PVM)(low effort, independent of platform)

• High Level Architecture (HLA)(developed especially for simulator coupling, mechanism for synchronisation)

• Common Object Request Broker Architecture (CORBA)(transparent coupling of distributed objects, client server architectur)

33

IIS

Fraunhofer InstitutIntegrierte Schaltungen

Conclusions

• Simulation of distributed systems via simulator coupling

=> Combination of suitable simulators (abstraction level,

modelling language, available libraries)

• OOS approach (autonomous objects, optimale adaption on requirements,

integration of real soft- and hardware components possible)

• OMI (interface standard for object coupling)

• Object communication via TCP/IP-Sockets

=> distributed simulation is easily possible

• Further coupling methods possible (PVM, CORBA, HLA)

• Very flexible and user comfortable simulation environment

Recommended