Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cocotb: libffi.so.7 often not found at runtime #74

Open
dlmiles opened this issue Jul 25, 2023 · 0 comments
Open

cocotb: libffi.so.7 often not found at runtime #74

dlmiles opened this issue Jul 25, 2023 · 0 comments

Comments

@dlmiles
Copy link

dlmiles commented Jul 25, 2023

The distribution appears to bundle $OSS_CAD_SUITE_HOME/lib/libffi.so.7 however this is often not found by cocotb when loading VPI DSOs for simulator support. Such a Verilator or CVC (Tachyon)

This error still occurs after use of source $OSS_CAD_SUITE_HOME/environment

The resolution has been to sudo -E apt-get install -y libffi7 on the system. Rendering the one provided by OSS CAD suite, not use for this use-case scenario.

Example of the generated use case, in particular it is the use of "-lcocotbvpi_verilator" that is provided by oss-cad-suite, that causes libffi.so.7 to be needed. This file is provided at lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/libs/libcocotbvpi_verilator.so

This is nothing special and can be largely created with use of SIM=verilator make

## EXAMPLE VERILATOR EXECUTION
verilator -cc --exe -Mdir sim_build -DCOCOTB_SIM=1 --top-module tb_project --vpi --public-flat-rw --prefix Vtop -o Vtop
-LDFLAGS "-Wl,-rpath,/home/runner/work/_temp/oss-cad-suite/lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/libs
-L/home/runner/work/_temp/oss-cad-suite/lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/libs
-lcocotbvpi_verilator"
--trace --trace-structs
--no-timing
--coverage --coverage-underscore
--timescale 1ns/1ps
/home/runner/work/project/src/tbc_project.v
/home/runner/work/project/src/top_project.v
/home/runner/work/project/src/MyMainThing.v
/home/runner/work/_temp/oss-cad-suite/lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/share/lib/verilator/verilator.cpp

## EXAMPLE FINAL LINK
g++     verilator.o verilated.o verilated_dpi.o verilated_vpi.o verilated_cov.o verilated_vcd_c.o verilated_threads.o Vtop__ALL.a
-Wl,-rpath,/home/runner/work/_temp/oss-cad-suite/lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/libs
-L/home/runner/work/_temp/oss-cad-suite/lib/python3.8/site-packages/cocotb-1.9.0.dev0-py3.8-linux-x86_64.egg/cocotb/libs
-lcocotbvpi_verilator
 -pthread -lpthread -latomic   -o Vtop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant