Analyzing design...
-- Loading module test
Incremental compilation check found no design-units have changed.
Optimized design name is opt_test
H:\modelsim-project\data_passing>gcc -I H:\questa_sim_10.0c;\include -shared -g
-o foreign.dll foreign.c -lmtipli -L H:\questa_sim_10.0c;\win32
foreign.c: In function 'print_int':
foreign.c:5: warning: incompatible implicit declaration of built-in function 'pr
intf'
foreign.c: In function 'print_logic':
foreign.c:12: warning: incompatible implicit declaration of built-in function 'p
rintf'
h:/questa_sim_10.0c/bin/../libexec/gcc/mingw32/4.2.1/ld.exe: cannot find -lmtipl
i
collect2: ld returned 1 exit status
Analyzing design...
-- Loading module test
Incremental compilation check found no design-units have changed.
Optimized design name is opt_test
H:\modelsim-project\data_passing>gcc -I H:\questa_sim_10.0c\include -shared -g -
o foreign.dll foreign.c -lmtipli -L H:\questa_sim_10.0c\win32
foreign.c: In function 'print_int':
foreign.c:5: warning: incompatible implicit declaration of built-in function 'pr
intf'
foreign.c: In function 'print_logic':
foreign.c:12: warning: incompatible implicit declaration of built-in function 'p
rintf'
在questa Sim中点击run后,得到如下结果:
# // Questa Sim
# // Version 10.0c win32 Jul 21 2011
# //
# // Copyright 1991-2011 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.
# //
# vsim -do {view source} -i -sv_lib foreign opt_test
# Loading sv_std.std
# Loading work.test(fast)
# Loading .\foreign.dll
# view source
# .main_pane.source.interior.cs.body.editor
#
run
# Just received a value of 0.
# Just received a value of 1.
# Just received a value of -12.
# Just received a value of 0.
# Just received a value of 1.
# Just received a value of 0.
# Just received a value of 1.
# Just received a value of 0.
# Just received a value of logic X.
# Just received a value of logic Z.
# Just received a value of logic 0.