• 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. Error of undeclared identifier while calling c-function...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 65
  • Views 14554
  • 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

Error of undeclared identifier while calling c-function in VHDL with ncsim

jayvyas13
jayvyas13 over 9 years ago

I am getting error of undeclared identifier while calling c-function in VHDL with ncsim.

I am trying to call C-functions existing in a .so filed - c_api.so inside a VHDL file, something like:

begin
    wait for 1 ns;
    if ( RESETEN = '1') then
       c_matrix_multi( size, cofficient_m1, cofficient_m2, cofficient_reduced);
    end if;
    wait;
end process initial;  


But i am getting following error of c-function name "c_matrix_multi" not declared.
                                c_matrix_multi( size, cofficient_m1, cofficient_m2, cofficient_reduced);
ncvhdl_p: *E,IDENTU (.../compute_cofficient.vhd,107|46): identifier (c_matrix_multi) is not declared [10.3].

Plz, provide a sample code of c-function being used inside VHDL using three steps (compile, elab and run).

  • Cancel
  • StephenH
    StephenH over 9 years ago
    There is no way to call foreign language functions directly from VHDL, the simulator assumes all references are native to VHDL unless you explicitly declare them to be "foreign", i.e. in another language domain. For SystemVerilog it's really easy using the DPI, but for VHDL things are slightly more complex. You will need to study the Foreign Model Import library (FMI) documentation to understand how to declare your C code within the VHDL so that you can make the calls the way you want. There is a worked example in the simulator installation directory: `ncroot`/inca/examples/cif/import_function/, and you can get eh right part of the docs by running the Linux command "cdnshelp -search 'Foreign Model Integration' ".
    • 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