Jump to content

SumitK

Members
  • Content Count

    22
  • Joined

  • Last visited

Everything posted by SumitK

  1. Hi How I can do serial transfer of data(one bit at a time) using TLM2 sockets ? Any example ? Thanks Sumit
  2. Hi I am not able to think of the case where we need to create dynamic processes using sc_spwan and cases where simple SC_THREAD/SC_METHOD is not suffice. Can you give me few example cases where I must use sc_spawn during end_of_elaboration or during simulation to create the processes? Thanks in advance Thanks Sumit
  3. SumitK

    Dynamic process creation using sc_spawn

    hi Sheridp I am not sure to understand your comment. Can you please elaborate a little possibly with an example. Sumit
  4. I am looking for the updated source code for greensocs CCI implementation. Earlier it was at https://github.com/OSCI-WG/cci.git but now I am not able to find it Anybody knows from where I can get this ? Thanks Sumit
  5. I have a scenario where I have a model (initiator) with following ports tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> Out; and another model(target) with following ports tlm::tlm_target_socket<32,tlm::tlm_base_protocol_types,1,SC_ZERO_OR_MORE_BOUND> In[2]; When I connect them as initiator_inst->Out.bind(target_inst->In[0]); initiator_inst->Out.bind(target_inst->In[1]); I get the following error Error: (E107) bind interface to port failed: interface already bound to port: port 'init_inst.tlm_base_initiator_socket_0' (tlm_initiator_socket) In file: ../../../../src/sysc/communication/sc_port.cpp:231 In above example, the Out socket has N=0 so it can connect to many number of sockets, then why I get this error Thanks SumitJ
  6. Thanks Eyck I have couple of more questions. 1. In case of tlm::tlm_inititor_socket/tlm::tlm_target_sockts, how to know whther they are connected or not 2. If N=0 for tlm::tlm_inititor_socket/tlm::tlm_target_sockts, then how to know the number of sockets bound to it Thanks Sumit
  7. Hi Guys How can I know whether - a multi_passthrough_initiator_socket is connected or not - a multi_passthrough_target_socket is connected or not I need this before forwarding the incoming/outgoing transactions to avoid runtime error Thanks in advance SumitJ
  8. I have an array of initiaot/target sockets(without pointers) like tlm_utils::multi_passthrough_initiator_socket<Router, 32, tlm::tlm_base_protocol_types,1,sc_core::SC_ZERO_OR_MORE_BOUND > Out[10] How I can provide the name to these elements as Out0, Out1,Out2,...,Out9. Please note these are not pointers but simple object Thanks Sumit
  9. Hi Eyck Please ignore my last thread. It was my mistake. I should use for(unsigned int i=0; i<In.size(); ++i) In[i]->invalidate_direct_mem_ptr(...) and for(unsigned int i=0; i<In.size(); ++i) In[i]->nb_transport_bw() // only is corresponding nb_transport_fw() is received on that In My only remaining point is now wrt nb_transport_bw() calls. For this if I want to make sure that my interconnect model only pass that calls to that initiator socket from which the corresponding nb_transport_fw() call is received, do I need to add the corresponding checks in interconnect model itself before forwarding the transaction using nb_transport_bw() call ? Thanks Sumit
  10. Hi Folks In my inteconnect model, I have a target socket In (which allows multiple initiator sockets connected to it) and an array of initiator socket like folloiwng tlm_utils::multi_passthrough_target_socket<QC_Mux_base<N_TARGETS>, 32, tlm::tlm_base_protocol_types,0,sc_core::SC_ZERO_OR_MORE_BOUND > In tlm_utils::multi_passthrough_initiator_socket<QC_Mux_base<N_TARGETS>, 32, tlm::tlm_base_protocol_types,1,sc_core::SC_ZERO_OR_MORE_BOUND > Out[MAX] Now if I receive some backward transaction, e.g. nb_transport_bw or invalidate_direct_mem_ptr, on some of the Out socket, I need to forward it via In socket. For that do I just say In->nb_transport_bw(...) and In->invalidate_direct_mem_ptr(...) or for(unsigned int i=0; i< In.size(); i++) In->nb_transport_bw(...) and for(unsigned int i=0; i< In.size(); i++) In->invalidate_direct_mem_ptr(...) wrt compilation, both are accepted Thanks in Advance Thanks Sumit
  11. Hi Eyck My mistake, I mean to say for(unsigned int i=0; i<In.size(); ++i) In[i]->invalidate_direct_mem_ptr(...) In my platform, when I just call In->invalidate_direct_mem_ptr(...), I see it reaches to all connected sockets . but you said it will reach only to first bound initiator socket. I am confused here. What is different between In->invalidate_direct_mem_ptr(...) and for(unsigned int i=0; i<In.size(); ++i) In[i]->invalidate_direct_mem_ptr(...) With both the cases, how we should handle nb_transport_bw() so that it reaches only to intended recipients ? Thanks Sumit
  12. Hi Folks Is it allowed to connect an initiator port to a target port up in the hierarchy ? Is it allowed to connect an target port to a initiator port up in the hierarchy ? I assume no but what I observe that OSCI systemc implementation allows this. I tried to reproduce this problem with a small example(attached) where I have a component model with following ports tlm_utils::multi_passthrough_initiator_socket<model,32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> master; tlm_utils::multi_passthrough_target_socket<model,32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> slave; Then I create a subsystem with an instance of above component model and a following port tlm_utils::multi_passthrough_initiator_socket<model,32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> master; Then if I connect model_inst->master.bind(master); // this is fine master.bind(model_inst->slave); // this should not allowed, I think I am attaching the complete code. Can you help me to understand whether it is allowed ? Thanks Sumit test.cpp
  13. Hi Guys In this case the SystemC implementation shouldn't allow hierarchical connections between ports having different directions What you think ? Thanks Sumit
  14. Hi David I can not use sc_vector here because in real scenario, I have a interconnect implemented with following ports tlm::tlm_target_socket<32,tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> In; tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types,1,SC_ZERO_OR_MORE_BOUND> Out[N]; and in my platform, there are a case when two Out socket of an interconnect instance connected to same In socket of other interconnect. Thanks SumitJ
  15. Hi Eyck I agree with you that it is allowed to direct connect an initiator(target) socket to target(initiator) socket but my question is related to hierarchical connections. As far as I know, it is allowed to hierarchically connect the following - initiator socket of child object to initiator socket of parent - target socket of child object to an target socket of parent but what about following - connecting initiator socket of child object to target socket of parent - connecting target socket of child object to initiator socket of parent In my understanding these should not be allowed but if I do that there is no compilation/elaboration errors Thanks Sumit
  16. In one of my use case I have following ports in my module tlm_utils::multi_passthrough_initiator_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Master; tlm_utils::multi_passthrough_target_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Slave; These two ports are optional not bound at top level. For that I clearly specify the N=0 and POL=SC_ZERO_OR_MORE_BOUND. In systemc2.3.0, I didn't get any elaboration error with this use case but when I switch to systemc 2.3.1, I get the following errors Error: /OSCI_TLM-2/multi_socket: ERROR in instance memory_inst.AXI_Slave: Not bound to tlm_socket. In file: /usr2/pwcd/sw/systemc-2.3.1a/include/tlm_utils/multi_passthrough_target_socket.h:113 Is there some specific reason for this ? Is we can not keep such ports unconnected even with N=0 and POL=SC_ZERO_OR_MORE_BOUND. Thanks Sumit K
  17. Hi With the following code, I am getting the error "Error: (E513) an sc_module_name parameter for your constructor is required" I am not able to understand why ? Can anyone help please #include <iostream> #include <systemc.h> using namespace std; class Foo: public virtual sc_module { public: Foo(sc_module_name val) { } }; class Bar : public virtual sc_module { public: Bar(sc_module_name name) : foo(name) { } Foo foo; }; int sc_main(int argc, char* argv[]){ Bar b("b"); sc_start(); return 0; } Thanks Sumit
  18. Hi Ralph I tried as you suggested(see below). I still have the same issue. #include <iostream> #include <systemc.h> using namespace std; class Foo: public virtual sc_module { public: Foo(sc_module_name name):sc_module(name) { } }; class Bar : public virtual sc_module { public: Foo foo; Bar(sc_module_name name) : foo(name) { } }; int sc_main(int argc, char* argv[]){ Bar b("b"); sc_start(); return 0; } Thanks Sumit
  19. Hi Philipp The following code is working fine on 2.3.0 but giving port not bound error with 2.3.1. #include "tlm.h" #include "systemc.h"   using namespace std;   #include <tlm_utils/multi_passthrough_initiator_socket.h> #include <tlm_utils/multi_passthrough_target_socket.h>   class initiator : public sc_module { private:   public : tlm_utils::multi_passthrough_initiator_socket<initiator,32, tlm::tlm_base_protocol_types,0,::sc_core::SC_ZERO_OR_MORE_BOUND> AXI_Master; tlm_utils::multi_passthrough_target_socket<initiator,32, tlm::tlm_base_protocol_types,0,::sc_core::SC_ZERO_OR_MORE_BOUND> AXI_Slave;   SC_HAS_PROCESS(initiator); initiator(sc_module_name name){ AXI_Slave.register_b_transport(this,&initiator::b_transport); AXI_Slave.register_transport_dbg(this,&initiator::transport_dbg); AXI_Slave.register_get_direct_mem_ptr(this,&initiator::get_direct_mem_ptr);   AXI_Master.register_invalidate_direct_mem_ptr(this,&initiator::invalidate_direct_mem_ptr); SC_METHOD(run); } virtual tlm::tlm_sync_enum nb_transport_bw(int id,tlm::tlm_generic_payload &,tlm::tlm_phase &,sc_core::sc_time &){return tlm::TLM_ACCEPTED;} virtual void invalidate_direct_mem_ptr(int id,sc_dt::uint64 start_range,sc_dt::uint64 end_range){}   virtual bool get_direct_mem_ptr(int id,tlm::tlm_generic_payload& trans,tlm::tlm_dmi& dmi_data){return false;} virtual unsigned int transport_dbg(int id,tlm::tlm_generic_payload& r){return 0;} void b_transport(int id,tlm::tlm_generic_payload& trans, sc_core::sc_time &t){} tlm::tlm_sync_enum nb_transport_fw(int id,tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_core::sc_time& t){return tlm::TLM_ACCEPTED;}   void run(){}   ~initiator(){} };   int sc_main(int argc, char** argv){ initiator* initiator_inst = new initiator("initiator_inst"); sc_start(0,SC_NS); return 0; }      
  20. Hi Alain In Systemc 2.3.1 if I left the following ports unbounded, I get elaboration error (Error: /OSCI_TLM-2/multi_socket: ERROR in instance memory_inst.AXI_Slave: Not bound to tlm_socket) tlm_utils::multi_passthrough_initiator_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Master; tlm_utils::multi_passthrough_target_socket<initiator, 32, tlm::tlm_base_protocol_types,0,SC_ZERO_OR_MORE_BOUND> AXI_Slave; But in 2.3.0, there were no elaboration error with that. Thanks Sumit
×