Modeling and Refining Heterogeneous Systems With SystemC
Download
Report
Transcript Modeling and Refining Heterogeneous Systems With SystemC
Modeling and Refining Heterogeneous
Systems With SystemC-AMS:
Application to WSN
M. Vasilevski
F. Pecheux, N. Beilleau, H. Aboushady
K. Einwich*
Laboratory LIP6 University Pierre and Marie Curie, Paris 6, France
*Fraunhofer IIS/EAS, Dresden, Germany
March 2008
1.Issues
2.SystemC-AMS Language
a. Models of Computation
b. SDF Behavioral Description
c. SDF Multi-rates
3.RF and AMS Modeling
a. AMS Models
b. RF Models
4.Wireless Sensor Network Node
5.Conclusion
1. Issues : Mixed Systems Design
Matlab
SystemC
Matlab
Verilog-A
VHDL-AMS
Verilog
VHDL
Verilog-A
VHDL-AMS
Spice
A/D Converter
M. Vasilevski
Spice-RF
Microcontroller
University Paris 6
Fraunhofer IIS/EAS
RF Transceiver
3
1.Issues
2.SystemC-AMS Language
a. Models of Computation
b. SDF Behavioral Description
c. SDF Multi-rates
3.RF and AMS Modeling
a. AMS Models
b. RF Models
4.Wireless Sensor Network Node
5.Conclusion
2.a Models of Computation
SystemC-AMS
Synchronous
Data Flow
SDF
Modeling
Formalism
SystemC
Linear
Network
LN
Modeling
Formalism
LN
Solver
Models of
computation :
Other
Modeling
Formalism
Other
Solver
DE, MoCs
(CP,FSM,
etc…)
Synchronisation Layer
•Conservative
Linear network
•Synchronous
Data Flow
SystemC Simulation Kernel
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
5
2.b SDF Behavioral Description
SCA_SDF_MODULE(B)
B
Input
Behaviour
Output
SCA_SDF_IN<double>
SCA_SDF_OUT<double>
void sig_proc( )
A
a 0 a1S ... anSn
H(S)
b0 b1S ... bmSm
C
Output f(input)
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
6
2.c SDF Multi-Rates
Cluster
Simulation sample time 62.5s
Tin
Tout
A
1
2
1
B
16 kHz
8 Hz
Simulation
rates
M. Vasilevski
3
2
48 kHz
C
1
24 kHz
out _ sam ple_ freq in _ sam ple_ freq
out _ sam ple_ rate in _ sam ple_ rate
University Paris 6
Fraunhofer IIS/EAS
7
1.Issues
2.SystemC-AMS Language
a. Models of Computation
b. SDF Behavioral Description
c. SDF Multi-rates
3.RF and AMS Modeling
a. AMS Models
b. RF Models
4.Wireless Sensor Network Node
5.Conclusion
3.a AMS models : Integrator
In/Out
ports
Other
Attributes
A
S
Initialisation
method
Signal
processing
method
M. Vasilevski
SCA_SDF_MODULE (integrator)
{
sca_sdf_in < double >in;
sca_sdf_out < double >out;
double f;
sca_vector < double >NUM,DEN,S;
sca_ltf_nd ltf1;
void set_coeffs(double A){
DEN (0) = 0.0;
DEN (1) = 1.0;
NUM (0) = A;
}
void sig_proc(){
out.write(
ltf1(NUM, DEN, S, in.read()));
}
SCA_CTOR (integrator) {}};
University Paris 6
Fraunhofer IIS/EAS
9
3.a AMS models : Decimator
SCA_SDF_MODULE (decimator)
{
sca_sdf_in < double >in;
sca_sdf_out < double >out;
Decimator
double old_input;
1 z
1
M. Vasilevski
2
1 z
1
void init(){
in.set_rate(2);
out.set_rate(1);
old_input=0;
}
1
2void sig_proc(){
2
double input=in.read(0)/2;
out.write(old_input+input);
old_input=input;
}
SCA_CTOR (decimator){}
};
1 z
University Paris 6
Fraunhofer IIS/EAS
10
1.Issues
2.SystemC-AMS Language
a. Models of Computation
b. SDF Behavioral Description
c. SDF Multi-rates
3.RF and AMS Modeling
a. AMS Models
b. RF Models
4.Wireless Sensor Network Node
5.Conclusion
3.b RF models
Power gain IIP3
NF
Rin
Rout
Na
input
output
a1x+a3x³
Rin
Rout
a1 = f(Power gain, Rin, Rout)
a3 = f(a1, IIP3)
Na = f(NF)
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
12
3.b RF models : IIP3 and Noise Figure
Test
FFT BW = 120kHz
Power Gain = 10 dB
Input amplitude = -16.02 dBm
IIP3 = 10 dBm
NF = 30 dB
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
13
3.b RF models : Baseband Equivalent
X(t) = DC + I1cos(wt) + I2cos(2wt) + I3cos(3wt) +
Q1cos(wt) + Q2cos(2wt) + Q2cos(3wt)
DC I1
I2
I3
w
2w
3w
0
Q1
M. Vasilevski
Q2
DC
I1
I2
xBB(t) = I3
Q1
Q2
Q3
Q3
University Paris 6
Fraunhofer IIS/EAS
14
3.b RF models : Baseband Equivalent
Implementation
class BB{
A cos(wt ) B cos(wt ) ( A B) cos(wt )
double DC,I1,I2,I3,
A sin(wt ) B sin(wt ) ( A B) sin(wt )
Q1,Q2,Q3;
...
BB operator+(BB x)const{ SCA_SDF_MODULE (adder)
{
BB z(this->DC+x.DC,
sca_sdf_in < BB
double
>inI;
>inI;
this->I1+x.I1,
sca_sdf_in < BB
double
>inQ;
>inQ;
this->I2+x.I2,
sca_sdf_out < BB
double
>out;
>out;
this->I3+x.I3,
...
this->Q1+x.Q1,
void sig_proc () {
this->Q2+x.Q2,
out.write (inI.read()+
this->Q3+x.Q3);
inQ.read());
return z;
}...
}
...
University Paris 6
15
};M. Vasilevski
Fraunhofer IIS/EAS
1.Issues
2.SystemC-AMS Language
a. Models of Computation
b. SDF Behavioral Description
c. SDF Multi-rates
3.RF and AMS Modeling
a. AMS Models
b. RF Models
4.Wireless Sensor Network Node
5.Conclusion
4. Wireless Sensor Network Node
• Wireless sensor network
for environmental and
physical monitoring:
o Temperature, vibration,
pressure, motion, polluants
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
17
4. Wireless Sensor Network Node
SystemC-AMS
SystemC
A/D Converter
ATMEGA128
8 bits
Microcontroller
modulator 2nd order
Application
OSR=64
Binary File
10
bits
decimator
RZ feedback
8.53 MHz
M. Vasilevski
2.4 MHz
University Paris 6
Fraunhofer IIS/EAS
RF Transceiver
QPSK
fc=2.4GHz
2.4 GHz
18
4. Wireless Sensor Network Node
RF : QPSK
2.4 GHz
cos(2fc t)
cos(2fc t)
1
T
filter
encoder
mux
LNA
demux
filter
sin(2fc t)
ADC :
2nd order
+
-
1
S
sin(2fc t)
+
-
1
S
OSR 64
M. Vasilevski
1
T
decimator
DAC
University Paris 6
Fraunhofer IIS/EAS
19
4. Wireless Sensor Network Node :
Results
Noisy channel DC offset
RF
Simulation
(2.4 GHz)
SC-AMS
classical
simulation
SC-AMS BB
eq. RF
simulation
1000 bits
63.0s
transmission
0.036s
DC offset
19.9s
0.018s
Frequency
offset
24.9s
0.022s
Phase
mismatch
44.4s
0.031s
Frequency
offset
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
Phase
mismatch
20
4. Wireless Sensor Network Node :
Results
Settings Simulation Matlab SystemC-AMS
ADC alone
OSR=64 16*1024 pts 1.6 s
0.9 s
10 bits
8.53MHz
RF alone
2.4 GHz 10e3 bits
150.7 s classic BB
10e7 pts RF
63.0 s 0.036s
2-nodes
Same
10e3 bits
181.7 s
transmission settings
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
21
Conclusion
Advantages to use SystemC-AMS:
• Digital and Analog-Mixed Signal systems
simulation
Interface with SystemC
• Simulations very fast
C++ based
• Polymorphism
Easy to refine components with C++ inheritance ability
Generic declaration of components with C++ templates
• Easy software programmer contribution
Example of a free FFT library used for IIP3 test.
M. Vasilevski
University Paris 6
Fraunhofer IIS/EAS
22