kansagaratushar
Newbie level 5
I don't know how to compile and simulate DPI C file with Questasim. So Can you please give compilation process for the same.
Thanks in advance..
Thanks in advance..
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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