1

I am trying to use two vhdl module in my systemverilog project in vivado. ( which are in the same project )

I have tried using include keyword at the beginning, which gave me no errors, but fails on synthesis , here is the error

[Synth 8-2715] syntax error near -- ["C:/Users/Batuhan/Desktop/fpga_VHDL_uart/Sonar_FPGA-master/src/MCU_UART_RX.vhd":1]

The line it shows is the first line of vhdl file which is just

-----------------------------------------------------------------------------

So I was wondering what is the proper way to include other modules

2
  • 2
    You can't just "include" a VHDL file in a SystemVerilog file. You need to compile both into language-independent objects and then combine them somehow.
    – mkrieger1
    Jul 23, 2019 at 19:22
  • Can you explain more please? About how to compile both to independent objects. Jul 23, 2019 at 19:24

1 Answer 1

4

Simply instantiate them. Based on your error message I assume that you want to add MCU_UART_RX module to your testbench. So if you have a module Foo

entity Foo is
    Port ( Clk     : in STD_LOGIC;
           DataIn  : in STD_LOGIC;
           DataOut : out STD_LOGIC
           );
end Foo;

you can add this module to your System Verilog testbench by writing

bit SimulationClock;
bit SimulationDataIn;
bit SimulationDataOut;

Foo DUT(
    .Clk(SimulationClock),
    .DataIn(SimulationDataIn),
    .DataOut(SimulationDataOut)
);

Finally it look like this
enter image description here

2
  • i guess you meant .DataOut in the third port.
    – Serge
    Jul 23, 2019 at 23:31
  • Yes. Sorry for that Typo. I fixed it.
    – Kampi
    Jul 24, 2019 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.