bk4u_1980 Posted November 21, 2012 Report Share Posted November 21, 2012 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, Quote Link to comment Share on other sites More sharing options...
maehne Posted November 21, 2012 Report Share Posted November 21, 2012 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 Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted November 21, 2012 Report Share Posted November 21, 2012 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 maehne and bk4u_1980 2 Quote Link to comment Share on other sites More sharing options...
bk4u_1980 Posted November 21, 2012 Author Report Share Posted November 21, 2012 Thanks Philipp. It seems working now. Cheers. 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.