在一个模块中引用另一个模块,对其端口进行相关连接,叫做模块例化。模块例化建立了描述的层次。信号端口可以通过位置或名称关联,端口连接也必须遵循一些规则。
根据信号名字例化根据
module top_module (
input a,
input b,
input c,
input d,
output out1,
output out2
);
mod_a mod_a_inst(
.in1 (a),
.in2 (b),
.in3 (c),
.in4 (d),
.out1 (out1),
.out2 (out2)
);
endmodule
根据被例化模信号顺序进行例化
module top_module (
input a,
input b,
input c,
input d,
output out1,
output out2
);
mod_a mod_a_inst( out1, out2, a, b, c, d );
endmodule