在用DCM这个IP核时,它的输入时钟为全局时钟引脚输入,输出有两种情况,第一,可以直接接在全局时钟引脚;第二,可以通过ODDR2原语接在普通IO引脚;说下第二种是怎么用的;
DCM DCM_INST (
.CLKIN ( CLKIN ),
.CLKOUT ( clkout_w)
);
如果clkout_w要接到普通IO引脚,则需要通过ODDR2原语,如下所示:
wire clkout_w;
ODDR2 #(
.DDR_ALIGNMENT("NONE"), //sets output alignment to "NONE","C0","C1"
.INIT(1‘b0), //set initial state of the Q
.SRTYPE("SYNC") //specifies "SYNC" or "ASYNC" set/reset
)
ODDR2_inst (
.Q( CLKOUT ), //1-bit DDR output data
.C0( clkout_w), //1-bit clock input
.C1( ~clkout_w), //1-bit clock input
.CE( 1‘b1 ), //1-bit clock enable input
.D0( 1‘b1 ), //1-bit data input ( associated with C0 )
.D1( 1‘b0 ), //1-bit data input ( associated with C1 )
.R( 1‘b0 ), //1-bit reset input
.S( 1‘b0 ) //1-bit set input
);
clkout_w通过ODDR2原语输出给CLKOUT,CLKOUT可以直接配置在普通IO引脚上。