In reply to saketa:
Sorry this was my mistake. The compile command is
vlog sine.sv dpi_sin.c -dpiheader sin.h
In reply to saketa:
Sorry this was my mistake. The compile command is
vlog sine.sv dpi_sin.c -dpiheader sin.h
In reply to chr_sue:
** Fatal: ** Error: (vsim-3828) Could not link ‘dpi_auto_compile.dll’: cmd = ’ C:\modeltech_10.1c\gcc-4.2.1-mingw32vc9\bin\gcc.exe -shared -o “C:\cygwin\tmp\ab doo@ABDOO-PC_dpi_4292\win32_gcc-4.9.0\dpi_auto_compile.dll” C:/cygwin/home/abdoo /work_dpi\auto_compile@\win32_gcc-4.9.0*.o -L"C:\modeltech_10.1c\win32" -lm tipli’
#
# (vsim-50) A call to system(C:\modeltech_10.1c\gcc-4.2.1-mingw32vc9\bin\gcc.exe -shared -o “C:\cygwin\tmp\abdoo@ABDOO-PC_dpi_4292\win32_gcc-4.9.0\dpi_auto_comp ile.dll” C:/cygwin/home/abdoo/work_dpi\auto_compile@\win32_gcc-4.9.0*.o -L" C:\modeltech_10.1c\win32" -lmtipli) returned error code ‘1’.
In reply to saketa:
Do you have a work library in the directory where you are calling vlog?
I do not use mingw compiler, I use the cygwin gcc
gcc version 5.3.0 (GCC)
see my compile log below:
vlog sine.sv sin.c -dpiheader sin.h
QuestaSim-64 vlog 10.4c Compiler 2015.07 Jul 20 2015
Start time: 18:42:54 on Apr 28,2016
vlog sine.sv sin.c -dpiheader sin.h
** Note: (vlog-2286) Using implicit +incdir+D:/SW/questa/10.4c/uvm-1.1d/…/verilog_src/uvm-1.1d/src from import uvm_pkg
– Compiling interface SDM_if
– Compiling interface sine_if
– Compiling package sine_sv_unit
– Importing package mtiUvm.uvm_pkg (uvm-1.1d Built-in)
– Compiling module top
– Compiling module sdm_rnm
– Compiling interface SDM_if
– Compiling module sv_ams_sin_voltage_gen
– Compiling interface sine_if
Top level modules:
top
– Compiling DPI/PLI C file sin.c
End time: 18:42:55 on Apr 28,2016, Elapsed time: 0:00:01
Errors: 0, Warnings: 1
** Warning: (vlog-7035) Skip generating the empty DPI header ‘sin.h’.
In reply to chr_sue:
Hi sue
I had resolved the work directory isuue ;)
you are using Questa 10.4c, I’m using ModelSim 10.1c, they require different compiler i guess?!
can i use gcc version 5.3.0 (GCC)? i do not know, i’ll try
In reply to saketa:
the gcc version does not matter. I don’t have installed the mingw compiler from Questa. It takes the cygwin gcc and this is 5.3.0.
In reply to chr_sue:
It does not work with ModelSim 10.1c, i must have questaSim 10
.4?
In reply to saketa:
What confuses me is the error message:
** Fatal: ** Error: (vsim-3828) Could not link ‘dpi_auto_compile.dll’: cmd = ’ C:\modeltech_10.1c\gcc-4.2.1-mingw32vc9\bin\gcc.exe -shared -o “C:\cygwin\tmp\ab doo@ABDOO-PC_dpi_4292\win32_gcc-4.9.0\dpi_auto_compile.dll” C:/cygwin/home/abdoo /work_dpi\auto_compile@\win32_gcc-4.9.0*.o -L"C:\modeltech_10.1c\win32" -lm tipli’
I do not see your compiled object (.dll in Windows, .o in Linux. It should not link to dpi_auto_compile.dll. This is correct.
The second thing is you have dpi_auto_compile.dll from 2 sources in the error message, one comes from the modelsim installation and the second one from cygwin. This looks like your setup is wrong.
In reply to chr_sue:
here are the whole log:
$ vsim -c sv_ams_sin_voltage_gen
Reading C:/modeltech_10.1c/tcl/vsim/pref.tcl
# 10.1c
# vsim -c sv_ams_sin_voltage_gen
# // ModelSim SE 10.1c Jul 27 2012
# //
# // Copyright 1991-2012 Mentor Graphics Corporation
# // All Rights Reserved.
# //
# // THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION
# // WHICH IS THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS
# // LICENSORS AND IS SUBJECT TO LICENSE TERMS.
# //
# Loading sv_std.std
# Loading work.sv_ams_sin_voltage_gen(fast)
# ** Fatal: ** Error: (vsim-3828) Could not link ‘dpi_auto_compile.dll’: cmd = ‘C:\modeltech_10.1c\gcc-4.2.1-mingw32vc9\bin\gcc.exe -shared -o “C:\cygwin\tmp\abdoo@ABDOO-PC_dpi_7916\win32_gcc-4.9.0\dpi_auto_compile.dll” C:/Users/abdoo/work_dpi\auto_compile@\win32_gcc-4.9.0*.o -L"C:\modeltech_10.1c\win32" -lmtipli’
#
# (vsim-50) A call to system(C:\modeltech_10.1c\gcc-4.2.1-mingw32vc9\bin\gcc.exe -shared -o “C:\cygwin\tmp\abdoo@ABDOO-PC_dpi_7916\win32_gcc-4.9.0\dpi_auto_compile.dll” C:/Users/abdoo/work_dpi\auto_compile@\win32_gcc-4.9.0*.o -L"C:\modeltech_10.1c\win32" -lmtipli) returned error code ‘1’.
#
# The logfile contains the following messages:
#
# gcc.exe: error: C:/Users/abdoo/work_dpi\auto_compile@\win32_gcc-4.9.0*.o: Invalid argument
#
#
# No such file or directory. (errno = ENOENT)
#
#
#
# FATAL ERROR while loading design
# Error loading design
Error loading design
In reply to saketa:
I was assuming the error appears during compilation. The vsim command needs to know where to look for the linked C-object (.dll for windows, .so for Linux). There is the switch -sv_lib. You have to point to the right place.
In reply to saketa:
the vsim command should look like this
vsim -sv_lib C:/Users/xx/example …
if your .dll file is available in C:/Users/xx/example