[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Re: Icarus Verilog PLI example: PLI_INT32 vs static int



Stephen Williams wrote:
> 
> "int" is PLI_INT32 in your case. The "static" part is something
> else altogether and perhaps more germain to your problem. You
> don't say what's crashing, Stu's example or mine, etc., so we
> have very little to go on.

Sorry for being so vague. I was more curious about the need for the static.

I am trying to run the pow() example from the Stu book. Originally I
typed it off and added my own test bench. That crashed right away with a
segmentation fault.

Next I took the example from the accompanied CD.

I modified the vpi_user.c to not needing the other application that
comes along with that chapter 2 example and compiled it with:

  iverilog-vpi pow_vpi.c vpi_user.c
  iverilog -opow_test.vvp pow_test.v
  vvp -M. mpow_vpi pow_test.vvp

The output I am getting is:

 $pow PLI application is being used.

 Segmentation fault

What is odd, even after changing the definition and the implementation
of the calltf, sizetf, compiletf functions I am getting warnings about
incompatible pointer types.

For example the calltf function I changed from:

  PLI_INT32  PLIbook_PowCalltf(PLI_BYTE8 *user_data);

to:

  static int PLIbook_PowCalltf(PLI_BYTE8 *user_data);

When compiling I am still getting:

 > iverilog-vpi pow_vpi.c vpi_user.c
 Compiling pow_vpi.c...
 pow_vpi.c: In function ‘PLIbook_pow_register’:
 pow_vpi.c:46: warning: assignment from incompatible pointer type
 pow_vpi.c:47: warning: assignment from incompatible pointer type
 pow_vpi.c:48: warning: assignment from incompatible pointer type
 Compiling vpi_user.c...
 Making pow_vpi.vpi from  pow_vpi.o vpi_user.o...

Line 46, 47, and 48 are:

  tf_data.calltf      = PLIbook_PowCalltf;
  tf_data.compiletf   = PLIbook_PowCompiletf;
  tf_data.sizetf      = PLIbook_PowSizetf;

I even removed the .o and the .vpi file to make sure it compiles again,
but still get the warning.

The example can be downloaded from this page:

http://sutherland-hdl.com/pli_book_files/pli_handbook_examples_unix.tar.gz

Any idea what I am doing wrong?

Thanks for the help.

Cheers,

Guenter



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user