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

Verilator DPI libraries when using MAIN #104

Open
Risto97 opened this issue Nov 26, 2024 · 0 comments
Open

Verilator DPI libraries when using MAIN #104

Risto97 opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Risto97
Copy link
Contributor

Risto97 commented Nov 26, 2024

Currently, if MAIN argument is used for Verilator backend function, DPI-C libraries are not supported.

Instead a standard flow must be used with executable and main defined explicitly like this:

ip_link(${IP} hello_dpi)
verilator(${IP})
add_executable(main Vtb__main.cpp)
target_link_libraries(main ${IP}__vlt)

The problem comes with the fact that the Vtb__main.cpp is generated during verilation.
Since SoCMake moves verilation from configure stage to build stage (through ExternalProject), the file is not available in the main CMake project.

There are few options:

  1. Check how the Vtb_main.cpp is generated, if its simple templating we can generate it with configure_file() easily. Declare executable in the main CMake project.
  2. Just create a placeholder main.cpp file, that will be overwritten in the external project. Then declare the executable in the main CMake project.
  3. Keep executable in the external project and pass shared/static libraries as paths through -DLIBRARIES="<lib1.so>|<lib2.a>,..."
@Risto97 Risto97 added the enhancement New feature or request label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant