Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing a global variable that's a pointer to an array of functions #275

Open
kaushalmodi opened this issue Apr 30, 2021 · 0 comments
Open

Comments

@kaushalmodi
Copy link

Hello,

Today I started working on a Nim wrapper for another SystemVerilog/C interface called "VPI".

The SystemVerilog standard provides a vpi_user.h that has this:

/****************************** GLOBAL VARIABLES ******************************/

PLI_VEXTERN PLI_DLLESPEC void (*vlog_startup_routines[]) ();

I am not very familiar with C, but looking at a C example, it looks like this is a pointer to an array of function symbols.

C example:

// Register the new system task here
void (*vlog_startup_routines[ ] ) () = {
    registerHelloSystfs,
    0  // last entry must be 0
};

example reference

But nimterop (version 0.6.13) parses that global variable declaration as a proc:

proc vlog_startup_routines*() {.importc, cdecl, impsv_vpi_userHdr.}

Also, while this gets fixed in nimterop, can you please suggest how I can override the vlog_startup_routines mapping in cOverride. I don't know how to translate a pointer to array of void returning functions to Nim.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant