Jump to content

Recommended Posts

Hi,

I am getting below error when compiling systemc code.

"$TESTDIR/../../src/common/test_uvm/cxx//reg_interceptor_wrapper.h", line 85: error:

identifier "sc_bind" is undefined

sc_spawn( sc_bind(&sc_sim_reg_if::write, this->wrappedObject, payload.GetAddress(), payload.GetValue()) );

^

"$TESTDIR/../../src/common/test_uvm/cxx//reg_interceptor_wrapper.h", line 85: error:

identifier "sc_spawn" is undefined

sc_spawn( sc_bind(&sc_sim_reg_if::write, this->wrappedObject, payload.GetAddress(), payload.GetValue()) );

Am I missing any file to include from systemC library?

I have already included systemc.h file in my csim wrapper.

Thanks,

Bharat,

Share this post


Link to post
Share on other sites

Hello,

Are you sure that at this point in your code in reg_interceptor_wrapper.h the <systemc.h> header is already included? sc_bind should be found always, as it is defined in the standard to be a #define to boost::bind, which as a side note is not very proper. So it should be found once <systemc> or <systemc.h> is included in the header. However, sc_spawn() is a function, which is defined in the namespace sc_core. In your error message, sc_spawn isn't prefixed with sc_core::. In that case there should be somewhere a

using namespace sc_core;

or

using sc_core::sc_spawn;

somewhere in the header to make it work or <systemc.h> has to be included. All three solutions are not very proper, as you should not use using statements in headers to avoid public namespace pollution. Therefore, als #include <systemc> is preferrerd over #include <systemc.h>.

No further diagnosis of your problem is possible without any further context.

Best regards,

Torsten

Share this post


Link to post
Share on other sites

To use the dynamic process features (like sc_bind and sc_spawn), you need to define the preprocessor symbol SC_INCLUDE_DYNAMIC_PROCESSES before including SystemC:

#define SC_INCLUDE_DYNAMIC_PROCESSES
#include <systemc>

In SystemC 2.3.0, this should work reliably, even if SystemC has been already included before. To make sure that this define is in place at all times, you might want to add the define to your compiler options.

Greetings from Oldenburg,

Philipp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×