Jump to content

kaustubh90

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Sir,how will I generate .vcd file from above code for my model.I have written sc_create_vcd_trace_file() for my code but getting an access violation error at the output.I there there might be somewhere NULL pointer assigned.So, just want to know where it is going wrong.Below is my code for sc_trace int sc_main(int argc, char *argv[]) { sca_tdf::sca_in<double>rf, osc; sc_core::sc_out<sc_int<8>>if_d; sc_trace_file *wf = sc_create_vcd_trace_file("wave"); sc_trace(wf,rf,"rf"); sc_trace(wf,osc,"osc"); sc_trace(wf,if_d,"if_d"); sc_start(1.0,SC_MS); sc_start(); getchar(); sc_close_vcd_trace_file(wf); return 0; }
  2. Sir,I'm getting error inside SCA_CTOR(front_end) that "adc" and "lpf" are undefined identifier even after declaring on the top. SCA_CTOR(front_end) { adc = new ad_converter("adc"); adc->in(rf); adc->out(if_d); lpf = new lp_filter_ltf("lpf"); lpf-> in(if_d); lpf->out(if_lpf); } please,help me out to declare it giving some syntax for it.
  3. Sir, but how to declare an identifier prior to be used. And how come I need to rearrange the blocks to work is synchronization/flow. Please, tell me the correct sequence to be used as I'm new to systemC. I tried to use sc_main function at the bottom of my file but still problem not resolved.
  4. Sir, as you had said to instantiate two modules and bind between them via signal sca_tdf::sca_signal<double>.I'm still getting the error that "Undeclared identifier".Below is my complete code for adc and lpf module.Find where I'm facing problem exactly. #include<systemc-ams.h> #include<systemc.h> int sc_main(int argc, char *argv[]) { //Instantiate the modules lp_filter_ltf lp_filter_ltf("lpf"); ad_converter ad_converter("adc"); //Signals sca_tdf::sca_in<double> rf; sc_core::sc_out<sc_int<8> > if_lpf; sca_tdf::sca_signal<double> if_d; sc_start(1.0,SC_MS); getchar(); return 0; } const double PI=3.1415; SC_MODULE(front_end) { sca_tdf::sca_in<double> rf; sc_core::sc_out<sc_int<8> > if_lpf; sca_tdf::sca_signal<double> if_d; SCA_CTOR(front_end) { adc = new ad_converter("adc"); adc->in(rf); adc->out(if_d); lpf = new lp_filter_ltf("lpf"); lpf-> in(if_d); lpf->out(if_lpf); } }; SCA_TDF_MODULE(ad_converter) // Very simple AD converter { sca_tdf::sca_in<double> in_tdf; // TDF port sca_tdf::sc_out<sc_dt::sc_int<12> > out_de; // converter port to DE domain void processing() { out_de.write( static_cast<sc_dt::sc_int<12> >(in_tdf.read() ) ); } SCA_CTOR(ad_converter) {} }; SCA_TDF_MODULE(lp_filter_ltf) { sca_tdf::sca_in<double> in; // input sca_tdf::sca_out<double> out; // output sca_tdf::sc_in<bool> ctrl; // gain ctrl sca_tdf::sca_ltf_nd ltf; // LTF object sca_util::sca_vector<double> num, den; void initialize() { num(0) = 1.0; den(0) = 1.0; den(1) = 1.0/(2.0*PI*1.0e4);} void processing() { double tf = ltf(num, den, in.read()); if (ctrl.read()) out.write(2.0*tf); else out.write(1.0*tf); } SCA_CTOR(lp_filter_ltf) {} }; The error that compiler is throwing out is mentioned below : error C2065: 'lp_filter_ltf' : undeclared identifier. error C2065: 'ad_converter' : undeclared identifier
  5. I Have built adc module using tdf model using systemc-ams. But on debugging I can't get any output results.please do check the code below and give some suggestions. #include<systemc-ams.h> #include<systemc.h> int main(int argc, char *argv[]) { sc_start(); getchar(); return 0; } SCA_TDF_MODULE(ad_converter) // Very simple AD converter { sca_tdf::sca_in<double> in_tdf; // TDF port sca_tdf::sc_out<sc_dt::sc_int<12> > out_de; // converter port to DE domain void processing() { out_de.write( static_cast<sc_dt::sc_int<12> >(in_tdf.read() ) ); } SCA_CTOR(ad_converter){} };
×