Jump to content

Is hierarchical bind not supported anymore in SystemC 2.3.2?


Jarodw

Recommended Posts

I just downloaded the SystemC 2.3.2 and found that the same design works in 2.3.0 but doesn't work in 2.3.2. The design utilizes the hierarchical bind as:

initiator->parent_target->target

It reports error with SystemC 2.3.2:

Error: /OSCI_TLM-2/multi_socket: parent_target.multi_passthrough_target_socket_0: Call to b_transport without a registered callback for b_transport

The b_transport is registered for target but not for parent_target. This used to be work fine in 2.3.0. Am I missing something here?

Full code:

#include <systemc.h>
#include <tlm.h>
#include "tlm_utils/multi_passthrough_initiator_socket.h"
#include "tlm_utils/multi_passthrough_target_socket.h" 

#define SC_INCLUDE_DYNAMIC_PROCESSES

using namespace std;
using namespace sc_core;
using namespace tlm;

class target : public sc_module {
    public:
        target( sc_module_name module_name ) { 
            cout << "Construct target" << endl;
            t00.register_b_transport(this, &target::b_transport);
        }   
        tlm_utils::multi_passthrough_target_socket<target> t00;
        void b_transport(int ID, tlm::tlm_generic_payload& bp, sc_time& delay) {
            cout << "Calling t00 b_transport" << endl;
        }   
};

class parent_target : public sc_module {
    public:
        parent_target( sc_module_name module_name ) { 
            cout << "Construct parent_target" << endl;
            p_target = new target("target");
            t0.bind(p_target->t00);
        }   
        tlm_utils::multi_passthrough_target_socket<parent_target> t0; 
        target *p_target;
};

class initator : public sc_module {
    public:
        initator( sc_module_name module_name ) { 
            cout << "Construct initator" << endl;
            SC_THREAD(thread0);
        }   
        tlm_utils::multi_passthrough_initiator_socket<initator> i0; 
        SC_HAS_PROCESS(initator);
        void thread0 (void) {
            cout << "Enter thread0" << endl;
            tlm_generic_payload p0; 
            sc_time delay = SC_ZERO_TIME;
            i0->b_transport(p0, delay);
            cout << "Exit thread0" << endl;
        }   
};

int sc_main(int argc, char* argv[])
{
    initator m_initator("initator");
    parent_target m_parent_target("parent_target");
    m_initator.i0.bind(m_parent_target.t0);

    sc_start();

    return (0);
}

 

Link to comment
Share on other sites

14 hours ago, Jarodw said:

Thanks Roman. Is there a way that I can see the progress of this bug? We use multi passthrough socket a lot.

As I understood, currently only Accellera members have access to SystemC GitHub repos. ( I heard that there are plans to make SystemC development open to general public, but we are not there yet)   So if your company is Accellera member, you can ask your account manager to request an access for you.

Meanwhile the best thing you can do is to stay on 2.3.1 until bugfix for 2.3.2 will be published. 

Link to comment
Share on other sites

Hi Jarodw,

Thanks for your report. I can confirm and reproduce the issue in SystemC 2.3.2.

It looks indeed like a regression compared to SystemC 2.3.0/1 that has been introduced by the fix for optionally unbound sockets, see:

It seems, the SystemC regression tests didn't cover the hierarchical binding for the multi sockets, so it wasn't caught before the release.

Your example can be fixed by changing line 228 in src/tlm_utils/multi_passthrough_target_socket.h:

  if (unbound && !m_hierarch_bind) return;
  //          ^-- add check for hierarchical binding here

Hope that helps,
  Philipp

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...