leoeltipo Posted January 22, 2015 Report Posted January 22, 2015 Hello all, I have been working with SystemC some time. I am entering the SystemC-AMS world. I have this system: Processing algorithm (SystemC DE) PWM generation (SystemC DE) LPF (SystemC AMS, ELN) I want to argument the selection. The processing part was already done and is almost digital, that's why DE is used for the modelling. PWM generation is crucial in this application, as errors or quantization of the pulse position would result in distortion after demodulation. Using SystemC DE allows to toggle the signal at exact moments in time, without adding any quantization to the process. Now I want to complete my model with the Low Pass Filter, that actuates as demodulator here. The input should be sc_signal<bool> or sc_signal<double>, to interact with the PWM module. The low pass filter should be model using ELN. However, I do not know how to properly do this because I would need to define the sample time, however, as the LPF is the only AMS block and is a SC_MODULE instantiating the components and nodes, no sampling time is specified. In the other hand, if I define a TDF block with a given sampling period, I will add uncertainty to the PWM signal, as well as aliasing because armonic extent is infinite. I would appreciate any ideas. Please let me know if I have missunderstood some of the concepts of AMS. Regards, Leandro Quote
karsten Posted January 22, 2015 Report Posted January 22, 2015 you have to use SystemC-AMS 2.0. The module should look like this (not tested nor compiled): SCA_TDF_MODULE(de2eln) { sca_tdf::sca_de::sca_in<double> inp; sca_tdf::sca_out<double> outp; //define a Maximum timestep e.g. half of the time constat of the ELN filter sca_core::sca_time max_timestep; void set_attributes() { this->set_timestep(max_timestep); this->does_attribute_changes(); } void processing() { outp = inp.read(); } void change_attributes() { //requests a new calculation of TDF Cluster (with the connected ELN Network) //if an Event occurs at inp or the max_time is over this->request_next_activation(max_timestep,inp->default_event()); } SCA_CTOR(de2eln){} }; This module gets as Input your pwm de Signal and the TDF Output should be connected to the ELN source. best regards Karsten maehne 1 Quote
leoeltipo Posted January 22, 2015 Author Report Posted January 22, 2015 Hi Karsten, Thank you very much for your answer!!!! This line makes the difference: this->request_next_activation(max_timestep,inp->default_event()); As it allows me to maintain the resolution of the PWM module. I read about Dynamic TDF but did not know how to apply it here. Thank you again!!! Kind regards, Leandro Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.