Sie sind auf Seite 1von 39

2 SystemC AMS Extensions

Case Studies:
1) A WSN for the determination of the
epicentre of a planar seismic perturbation
2) PCR-CE Lab-on-Chip
Laboratoire dInformatique de Paris 6, Universit Pierre et Marie Curie, Paris France

marie-minerve.louerat@lip6.fr
hassan.aboushady@lip6.fr
francois.pecheux@lip6.fr

SC-AMS Day - Grenoble 2010-09-07

1/39

Presentation overview

WSN Application description


Analog IPs
Digital IPs and embedded software
LOC Application overview
Conclusion

SC-AMS Day - Grenoble 2010-09-07

2/39

Application Contents & use case


Graduate course centered around SystemC,
AMS extensions and SoCLib
Executable specification of a representative
heterogeneous system

Physical environment
Sensor
RF transceiver
Digital

Architecture exploration
Refine AMS models
Update software
SC-AMS Day - Grenoble 2010-09-07

3/39

Application description (1)

Source
http://www.geology110.com/seismic.html

SC-AMS Day - Grenoble 2010-09-07

4/39

Application description (2)


20

30

40

50

C2(15,85)
80
70
60
50
40

epicentre(xe,ye) V

30
20
C0(15,15)
SC-AMS Day - Grenoble 2010-09-07

60

70

80
C3(85,85)
Assumption: All WSN nodes
are synchronous (local Real-time
counters are constantly equal)
Each WSN node
monitors
seismic perturbations.
Once a node detects the
presence of the seismic
perturbation, it records the value
of its counter and sends it to
other nodes along with its Id (0
to 3).
Each WSN node manages a
table of Ids and counter
timestamps.
When this table contains four
entries, computation of the
C1(85,15) epicentre can begin
5/39

Application Description (3)


20

30

40

50

60

70

80
C3(85,85)

C2(15,85)
80

1156372

1265372

70

C0= 565372
dist(1)

dist(2)

60

C1= 751372
C2=1156372

50

C3=1265372

40
epicentre(xe,ye)
30
20

565372
C0(15,15)

SC-AMS Day - Grenoble 2010-09-07

V
751372
dist(0)

C1(85,15)
6/39

Application Description (4)


20

30

40

50

60

70

C2(15,85)
80

80
C3(85,85)

1156372

1265372

70

C0= 565372
dist(1)

dist(2)

60

dist(0)= V*(751372 565372)


dist(1)= V*(1156372 565372)

50

dist(2)= V*(1265372 565372)

40
epicentre(xe,ye)
30
20

565372
C0(15,15)

SC-AMS Day - Grenoble 2010-09-07

V
751372
dist(0)

C1(85,15)
7/39

Application Description (5)


(1)

(2)

Keep only the two former equations (1) and (2)

SC-AMS Day - Grenoble 2010-09-07

8/39

Application Description (6)

System of non-linear equations that can be solved by an


iterative algorithm executed by the embedded processor
of each WSN node

SC-AMS Day - Grenoble 2010-09-07

9/39

Demonstration

SC-AMS Day - Grenoble 2010-09-07

10/39

Heterogeneous modeling
2.4 GHz communication channel
MIPS
Cache

RX TX

MIPS

Serdes

Cache

Timer

RX TX
Timer

Serdes

Interconnect

Interconnect

Node 0

RAM
SOFT

Seismic
sensor

Node 3

RAM
SOFT

Seismic
sensor

Seismic perturbation generator


Digital, BCA, SocLib
Analog, SystemC-AMS TDF, RF
Analog, SystemC-AMS TDF, Physics,
Embedded software

SC-AMS Day - Grenoble 2010-09-07

11/39

Implemented as 2 TDF Clusters


RF cluster
2.4 GHz communication channel
MIPS
Cache

Timer

RX TX

MIPS

Serdes

Cache

RX TX
Timer

Serdes

Interconnect

Interconnect

Node 0

RAM

Seismic
sensor

Node 3

RAM

Seismic
sensor

Seismic perturbation generator


Seismic Perturbation cluster

SC-AMS Day - Grenoble 2010-09-07

12/39

Cluster 1: Seismic perturbation

Node 0

Seismic
sensor

Node 1

Seismic
sensor

Node 2

Seismic
sensor

Node 3

Seismic
sensor

Seismic perturbation generator

SC-AMS Day - Grenoble 2010-09-07

13/39

Cluster 2 : RF network
TX
TX_EN

TX

TX

TX
TX_EN

SERDES

SERDES
RX
RX_EN

TX
TX_EN

RX

TX

RX

TX

RX
RX_EN

TX
TX_EN

SERDES

SERDES
RX
RX_EN

SC-AMS Day - Grenoble 2010-09-07

RX

RX

RX
RX_EN

14/39

Analog IPs: Seismic perturbation


Node 0

Seismic
sensor

Node 1

Seismic
sensor

Node 2

Seismic
sensor

Node 3

Seismic
sensor

Seismic perturbation generator

Wave equation

SC-AMS Day - Grenoble 2010-09-07

Discretized wave equation

15/39

TDF wavegen
SCA_TDF_MODULE (wavegen)
TDF module name
{
sca_tdf::sca_out < double > out_sensor[NB_SENSORS];
double wave[WAVE_SIZE][WAVE_SIZE][3];
double cd;

TDF module ports

Wave matrix for t+1 [2],t [1] and t-1 [0]


int
int
int
int
int
...

pos_x_sensor[NB_SENSORS];
pos_y_sensor[NB_SENSORS];
pos_x_epicenter;
pos_y_epicenter;
iter;

SC-AMS Day - Grenoble 2010-09-07

node locations on grid


epicentre location

16/39

void processing () {
int x,y; int c;

Wavegen processing() function

for (x=1;x<WAVE_SIZE-1;x++) {
for (y=1;y<WAVE_SIZE-1;y++) {
wave[x][y][2]=2.0*wave[x][y][1]-wave[x][y][0]
+cd*cd*(wave[x+1][y][1] + wave[x-1][y][1] +
wave[x][y+1][1] + wave[x][y-1][1] - 4.0*wave[x][y][1]);
}
}
...
for (c=0 ; c < NB_SENSORS; c++)
out_sensor[c].write(wave[pos_x_sensor[c]][pos_y_sensor[c]][2]);

for (x=0;x<WAVE_SIZE;x++){
for (y=0;y<WAVE_SIZE;y++){
wave[x][y][0]=wave[x][y][1];
wave[x][y][1]=wave[x][y][2];
}
}
}
SC-AMS Day - Grenoble 2010-09-07

17/39

void init (int _x_epi, int _y_epi, sc_core::sc_time sample_time) {


int x,y;
int k; int radius=10;
double DX=M_PI/radius; double DY=M_PI/radius;
pos_x_epicenter= _x_epi % WAVE_SIZE;
pos_y_epicenter= _y_epi % WAVE_SIZE;
for (x=0;x<WAVE_SIZE;x++) {
for (y=0;y<WAVE_SIZE;y++) {
for (k=0;k<3;k++) {
wave[x][y][k]=0.0;
} } }
cd=50e3*sample_time.to_seconds()/WAVE_SPEED;
for (x=0;x<radius;x++) {
for (y=0;y<radius;y++) {
wave[pos_x_epicenter-radius/2+x]
[pos_y_epicenter-radius/2+y][0]=
WAVE_AMPL*sin(x*DX)*sin(y*DY); } }
...
out_sensor[0].set_timestep(sample_time);
}

SC-AMS Day - Grenoble 2010-09-07

Port timestep
assignment

18/39

Seismic sensor: Sigma-Delta ADC


Seismic
Amplitude
+
from wavegen

1
S

1
S

decimator
DAC

A
S

SC-AMS Day - Grenoble 2010-09-07

SCA_TDF_MODULE (integrator)
{
sca_tdf::sca_in < double >in;
sca_tdf::sca_out < double >out;
double f;
sca_vector < double > num, den, state;
sca_tdf::sca_ltf_nd ltf1;
void set_coeffs(double A){
den(0) = 0.0; den(1) = 1.0; den(0) = A;
}
void processing(){
out.write(
ltf1(num, den, state, in.read()));
}
SCA_CTOR (integrator) {}};
19/39

SNR, SystemC-AMS Vs Matlab

SC-AMS Day - Grenoble 2010-09-07

20/39

RF transceiver: transmitter & receiver


cos(2fc t )

cos(2fc t )

1
T

Filt.
dac

demux

add

PA

LNA

mux
Filt.

sin( 2fc t )

sin( 2fc t )
TX_EN

1
T

RX_EN

2.4 GHz QPSK modulation

SC-AMS Day - Grenoble 2010-09-07

21/39

Baseband Equivalent
X(t) = DC + I1cos(t) + I2cos(2t) + I3cos(3t) +
Q1sin(t) + Q2sin(2t) + Q2sin(3t)

DC I1
0
Q1

Q2

I2
2
Q3

SC-AMS Day - Grenoble 2010-09-07

I3
3

xBB(t) =

DC
I1
I2
I3
Q1
Q2
Q3

22/39

Baseband Equivalent Implementation


class BB{
double DC,I1,I2,I3,
Q1,Q2,Q3;
...
BB operator+(BB x)const{
BB z(this->DC+x.DC,
this->I1+x.I1,
this->I2+x.I2,
this->I3+x.I3,
this->Q1+x.Q1,
this->Q2+x.Q2,
this->Q3+x.Q3);
return z;
}
...
};

SC-AMS Day - Grenoble 2010-09-07

SCA_TDF_MODULE (adder)
{
sca_tdf::sca_out < BB > inI;
sca_tdf::sca_in < BB > inQ;
sca_tdf::sca_out < BB > out;
...
void processing () {
out.write (inI.read()+
inQ.read());
}...

23/39

TDF dac
cos(2fc t )

SCA_TDF_MODULE

(dac)

{
sca_tdf::sca_de::sca_in < bool > in;
sca_tdf::sca_out <double > out;
double
double
double
double
double

gain_power;
gain_voltage;
rin;
rout;
*rload;

dac

demux

add

PA

sin( 2fc t )

void processing () {
gain_voltage=sqrt(gain_power/(*rload*rin))*(rout+*rload);
out.write(gain_voltage*((double(in.read())*2)-1));
}

TX_EN

...
SCA_CTOR (dac) {}
};
SC-AMS Day - Grenoble 2010-09-07

24/39

TDF Module Power amplifier pa


SCA_TDF_MODULE (pa)
{
sca_tdf::sca_de::sca_in < bool > tx_en;
sca_tdf::sca_in < BB > in;
cos(2fc t )
sca_tdf::sca_out < BB > out;
BB nullbb; // null Base band value
void processing () {
dac
if (tx_en.read()==true)
out.write (gain*in.read());
else
out.write (nullbb);
}
SCA_CTOR (pa) :
nullbb() {}
};
SC-AMS Day - Grenoble 2010-09-07

demux

add

PA

sin( 2fc t )
TX_EN

25/39

Communication channel
TX
TX_EN

TX

TX
(BB)

TX
TX_EN
(BB)

SERDES

SERDES
RX
RX_EN

RX
(BB)

RX
RX
(BB) RX_EN

TX
TX_EN

SERDES
RX
RX_EN

SC-AMS Day - Grenoble 2010-09-07

TX

TX
(BB)
RX
(BB)

TX
TX_EN
(BB)
AWGN

SERDES
RX
RX
(BB) RX_EN

26/39

BER SystemC-AMS Vs Theory

SC-AMS Day - Grenoble 2010-09-07

27/39

Constellation plots

SC-AMS Day - Grenoble 2010-09-07

28/39

Simulation results
RF Simulation
(2.4 GHz)

SC-AMS
Transient
simulation
(computation
time)

SC-AMS
BB equivalent
Transient
simulation
(computation
time)

1000 bits
transmission

63.0s

0.036s

DC offset

19.9s

0.018s

Frequency offset

24.9s

0.022s

Phase mismatch

44.4s

0.031s

SC-AMS Day - Grenoble 2010-09-07

x 1750

29/39

Digital IPs, software, and interrupts


2.4 GHz communication channel
MIPS
Cache

Timer

RX TX

MIPS

SerdesIdent

Cache

RX TX
Timer

SerdesIdent

Interconnect

Interconnect

Node 0

RAM

Seismic
sensor

Embedded
Application
Binary in RAM

Counter
Node 3

RAM

Seismic
sensor

Counter

Seismic perturbation generator


Embedded
Application
Binary in RAM

All digital components, tools, methdology info available at www.soclib.fr, an


opensource library of interoperable SystemC models for the design of
multiprocessor architectures (ISS, Caches, interconnect, Memory,
Peripherals) running multithreaded embedded applications.
SC-AMS Day - Grenoble 2010-09-07

30/39

Three interrupts
TDMA management

Seismic Sensor, when perturbation is detected


Serdes, when a message is received from RF receiver.
Timer, when a period of 100000 cycles is achieved. Used for TDMA policy

100000

200000

300000

TDMA Slot 0

TDMA Slot 1

TDMA Slot 2

TDMA Slot 3

Node 0
can send

Node 1
can send

Node 2
can send

Node 3
can send

TX_EN0
RX_EN1
RX_EN2
RX_EN3

RX_EN0
TX_EN1
RX_EN2
RX_EN3

RX_EN0
RX_EN1
TX_EN2
RX_EN3

RX_EN0
RX_EN1
RX_EN2
TX_EN3

SC-AMS Day - Grenoble 2010-09-07

400000
TDMA Slot 0

31/39

Embedded software example


int main(int argc, char**argv)
{
uint32_t data;
init();
printf("Sensor %d is alive and monitoring ... \n", id);
while (1){
if (tdma_trigger==1) { tdma_trigger=0;
if(!flag_compute){
if (tdma_slot==id) {
if(has_value) {
soclib_io_set(base(UART),UART_CTRL, 2); //rf emission
data=(id<<28) | (sensor_cpt & 0x0fffffff );
soclib_io_set(base(UART),UART_DATA,data);
fill_table(id,sensor_cpt);
has_value=0;
}
}
else
soclib_io_set(base(UART),UART_CTRL,5); } //rf reception
else {
irq_disable(); compute_epicentre(); } } }
return 0;
}
SC-AMS Day - Grenoble 2010-09-07

Appl. main function

32/39

PCR-CE Lab on chip

Multithreaded
Embedded
Application
Smith-Waterman

SC-AMS Day - Grenoble 2010-09-07

DNA
Database

System Analysis

SC-AMS Day - Grenoble 2010-09-07

Amplification by PCR

SC-AMS Day - Grenoble 2010-09-07

Capillary electrophoresis

SC-AMS Day - Grenoble 2010-09-07

SC-AMS Day - Grenoble 2010-09-07

Output of detection stage:

SC-AMS Day - Grenoble 2010-09-07

Conclusion
Success story !
Complex applications captured with SystemC AMS extensions
and models
Sigma-Delta converter in AMS-TDF
RF baseband transmission chain AMS-TDF
Accurate results, conform plots !

Results compliant to state-of-the-art


Fast !
Living project, architecture exploration, power-aware
modeling

SC-AMS Day - Grenoble 2010-09-07

39/39

Das könnte Ihnen auch gefallen