Search the Community
Showing results for tags 'hierarchical design'.
-
Hello Experts, presently I am designing a simple A2D converter in SystemC-AMS. While compiling complier returns with some errors. I would be very thankful to you, if you could comment on the errors messages. // A2D.h #include <systemc-ams> #include <systemc> #include <stdio.h> using namespace std; SCA_TDF_MODULE (a2d_nbit) { //port declaration sca_tdf::sca_in<double> a_in; // analog input pin sca_tdf::sca_de::sca_in<sc_dt::sc_logic> start; //start signal sca_tdf::sca_de::sca_in<sc_dt::sc_logic> clk; //clock signal sca_tdf::sca_de::sca_out<sc_dt::sc_logic> eoc; //end of conversion pin sca_tdf::sca_de::sca_out< sc_dt::sc_lv<8> > d_out; // digital output signal a2d_nbit(sc_core::sc_module_name nm, double Vmax_ = 5.0, double delay_ = 10.0e-6, int bit_rng = 8): a_in("a_in"), start("start"),clk("clk"), eoc("eoc"), d_out("d_out"), Vmax(Vmax_), delay(delay_), bit_range(bit_rng){} void set_attribute() { set_timestep(10.0, sc_core::SC_US); eoc.set_delay(0); } void initialize() { //eoc.initialize(sc_dt::SC_LOGIC_0); } void processing(); private: double Vmax; // ADC maximum range double delay; // ADC conversion time int bit_range; //vector length of d_temp and d_out }; //A2D.cpp has got only processing function defined. //A2D_top_level.cpp #include<systemc-ams.h> #include<systemc.h> #include<A2D.h> #include<vtg_src.h> using namespace std; using namespace sc_core; SC_MODULE (A2D_top_level) { a2d_nbit a2d; vtg_src input_vtg; sc_clock clk1("clk1", 100, SC_US,0.5, true); void start_logic(){ while(true) { start.write(sc_dt::SC_LOGIC_0); wait(2, sc_core::SC_MS); start.write(sc_dt::SC_LOGIC_1); wait(2, sc_core::SC_MS); start.write(sc_dt::SC_LOGIC_0); sc_core::sc_stop(); } } A2D_top_level(sc_core::sc_module_name nm): in("in"), out("out"), a2d("a2d"), input_vtg("input_vtg"),clk1("clk1"), start("start"), clk("clk"), eoc("eoc") { input_vtg.out(in); clk(clk1.signal()); a2d.a_in(in); a2d.start(start); a2d.clk(clk); a2d.eoc(eoc); // a2d.d_out(out); SC_THREAD(start_logic); } private: sca_tdf::sca_signal <double> in; sc_core::sc_signal<sc_dt::sc_lv<8> > out; sc_core::sc_signal<sc_dt::sc_logic> start, clk, eoc; }; compiler returns with following errors !!! A2D_top_level.cpp:13: error: expected identifier before string constant A2D_top_level.cpp:13: error: expected ‘,’ or ‘...’ before string constant A2D_top_level.cpp: In constructor ‘A2D_top_level::A2D_top_level(sc_core::sc_module_name)’: A2D_top_level.cpp:29: error: class ‘A2D_top_level’ does not have any field named ‘clk1’ A2D_top_level.cpp:33: error: ‘((A2D_top_level*)this)->A2D_top_level::clk1’ does not have class type A2D_top_level.cpp:41: error: ‘SC_CURRENT_USER_MODULE’ has not been declared please let me know your views. thanks in advance. Milind.
- 7 replies
-
- Internal signal
- port binding
-
(and 3 more)
Tagged with: