2

I'm currently reviewing 2 types of code (VHDL and Verilog). I trying to combine some function from Verilog into VHDL code by using Quartus. Is it possible to do it directly in Quartus? Or any recommend free Verilog2VHDL converter?

Ben Dan
  • 31
  • 2

1 Answers1

3

There's no way to call a Verilog function from VHDL directly.

What you'll have to do is wrap the function in an module so that the function gets called whenever the inputs change, and make an assignment to the output.

module wrap_function(input arg1,arg2, output arg3);

function Vfunction(input arg1, arg2);
   begin
   // whatever 
   Vfunction = ...;
   end
endfunction

assign arg3 = Vfunction(arg1,arg2);
endmodule

Then you can instantiate this module in a similar VHDL entity wrapper that has a procedure the modifies the input and captures the outputs.

ecm
  • 2,583
  • 4
  • 21
  • 29
dave_59
  • 39,096
  • 3
  • 24
  • 63