Modeling Heterogeneous Systems Using System CAMS A Case

  • Slides: 23
Download presentation
Modeling Heterogeneous Systems Using System. C-AMS, A Case Study: A Wireless Sensor Network Node

Modeling Heterogeneous Systems Using System. C-AMS, A Case Study: A Wireless Sensor Network Node {Michel. Vasilevski, François. Pecheux, Hassan. Aboushady, Laurent. Delamarre}@lip 6. fr Laboratoire d’Informatique de Paris 6, 4, place Jussieu 75252 PARIS Cedex 05

Presentation overview n n System. C-AMS, Models of Computation System. C-AMS description of the

Presentation overview n n System. C-AMS, Models of Computation System. C-AMS description of the WSN Results Ongoing research

System. C-AMS n n Introduced by Christoph Grimm (TU Vienna), Alain Vachoux (EPFL), Karsten

System. C-AMS n n Introduced by Christoph Grimm (TU Vienna), Alain Vachoux (EPFL), Karsten Einwich (Fraunhofer Institute Gesellschaft, Dresden) First prototype released by Karsten Einwich, available at www. systemc-ams. org, release candidate RC 2 OSCI AMS Working Group, managed by Martin Barnasconi (NXP). Lots of companies and academic partners Currently writing the LRM

2 Models of Computation implemented n n Conservative Mo. C n Dedicated to linear

2 Models of Computation implemented n n Conservative Mo. C n Dedicated to linear electrical networks, Kirchoff current law n If we limit application field to linear dynamic and non linear static, fast equation solver can be used Non-conservative Mo. C, Multi-rate Synchronous Dataflow

SDF Cluster Module SDF output port Module SDF input port SYSTEMC-AMS CLUSTER A B

SDF Cluster Module SDF output port Module SDF input port SYSTEMC-AMS CLUSTER A B out in C

Module behavior: sig_proc() function sca_sdf_in<double> input; sca_sdf_out<double> output; void sig_proc() {. . . output.

Module behavior: sig_proc() function sca_sdf_in<double> input; sca_sdf_out<double> output; void sig_proc() {. . . output. write( Behavior. Function(input. read(), …)) … }

Single rate dataflow n n n Modules static scheduling computed during system elaboration A,

Single rate dataflow n n n Modules static scheduling computed during system elaboration A, B, and C are scheduled in that order when cluster is triggered Cluster sample period set with set_T(), propagated to all modules out. set_T(sc_time t) CLUSTER A 1 out 1 B 1 1 C

Handling multirate dataflow n set_rate() can be used on module ports to modify input

Handling multirate dataflow n set_rate() can be used on module ports to modify input (consuming) and output (producing) rates according to equation: out. set_T(ta) in. set_rate(5) 5 calls to sig_proc() A A 1 1 call to sig_proc() B 5 B 1 1 in ta 1 call to sig_proc() C tb C

Decimator, interpolator Decimator A 1 5 B 1 1 C in tb ta Interpolator

Decimator, interpolator Decimator A 1 5 B 1 1 C in tb ta Interpolator A 1 1 B 5 in in. read(i) out. write(val, j) ta tb

The modeled WSN

The modeled WSN

The sensor #ifndef WAVE_H #define WAVE_H SC_MODULE (wave) { sca_elec_port w 1; sca_elec_ref gnd;

The sensor #ifndef WAVE_H #define WAVE_H SC_MODULE (wave) { sca_elec_port w 1; sca_elec_ref gnd; sca_isin sca_r *i_sin_1; *i_r_1; void init(double a, double f){ i_r_1 ->value = a*1000; i_sin_1 ->freq = f; } SC_MODULE (interface_v 2 sdf) { sca_elec_port in; sca_sdf_out<double> out; sca_v 2 sdf *i_v 2 sdf_1; SC_CTOR (interface_v 2 sdf) { i_v 2 sdf_1 = new sca_v 2 sdf("i_v 2 sdf_1"); i_v 2 sdf_1 ->p(in); // pos i_v 2 sdf_1 ->sdf_voltage(out); // i_v 2 sdf_1 ->scale=1. 0; // scaling factor } }; SC_CTOR (wave) { i_sin_1=new sca_isin("i_sin_1"); i_sin_1 ->p(w 1); // pos i_sin_1 ->n(gnd); // neg i_sin_1 ->ampl=0. 001; // magnitude in A i_r_1=new sca_r("r 1"); i_r_1 ->p(w 1); i_r_1 ->n(gnd); } }; #endif

2 nd order Sigma-Delta converter

2 nd order Sigma-Delta converter

2 nd order Sigma-Delta Integrator #ifndef INTEGRATOR_SD_H #define INTEGRATOR_SD_H SCA_SDF_MODULE (integrator_sd) { sca_sdf_in <

2 nd order Sigma-Delta Integrator #ifndef INTEGRATOR_SD_H #define INTEGRATOR_SD_H SCA_SDF_MODULE (integrator_sd) { sca_sdf_in < double >in 1; sca_sdf_in < double >in 2; sca_sdf_out < double >out; double fs, ai, ki; sca_vector < double >NUM, DEN, S; sca_ltf_nd ltf 1; void init DEN (0) DEN (1) NUM (0) ai=a; fs=f; ki=k; } (double a, double f, double k) { = 0. 0; = 1. 0/3. 0; void sig_proc () { out. write (ltf 1(NUM, DEN, S, fs * (ai * in 1. read () - ki * in 2. read ()))); } SCA_CTOR (integrator_sd) {} }; #endif

2 nd order Sigma-Delta « System. C-AMS » decimator #ifndef SAMPLER_SD_H #define SAMPLER_SD_H SCA_SDF_MODULE

2 nd order Sigma-Delta « System. C-AMS » decimator #ifndef SAMPLER_SD_H #define SAMPLER_SD_H SCA_SDF_MODULE (sampler_sd) { sca_sdf_in < double >in; sca_sdf_out < double >out; double input; void init (int r) { in. set_rate(r); } void sig_proc () { out. write(in. read(0)); } SCA_CTOR (sampler_sd) {} }; #endif System. C-AMS Decimator 85. 3 MHz to 8. 53 MHz

ATMEL Atmega 128 BCA Instruction Set Simulator main: ldi R 16, 0 x 01

ATMEL Atmega 128 BCA Instruction Set Simulator main: ldi R 16, 0 x 01 out DDRA, R 16 ; port. A 0 output ldi R 16, 0 x 00 out DDRB, R 16 ; port. B[7: 0] input loop: in R 16, PINB ; read ADC out PORTA, R 16 ; shift Bit 0 lsr r 16 out PORTA, R 16 ; shift Bit 1 lsr r 16 out PORTA, R 16 ; . . . lsr r 16 out PORTA, R 16 lsr r 16 out PORTA, R 16 rjmp loop ; and loop HEX File : 10000 C 9446000 C 9463000 C 94630001 : 10000 C 9463000 C 946300 D 4 : 100020000 C 9463000 C 946300 C 4 : 100030000 C 9463000 C 946300 B 4 : 100040000 C 9463000 C 946300 A 4 : 100050000 C 9463000 C 94630094 : 100060000 C 9463000 C 94630084 : 100070000 C 9463000 C 94630074 : 100080000 C 9463000 C 94630011241 FBE 55 : 10009000 CFEFD 0 E 1 DEBFCDBF 11 E 0 A 0 E 0 B 1 E 0 ECEEEC : 1000 A 000 F 0 E 00 BBF 02 C 007900 D 92 A 030 B 10756 : 1000 B 000 D 9 F 711 E 0 A 0 E 0 B 1 E 001 C 01 D 92 A 030 B 10776 : 1000 C 000 E 1 F 70 C 9465000 C 940000 CFEFD 0 E 1 DEBFA 7 : 1000 D 000 CDBF 8 FEF 80933 A 00109237008 FEF 80935 F : 0 C 00 E 0003 B 008091360080933 B 00 F 8 CF 7 D : 00000001 FF

RF Transceiver: Transmitter

RF Transceiver: Transmitter

SCA_SDF_MODULE (mixer) { sca_sdf_in < double >in; sca_sdf_out < double >out; RF Transceiver: Transmitter

SCA_SDF_MODULE (mixer) { sca_sdf_in < double >in; sca_sdf_out < double >out; RF Transceiver: Transmitter double ampl; bool func; double wc; double Ts; double dc_offset; double phase_mismatch; double gain_mismatch; double pulsation_offset; … void sig_proc () { double t = in. get_time(). to_seconds()+Ts; // get_time() returns previous time switch(func){ case COS: out. write((in. read()*cos((wc+pulsation_offset)*t+ phase_mismatch/2)*ampl+dc_offset)*(1+(gain_mismatch/2))); break; case SIN: out. write((in. read()*sin((wc+pulsation_offset)*tphase_mismatch/2)*ampl+dc_offset)*(1 -(gain_mismatch/2))); break; } } void init(bool f, sc_time tc, sc_time tb, sc_time ts, double dc_o, double g_m, double ph_m, double f_o){ … } SCA_CTOR (mixer) {} };

RF Transceiver: Receiver

RF Transceiver: Receiver

Simulation results

Simulation results

Accuracy System. C-AMS vs Matlab

Accuracy System. C-AMS vs Matlab

Bit Error Rate (BER)

Bit Error Rate (BER)

Taking non-idealities into account

Taking non-idealities into account

Ongoing research n n Non-linearities, LNA, Noise, CP 1, IIP 3 Baseband-equivalent

Ongoing research n n Non-linearities, LNA, Noise, CP 1, IIP 3 Baseband-equivalent