create a single shared library (.so) for SystemC files. These files have SC_EXPORT_MODULE for a module_A.
Used following commands:
vlib sc_work
sccom -64 -DMTI_SYSTEMC -f file_list -work sc_work
sccom -linkshared -work sc_work
It created “sc_work/_sc/linux_x86_64_gcc-4.7.4/systemc.so”. //no errors
use the shared library (.so) in other System Verilog simulations where module_A is instantiated.
Used following commands:
vlib work
vlog -64 -sv -mfcu ./top_tb.sv
vsim -64 -c top_tb -do vsim.do -sclib sc_work/_sc/linux_x86_64_gcc-4.7.4/systemc.so
or
vsim -64 -c top_tb -l vsim.log -do vsim.do -sclib sc_work
** Error: ./top_tb.sv(15): Module ‘Module_A’ is not defined.
Chapter 9 of the QuestaSim user manual covers mixed-language simulation. There is a section on instantiating SystemC modules within Verilog/SystemVerilog.
Hi cgales,
I was referring to the same section. It says to use “-sclib” option to use .so file.
But, I could not find any example on how to link/use .so file in vsim command.
It works fine if I use same work library for compiling both SystemC and Verilog files.
Issue happens when i compile systemC files to sc_work and use the generated .so in another simulation with different work directory.
My intention is to generate a single .so file for SystemC exported module and share it with other teams so that they can directly use it their verilog simulations.