Error While Running Vivado Simulation on Ubuntu 22.04

So I was recently playing around with DPI (Direct Programming Interface) in Vivado Simulator.  My goal is to call some python code that I wrote that will generate valid BATS messages, pass that data into my IP, and check the parsed code coming out is correct.

After reading through the Xilinx/AMD documentation, I went ahead and used some Python to SystemVerilog and tried to run some sample code and eventually came upon an error complaining about GLIBCXX_3.4.29 not found

There is a question and answer record for this on the Xilinx website here, but it does not specifically mention the use of the pysv library (Python to SystemVerilog library):


I wanted to expand on the answer and explain exactly what I did to diagnose and workaround this error.

The error is occurring because the version of gcc that is bundled with Vivado is older and does not contain the version of GLIBCXX_3.4.29, and the pysv compile commands use the later version of the system gcc.

source xsim.dir/bats_parser_tb/xsim_script.tcl
# xsim {bats_parser_tb} -autoloadwcfg -runall
xsim.dir/bats_parser_tb/xsimk: /tools/Xilinx/Vivado/2023.2/lib/lnx64.o/../../tps/lnx64/gcc-9.3.0/bin/../lib64/ version `GLIBCXX_3.4.29′ not found (required by ./build/
xsim.dir/bats_parser_tb/xsimk: /tools/Xilinx/Vivado/2023.2/lib/lnx64.o/../../tps/lnx64/gcc-9.3.0/bin/../lib64/ version `CXXABI_1.3.13′ not found (required by ./build/
ERROR: [Simtcl 6-50] Simulation engine failed to start: Simulation exited with status code 1.

I use the ‘strings’ utility and run it on the file that is mentioned by the error, the results are expected to be vast, so I grep on GLIBCXX_3.4:

strings /tools/Xilinx/Vivado/2023.2/lib/lnx64.o/../../tps/lnx64/gcc-9.3.0/bin/../lib64/ | grep ^GLIBCXX_3.4 | sort | uniq


Notice how GLIBCXX_3.4.29 is not present…

A further examination of that directory shows the version of libstdc++ is 6.0.28

john@Ryzen10:/mnt/d/work/fpganow/Market.Data.Bats.Parser$ ls -l /tools/Xilinx/Vivado/2023.2/lib/lnx64.o/../../tps/lnx64/gcc-9.3.0/bin/../lib64/ | grep libstdc++
-rwxr-xr-x 2 root 44M Jan 5 2023 libstdc++.a*
-rwxr-xr-x 2 root 1006 Jan 5 2023*
lrwxrwxrwx 1 root 19 Dec 19 22:45 ->*
lrwxrwxrwx 1 root 19 Dec 19 22:45 ->*
-rwxr-xr-x 2 root 17M Jan 5 2023*
-rwxr-xr-x 2 root 2.5K Jan 5 2023*
-rwxr-xr-x 2 root 12M Jan 5 2023 libstdc++fs.a*
-rwxr-xr-x 2 root 946 Jan 5 2023*

I check my system and see that I have 6.0.30 installed, and that that version supports GLIBCXX_3.4.29:

john@Ryzen10:/mnt/d/work/fpganow/Market.Data.Bats.Parser$ ls -l /usr/lib/x86_64-linux-gnu/ | grep libstdc++
lrwxrwxrwx 1 root 19 May 13 2023 ->
-rw-r–r– 1 root 2.2M May 13 2023

john@Ryzen10:/mnt/d/work/fpganow/Market.Data.Bats.Parser$ strings /usr/lib/x86_64-linux-gnu/ | grep ^GLIBCXX_3.4.29

The versions are pretty close – not even a minor version upgrade – so I decided to manually bring in the new version to the Vivado version:

# Copy in the newer libstdc++
john@Ryzen10:/tools/Xilinx/Vivado/2023.2/tps/lnx64/gcc-9.3.0/lib64$ cd /tools/Xilinx/Vivado/2023.2/lib/lnx64.o/../../tps/lnx64/gcc-9.3.0/bin/../lib64/
john@Ryzen10:/tools/Xilinx/Vivado/2023.2/tps/lnx64/gcc-9.3.0/lib64$ sudo cp /usr/lib/x86_64-linux-gnu/ .
# Break existing link
john@Ryzen10:/tools/Xilinx/Vivado/2023.2/tps/lnx64/gcc-9.3.0/lib64$ sudo rm
john@Ryzen10:/tools/Xilinx/Vivado/2023.2/tps/lnx64/gcc-9.3.0/lib64$ sudo rm
# Create new link
sudo ln -s
sudo ln -s

Now it works…

And what my Vivado embedded gcc directory looks like:

john@Ryzen10:/tools/Xilinx/Vivado/2023.2/tps/lnx64/gcc-9.3.0/lib64$ ls -l | grep stdc++
-rwxr-xr-x  2 root  44M Jan  5  2023 libstdc++.a*
-rwxr-xr-x  2 root 1006 Jan  5  2023*
lrwxrwxrwx  1 root  19 Dec 24 10:50 ->
lrwxrwxrwx  1 root  19 Dec 24 10:50 ->
-rwxr-xr-x  2 root  17M Jan  5  2023*
-rwxr-xr-x  2 root 2.5K Jan  5  2023*
-rw-r–r–  1 root 2.2M Dec 24 10:49
-rwxr-xr-x  2 root  12M Jan  5  2023 libstdc++fs.a*
-rwxr-xr-x  2 root  946 Jan  5  2023*

Leave a Comment