• 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. Custom IC Design
  3. mmsim_genplugin documentation for compiling C/C++ functions...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 1058
  • 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

mmsim_genplugin documentation for compiling C/C++ functions for VerilogA

ccsim
ccsim over 1 year ago

I've written a custom function in C++ that I need to compile using mmsim_genplugin. Is there detailed documentation on mmsim_genplugin? My searches haven't yielded results. 

Specifically, I'd like to know:

1) My function has one library dependency (armadillo), how do I include it? I can compile in gcc as follows:

g++ myfunction.cpp -std=c++17 -I <path_to_include_folder> -O3 -L <path_to_libraries_if_needed> -larmadillo -lopenblas

2) My function makes use of C++ features up to C++ 17. How can I confirm if mmsim_genplugin supports C++17?

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    The dependency isn't going to be with mmsim_genplugin, since that really just generates the GNUmakefile. The dependency is that the spectre version probably needs to use a compatible GCC version, and looking at the <SPECTRE231instDir>/tools/cdsgcc directory, the version that Spectre was built with was gcc 9.3 and that certainly supports C++ 17 (see https://gcc.gnu.org/projects/cxx-status.html#cxx17)

    Most likely you'd need to modify the makefile produced to add the references to your additional libraries, and you'd need to ensure the LD_LIBRARY_PATH is set appropriately so that the shared library will be found at run time.

    There's some information on mmsim_genplugin in the documentation (search in cdnshelp or cda, depending on the Spectre version, for mmsim_genplugin). Also this app note: Simulating C/C++ Objects with Spectre and AMS Designer

    If you have any trouble though, I would advise you to contact customer support (submit a case after logging in). I don't see lots of people linking in C/C++ code with Verilog-A, but it does happen now and again and going via customer support is probably your best bet.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    The dependency isn't going to be with mmsim_genplugin, since that really just generates the GNUmakefile. The dependency is that the spectre version probably needs to use a compatible GCC version, and looking at the <SPECTRE231instDir>/tools/cdsgcc directory, the version that Spectre was built with was gcc 9.3 and that certainly supports C++ 17 (see https://gcc.gnu.org/projects/cxx-status.html#cxx17)

    Most likely you'd need to modify the makefile produced to add the references to your additional libraries, and you'd need to ensure the LD_LIBRARY_PATH is set appropriately so that the shared library will be found at run time.

    There's some information on mmsim_genplugin in the documentation (search in cdnshelp or cda, depending on the Spectre version, for mmsim_genplugin). Also this app note: Simulating C/C++ Objects with Spectre and AMS Designer

    If you have any trouble though, I would advise you to contact customer support (submit a case after logging in). I don't see lots of people linking in C/C++ code with Verilog-A, but it does happen now and again and going via customer support is probably your best bet.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • ccsim
    ccsim over 1 year ago in reply to Andrew Beckett

    Thank you! This helps a lot. I'll contact support if I can't get it working 

    • 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