brainiac_rus
Newbie level 5
Hello!
I tryed to run DPI with Questasim. I saw topics about it but version of sim changed and some things could be changed too.
My C code:
#include <svdpi.h>
//#include <gmodel_tb_top.h>
My SV code
In console of questasim I do next thing:
vlib work
vlog gmodel_tb_top.sv gmodel.c
But the output:
vlog gmodel_tb_top.sv gmodel.c
# QuestaSim-64 vlog 10.2c Compiler 2013.07 Jul 19 2013
# -- Compiling package user_math
# -- Compiling module test
# -- Importing package user_math
#
# Top level modules:
# test
# ** Error: gmodel_tb_top.sv(14): Verilog Compiler exiting
# C:/questasim64_10.2c/win64/vlog failed.
Can you help me to find an error?
I tryed to run DPI with Questasim. I saw topics about it but version of sim changed and some things could be changed too.
My C code:
#include <svdpi.h>
//#include <gmodel_tb_top.h>
Code:
int factorial(int i)
{
if(i <= 1)
{
return 1;
}
else
{
return i*factorial(i-1);
}
}
My SV code
Code:
package user_math;
import "DPI-C" function int factorial (input int i);
endpackage
module test;
import user_math::*;
initial begin
$display("%d", factorial(1));
end
endmodule
In console of questasim I do next thing:
vlib work
vlog gmodel_tb_top.sv gmodel.c
But the output:
vlog gmodel_tb_top.sv gmodel.c
# QuestaSim-64 vlog 10.2c Compiler 2013.07 Jul 19 2013
# -- Compiling package user_math
# -- Compiling module test
# -- Importing package user_math
#
# Top level modules:
# test
# ** Error: gmodel_tb_top.sv(14): Verilog Compiler exiting
# C:/questasim64_10.2c/win64/vlog failed.
Can you help me to find an error?