import "DPI" function int get_pid();
import "DPI" function int get_vmem( output string output_str_ptr );
your above code is write
in c file what you write in 2nd line?
remove 2nd line and run it will work
$ vlog -dpiheader dpi_header_file.h dpi_test.c dpi_test.sv
QuestaSim vlog 10.2a Compiler 2013.03 Mar 15 2013
-- Compiling program main
Top level modules:
main
[COLOR="#FF0000"]-- Compiling DPI C/C++ file dpi_test.c[/COLOR]
The output from vlog should have been
Try putting everything in the same directory so there are no differences between cygwin and windows paths. If that doesn't work, you may need to compile your C files directly with gcc.Code:$ vlog -dpiheader dpi_header_file.h dpi_test.c dpi_test.sv QuestaSim vlog 10.2a Compiler 2013.03 Mar 15 2013 -- Compiling program main Top level modules: main [COLOR="#FF0000"]-- Compiling DPI C/C++ file dpi_test.c[/COLOR]
Also, you can simplify your import statement when the name in SV and C are the same.
import "DPI-C" function void string_sv2c();
The output from vlog should have been
Try putting everything in the same directory so there are no differences between cygwin and windows paths. If that doesn't work, you may need to compile your C files directly with gcc.Code:$ vlog -dpiheader dpi_header_file.h dpi_test.c dpi_test.sv QuestaSim vlog 10.2a Compiler 2013.03 Mar 15 2013 -- Compiling program main Top level modules: main [COLOR="#FF0000"]-- Compiling DPI C/C++ file dpi_test.c[/COLOR]
Also, you can simplify your import statement when the name in SV and C are the same.
import "DPI-C" function void string_sv2c();
vlog hello.sv -dpiheader hello.h
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?