在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