@@ -45,11 +45,19 @@ module iddr #
4545)
4646(
4747 input wire clk,
48+ input wire rst,
49+ input wire en,
50+ input wire en_vtc,
51+ input wire inc,
52+ input wire load,
53+ input wire [8 :0 ] cnt_value_in,
54+ output wire [(WIDTH* 9 )- 1 :0 ] cnt_value_out,
55+ // Data input
4856
4957 input wire [WIDTH- 1 :0 ] d,
5058
5159 output wire [WIDTH- 1 :0 ] q1,
52- output wire [WIDTH- 1 :0 ] q2
60+ output wire [WIDTH- 1 :0 ] q2,
5361);
5462
5563/*
@@ -66,6 +74,7 @@ Provides a consistent input DDR flip flop across multiple FPGA families
6674
6775*/
6876wire [WIDTH- 1 :0 ] d_int;
77+ wire [WIDTH- 1 :0 ] delayed_data_int;
6978genvar n;
7079
7180generate
8392
8493if (TARGET == "XILINX" ) begin
8594 for (n = 0 ; n < WIDTH; n = n + 1 ) begin : iddr
95+
96+ IDELAYE3 #(
97+ .CASCADE("NONE" ), // Cascade setting (MASTER, NONE, SLAVE_END, SLAVE_MIDDLE)
98+ .DELAY_FORMAT("COUNT" ), // Units of the DELAY_VALUE (COUNT, TIME)
99+ .DELAY_SRC("IDATAIN" ), // Delay input (DATAIN, IDATAIN)
100+ .DELAY_TYPE("VARIABLE" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
101+ .DELAY_VALUE(0 ), // Input delay value setting
102+ .IS_CLK_INVERTED(1'b0 ), // Optional inversion for CLK
103+ .IS_RST_INVERTED(1'b0 ), // Optional inversion for RST
104+ .REFCLK_FREQUENCY(125 .0 ), // IDELAYCTRL clock input frequency in MHz (200.0-800.0)
105+ .SIM_DEVICE("ULTRASCALE_PLUS" ), // Set the device version for simulation functionality (ULTRASCALE)
106+ .UPDATE_MODE("ASYNC" ) // Determines when updates to the delay will take effect (ASYNC, MANUAL, SYNC)
107+ )
108+ IDELAYE3_inst (
109+ .CASC_OUT(), // 1-bit output: Cascade delay output to ODELAY input cascade
110+ .CNTVALUEOUT(cnt_value_out[(n*9 )+8 : n*9 ]), // 9-bit output: Counter value output
111+ .DATAOUT(delayed_data_int[n]), // 1-bit output: Delayed data output
112+ .CASC_IN(0 ), // 1-bit input: Cascade delay input from slave ODELAY CASCADE_OUT
113+ .CASC_RETURN(0 ), // 1-bit input: Cascade delay returning from slave ODELAY DATAOUT
114+ .CE(en), // 1-bit input: Active-High enable increment/decrement input
115+ .CLK(clk), // 1-bit input: Clock input
116+ .CNTVALUEIN(cnt_value_in), // 9-bit input: Counter value input
117+ .DATAIN('0 ), // 1-bit input: Data input from the logic
118+ .EN_VTC(en_vtc), // 1-bit input: Keep delay constant over VT
119+ .IDATAIN(d_int[n]), // 1-bit input: Data input from the IOBUF
120+ .INC(inc), // 1-bit input: Increment / Decrement tap delay input
121+ .LOAD(load), // 1-bit input: Load DELAY_VALUE input
122+ .RST(rst) // 1-bit input: Asynchronous Reset to the DELAY_VALUE
123+ );
124+
125+
86126 if (IODDR_STYLE == "IODDR" ) begin
87127 IDDR #(
88128 .DDR_CLK_EDGE("SAME_EDGE_PIPELINED" ),
@@ -93,7 +133,7 @@ if (TARGET == "XILINX") begin
93133 .Q2(q2[n]),
94134 .C(clk),
95135 .CE(1'b1 ),
96- .D(d_int[n] ),
136+ .D(),
97137 .R(1'b0 ),
98138 .S(1'b0 )
99139 );
@@ -110,7 +150,7 @@ if (TARGET == "XILINX") begin
110150 .C0(clk),
111151 .C1(~clk),
112152 .CE(1'b1 ),
113- .D(d_int [n]),
153+ .D(delayed_data_int [n]),
114154 .R(1'b0 ),
115155 .S(1'b0 )
116156 );
0 commit comments