A new compiler executable, xsc, is provided to
convert C code into an object code file. It also links multiple object code files into a
shared library (.a on Windows and .so on Linux). The xsc compiler is available in the
<Vivado installation>/bin directory. You
can use -sv_lib to pass the shared library containing
your C code to the Vivado simulator/elaborator
executable. The xsc compiler works in the same way as a C compiler, such as gcc. The xsc
compiler:
- Calls the LLVM clang compiler to convert C code into object code
- Calls the GNU linker to create a shared library (.a on Windows and .so on Linux) from one or more object files corresponding to the C files
The shared library generated by the xsc compiler is linked with the Vivado simulator kernel using one or more newly added switches in xelab, as described below. The simulation snapshot created by xelab connects the compiled C code with compiled SystemVerilog code and effect communication between C and SystemVerilog.