Jump to content

Recommended Posts

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

  1.  sudo su
  2. Untar the package using - change permissions "chmod  -R +x systemc-2.3.0"
  3. Change to the top level directory systemc-2.3.0 : cd systemc-2.3.0
  4.  Make a directory  systemc230 for installation in your /usr/local/ path.
    "mkdir /usr/local/systemc230"
  5.  Make a directory “objdir” in the directory systemc-2.3.0 : "mkdir objdir"
  6. Change to objdir : cd objdir
  7. now type: export CXX=g++
    export OPT_CXXFLAGS=-O0
  8. Run configure from objdir:  ../configure --prefix=/usr/local/systemc230
  9. Do: make
  10. 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.3
Ubuntu "12.04.2 LTS, Precise Pangolin"

 

 

What am I doing wrong?

What am I supposed to do?

 

 

 


 

Share this post


Link to post
Share on other sites

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

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

×