Jump to content

taog

Members
  • Content Count

    9
  • Joined

  • Last visited

About taog

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I want to create a SystemC class as a derivative of another SystemC class like below: struct A : public sc_module { ... tlm_utils::multi_passthrough_target_socket<A, 32, tlm::tlm_base_protocol_types, 0, sc_core::SC_ZERO_OR_MORE_BOUND> tsocket; ... }; struct B : public A { ... }; struct C : public sc_module { ... tlm_utils::multi_passthrough_initiator_socket<C, 32, tlm::tlm_base_protocol_types, 0, sc_core::SC_ZERO_OR_MORE_BOUND> isocket; ... }; Then I need to bind B to C B b; C c; C->isocket.bind(b->tsocket); But, I will get some runtime error like below: Error: (E120) sc_export instance has no interface: B.tsocket In file: /home/tools/vcs/mx-2017.12-1/include/systemc231/sysc/communication/sc_export.h:162 Does SystemC do not support such a use case? Or I only need to do some “cast” to bind this socket? I'm not sure if it will bring some side-effect.
  2. I'm really agree with you. I think it's because of we do not familiar with SystemC implement, and not sure if it would bring us some side-effects or restrictions when we apply SystemC in all our models. What we need is that we can reuse our models under different simulators with as less effort as possible.
  3. Because in my project, we need to use our models in a non-SystemC simulator(C++ based). We do not want to use SystemC scheduler. We only want to use TLM-2.0 to unify function calls between our modules. Another thing is that we do not want to link SystemC library because SystemC seems have some global objects which may not easy to support checkpointing.
  4. It seems I can not use tlm2 socket like simple_initiator_socket/simple_target_socket in a pure C++ class which do not inherent from sc_module. Is TLM2 socket tight coupling with sc_module? Can I decouple this relationship?
  5. Ok, I see. Another question, can I use TLM-2.0 infrastructure like initiator socket/target socket/generic payload/socket bind/register b_transport function without trigger systemc kernel by using sc_start in my pure C++ simulation enviroment?
  6. taog

    SystemC 2.3.0 with main()

    Get it, thank you, maehne.
  7. taog

    SystemC 2.3.0 with main()

    I've tried link against the static library libsystemc.a, I got error below: /home/taog/tools/systemc-2.3.1/lib-linux64//libsystemc.a(sc_main_main.o): In function `sc_elab_and_sim': /home/taog/tools_src/systemc-2.3.1a/objdir/src/sysc/kernel/../../../../src/sysc/kernel/sc_main_main.cpp:84: undefined reference to `sc_main' I need to pack a library based on SystemC, adding a empty sc_main in a library is weld.
  8. Hi all, in my opinion, TLM-2.0 defines the communication protocol between modules. Can I just use TLM-2.0 generic payload/b_transport without SystemC, just in a pure C++ enviroment??? When I compiled my C++ program which have included TLM2 headers, it give me some errors, like below: undefined reference to `sc_core::sc_port_base::add_static_event(sc_core::sc_method_process*, sc_core::sc_event const&) const' Must I link SystemC library to use TLM-2.0? i'm using SystemC-2.3.0
  9. Hi all, I'm not familiar with SystemC source code. I'm debugging a segment fault issue inside SystemC. The call stack is like below: #0 0x000000000048124e in sc_core::sc_inout<bool>::end_of_elaboration() () #1 0x0000000000473d8e in sc_core::sc_port_base::elaboration_done() () #2 0x0000000000474ab3 in sc_core::sc_port_registry::elaboration_done() () #3 0x00000000004e1e0c in sc_core::sc_simcontext::elaborate() () #4 0x00000000004e3d1d in sc_core::sc_simcontext::initialize(bool, bool) () #5 0x00000000004e3e04 in sc_core::sc_simcontext::initialize(bool) () #6 0x00000000004e3e26 in sc_core::sc_simcontext::simulate(sc_core::sc_time const&) () #7 0x00000000004e4022 in sc_core::sc_start(sc_core::sc_time const&, sc_core::sc_starvation_policy) () In src/sysc/communication/sc_port.cpp, I found void sc_port_base::elaboration_done() { assert( m_bind_info != 0 && m_bind_info->complete ); delete m_bind_info; m_bind_info = 0; sc_module* parent = static_cast<sc_module*>( get_parent_object() ); sc_object::hierarchy_scope scope( parent ); end_of_elaboration(); } // called by elaboration_done (does nothing) void sc_port_base::end_of_elaboration() {} Why we call end_of_elaboration() here and why we come to sc_core::sc_inout<bool>::end_of_elaboration()? Maybe the call stack is not correct.
×