• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Xcelium DPI

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 65
  • Views 19882
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Xcelium DPI

SuperUVM
SuperUVM over 6 years ago

I am calling c functions from sv module.  c functions are  compiled in shared lib. I am able to call c function from sv module with shared lib.

I am using xcelium xrun for simulation. I want to use static lib instead of share lib for c functions. I am  using gcc compiler to build shared and static lib.

Can I use static lib containing c functions and used with DPI?

Can you please give example to show how to compile using gcc and run using xrun?

  • Cancel
  • SuperUVM
    SuperUVM over 6 years ago

    How do you link static lib containing C-functions with SystemVerilog in Xcelium? Can you add c object lib to snapshot at elaboration phase?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • TAM1
    TAM1 over 6 years ago

    The docs contain this text regarding static linking:

    --------------------------------------
    VPI User Guide and Reference 19.03

    Static linking

    Compile and link your application with the simulator object modules to create a new set of simulator executables that include your application functions. Every time you change your application, you must rebuild the executables.

    Use static linking only for backwards compatibility with existing, statically linked PLI applications. Static linking is not recommended for any other purpose.
    --------------------------------------

    Obviously the writers of that chapter don't think that there is much use for static linking in this day and age. What are you trying to accomplish?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SuperUVM
    SuperUVM over 6 years ago in reply to TAM1

    Thanks. I have a library of c functions. I want to link  lib.so or lib.a at elaboration phase. I have read the doc you specified. It talks about integrating VPI which I do not have and I am not sure what function to register.

    When I elaborate using -loadvpi lib.so: , I get an error "xmdim: *F,NOFDPI: Function my_c_fucntion not found in any of the shared object specified with -SV_LIB switch. 

    I do not use -SV_LIB switch to specify .so file.

    Goal is to link .so or .a file with rest of sv code in to single snapshot.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information