Home > Community > Forums > Functional Verification > DPI-C Simulation error

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 DPI-C Simulation error 

Last post Wed, Apr 27 2011 4:29 AM by Vishnugupt. 3 replies.
Started by Miguel Caetano 02 Mar 2010 09:44 PM. Topic has 3 replies and 4704 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Mar 2 2010 9:44 PM

    • Miguel Caetano
    • Not Ranked
    • Joined on Tue, Mar 2 2010
    • <?xml version="1.0" encoding="utf-16"?><string>Porto, Douro</string>
    • Posts 1
    • Points 20
    DPI-C Simulation error Reply

    Hello to all,

     I'm new at SystemVerilog and i'm trying to create a way to use C code.  However, when i run the ncsim i obtain these following messages:

    "ncsim: *F,NOLWSV: Unable to load the default library libdpi."
    "OSDLERROR: ./libdpi.so: cannot open shared object file: No such file or directory or file is not valid ELFCLASS32 library.."

    The c-program is a very simple one:

    #include "svdpi.h"

    void reportc()
    {
    printf("Hello World from C! ");
    }

     

    and the systemverilog code is:

     program main();
    //string str;

    import "DPI-C" reportc=task reportc();

    initial
    begin
      reportc();
    end

    endprogram

     

     Thanks for your help

    Best Regards

    Miguel Caetano 

    Filed under: ,
    • Post Points: 20
  • Thu, Mar 4 2010 6:16 AM

    • Pushpa P
    • Not Ranked
    • Joined on Thu, Mar 4 2010
    • Sunnyvale, CA
    • Posts 1
    • Points 20
    Re: DPI-C Simulation error Reply
    Hi Miguel, I think the problem is that the libdpi.so file is not created. I ran the program and found no error. These are the commands that I used : >ncvlog -sv hello.sv >ncelab main >gcc -fPIC -shared -o libdpi.so hello.c -I /tools/cadence/Incisive92/IUS92/tools/inca/include where ( /tools/cadence/Incisive92/IUS92) is the installation directory >ncsim main
    Pushpa Prabhuswamy
    • Post Points: 20
  • Fri, Apr 15 2011 2:10 AM

    • basa
    • Not Ranked
    • Joined on Fri, Apr 15 2011
    • Posts 1
    • Points 20
    Re: DPI-C Simulation error Reply

    Hi,

    I tried with the same .sv with c function calling, my sv file name is sv_c_dpi.sv  and c file name as c_sv.c

    I gave the command as

    step 1: ncvlog -sv sv_c_dpi.sv  ---- compiling successfully

    step 2: ncelab main               --- success

    step 3: gcc -fPIC -shared -o libdpi.so c_sv.c (In c file i have included the complete path of svdpi.h)    ---- success  libdpi.so file is created.

    step4: ncsim main           --- Error  (cannot open shared object file : No such file or directory or file is not valid ELFCLASS32 library)

             My both .sv and .c files are contains same data as above said.  Can you give me more insight on how to solve this issue.

             Thanks in Advance.

    • Post Points: 20
  • Wed, Apr 27 2011 4:29 AM

    • Vishnugupt
    • Not Ranked
    • Joined on Mon, Apr 11 2011
    • Posts 1
    • Points 5
    Re: DPI-C Simulation error Reply

     Check with this

    step 3: gcc -m32 -fPIC -shared -o libdpi.so c_sv.c (In c file i have included the complete path of svdpi.h)

     Hope this helps!

    Vishnu

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Miguel Caetano at 02 Mar 2010 09:44 PM. Topic has 3 replies.