Tanja Posted November 5, 2012 Report Share Posted November 5, 2012 Hello, what is the difference between the following sockets: 1. a passthrough_target_socket_tagged 2. a simple_target_socket_tagged thanks a lot for your explanations Tanja Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 5, 2012 Report Share Posted November 5, 2012 Passthrough doesn't support automatic blocking/non-blocking conversion - see table 59 in the 1666-2011 LRM, regards Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted November 6, 2012 Author Report Share Posted November 6, 2012 hello, Is it possible for an interconnect component to have different types of sockets? e.g.: a simple_target_socket and a simple_initiator_socket_tagged? Thank you Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 6, 2012 Report Share Posted November 6, 2012 I suppose so - though since a simple target socket is not a multi-socket, it would not tag transactions. But you could route incoming transactions on the simple target socket to a particular interface of the tagged initiator socket based on address, and then use the tag to reconstruct the address on the backward path. Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted November 6, 2012 Author Report Share Posted November 6, 2012 hello, i am getting following error while using a simple_target_socket: tlm_utils::simple_target_socket<class_name> socket; error C2079: 'opts' uses undefined class 'sc_core::sc_spawn_options' What am i doing wrong? Thank you Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 6, 2012 Report Share Posted November 6, 2012 That socket requires SystemC dynamic processes. With the ASI Proof of Concept simulator, you need to define SC_INCLUDE_DYNAMIC_PROCESSES, for instance at the top of the file where you instance the simple_target_socket, do #define SC_INCLUDE_DYNAMIC_PROCESSES regards Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted November 6, 2012 Author Report Share Posted November 6, 2012 hello, isocket is a tlm_initiator socket of an interconnect component. tsocket is a simple_target_socket_tagged of a target compoment initiator->isocket.bind( target->tsocket ); => error C2664: 'void tlm::tlm_base_initiator_socket<BUSWIDTH,FW_IF,BW_IF,N,POL>::bind(tlm::tlm_base_target_socket_b<32,FW_IF,BW_IF> &)' : cannot convert parameter 1 from 'tlm_utils::simple_target_socket_tagged<MODULE> *' to 'tlm::tlm_base_target_socket_b<BUSWIDTH,FW_IF,BW_IF> &' According to Table 60 of the "1666-2011"-reference manual, i can bind a tlm_initiator_socket to a simple_target_socket_tagged. right? How does it work? Thank you (Alan) Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 6, 2012 Report Share Posted November 6, 2012 Yes I think so. The error message seems to say that you have a pointer to the target socket, perhaps you need initiator->isocket.bind( *(target->tsocket) ); It's hard to say without seeing your code, regards Alan Tanja 1 Quote Link to comment Share on other sites More sharing options...
Tanja Posted November 6, 2012 Author Report Share Posted November 6, 2012 actually i have an array of tagged sockets on the target component and another on the 2. interconnect component i am doing following bindings: interconnect1->isocket.bind( target->tsocket[0] ); interconnect2->isocket[0].bind(target->tsocket[1]); this is the complete error for the 1st one 'void tlm::tlm_base_initiator_socket<BUSWIDTH,FW_IF,BW_IF,N,POL>::bind(tlm::tlm_base_target_socket_b<32,FW_IF,BW_IF> &)' : cannot convert parameter 1 from 'tlm_utils::simple_target_socket_tagged<MODULE> *' to 'tlm::tlm_base_target_socket_b<BUSWIDTH,FW_IF,BW_IF> &' 1> with 1> [ 1> BUSWIDTH=32, 1> FW_IF=tlm::tlm_fw_transport_if<tlm::tlm_base_protocol_types>, 1> BW_IF=tlm::tlm_bw_transport_if<>, 1> N=1, 1> POL=SC_ONE_OR_MORE_BOUND 1> ] 1> and 1> [ 1> MODULE=target 1> ] 1> and 1> [ 1> BUSWIDTH=32, 1> FW_IF=tlm::tlm_fw_transport_if<tlm::tlm_base_protocol_types>, 1> BW_IF=tlm::tlm_bw_transport_if<> 1> ] Quote Link to comment Share on other sites More sharing options...
Tanja Posted November 6, 2012 Author Report Share Posted November 6, 2012 problem solved! thank you. Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 6, 2012 Report Share Posted November 6, 2012 Phew, I'd just about run out of ideas :-) Quote Link to comment Share on other sites More sharing options...
Tanja Posted January 24, 2013 Author Report Share Posted January 24, 2013 Hi there, i would like declare an array of tagged target socket in the header file of my interconnect component. The size of the array will then be determine in constructor (.cpp file) using the initial values of one of the member variables. I tried it with the std::vector<> file.h std::vector<tlm_utils::simple_target_socket_tagged<interconnect1>> sockets_array file.cpp - class constructor sockets_array.resize(number); It doesn't work. Why? Quote Link to comment Share on other sites More sharing options...
Tanja Posted January 24, 2013 Author Report Share Posted January 24, 2013 Hello, what is the meaning of these errors please? error C2248: 'sc_core::sc_module::operator =' : cannot access private member declared in class 'sc_core::sc_module' error C2248: 'sc_core::sc_module::operator =' : cannot access private member declared in class 'sc_core::sc_module_name' error C2248: 'tlm::tlm_generic_payload::operator =' : cannot access private member declared in class 'tlm::tlm_generic_payload' thank you Quote Link to comment Share on other sites More sharing options...
apfitch Posted January 24, 2013 Report Share Posted January 24, 2013 Hi Tanja, we need more information. Going from what you've posted above, I'd say the problem is a missing semicolon in file.h regards Alan Quote Link to comment Share on other sites More sharing options...
apfitch Posted January 24, 2013 Report Share Posted January 24, 2013 The errors are saying that you are attempting to copy or assign an sc_module. Copying and assignment of sc_modules is disabled by making the copy constructor and operator= private. This can happen if you declare std::vector<sc_module> for instance, as std::vector using copying and assignment internally. In SystemC you can use the sc_vector class instead to manage arrays of modules, ports, and so on, regards Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted January 24, 2013 Author Report Share Posted January 24, 2013 Hi Alan, i have a component "interconnect1" which can have more than one sockets. The exact number of sockets is given every time an object of this component is instantiated. So i wrote following code in the header file for the socket: std::vector<tlm_utils::simple_target_socket_tagged<interconnect1>> sockets_array; In the implementation file (.cpp) the constructor looks like this: interconnect1::interconnect1( sc_module_name name, const unsigned int number ) : nr(number) { socket_array.resize(nr); for (int i=0; i<nr; i++) { socket_array[i].register_b_transport ( this, &interconnect1::b_transport , i); socket_array[i].register_get_direct_mem_ptr( this, &interconnect1::get_direct_mem_ptr , i); socket_array[i].register_nb_transport_fw ( this, &interconnect1::nb_transport_fw , i); socket_array[i].register_transport_dbg ( this, &interconnect1::transport_dbg , i); } } i get the following build errors: ClCompile: 1> interconnect1.cpp 1> Unknown compiler version - please run the configure tests and report the results 1>c:\users\...\desktop\systemc-2.3.0\src lm_utils\simple_target_socket.h(1126): error C2248: 'sc_core::sc_event::operator =' : cannot access private member declared in class 'sc_core::sc_event' 1> c:\users\...\desktop\systemc-2.3.0\src\sysc\kernel\sc_event.h(331) : see declaration of 'sc_core::sc_event::operator =' 1> c:\users\...\desktop\systemc-2.3.0\src\sysc\kernel\sc_event.h(250) : see declaration of 'sc_core::sc_event' 1> This diagnostic occurred in the compiler generated function 'tlm_utils::simple_target_socket_tagged<MODULE> &tlm_utils::simple_target_socket_tagged<MODULE>::operator =(const tlm_utils::simple_target_socket_tagged<MODULE> &)' 1> with 1> [ 1> MODULE=interconnect1 1> ] What am i doing wrong? Or is it possible to define vector of sockets? Arrays works just fine, but the number of socket is variable. thx for the help Quote Link to comment Share on other sites More sharing options...
apfitch Posted January 24, 2013 Report Share Posted January 24, 2013 Hi Tanja, yes the std::vector is trying to assign and copy sockets, which then is causing it to attempt and assign an an sc_event. To avoid that, you could create an array of pointers to sockets e.g. std::vector<tlm_utils::simple_target_socket_tagged<interconnect1>* > sockets_array; and then dynamically allocate the sockets and bind them, e.g. interconnect1::interconnect1( sc_module_name name, const unsigned int number ) : nr(number) { socket_array.resize(nr); for (int i=0; i<nr; i++) { socket_array[i] = new tlm_utils::simple_target_socket_tagged<interconnect1>; *(socket_array[i]).register_b_transport ( this, &interconnect1::b_transport , i); // etc } } and then preferably implement a destructor. Does that make sense? If you're using SystemC 2.3.0, the sc_vector should provide a better solution, regards Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted January 24, 2013 Author Report Share Posted January 24, 2013 Thank you very much Alan. i am just trying "sc_vector" Quote Link to comment Share on other sites More sharing options...
Tanja Posted January 24, 2013 Author Report Share Posted January 24, 2013 Hi Alan, now i have sc_vector<my_module> M; how do i push the new objects of type my_module into the vector? class my_module { my_module(sc_module_name, unsigned int nr); }; my_module my1("one", 2); my_module my2("two", 3); Thx Quote Link to comment Share on other sites More sharing options...
apfitch Posted January 24, 2013 Report Share Posted January 24, 2013 There's a paper about sc_vector written by Philipp Hartmann who was the original author. You can download it here: http://complex.offis.de/documents/doc_download/29-scvector-container-and-the-ieee-p1666-2011-systemc-standard Also of course have a look at the 1666-2011 standard, in particular pages 404 and 405. You should just be able to do something like struct Mod: sc_module { sc_vector< tlm_utils::simple_target_socket_tagged<interconnect1> > vec; Mod(sc_module_name n) : vec("vec", 4) // 4 is the size { You can also defer the creation by calling the init() of sc_vector in the constructor, regards Alan Quote Link to comment Share on other sites More sharing options...
Tanja Posted February 1, 2013 Author Report Share Posted February 1, 2013 thank you Alan. Problem solved Quote Link to comment Share on other sites More sharing options...
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.