Skip to content

Commit cccca8d

Browse files
committed
idelay integration
1 parent e9be3f9 commit cccca8d

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

rtl/iddr.v

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
6876
wire [WIDTH-1:0] d_int;
77+
wire [WIDTH-1:0] delayed_data_int;
6978
genvar n;
7079

7180
generate
@@ -83,6 +92,37 @@ end
8392

8493
if (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
);

rtl/rgmii_phy_if.v

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module rgmii_phy_if #
4545
parameter CLOCK_INPUT_STYLE = "BUFIO",
4646
// Use 90 degree clock for RGMII transmit ("TRUE", "FALSE")
4747
parameter USE_CLK90 = "TRUE",
48-
parameter INSERT_BUFFERS = "FALSE"
48+
parameter INSERT_BUFFERS = "TRUE"
4949
)
5050
(
5151
// Reset, synchronous to gmii_gtx_clk
@@ -90,7 +90,15 @@ module rgmii_phy_if #
9090
input wire [1:0] speed,
9191
output wire [47:0] debug_rgmii,
9292
output wire rx_rgmii_clk,
93-
output wire rx_gmii_clk
93+
output wire rx_gmii_clk,
94+
95+
input wire rst,
96+
input wire en,
97+
input wire en_vtc,
98+
input wire inc,
99+
input wire load,
100+
input wire [8:0] cnt_value_in,
101+
output wire [(WIDTH*9)-1:0] cnt_value_out
94102

95103

96104

@@ -165,7 +173,14 @@ rx_ssio_ddr_inst (
165173
.input_d({rgmii_rd, rgmii_rx_ctl}),
166174
.output_clk(gmii_rx_clk),
167175
.output_q1({gmii_rxd[3:0], rgmii_rx_ctl_1}),
168-
.output_q2({gmii_rxd[7:4], rgmii_rx_ctl_2})
176+
.output_q2({gmii_rxd[7:4], rgmii_rx_ctl_2}),
177+
.rst(rst),
178+
.en(en),
179+
.en_vtc(en_vtc),
180+
.inc(inc),
181+
.load(load),
182+
.cnt_value_in(cnt_value_in),
183+
.cnt_value_out(cnt_value_out)
169184
);
170185

171186
assign gmii_rx_dv = rgmii_rx_ctl_1;

rtl/ssio_ddr_in.v

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ module ssio_ddr_in #
5555
output wire output_clk,
5656

5757
output wire [WIDTH-1:0] output_q1,
58-
output wire [WIDTH-1:0] output_q2
58+
output wire [WIDTH-1:0] output_q2,
59+
60+
input wire rst,
61+
input wire en,
62+
input wire en_vtc,
63+
input wire inc,
64+
input wire load,
65+
input wire [8:0] cnt_value_in,
66+
output wire [(WIDTH*9)-1:0] cnt_value_out
5967
);
6068

6169
wire input_clk_int;
@@ -145,6 +153,8 @@ end
145153

146154
endgenerate
147155

156+
157+
148158
iddr #(
149159
.TARGET(TARGET),
150160
.IODDR_STYLE(IODDR_STYLE),
@@ -155,7 +165,14 @@ data_iddr_inst (
155165
.clk(clk_io),
156166
.d(input_d),
157167
.q1(output_q1),
158-
.q2(output_q2)
168+
.q2(output_q2),
169+
.rst(rst),
170+
.en(en),
171+
.en_vtc(en_vtc),
172+
.inc(inc),
173+
.load(load),
174+
.cnt_value_in(cnt_value_in),
175+
.cnt_value_out(cnt_value_out)
159176
);
160177

161178
endmodule

0 commit comments

Comments
 (0)