• 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. C DPI compilation error

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 65
  • Views 15286
  • 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

C DPI compilation error

abhingp01
abhingp01 over 15 years ago

Hi all,

 I am checking my OVC against existing eVC. My OVC has some DPI interfaces with C-code.

 C-Code is as follows:

#include<math.h>
#include"svdpi.h"

int ilog2_inC(int val)
{
   return (log2(val));
}


int ipow_inC(int val)
{
   return(pow(2,val));
}

I am using it in my monitor class of OVC.

Following statements imports it:

import "DPI-C" pure function int ilog2_inC(int logchk);
import "DPI-C" pure function int ipow_inC(int logchk);

 But on compiling I am getting following error:

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..

 

Kindly help for same.

 

Regards

Abhishek

  • Cancel
Parents
  • StephenH
    StephenH over 15 years ago

    Hi Abhishek.

    From the paths in the file names, I think I recognise the company you work for, and I recall that all the tools are heavily wrapped by your CAD team, so the "irun" command that you run is not the exact irun that Cadence supplies. Thus there  may be some issue in the wrapper.

    When I debug something like this, I always start with a known-good example and make sure that works on the local IT setup.
    For DPI code, you should try running one of the DPI examples that come with Incisive.
    Can you try the following commands, and if they don't work, please talk to your IT support to see what's wrong in your IT setup?

    cp -r `ncroot`/doc/dpiEngrNtbk/fourbit_ctr $HOME
    cd $HOME/fourbit_ctr
    irun -sv top.v t_counter.v t_ff.v counter.c

    Note: the ncroot command is enclosed in back-ticks (like the Verilog `include tick), this executes the ncroot command to return the path to the tool installation.

    Regards,

    Steve.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • StephenH
    StephenH over 15 years ago

    Hi Abhishek.

    From the paths in the file names, I think I recognise the company you work for, and I recall that all the tools are heavily wrapped by your CAD team, so the "irun" command that you run is not the exact irun that Cadence supplies. Thus there  may be some issue in the wrapper.

    When I debug something like this, I always start with a known-good example and make sure that works on the local IT setup.
    For DPI code, you should try running one of the DPI examples that come with Incisive.
    Can you try the following commands, and if they don't work, please talk to your IT support to see what's wrong in your IT setup?

    cp -r `ncroot`/doc/dpiEngrNtbk/fourbit_ctr $HOME
    cd $HOME/fourbit_ctr
    irun -sv top.v t_counter.v t_ff.v counter.c

    Note: the ncroot command is enclosed in back-ticks (like the Verilog `include tick), this executes the ncroot command to return the path to the tool installation.

    Regards,

    Steve.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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