My experience is that it is possible to instantiate a verilog module
inside a VHDL architecture, both using component instantiation and entity
instantiation, in most tools, for both synthesis and simulation.
Significantly, Altera Quartus does not allow entity instantiation, which
means if you want Altera compatibility you will need to write a component
declaration for each Verilog module.
Things that don't work the way you'd want:
- heirarchical references typically can't go across a VHDL/Verilog
boundary.
Things to avoid for portability:
- (for ports) types other than std_logic, std_logic_vector
- (for generics/parameters) types other than integer and string
- in some tools (e.g. older Modelsim), port mappings can only be to
signals. It is not possible to map a port to a constant, for example.
Example:
module foo
#(
parameter bar = 1
)
(
input wire bletch,
output reg baz = 1'b0
);
You could instantiate this as an entity, provided that it has already
been compiled into the work library:
some_label : entity work.foo
generic map (
bar => 2
)
port map (
bletch => signal1,
baz => signal2
);
Or if you really like typing you could instantiate module foo as a
component:
component foo is
generic (
bar : integer := 1
);
port (
bletch : in std_logic;
baz : out std_logic
);
end component foo;
...
some_label : component foo
generic map (
bar => 2
)
port map (
bletch => signal1,
baz => signal2
);
Note that the keyword "component" is optional in a component
instantiation. Most people leave it out.
Regards,
Allan