在VerilogHDL中调用VHDL的模块

最近忽然要用到在VerilogHDL中调用VHDL的模块,从网上找了例程,把自己会忘掉的东西记在这里,。

2选1多路复用器的VHDL描述:
entity mux2_1 is
port(
dina : in bit;
dinb : in bit;
sel : in bit;
dout : out bit
);
end mux2_1;

architecture Behavioral of mux2_1 is
begin
dout <= dina when sel = '0' else dinb;
end Behavioral;
verilog中2选1多路复用器的例化:
module mux2_1_top
(
input dina,
input dinb,
input sel,
output dout
);
//------------------
// call mux2_1 module
mux2_1 u_mux2_1(
.dina ( dina ),
.dinb ( dinb ),
.sel ( sel ),
.dout ( dout )
);

endmodule

 

posted @ 2017-12-24 14:16  风尘孤客  阅读(1905)  评论(0编辑  收藏  举报