=========================================================================
=========================================================================
参数比较运算
localparam QPLL_FBDIV_IN = (QPLL_FBDIV_TOP == 16) ? 10'b0000100000 :
(QPLL_FBDIV_TOP == 20) ? 10'b0000110000 :
(QPLL_FBDIV_TOP == 32) ? 10'b0001100000 :
(QPLL_FBDIV_TOP == 40) ? 10'b0010000000 :
(QPLL_FBDIV_TOP == 64) ? 10'b0011100000 :
(QPLL_FBDIV_TOP == 66) ? 10'b0101000000 :
(QPLL_FBDIV_TOP == 80) ? 10'b0100100000 :
(QPLL_FBDIV_TOP == 100) ? 10'b0101110000 : 10'b0000000000;
=========================================================================
参数选择编译
generate
if(C_CLK_IN_TYPE==0)begin: IBUF_U
IBUF IBUF_u(
.I(clk_in_p ),
.O(clk_in_buf)
);
end
if(C_CLK_IN_TYPE==1)begin: IBUFDS_U
IBUFDS IBUFDS_u(
.I (clk_in_p ),
.IB(clk_in_n ),
.O (clk_in_buf)
);
end
if(C_CLK_IN_TYPE==2)begin: IBUFDS_GTE2_U
IBUFDS_GTE2 IBUFDS_GTE2_u(
.I (clk_in_p ),.ODIV2( ),
.IB(clk_in_n ),.CEB (1'b0),
.O (clk_in_buf)
);
end
endgenerate