Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] DPI and Questasim error

Status
Not open for further replies.

brainiac_rus

Newbie level 5
Joined
May 28, 2014
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
103
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>
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?
 

I get some thoughts about it.
I use win 7 x64 and may be for using C code questa needs c compiler, but in linux it is standard gcc, but in my windows it can't find it and can't do what i want. Is it true?

- - - Updated - - -

Yes, it is true!
I forgot install gcc compiler to my system, but do it and it starts to work!
Thank you for help!)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top