Josep Sans Posted March 8, 2021 Report Share Posted March 8, 2021 Hi I have compiled scv-2.0.1 and after link it to my project I'm having trouble with this error. Can somebody help? Thanks scv-2.0.1/src/scv/scv_bag.h:489:16: error: cannot assign to non-static data member within const member function 'peekRandom' _randomP = new scv_random(nameP(),_seed); ~~~~~~~~ ^ Quote Link to comment Share on other sites More sharing options...
Eyck Posted March 8, 2021 Report Share Posted March 8, 2021 Which compiler version do you use? _randomP is declared as mutable so it should be possible to assign to it even in const member functions. Or maybe you have a define named 'mutable'? Quote Link to comment Share on other sites More sharing options...
Josep Sans Posted March 9, 2021 Author Report Share Posted March 9, 2021 Hi, I've compiled the SCV library with clang (version 11.0.0) and g++ (version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)) and my uvm-SystemC testbench where I use SCV for randomize my transaction with clang All configurations yielded to the same errror. Thanks Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted March 11, 2021 Report Share Posted March 11, 2021 Hi Josep, After building SCV, did you run 'make check'? Did all tests pass? If so, could you share a small example that reproduces your problem? For me, 'make check' runs successfully using SystemC 2.3.3 and g++ 9.1.0. Thanks Quote Link to comment Share on other sites More sharing options...
Josep Sans Posted March 11, 2021 Author Report Share Posted March 11, 2021 Hi, After a clean compile with g++ (version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)), at executing 'gmake check' I get the following errors: gmake[4]: Entering directory `/scv-2.0.1/objdir/examples/data_structures/scv_bag' g++ -DHAVE_CONFIG_H -I. -I../../../../examples/data_structures/scv_bag -I../../../config -I/opt/eda/verilator/systemc-2.3.3/include -I../../../../src -Wall -Wformat -O2 -g -MT scv_bag-test.o -MD -MP -MF .deps/scv_bag-test.Tpo -c -o scv_bag-test.o `test -f 'test.cc' || echo '../../../../examples/data_structures/scv_bag/'`test.cc mv -f .deps/scv_bag-test.Tpo .deps/scv_bag-test.Po /bin/sh ../../../libtool --tag=CXX --mode=link g++ -Wall -Wformat -O2 -g -R/opt/eda/verilator/systemc-2.3.3/lib-linux64 -o scv_bag scv_bag-test.o ../../../src/scv/libscv.la -lsystemc libtool: link: warning: library `/opt/eda/verilator/systemc-2.3.3/lib-linux64/libsystemc.la' was moved. libtool: link: warning: library `/opt/eda/verilator/systemc-2.3.3/lib-linux64/libsystemc.la' was moved. libtool: link: warning: library `/opt/eda/verilator/systemc-2.3.3/lib-linux64/libsystemc.la' was moved. libtool: link: g++ -Wall -Wformat -O2 -g -o .libs/scv_bag scv_bag-test.o ../../../src/scv/.libs/libscv.so -L/opt/eda/verilator/systemc-2.3.3/lib-linux64 /opt/eda/verilator/systemc-2.3.3/lib-linux64/libsystemc.so -lpthread -pthread -Wl,-rpath -Wl,scv-2.0.1/build/lib-linux64 -Wl,-rpath -Wl,/opt/eda/verilator/systemc-2.3.3/lib-linux64 scv_bag-test.o: In function `__static_initialization_and_destruction_0': /opt/eda/verilator/systemc-2.3.3/include/sysc/kernel/sc_ver.h:179: undefined reference to `sc_core::sc_api_version_2_3_3_cxx199711L<&sc_core::SC_DISABLE_VIRTUAL_BIND_UNDEFINED_>::sc_api_version_2_3_3_cxx199711L(sc_core::sc_writer_policy)' collect2: error: ld returned 1 exit status gmake[4]: *** [scv_bag] Error 1 gmake[4]: Leaving directory `scv-2.0.1/objdir/examples/data_structures/scv_bag' gmake[3]: *** [check-am] Error 2 gmake[3]: Leaving directory `scv-2.0.1/objdir/examples/data_structures/scv_bag' gmake[2]: *** [check-recursive] Error 1 gmake[2]: Leaving directory `scv-2.0.1/objdir/examples/data_structures' gmake[1]: *** [check-recursive] Error 1 gmake[1]: Leaving directory `scv-2.0.1/objdir/examples' gmake: *** [check-recursive] Error 1 Thanks Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted March 11, 2021 Report Share Posted March 11, 2021 It seems that you are mixing compiler versions and/or settings between the different packages you use. At least, your SystemC installation has not been built with the default GCC 4.8.5. Although not strictly necessary, I'd recommend to build SystemC, UVM-SystemC and SCV with the same compiler version and -options. I can confirm that with GCC 4.8.5, the SCV 'make check' also runs successfully. Quote Link to comment Share on other sites More sharing options...
Josep Sans Posted March 12, 2021 Author Report Share Posted March 12, 2021 Thanks, this was the problem. The SystemC library was compiled with a different compiler. 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.