在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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM