aheimberger Posted April 2, 2013 Report Share Posted April 2, 2013 I get following message when I debug and print a variable of type sc_dt::sc_int<N> &"print integer\n" ~"$4 = {<sc_dt::sc_int_base> = {<No data fields>}, <No data fields>}" I tried to add debug informations with no success. I did following. Install of the shared Library in Linux sudo su Untar the package using - change permissions "chmod -R +x systemc-2.3.0" Change to the top level directory systemc-2.3.0 : cd systemc-2.3.0 Make a directory systemc230 for installation in your /usr/local/ path. "mkdir /usr/local/systemc230" Make a directory “objdir” in the directory systemc-2.3.0 : "mkdir objdir" Change to objdir : cd objdir now type: export CXX=g++ export OPT_CXXFLAGS=-O0 Run configure from objdir: ../configure --prefix=/usr/local/systemc230 Do: make Install by typing command: make install First make this export SYSTEMC_HOME=/usr/local/systemc230/ My Sample Program #define SC_INCLUDE_FX #include <systemc.h> int sc_main( int, char*[]){ sc_int<30> integer; integer = 12; integer = -15; return 0; } Then this to create your program g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib-linux -Wl,-rpath=$SYSTEMC_HOME/lib-linux -o main main.cpp -g -O0 -lsystemc -lm System I Use GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3Ubuntu "12.04.2 LTS, Precise Pangolin" What am I doing wrong? What am I supposed to do? Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted April 2, 2013 Report Share Posted April 2, 2013 Running your example program in a debugger prints the full expected information here: (gdb) print integer $1 = {<sc_dt::sc_int_base> = {<sc_dt::sc_value_base> = {_vptr.sc_value_base = 0x804a628}, m_val = 12, m_len = 30, m_ulen = 34}, <No data fields>} (gdb) print integer.m_val $2 = 12 Since some debugging information is present, I assume that the symbols in the linked library were not found. I tried to add debug informations with no success. I did following.Read the INSTALL information that is part of the SystemC 2.3.0 package (quoting): ... Several options are available to the configure script to modify the compiler configuration and the selection of certain features: --disable-shared do not build shared library (libsystemc.so) --enable-debug include debugging symbols --disable-optimize disable compiler optimization --disable-async-updates disable request_async_update support --enable-pthreads use POSIX threads for SystemC processes As you can see, there are specific options supported by the configure script to build the library variant you want. You seem to want something like: ../configure --enable-debug --disable-optimize --prefix=/usr/local/systemc230 Some comments on your build process: ... export OPT_CXXFLAGS=-O0 Run configure from objdir: ../configure --prefix=/usr/local/systemc230 This won't work reliably (if at all). You should never mess with (internal) configure/Automake variables via the environment. Pass them as arguments to the configure call instead. Secondly, use standardized user-customisation variables like CXXFLAGS here. ../configure --enable-debug --disable-optimize --prefix=/usr/local/systemc230 CXXFLAGS="-Werror" hth, Philipp aheimberger 1 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.