modeling wireless sensor network nodes using systemc-ams
TRANSCRIPT
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Modeling Wireless Sensor Network Nodes
Using SystemC-AMS
Michel Vasilevski, Hassan Aboushady,Francois Pecheux, Laurent de [email protected]
Laboratory LIP6
4, place Jussieu
75252 PARIS Cedex 05
December 2007
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Introduction
SystemC-AMS introduction
Synchronous DataFlowConservative model
Wireless sensor network node : Architecture and implementation
Analog-to-Digital ConverterArchitecture
Implementation
MicrocontrollerQPSK RF Transceiver
Transmitter architecture
Receiver architecture
RF Validation
Conclusion
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Introduction
Introduction
Wireless sensor networkfor environmental andphysical monitoring:
Temperature, vibration, pressure,motion, poluants
Analog-digital mixed
systems description
needed
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
SystemC-AMS introduction
SystemC-AMS introduction
LNModelingFormalism
LNSolver
OtherModelingFormalism
OtherSolver
ModelingSDF
Formalism
DE MoCs
(CP, FSM,etc...)
Synchronisation Layer
SystemC Simulation Kernel
Models of computation(MoC)
Model : SynchronousData Flow (SDF)
Model : Conservativelinear network
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
SystemC-AMS introduction
Synchronous DataFlow
Synchronous DataFlow : multi-rate synchronisation
port sample time = 1/16e3
= 62.5µs
2 1 3 2B
out sample freq
out sample rate= in sample freq
in sample rate
1 1
8 kHz 16 kHz 24 kHz48 kHz
port rates
A C
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
SystemC-AMS introduction
Synchronous DataFlow
Synchronous DataFlow : language elements
SCA_SDF_MODULE (interpolator)
sca_sdf_in <double> in; // input port
sca_sdf_out <double> out; // output port
...
SCA_CTOR(interpolator)...
void init()
in.set_T(62.5,SC_US); // simulation sample time setting
// freq = 16 kHz
in.set_rate(1); // 1 sample consumed
out.set_rate(3); // 3 samples produced
...
void sig_proc()
double input = in.read();
for (int i=0;i<3;i++) out.write(input,i);
;
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
SystemC-AMS introduction
Conservative model
Conservative model
sca r
sca c
sca l
sca vconst / sca vsin
sca iconst / sca isin
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
SystemC-AMS introduction
Conservative model
Conservative model : language elements
1 SC_MODULE (wave )
2
3 sca_elec_port w1;
4 sca_elec_ref gnd;
5
6 sca_isin *i_sin_1;
7 sca_r *i_r_1 ;
8
9 void init (double a, double f)
10 i_r_1 ->value = a*1000;
11 i_sin_1 ->freq = f;
12
13 SC_CTOR (wave )
14 i_sin_1=new sca_isin (" i_sin_1 ");
15 i_sin_1 ->p(w1);
16 i_sin_1 ->n(gnd);
17 i_sin_1 ->ampl =0.001;
18
19 i_r_1 =new sca_r ("r1");
20 i_r_1 ->p(w1);
21 i_r_1 ->n(gnd );
22
23 ;
R = xkΩ
u(t) =
i(t) =sin(2πft)mA
xsin(2πft)V
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
Wireless sensor network node : Architecture and
implementation
SystemC
SystemC-AMSSDF modelConservative model
SystemC-AMS
2.4 GHz2.4 MHz8.53 MHz — 133 kHz3.65 kHz
Binary FileDecimator
modulatorΣ∆ RF Transceiver
8 bits microcontrollerATMEGA128
Application
A/D Conversion
Sensor
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
Analog-to-Digital Converter
Analog-to-Digital Converter
1 bit
int1 int2
1a
A A
a2
Ts
X(s) Y(z)
DAC
U(z)
Ts
H (s)
T
x[n] y[n]2 2 2(1+ z−1)k (1+ z−1)k (1+ z−1)k
Modulator Σ∆:
resolution 10bits
2nd order
OSR=64
Return-to-Zerofeedback
Decimator:
FIR2 filter
3rd order(k=3)
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
Analog-to-Digital Converter
Implementation : SDF model of the Σ∆ integrator
1 SCA_SDF_MODULE (integrator_sd )
2
3 sca_sdf_in < double >in;
4 sca_sdf_out < double >out;
5
6 double fs, ai;
7 sca_vector < double >NUM , DEN , S;
8 sca_ltf_nd ltf1 ;
9
10 void init (double a, double f)
11 DEN (0) = 0.0;
12 DEN (1) = 1.0;
13 NUM (0) = 1.0/3.0;
14 ai=a;
15 fs=f;
16
17 void sig_proc ()
18 out.write (ltf1 (NUM ,
19 DEN ,
20 S,
21 fs * ai * in.read ()
22 )
23 );
24
25 SCA_CTOR (integrator_sd )
26 ;
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
Analog-to-Digital Converter
Validation : Σ∆ simulation
SNR variation repecting to input amplitude
Power spectrum of output signals
−60 −50 −40 −30 −20 −10 010
20
30
40
50
60
70
Amplitude (dB)
SN
R (d
B)
RZ : matlabRZ : SystemC−AMS
SN
R(d
B)
Matlab
SystemC-AMS
Input amplitude (dB)
100
101
102
103
104
−140
−120
−100
−80
−60
−40
−20
0
100
101
102
103
104
−150
−100
−50
0
Normalized Frequency, f/(fs/64)
Po
we
r S
pe
ctra
l De
nsi
ty (
dB
)
MatlabSystemC−AMS simulation
MatlabSystemC−AMS simulation
Modulator output
Decimator output
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
Microcontroller
Microcontroller
ATMEGA128 2.4 MHz
CABA : Cycle Accurate, Bit Accurate
Binary FileBinary File
ATMEGA128
Sensor
RF Transceiver
Sensor
ApplicationApplication
ATMEGA1288 bits microcontroller RF Transceiver
A/D Conversion A/D Conversion
8 bits microcontroller
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
QPSK RF Transmitter
QPSK : quadrature phase shift keying
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
−√
Eb
+√
Eb
Demultiplexer
φ2(t) =√
2T
sin(2πfct)
φ1(t) =√
2T
cos(2πfct)
Binary
Data
−√
Eb,√
Eb,√
Eb...Encoder
011011...
antenna
sQ
sI
0
1
−√
Eb
+√
Eb +√
Eb
−√
Eb
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
QPSK RF Receiver
0
1
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
1
0
0
1
φ1(t) =√
2T
cos(2πfct)
φ2(t) =√
2T
sin(2πfct)
BinaryData
011011 . . .
DecisionDevice
Multiplexer
1T
1T
DecisionDevice
threshold = 0
threshold = 0
antenna Filter
Filter
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
QPSK RF Receiver
0
1
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0 100 200 300 400 500 600−1.5
−1
−0.5
0
0.5
1
1.5
0 100 200 300 400 500 600−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0
1
1
−1.5 −1 −0.5 0 0.5 1 1.5−1.5
−1
−0.5
0
0.5
1
1.5Constellation de la transmission idéale
φ1(t) =√
2T
cos(2πfct)
φ2(t) =√
2T
sin(2πfct)
1T
threshold = 0
antenna
1T
DeviceDecision
Filter
Filter
Constellation
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
RF Validation : Simulation including effects of
defaults
sin(2π(fc +∆f )t)
cos(2π(fc +∆f )t)
sin(2πfct −Φ/2)
cos(2πfct +Φ/2)
Offset
Offsetsin(2πfct)
cos(2πfct)
sin(2πfct)
cos(2πfct)
AWGN
DC Offset
Phase mismatchFrequency offset
Noisy channel
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
RF Validation : BER variation respecting to SNR
0 1 2 3 4 5 6 7
10−3
10−2
10−1
SNR (dB)
BE
R
TheorySystemC−AMSTheory
SystemC-AMS
SNR (dB)
BER
BER =nb bits incorrect
nb bits sent
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Wireless sensor network node : Architecture and implementation
QPSK RF Transceiver
Simulation results
Settings Simulation Matlab SystemC-AMS
OSR=64 1 msADC alone 8 bits output 16*1024 pts 1.605s 0.934s
416.67 µs
RF alone 2.4 GHz 103 bits 2m30.746s 54.360s107 pts RF
2-mote SameWSN settings 416.67 µs – 3m1.654s
Modeling Wireless Sensor Network Nodes Using SystemC-AMS
Conclusion
Conclusion
SystemC
SystemC-AMSSDF modelConservative model
SystemC-AMS
2.4 GHz2.4 MHz8.53 MHz — 133 kHz3.65 kHz
Binary FileDecimator
modulatorΣ∆ RF Transceiver
8 bits microcontrollerATMEGA128
Application
A/D Conversion
Sensor
Ongoing research :
Refinements : IIP3, CP1, Noise Figure, I/O Impedances
Baseband equivalent modeling