Jump to content

Flori_He

Members
  • Content Count

    7
  • Joined

  • Last visited

About Flori_He

  • Rank
    Member

Recent Profile Visitors

287 profile views
  1. Flori_He

    Runtime warnings

    Hello, I think there must be a relation between these warnings and the fact that every said class/module has exactly the same number of amba slave sockets(these are types from the amba toolkit by Carbon Design Systems included with the header #include <amba.h>) minus one. Minus one is because the module related to the first socket doesn't have to be renamed. In my class definitions this looks like: template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dpr_two_even_regions: public sc_module { ... public: amba::amba_slave_socket<BUSWIDTH_0> slave_sock_r_0; amba::amba_slave_socket<BUSWIDTH_0> slave_sock_w_0; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_r_1; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_w_1; }; ... template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dpr: public sc_module { .... public: amba::amba_slave_socket<BUSWIDTH_0> slave_sock_r_0; amba::amba_slave_socket<BUSWIDTH_0> slave_sock_w_0; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_r_1; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_w_1; }; ... template<unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dummy_socks: public sc_module { public: amba::amba_slave_socket<BUSWIDTH_0> slave_sock_dummy_1; amba::amba_slave_socket<BUSWIDTH_0> slave_sock_dummy_2; amba::amba_slave_socket<BUSWIDTH_0> slave_sock_dummy_3; amba::amba_slave_socket<BUSWIDTH_0> slave_sock_dummy_4; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_dummy_5; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_dummy_6; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_dummy_7; amba::amba_slave_socket<BUSWIDTH_1> slave_sock_dummy_8; ... }; Does this mean each socket calls the sc_module constructor with the same sc_module_name? Greetings Florian
  2. Flori_He

    Process doesn't get triggered

    Thanks for the info Roman!
  3. Flori_He

    Runtime warnings

    Hello everyone, I've built a little system in SystemC, which compiles without errors. But when I run the simulation, I get (besides a seg fault, which I will debug) the warnings: Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_0 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_1 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_2 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_3 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_4 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_5 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dummy_socks.AT_LT_conv_peq. Latter declaration will be renamed to _dummy_socks.AT_LT_conv_peq_6 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr1_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr1_10.AT_LT_conv_peq_0 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr1_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr1_10.AT_LT_conv_peq_1 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr1_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr1_10.AT_LT_conv_peq_2 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr2_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr2_10.AT_LT_conv_peq_0 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr2_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr2_10.AT_LT_conv_peq_1 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 Warning: (W505) object already exists: _dpr2_10.AT_LT_conv_peq. Latter declaration will be renamed to _dpr2_10.AT_LT_conv_peq_2 In file: ../../../../src/sysc/kernel/sc_object_manager.cpp:149 I've found a previous thread in the archive which discussed a similar problem: http://workspace.accellera.org/Discussion_Forums/systemc-forum/archive/msg/msg?list_name=systemc-forum&monthdir=200506&msg=msg00014.html Here, there were two possible solutions proposed: -Either the warnings are because of separate multiple inheritance (class/module is inherited multiple times and so multiple objects/modules with the same sc_module_name are created) -> make class/module which is inherited virtual -Or I have multiple objects/modules with the same sc_module_name on the same system hierarchy -> rename classes/modules Option 1 cannot be the solution for me because the said modules are templated. And also, the only class which is inherited by all modules individually is sc_module. Option 2 (seems) to be not working for me too, because every module I created has a unique name. Here are (all?) relevant infos on my classes/modules and constructors and how I build and connect them in sc_main: template<unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dummy_socks: public sc_module { .... } ... template<unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> dummy_socks<BUSWIDTH_0, BUSWIDTH_1>::dummy_socks(sc_module_name name): sc_module(name), slave_sock_dummy_1("ssockd1", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_2("ssockd2", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_3("ssockd3", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_4("ssockd4", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_5("ssockd5", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_6("ssockd6", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_7("ssockd7", amba::amba_AXI, amba::amba_AT, false), slave_sock_dummy_8("ssockd8", amba::amba_AXI, amba::amba_AT, false) {} ... template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dpr_two_even_regions: public sc_module { .... }; ... template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> dpr_two_even_regions<T, BUSWIDTH_0, BUSWIDTH_1>::dpr_two_even_regions(sc_module_name name, unsigned int _wl, unsigned int _iwl, unsigned int _mem_size, unsigned int _bytes_per_word, sc_time& _delay_r, sc_time& _delay_w, addr_sub_space _a_subspace_1, addr_sub_space _a_subspace_2, sc_mutex* _m0, sc_mutex* _m1): sc_module(name), wl(_wl), iwl(_iwl), mem_size(_mem_size), bit_shift_int(1), bytes_per_word(_bytes_per_word), slave_sock_r_0("ssockr2_0", amba::amba_AXI, amba::amba_AT, false), slave_sock_w_0("ssockw2_0", amba::amba_AXI, amba::amba_AT, false), slave_sock_r_1("ssockr2_1", amba::amba_AXI, amba::amba_AT, false), slave_sock_w_1("ssockw2_1", amba::amba_AXI, amba::amba_AT, false), delay_r(_delay_r), delay_w(_delay_w), a_subspace_1(_a_subspace_1), a_subspace_2(_a_subspace_2), m0(_m0), m1(_m1) { ... } ... template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> class dpr: public sc_module { ... } ... template<class T, unsigned int BUSWIDTH_0, unsigned int BUSWIDTH_1> dpr<T, BUSWIDTH_0, BUSWIDTH_1>::dpr(sc_module_name name, unsigned int _wl, unsigned int _iwl, unsigned int _mem_size, unsigned int _bytes_per_word, unsigned int _regions_nmbr, unsigned int* _sub_region_sizes, addr_sub_space _dpr_addr_space, sc_mutex**_mutexes): sc_module(name), wl(_wl), iwl(_iwl), mem_size(_mem_size), bytes_per_word(_bytes_per_word), regions_nmbr(_regions_nmbr), sub_region_sizes(_sub_region_sizes), dpr_addr_space(_dpr_addr_space), mutexes(_mutexes), bit_shift_int(1), slave_sock_r_0("ssockr1_0", amba::amba_AXI, amba::amba_AT, false), slave_sock_w_0("ssockw1_0", amba::amba_AXI, amba::amba_AT, false), slave_sock_r_1("ssockr1_1", amba::amba_AXI, amba::amba_AT, false), slave_sock_w_1("ssockw1_1", amba::amba_AXI, amba::amba_AT, false) { ... } ... int sc_main(int argc, char *argv[]) { ... dpr_two_even_regions<sc_uint<10>, 16, 16> dpr1("_dpr1_10", resolution, iwl, dpr1_mem_size, bytes_per_word, delay_r_dpr1, delay_w_dpr1, dpr1_a_subspace, dpr1_a_subspace, &_m1_1, &_m2_1); dpr<sc_uint<10>, 16, 16> dpr2("_dpr2_10", resolution, iwl, dpr2_mem_size, bytes_per_word, dpr2_regions_nmbr, dpr2_sub_region_sizes, dpr2_a_subspace, mutexes); fft_correlator<sc_uint<10>, 16> fft_c("fft_c", resolution, iwl, bytes_per_word, fft_framesize, delay_cycles_fft, delay_cycles_ifft, delay_cycles_cross_corr, nmbr_of_tasks, fft_correl_a_subspace, tasks); fft_c.master_sock_r_1(dpr1.slave_sock_r_1); fft_c.master_sock_w_1(d_socks.slave_sock_dummy_5); fft_c.master_sock_r_2(dpr2.slave_sock_r_0); fft_c.master_sock_w_2(dpr2.slave_sock_w_0); fft_c.io_clk(c_io); fft_c.fft_clk(c_fft); fft_c.interrupt_clk(c_inter); fft_c.m1_1_port(_m1_1); fft_c.m2_1_port(_m2_1); fft_c.m3_1_port(_m_dummy); fft_c.m4_1_port(_m_dummy); fft_c.m1_2_port(_m1_2); fft_c.m2_2_port(_m2_2); fft_c.m3_2_port(_m3_2); fft_c.m4_2_port(_m4_2); sc_report_handler::set_actions(SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, SC_DO_NOTHING); sc_time sim_time = sc_time(s_time, s_time_unit); // run the simulation sc_start(sim_time); .... } Anyone has an idea why this is happening? Thanks and regards, Florian
  4. Flori_He

    Process doesn't get triggered

    Hello Alan and dakupoto, nesting the code into an infinite loop, putting a wait(ev) at the beginning and deleting the static sensitivities solved the problem for me. Thanks very much for that. Nevertheless I still don't understand why the thread wasn't triggered a second time, Regards Florian
  5. Hello, I simply don't get why the process axi_run() doesn't get triggered a second time. Here are all relevant(hopefully) code snippets: template<class T, unsigned int BUSWIDTH> tlm::tlm_sync_enum adc_slave<T, BUSWIDTH>::nb_trans(tlm::tlm_generic_payload& gp, tlm::tlm_phase& ph, sc_time& t) { assert(ph==tlm::BEGIN_REQ || ph==amba::BEGIN_DATA || ph==amba::BEGIN_DATA); if(ph==tlm::BEGIN_REQ) { sl_ph = tlm::END_REQ; sl_ev1.notify(SC_ZERO_TIME); wait(sl_ev2); sl_ph = tlm::BEGIN_RESP; sl_gp = &gp; if(gp.is_read()) { cout<<"notifying sl_ev1"<<endl; sl_ev1.notify(SC_ZERO_TIME); wait(sl_ev2); cout<<"waited for sl_ev2"<<endl; return tlm::TLM_ACCEPTED; } else .... } } ... template<class T, unsigned int BUSWIDTH> void adc_slave<T, BUSWIDTH>::axi_run() { cout<<"entering..."<<endl; if(sl_ph==tlm::END_REQ) { cout<<"entering...end_req"<<endl; sl_gp->set_response_status(tlm::TLM_OK_RESPONSE); retVal = slave_sock->nb_transport_bw(*sl_gp, sl_ph, sl_t); assert(retVal==tlm::TLM_UPDATED); sl_ev2.notify(SC_ZERO_TIME); cout<<"leaving...end_req"<<endl; } else if(sl_ph==tlm::BEGIN_RESP) { cout<<"entering...end_resp"<<endl; ... } .... } template<class T, unsigned int BUSWIDTH> adc_slave<T, BUSWIDTH>::adc_slave(...) ... SC_THREAD(axi_run); dont_initialize(); sensitive<<sl_ev1; } ... template<class T, unsigned int BUSWIDTH> class adc_slave: public sc_module { ... public: ... sc_event sl_ev1, sl_ev2; .... } If I run my simulation (in which i call nb_transport with a read command), I get as an output: entering... entering...end_req leaving...end_req notifying sl_ev1 which means the process axi_run() doesn't get triggered a second time. So far there is no logical explanation for me, why this isn't happening. Does anyone have an idea? Thanks and greetings, Florian
  6. Hello Stephan, yes I tried this out, but when moving this function out of the class or keeping it in the class and making it a static member, I cannot work on any member variables (of objects) of the class. Regards Florian
  7. Hello everyone, I tried to use code from the SystemC Verification Standard Specification. It can be found on page 46 and reads: class my_module : public sc_module { public: scv_smart_ptr<int> fsm_state; SC_CTOR(my_module) { fsm_state->register_cb(fsm_state_callback); } void fsm_state_callback(scv_extensions_if& data, scv_extensions_if::callback_reason r) { if ( r == scv_extensions_if::VALUE_CHANGE) { cout << "The FSM state has been changed to : " << data << endl; // write_to_the_database(data); } } }; Compiling this with the respective haeders and libraries, I get the error. my_mod.cpp: In constructor ‘my_module::my_module(sc_core::sc_module_name)’: my_mod.cpp:11:42: error: no matching function for call to ‘scv_extensions<int>::register_cb(<unresolved overloaded function type>)’ fsm_state->register_cb(fsm_state_callback); ^ I already searched for a solution and found that there seems to be a problem with: pointer-to-member-function vs pointer-to-function are different and incompatible This seems to be the case here as the definition of the function in the API reads: virtual callback_h register_cb( void (*f)(scv_extensions_if&, callback_reason) ) = 0; In the above example I try to register a pointer-to-member-function to a pointer-to-function which leads to the error (as I understand it). So is there any known solution to the problem? Regards, Florian
×