Jump to content

Recommended Posts

Hi all,

This is my first SystemC/SystemC-AMS code, so please ignore any bad coding that might exist.

I wanted to design a PLL just to test SystemC-AMS. The code is available at:

https://github.com/americodias/systemc-ams_pll

It is working, but I had to change the signals UP and DN from sc_signal<bool> to sc_signal<unsigned char>. If I use bool I get the following linking problem:

Undefined symbols for architecture x86_64:
  "sca_tdf::sca_de::sca_in<bool>::bind(sc_core::sc_port_b<sc_core::sc_signal_in_if<bool> >&)", referenced from:
      vtable for sca_tdf::sc_in<bool> in main.cpp.o
  "sca_tdf::sca_de::sca_in<bool>::trace(sc_core::sc_trace_file*) const", referenced from:
      vtable for sca_tdf::sc_in<bool> in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Using "sc_bit" also fix the problem, but this type is deprecated.

I am using SystemC 2.3.1 and SystemC-AMS 2.1.

Thanks in advance.

PS: The issue seems to be on the chargepump ams module when I use "sca_tdf::sc_in<bool>" do declare UP and DN.

Américo

Share this post


Link to post
Share on other sites

I can't reproduce the issue - the example compiles and runs under Linux 64Bit with the gcc 4.9.2

The example works also after I changed the port types and the signals to bool.

 

Do you removed all object files before recompiling (call make clean) - may the make file of the example works not properly, it does not recompile the main function after changing the header

 

Best regards

Karsten

Share this post


Link to post
Share on other sites

Hi!

Thank you for your answers.

@karsten The default g++ version on Mac OS is the 4.2.1. I tried to install g++ 4.9.2 using brew, but I've got a lot of warnings when compiling and I ended up with more problems than before.

@Philipp A Hartmann That was one of the first things I've tried. But independently of the the order I get the same error:

adias-desktop:PLL adias$ make
c++  -Wno-deprecated -std=c++11 -I/usr/local/Cellar/systemc-ams/2.1/include -I/usr/local/Cellar/systemc/2.3.1/include -fpermissive -O3 -c chargepump.cpp -o chargepump.cpp.o
c++  -Wno-deprecated -std=c++11 -I/usr/local/Cellar/systemc-ams/2.1/include -I/usr/local/Cellar/systemc/2.3.1/include -fpermissive -O3 -c divider.cpp -o divider.cpp.o
c++  -Wno-deprecated -std=c++11 -I/usr/local/Cellar/systemc-ams/2.1/include -I/usr/local/Cellar/systemc/2.3.1/include -fpermissive -O3 -c main.cpp -o main.cpp.o
c++  -Wno-deprecated -std=c++11 -I/usr/local/Cellar/systemc-ams/2.1/include -I/usr/local/Cellar/systemc/2.3.1/include -fpermissive -O3 -c pfdetector.cpp -o pfdetector.cpp.o
c++  -Wno-deprecated -std=c++11 -I/usr/local/Cellar/systemc-ams/2.1/include -I/usr/local/Cellar/systemc/2.3.1/include -fpermissive -O3 -c vcoscillator.cpp -o vcoscillator.cpp.o
c++ ./chargepump.cpp.o ./divider.cpp.o ./main.cpp.o ./pfdetector.cpp.o ./vcoscillator.cpp.o -L/usr/local/Cellar/systemc/2.3.1/lib -lsystemc -L/usr/local/Cellar/systemc-ams/2.1/lib-macosx64 -lsystemc-ams  -o pll
Undefined symbols for architecture x86_64:
  "sca_tdf::sca_de::sca_in<bool>::bind(sc_core::sc_port_b<sc_core::sc_signal_in_if<bool> >&)", referenced from:
      vtable for sca_tdf::sc_in<bool> in main.cpp.o
  "sca_tdf::sca_de::sca_in<bool>::trace(sc_core::sc_trace_file*) const", referenced from:
      vtable for sca_tdf::sc_in<bool> in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pll] Error 1

Thanks,

Américo

Share this post


Link to post
Share on other sites

Hi.

The line you posted shows the wrong order of libs. They should be in opposite order of their dependencies, i.e. first systemc-ams the systemc. The same should be done for the object files. Some compilers expect the correct order for them as well.

And are you sure that you compiled both libs (systemc and systemc-ams) with the same compiler and settings? Are you sure that there are no remainders of the gcc4.9 experiments in the libs?

Regards

Ralph

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

×