Reputation: 31
I have this Systemverilog testbench, in which I want to use a package written in VHDL.
When I do: 'include "desired_pkg.vhd"
, it appararantly interpretes is a Verilog package, as ModelSim reports:
Error: (vlog-13069) ** while parsing file included at C:/Users/VHDL/CO_code/CO_18_03/simulation/ed_sim/models/tb_top.sv(22)
** at C:/Users/VHDL/CO_code/CO_18_03/CO_simulation/mentor/020_regmaps_struct_pkg.vhd(1): near "--": syntax error, unexpected --, expecting class.
So it tries to interpret --
(comment in VHDL) as something in Verilog. How to include this package without rewriting it into Verilog?
Upvotes: 1
Views: 4844
Reputation: 31
Thanks. It works with Modelsim.
In the seek of completeness, let me add some details below:
-mixedsvvh
-mixedsvvh
when compiling my SystemVerilog moduleimport my_pkg::*;
at the beginning of my SystemVerilog module fileMy two cents ;)
Upvotes: 3
Reputation: 4516
you dont use include as that is a pre-processor directive, and assumes the included code is verilog. You need to import
the code:
import vhdl_lib::desired_pkg::*
But be aware, importing VHDL from verilog is not defined by any standard, and is purely down to the tool whether it even works, and what items in the package are supported.
Upvotes: 3