OVP Forums - A community of assistance, help, questions, and answers.
  FAQFAQ    SearchSearch      RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in
OVP ISS INTEGRATION IN SYSTEMC VIRTUAL PLATFORM

 
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Ask a Question
View previous topic :: View next topic  
Author Message
ShabarishSundar



Joined: 15 Nov 2019
Posts: 2

PostPosted: Thu Nov 28, 2019 4:04 am    Post subject: OVP ISS INTEGRATION IN SYSTEMC VIRTUAL PLATFORM Reply with quote

Hi there,

I am Shabarish, currently working on integrating imperas iss into our systemc based virtual platform.

We are facing some problem in compiling / linking, and need your help to resolve this issue.

I have included the required headers for instantiating riscv cpu and linking the libraries "librarieslibRuntimeLoader.so, libRuntimeLoader++.so"
which contains the definitions of class module and processor required by "class tlmModule and tlmProcessor"

Step 1 : Included the headers
Headers:
#include "ovpworld.org/modelSupport/tlmModule/1.0/tlm/tlmModule.hpp"
#include "riscv.ovpworld.org/processor/riscv/1.0/tlm/riscv_RV32I.igen.hpp"

Step 2 : Instantiated the cpu

class Top:public sc_module
{
..
tlmModule Platform;
riscv_RV32I cpu;
public:
params paramsForplatform() {
params p;
p.set("verbose", true);
p.set("stoponcontrolc", true);
return p;
}

params paramsForcpu() {
params p;
return p;
}
..
Top(sc_module_name nm):sc_module(nm)
,Platform ("", paramsForplatform())
,cpu ( Platform, "cpu", paramsForcpu(), 32, 32)
{
...
}
...
}

STEP 3: Compile/Link

Linked the precompiled libraries provided in Imperas_SDK.20191106.0.Linux64.exe i.e "librarieslibRuntimeLoader.so, libRuntimeLoader++.so" which contains the definitions of class module and processor etc.

I am getting below linker error :

CMakeFiles/cst_board_fe310.dir/main.cpp.o: In function `cw::tlmProcessor::tlmProcessor(cw::tlmModule&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, sc_core::sc_module_name)':
/home/shabarishs/installs/Imperas.20191106/ImperasLib/source/ovpworld.org/modelSupport/tlmProcessor/1.0/tlm/tlmProcessor.hpp:149: undefined reference to `op::processor::processor(op::module&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, op::params)'
CMakeFiles/cst_board_fe310.dir/main.cpp.o: In function `cw::tlmProcessor::tlmProcessor(cw::tlmModule&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, sc_core::sc_module_name, op::params)':
/home/shabarishs/installs/Imperas.20191106/ImperasLib/source/ovpworld.org/modelSupport/tlmProcessor/1.0/tlm/tlmProcessor.hpp:166: undefined reference to `op::processor::processor(op::module&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, op::params)'
CMakeFiles/cst_board_fe310.dir/main.cpp.o: In function `cw::tlmPeripheral::tlmPeripheral(cw::tlmModule&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, sc_core::sc_module_name)':
/home/shabarishs/installs/Imperas.20191106/ImperasLib/source/ovpworld.org/modelSupport/tlmPeripheral/1.0/tlm/tlmPeripheral.hpp:81: undefined reference to `op::peripheral::peripheral(op::module&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

Observation and analysis

1. Reference to class module is resolved but not processor.
2. Run nm command on " libRuntimeLoader++.so" and confirmed definition available for class module and processor
3. Commenting cpu instantiation and keeping tlmModule succeeds the build and executable is created.

Development Environment :

1. OS : Ubuntu 16.04
2. Compiler: GCC 5.5.0 with C++11

Please let me know if you need more information.

Thanks,
Shabarish
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Fri Nov 29, 2019 2:14 am    Post subject: Reply with quote

I think that the problem you are facing is being caused by the CPP libraries (libsystemc.a, libRuntimeLoader++.so) not being compiled with the same compiler and/or compiler options.

You could try re-compiling the SystemC library using the option -D_GLIBCXX_USE_CXX11_ABI=0 that was used when the OVP CPP library was compiled.

See also the document Imperas/doc/ovp/OVPsim_Using_OVP_Models_in_SystemC_TLM2.0_Platforms.pdf which has this information.

NOTE: We are doing some work in this area to make it easier to re-compile the OVP CPP library and SystemC support. This will be included in a future release.
Back to top
View user's profile Send private message Visit poster's website
ShabarishSundar



Joined: 15 Nov 2019
Posts: 2

PostPosted: Sun Dec 01, 2019 9:31 pm    Post subject: Reply with quote

Recompiling the sources with -D_GLIBCXX_USE_CXX11_ABI=0 flag enabled fixed the issue.

Thanks for the fix.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Ask a Question All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Information regarding OVP © 2008-2022 Imperas Software