|
连接模块之间的模块一般思路是清楚输入和输出各个引脚之间的联系:
module exp06_top
(
CLK, RSTn,
Pin_In, Pin_Out
);
input CLK;
input RSTn;
input Pin_In;
output Pin_Out; //整个工程的输入和输出接口;
/***************************************/
wire Trig_Sig;
debounce_module2 U1
(
.CLK( CLK ),
.RSTn( RSTn ),
.Pin_In( Pin_In ), // input - from top 第一级输入给第一级的输入
.Pin_Out( Trig_Sig ) // output - to U2 第一级的输出给自己定义的一个接口
);
/***************************************/
wire SOS_En_Sig;
inter_control_module U2
(
.CLK( CLK ),
.RSTn( RSTn ),
.Trig_Sig( Trig_Sig ), // input - from U1 第一级自己定义的接口输出给第二级输入
.SOS_En_Sig( SOS_En_Sig ) // output - to U2 第二级的输出给自己定义的一接口,只是一般情况下吧自己定义的接口定义为下一级的输入的接口名称,导致初学的时候感觉很混乱
);
/***************************************/
sos_module U3
(
.CLK( CLK ),
.RSTn( RSTn ),
.SOS_En_Sig( SOS_En_Sig ), // input - from U2
.Pin_Out( Pin_Out ) // ouput - to top //系统的输出来自第三级的输出
);
/***************************************/
endmodule
这是连接模块之间的一些写法,刚开始写的时候可能感觉混乱,将每个接口来自哪里明白了就ok了~