network simulation with systemc · • network simulation requires that setup can change at...

22
Network simulation with SystemC SystemC Davide Quaglia

Upload: others

Post on 30-Apr-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Network simulation with

SystemCSystemC

Davide Quaglia

Page 2: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Outline

• Motivation

• Architecture

2

• Experimental results

• Advantages of the proposed framework

Page 3: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Motivation

NetworkNetworked

Embedded

Systems

3

• Design of Networked Embedded Systems (smartphones,

routers, wireless sensor networks)

• Network (protocols and channels) may be a design-space

dimension (e.g., Networked Control Systems)

• System and Network may be reciprocally affected during design

• Pure network simulators are not well integrated with EDA tools

Systems

Page 4: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

SystemC Network Simulation Library

(SCNSL)

Let’s change the scale !

4

Networkinterface

I/Ointerface

ASIC

CPU Memory

bus

SystemC model of a System on

Chip

Packet-based

Network

SystemC model of several

networked embedded systems AND the network among them

Page 5: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Problems to be solved

• Packet-based simulation in order to be fast

• Packets are not Signals (RTL) or Payloads (TLM)– Variable size

– Variable formats (during simulation !)

5

– Variable formats (during simulation !)

• Network simulation requires that setup can change at

simulation time (binding is not enough)

– Traffic activation/de-activation

– Node mobility

– Channel failure

• Efficient way to handle collisions on the channel

Page 6: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain

6

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

library

Page 7: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain

Traditional description

of behavior and

communication

between intra-node

components

7

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

library

Page 8: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain

Packets

transmission

& reception,

carrier sense

8

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

library

Page 9: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain

- Topology definition

- Traffic sources

- Scenario changes

at simulation time

9

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

library

Page 10: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain - Binding of network

components

- Mapping of

10

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

library

- Mapping of

network events onto

SystemC events

Page 11: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Architecture

Description of the

Network Scenario

Description of

the Embedded Systems

User

domain

11

SystemC primitives: module, process,

port, event, simulation engine

SystemC Network Simulation Library:

packet and channel model

C++

Legacy

libraries

New

libraryBasic data

structures

Page 12: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

SCNSL components

12

Page 13: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Simulation flow

Network

scenario

sc_main() in

Task

implementation

MyTask.cc

Header files

of the

simulator and

SystemC

*.hh

Simulator

library

SystemC

library

13

main.cc MyTask.hh *.hh

Compilation process

Linking

Executable

Page 14: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Simulation flow (2)

Input

data

14

Command line

parameters

Executable Log

fileStatistics

Page 15: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Provided objects

• Task– Interfaces for TLM and RTL custom tasks– Traffic sources (CBR, bursty traffic, etc.)

• Node• Node

• Protocol

• Channel– Simple link– Full duplex link– Shared– Delayed shared

15

To model wired or abstract

channels

To model wireless channels

Page 16: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Experimental setup

• Wireless sensor network– 1 master requesting temperature to N-1 slaves

– IEEE 802.15.4 MAC (the base for ZigBee)

– Peer un-slotted communication with ack

16

– Peer un-slotted communication with ack

• Description of the node at different abstraction levels– TLM (Approximate Timing) � 633 lines of code

– RTL � 688 lines– sc_main()� 172 lines

• Comparison with a well-known network simulator (NS-2)

Page 17: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Experimental results

CPU time for the

simulation as a

function of the

number of wireless

sensor nodes.

17

sensor nodes.

Uniix “time”

command

(system+user)

Page 18: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Experimental results

Simulation of all nodes

at TLM is x100 faster

than NS-2

18

than NS-2

Page 19: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Experimental results

Simulation of all nodes

at RTL is slower than

NS-2 as expected

19

Page 20: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Experimental results

Simulation of one

node at RTL and the

others at TLM is as

20

others at TLM is as

fast as NS-2 with the

advantage of a higher

system accuracy

Fine-tuning between

speed and accuracy

Page 21: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Advantages• Direct use of SystemC models in network simulation � re-

usability

• Single simulation tool (no need of System/Network co-

simulation) � fast

21

simulation) � fast

• Direct support of tools from EDA ecosystem

– SystemC TLM 2.0

– SystemC Verification Library

– SystemC Analog & Mixed Signals (AMS)

– Debugging tools

– Analysis tools

– Synthesis

Page 22: Network simulation with SystemC · • Network simulation requires that setup can change at simulation time (binding is not enough) – Traffic activation/de-activation – Node mobility

Advantages (cont.)

• Fruitful integration of Network design &

simulation in the traditional design flow

• Open-source (LGPL) project on SourceForge

– Repository with versioning

22

– Repository with versioning

– Bug tracking facility

– Wiki

– Mailing lists