Networked embedded devices design: NS-SystemC timing-accurate synchronization

Fabio Ricciato, Paolo Pellegrino, Maura Turolla, Paolo Gallo Telecom Italia Lab Franco Fummi Massimo Poncino Università di Verona - Dipartimento di I...
Author: Joel Riley
2 downloads 2 Views 1MB Size
Fabio Ricciato, Paolo Pellegrino, Maura Turolla, Paolo Gallo Telecom Italia Lab

Franco Fummi Massimo Poncino Università di Verona - Dipartimento di Informatica

Stefano Martini

Giovanni Perbellini

All rights reserved

Embedded Systems Design Center

Networked embedded devices design: NS-SystemC timing-accurate synchronization

Telecom Italia LAB

System On Chip

All rights reserved

Mission – being a worldwide excellence center for research and realization of innovative ICT products and systems that can be integrated on silicon, merging system and technology know how and creating business opportunities for Telecom Italia • UMTS Terminals and Base Station • ADSL modem e Home Gateway • Network Processor • Intellectual Property libraries(VIPLibrary®) • Virtual Platforms for system simulations and field trails • IC Cards (SIM e Smart cards) • Optical and electro-optical products (i.e. digital wrappers) European SystemC Users Group Meeting

2

Networked Embedded Systems • Embedded Systems with communication capabilities – Environmental Monitoring – Mobile Wireless devices – Network Access Point – Domotic application

• Embedded Systems with on chip network – Complex Protocol on SoC bus

All rights reserved

Network simulation capability

European SystemC Users Group Meeting

System Level Modeling

3

Simulation cores synchronization System Level Modeling

Network Simulator by Berkeley

Time synchronization

Programming Model

All rights reserved

Data Exchange

European SystemC Users Group Meeting

Performance

4

Programming Model

/* m1.h */ SC_MODULE(m1) { sc_outmaster out;

ns_in *port1

ns_in *port1; void proc1(); SC_CTOR(m1) { port1=new ns_in(7); ns_proc(proc1,port1); }

ApplicationUDP

All rights reserved

SocketUDP

}; # ns-socket.ns set udp0 [new Agent/socketUDP 9 “SystemC” 7] $ns attach-agent $node(0) $udp0

European SystemC Users Group Meeting

5

New user objects New objects do not change the behaviour of existing objects •

ports to read data sent by NS2 agents, they are derived by template class sc_in



agents do not call standard sendv method to send data, but call a kernel function that send data to SystemC



agents use the standard recv method to receive data from SystemC

– ns_in



ports to write data to NS2 agents (derived by sc_out) – ns_out



methods that execute if new data are sent by NS2 agents to SystemC ports.

All rights reserved

– ns_proc

European SystemC Users Group Meeting

Communication at the kernel level only 6

Data Exchange Packet Size Packet Type Data time Data Size

Data

Receiver

... Next Event Time

Process Queue Wrapper

NS2 Kernel

Data Queue Manager

Data Queue Manager

All rights reserved

....

Message

European SystemC Users Group Meeting

7

SystemC Kernel

Process Queue Wrapper

Time synchronization • Two communicating processes

write T0

Start phase

through sockets, shared memory, messages... •

read

Symmetric synchronization algorithm

Yes

• The event queues are kept

schedule event

separated

write T kernel1 next event

• Each kernel communicates its next scheduled event All rights reserved

Tkernel2

European SystemC Users Group Meeting

8

T kernel1 < kernel2 T No

write T kernel1

Performance • Messages among kernels are as few as possible • Two types of message: ‘time message’ and ‘data message’. Data message can carries a large amount of data for different receivers to reduce number of messages • Each kernel can inject events into the other’s event queue only if some data have to move across the simulators – When one kernel is running its next event time is lower than the other’s one – Data arriving from the other kernel have been generated earlier than the All rights reserved

next event time of the current kernel

European SystemC Users Group Meeting

9

Intrusion into simulation kernel (SC) •

sc_simcontext – created a new function sc_ns_start that starts the cosimulation – created new methods to run all the processes sensitive to data from NS2 – created methods to register NS2 ports and NS2 processes



sc_module – defined all the macros for the user to use all the new objects (ns_in, ns_out ns_proc)



sc_process, sc_process_int – created the class ns_proc for the management of NS2 processes



ns_port

All rights reserved

– created the new class ns_in to read data sent by NS2 – created the new class ns_out to send data to NS2

European SystemC Users Group Meeting

10

Intrusion into simulation kernel (NS2) •

Scheduler.{c,h} – Modified method Scheduler::run to implement the synchronization algorithm – added method to register objects that need to exchange data with SystemC



New Agent – socketUDP



Generic functions for entry point at different protocols levels – socketLink – socketApp

– …

All rights reserved

No performance degradation European SystemC Users Group Meeting

11