|
发表于 2021-11-17 11:20:43
|
显示全部楼层
假定你的模块叫xxx,并且所有的port都要接到pad上,可以参考下面的代码。
你的代码里信号都是单向的,input或output,因此IE和OEN接成定值即可。针对input,I任意,OEN为1,此时I不起作用。针对output,C不需要使用。
module xxx_wrapper(
input wire pad_clk_main_in ,
input wire pad_sd_in ,
input wire pad_rst_n ,
input wire [1:0] pad_cfg_curr_mode,
inout wire pad_sd_out ,
inout wire [5:0] pad_rpt_rz_err ,
inout wire pad_PWM_R ,
inout wire pad_PWM_G ,
inout wire pad_PWM_B ,
inout wire [1:0] pad_curr_mode_out
);
wire pad_clk_main_in ;
wire pad_sd_in ;
wire pad_rst_n ;
wire [1:0] pad_cfg_curr_mode;
wire pad_sd_out ;
wire [5:0] pad_rpt_rz_err ;
wire pad_PWM_R ;
wire pad_PWM_G ;
wire pad_PWM_B ;
wire [1:0] pad_curr_mode_out;
xxx u_xxx(
.clk_main_in (clk_main_in ),
.sd_in (sd_in ),
.rst_n (rst_n ),
.cfg_curr_mode(cfg_curr_mode),
.sd_out (sd_out ),
.rpt_rz_err (rpt_rz_err ),
.PWM_R (PWM_R ),
.PWM_G (PWM_G ),
.PWM_B (PWM_B ),
.curr_mode_out(curr_mode_out)
);
// input
PBSDxR u_pad_00(.IE(1'b1),.C(clk_main_in ),.I(1'b0),.OEN(1'b1),.PAD(pad_clk_main_in ));
PBSDxR u_pad_01(.IE(1'b1),.C(sd_in ),.I(1'b0),.OEN(1'b1),.PAD(pad_sd_in ));
PBSDxR u_pad_02(.IE(1'b1),.C(rst_n ),.I(1'b0),.OEN(1'b1),.PAD(pad_rst_n ));
PBSDxR u_pad_03(.IE(1'b1),.C(cfg_curr_mode[0]),.I(1'b0),.OEN(1'b1),.PAD(pad_cfg_curr_mode[0]));
PBSDxR u_pad_04(.IE(1'b1),.C(cfg_curr_mode[1]),.I(1'b0),.OEN(1'b1),.PAD(pad_cfg_curr_mode[1]));
// output
PBSDxR u_pad_05(.IE(1'b0),.C(),.I(sd_out ),.OEN(1'b0),.PAD(pad_sd_out ));
PBSDxR u_pad_06(.IE(1'b0),.C(),.I(rpt_rz_err[0] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[0] ));
PBSDxR u_pad_07(.IE(1'b0),.C(),.I(rpt_rz_err[1] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[1] ));
PBSDxR u_pad_08(.IE(1'b0),.C(),.I(rpt_rz_err[2] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[2] ));
PBSDxR u_pad_09(.IE(1'b0),.C(),.I(rpt_rz_err[3] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[3] ));
PBSDxR u_pad_10(.IE(1'b0),.C(),.I(rpt_rz_err[4] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[4] ));
PBSDxR u_pad_11(.IE(1'b0),.C(),.I(rpt_rz_err[5] ),.OEN(1'b0),.PAD(pad_rpt_rz_err[5] ));
PBSDxR u_pad_12(.IE(1'b0),.C(),.I(PWM_R ),.OEN(1'b0),.PAD(pad_PWM_R ));
PBSDxR u_pad_13(.IE(1'b0),.C(),.I(PWM_G ),.OEN(1'b0),.PAD(pad_PWM_G ));
PBSDxR u_pad_14(.IE(1'b0),.C(),.I(PWM_B ),.OEN(1'b0),.PAD(pad_PWM_B ));
PBSDxR u_pad_15(.IE(1'b0),.C(),.I(curr_mode_out[0]),.OEN(1'b0),.PAD(pad_curr_mode_out[0]));
PBSDxR u_pad_16(.IE(1'b0),.C(),.I(curr_mode_out[1]),.OEN(1'b0),.PAD(pad_curr_mode_out[1]));
endmodule |
|