在VerilogHDL中調用VHDL的模塊

最近突然要用到在VerilogHDL中調用VHDL的模塊,從網上找了例程,把本身會忘掉的東西記在這裏,。input

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

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 )
);io

endmodulemodule

相關文章
相關標籤/搜索