Jump to content

Eyck

Members
  • Posts

    355
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by Eyck

  1. You may use a temporary object: My::My(sc_core::sc_module_name nm, int ID) : sc_core::sc_module(sc_core::sc_module_name((string(nm).append(1,ID<26 ?'A'+ID : 'A'+ID +6)).c_str())) But I would move the stuff into a free function: sc_core::sc_module_name concatenate(sc_core::sc_module_name nm, int ID){ std::string res(nm); res.append(1,ID<26 ? 'A'+ID : 'A'+ID+6); return res.c_str(); } My::My(sc_core::sc_module_name nm, int ID) : sc_core::sc_module(concatenate(nm, ID)) This makes the whole code easier to understand and more maintainable... Cheers
  2. Hi Sumit, both options will forward your transaction only to the first bound initiator socket of your multi_passthrough_target_socket as it just calls the operator->() of the underlying port. What you want to do is: for(unsigned int i=0; i<In.size(); ++i) In[i]->invalidate_direct_mem_ptr(...) But here you forward the call to all initiator sockets. In case of invalidate_direct_mem_ptr() this might be ok but for nb_transport_bw() it isn't as the call is part of the AT phases protocol and then you send e.g a BEG_RESP to a socket which never sent a BEG_REQ thus violating the TLM protocol as specified in the TLM 2.0 LRM (e.g. section 8.2.6) Cheers -Eyck
  3. Hi Sumit, you can use the size() method on both sockets to get the number of bound sockets. Cheers -Eyck
  4. Hi Sumit, of course it is allowed to bind an initator to a target socket, otherwise you would not be able connect an initiator to a target. But a can only once do this so usually you do it at the top level of connectivity. The picture below illustartes this, between module1 and module2 you have a binding of intor to target. +------------------------+ +----------------------+ | +---------------+ | | | | | | | | +-------------+ | | | | | | | | | | | intor | | | | target | | | | module +-+-+ +-+-+ intor to +-+-+ +-+-+ module | | | | | I +--+ I +-----------+ T +--+ T | | | | | +-+-+ +-+-+ target +-+-+ +-+-+ | | | | | | | | | | | | | | | | | | | +---------------+ | | +-------------+ | | module1 | |module2 | +------------------------+ +----------------------+ HTH -Eyck
  5. Maybe a little bit late but there are socket implementations available which do trace tlm transactions int a SCV database. They can be found at https://github.com/Minres/SystemC-Components/tree/master/incl/scv4tlm and are used e.g. at https://github.com/Minres/SystemC-Components/blob/5f7387ab7e3dfc2ff6a7cac6fbe834ed7ec8ae36/incl/sysc/tlmtarget.h which in turn serve as building blocks in https://github.com/Minres/SystemC-Components-Test/tree/master/examples/simple_system The setup given by Kai is put into sysc::tracer where all the tracing setup (VCD & SCV) is impelemted. Best regards -Eyck
×
×
  • Create New...