• 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. Getting error while running dpi-c functions with SV cod...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 65
  • Views 20832
  • 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

Getting error while running dpi-c functions with SV code

chauhan
chauhan over 8 years ago

Hi all,

I am first time using dpi-c functions in my sv code.When I am trying to call dpi-c functions within sv code using irun command(irun -sv test_c.c test.sv).I have tried ncverilog,ncelab,ncsim also but I m getting same like this error,

make: *** [INCA_libs/irun.lnx86.15.10.nc/ncsc_run/ncsc_obj/test_c_0.o] Error 1
In file included from /usr/include/features.h:385,
                 from /usr/include/stdio.h:28,
                 from $TESTDIR/test_c.c:1:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

ncsc_run: *E,TBBLDF: Failed to generate object ./INCA_libs/irun.lnx86.15.10.nc/ncsc_run/ncsc_obj/test_c_0.o

irun: *E,CCERR: Error during cc compilation (status 1), exiting.

Please can anyone  help me to know why this error is coming and what wrong I m doing. And can anyone tell me what are the commands and step by step process to run this two files. 

Below is my C and SV code :

//sv code

1>

module main;
import "DPI-C" function void hello();

initial
begin
print();
end

endmodule

2>

//c code

#include <stdio.h>

void hello() {
printf("hello from c");
}

thanks,

JAY

  • Cancel
  • tpylant
    tpylant over 8 years ago
    The "-sv" argument on the command line tells irun to use the SV compiler for all files, regardless of filename extension. Try running without the "-sv" switch.

    Tim
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 8 years ago
    I'm going to guess that you're not running on a supported OS. You should be using RedHat Enterprise Linux 5 or 6, and have certain RPMs installed including things like glibc-devel. Please confirm what OS you're using...
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    thank u so much for ur reply...I tried without -sv but still I m getting same error..is there any other way(commands) to compile this files?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    thank for ur reply ...I m using Red Hat Enterprise Linux Server release 6.7.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    Is it supported or not ?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    Is it required to include svdpi.h header file in c code ? because when I m including that I m getting below warning..
    ncsc: compiling $TESTDIR/test_c.c

    make: *** [INCA_libs/irun.lnx86.15.10.nc/ncsc_run/ncsc_obj/test_c_0.o] Error 1
    In file included from /usr/include/features.h:385,
    from /usr/include/stdio.h:28,
    from $TESTDIR/test_c.c:1:
    /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
    In file included from $CDSROOT/tools/include/svdpi.h:80,
    from $TESTDIR/test_c.c:2:
    $CDSROOT/tools/include/svdpi_compatibility.h:48:2: warning: #warning "INCISIV is currently compliant with DPI header file svdpi.h as per IEEE 1800-2005. Starting IUS15.20, the default header file will be as per IEEE 1800-2012. DPI applications which need to continue complying with IEEE 1800-2005 will need to compile with the macro DPI_COMPATIBILITY_VERSION_1800v2005 starting in 15.2. The difference in the two header files is in the declaration of the struct t_vpi_vecval."
    ncsc_run: *E,TBBLDF: Failed to generate object ./INCA_libs/irun.lnx86.15.10.nc/ncsc_run/ncsc_obj/test_c_0.o

    irun: *E,CCERR: Error during cc compilation (status 1), exiting.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jaichandra
    jaichandra over 8 years ago
    Hi
    I too use DPI to call my C function from SV environment. I use two step for my simulations. I compile, elaborate and generate the snapshot in one step and simulate in the second step. In my compile script i use -c and -sv options and list both SV and C files using -f option. I am using 15.22-s005 version. I belive your issue could be something realted to environment than to the code itself.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    can u mention that two steps ? I have tried using file list & -f option also..
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chauhan
    chauhan over 8 years ago
    thank u guys for all your help & suggestions ...but now problem is solved ..it is working fine.
    • 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