在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

相关文章
相关标签/搜索