Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8bc71e6
debug signals
kavitha-etl Jun 25, 2025
207edef
syntax fix
kavitha-etl Jun 25, 2025
df79ad7
net type
kavitha-etl Jun 25, 2025
d71e232
debug signals
kavitha-etl Jul 2, 2025
05d1d22
syntax fix
kavitha-etl Jul 2, 2025
6857995
add clock signal
kavitha-etl Jul 2, 2025
3aed9f7
remove clock output
kavitha-etl Jul 7, 2025
59ccec6
syntax fix
kavitha-etl Jul 7, 2025
1ee830f
clock enable
kavitha-etl Jul 7, 2025
8ba0524
remove some debug signals
kavitha-etl Jul 7, 2025
56054b9
syntax fix
kavitha-etl Jul 7, 2025
6078cd7
remove few more signals
kavitha-etl Jul 7, 2025
ad58735
multiple drivers
kavitha-etl Jul 10, 2025
a936332
default settings
kavitha-etl Jul 10, 2025
a5c4b22
oddr fix
kavitha-etl Jul 10, 2025
e9be3f9
parameter default change
kavitha-etl Jul 10, 2025
cccca8d
idelay integration
kavitha-etl Jul 10, 2025
9d05adb
parameter change
kavitha-etl Jul 10, 2025
c5091a2
rst definition
kavitha-etl Jul 10, 2025
1b44b07
syntax fix
kavitha-etl Jul 10, 2025
0d9b7f9
another syntax fix :(
kavitha-etl Jul 10, 2025
0b3144d
oddr parameters
kavitha-etl Jul 10, 2025
27c351b
another try with out iddr
kavitha-etl Jul 10, 2025
08df341
pulse for enable
kavitha-etl Jul 11, 2025
98705e5
fixed counter value
kavitha-etl Jul 11, 2025
73256cf
ref clk addition
kavitha-etl Jul 11, 2025
a1b32ef
syntax fix
kavitha-etl Jul 11, 2025
071d4c0
rst connection
kavitha-etl Jul 11, 2025
494151e
change clock polarity
kavitha-etl Jul 14, 2025
d26e30c
remove idelay control
kavitha-etl Jul 14, 2025
e6cb0c6
clock negative edge
kavitha-etl Jul 14, 2025
68cb8df
clean up and remove vio
kavitha-etl Jul 14, 2025
6637c6a
remove debug signal
kavitha-etl Jul 15, 2025
380e922
remove debug signals
kavitha-etl Jul 15, 2025
6f23728
revert unnecessary changes
kavitha-etl Jul 15, 2025
8a32def
clean up
kavitha-etl Jul 15, 2025
3453421
delay value as parameter
kavitha-etl Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 38 additions & 74 deletions rtl/iddr.v
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,15 @@ THE SOFTWARE.
*/
module iddr #
(
// target ("SIM", "GENERIC", "XILINX", "ALTERA")
parameter TARGET = "GENERIC",
// IODDR style ("IODDR", "IODDR2")
// Use IODDR for Virtex-4, Virtex-5, Virtex-6, 7 Series, Ultrascale
// Use IODDR2 for Spartan-6
parameter IODDR_STYLE = "IODDR2",
// Width of register in bits
parameter WIDTH = 1,
parameter INSERT_BUFFERS = "FALSE"
parameter INSERT_BUFFERS = "FALSE",
// Can be count or time depending on delay type
parameter [8:0] DELAY_VALUE = 9'h19
)
(
input wire clk,

// Data input
input wire [WIDTH-1:0] d,

output wire [WIDTH-1:0] q1,
Expand All @@ -66,6 +62,8 @@ Provides a consistent input DDR flip flop across multiple FPGA families

*/
wire [WIDTH-1:0] d_int;
wire [WIDTH-1:0] delayed_data_int;

genvar n;

generate
Expand All @@ -81,83 +79,50 @@ end else begin
assign d_int = d;
end

if (TARGET == "XILINX") begin
for (n = 0; n < WIDTH; n = n + 1) begin : iddr
if (IODDR_STYLE == "IODDR") begin
IDDR #(
.DDR_CLK_EDGE("SAME_EDGE_PIPELINED"),
.SRTYPE("ASYNC")
)
iddr_inst (
.Q1(q1[n]),
.Q2(q2[n]),
.C(clk),
.CE(1'b1),
.D(d_int[n]),
.R(1'b0),
.S(1'b0)
);
end else if (IODDR_STYLE == "IODDR2") begin
wire q1_int;
reg q1_delay;

IDDR2 #(
.DDR_ALIGNMENT("C0")
)
iddr_inst (
.Q0(q1_int),
.Q1(q2[n]),
.C0(clk),
.C1(~clk),
.CE(1'b1),
.D(d_int[n]),
.R(1'b0),
.S(1'b0)
);

always @(posedge clk) begin
q1_delay <= q1_int;
end

assign q1[n] = q1_delay;
end
end
end else if (TARGET == "ALTERA") begin
wire [WIDTH-1:0] q1_int;
reg [WIDTH-1:0] q1_delay;

altddio_in #(
.WIDTH(WIDTH),
.POWER_UP_HIGH("OFF")
for (n = 0; n < WIDTH; n = n + 1) begin : iddr
// Use IDELAYE3 for Ultrascale and Ultrascale+ devices to adjust delay between clock and data
// found delay count value by sweeping and checking the output
IDELAYE3 #(
.CASCADE("NONE"),
.DELAY_FORMAT("COUNT"), // Units of the DELAY_VALUE (COUNT, TIME)
.DELAY_SRC("IDATAIN"),
.DELAY_TYPE("FIXED"),
.DELAY_VALUE(9'h19),
.IS_CLK_INVERTED(1'b0),
.IS_RST_INVERTED(1'b0),
.REFCLK_FREQUENCY(300.0),
.SIM_DEVICE("ULTRASCALE_PLUS"),
.UPDATE_MODE("ASYNC")
)
altddio_in_inst (
.aset(1'b0),
.datain(d_int),
.inclocken(1'b1),
.inclock(clk),
.aclr(1'b0),
.dataout_h(q1_int),
.dataout_l(q2)
IDELAYE3_inst (
.CASC_OUT(),
.CNTVALUEOUT(),
.DATAOUT(delayed_data_int[n]),
.CASC_IN(0),
.CASC_RETURN(0),
.CE(0),
.CLK(clk),
.CNTVALUEIN(0),
.DATAIN(0),
.EN_VTC(0),
.IDATAIN(d_int[n]),
.INC(0),
.LOAD(0),
.RST(0)
);

always @(posedge clk) begin
q1_delay <= q1_int;
end

assign q1 = q1_delay;
end else begin
end
reg [WIDTH-1:0] d_reg_1 = {WIDTH{1'b0}};
reg [WIDTH-1:0] d_reg_2 = {WIDTH{1'b0}};

reg [WIDTH-1:0] q_reg_1 = {WIDTH{1'b0}};
reg [WIDTH-1:0] q_reg_2 = {WIDTH{1'b0}};

always @(posedge clk) begin
d_reg_1 <= d_int;
d_reg_1 <= delayed_data_int;
end

always @(negedge clk) begin
d_reg_2 <= d_int;
d_reg_2 <= delayed_data_int;
end

always @(posedge clk) begin
Expand All @@ -167,7 +132,6 @@ end else begin

assign q1 = q_reg_1;
assign q2 = q_reg_2;
end

endgenerate

Expand Down
15 changes: 8 additions & 7 deletions rtl/rgmii_phy_if.v
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ THE SOFTWARE.
module rgmii_phy_if #
(
// target ("SIM", "GENERIC", "XILINX", "ALTERA")
parameter TARGET = "GENERIC",
parameter TARGET = "XILINX",
// IODDR style ("IODDR", "IODDR2")
// Use IODDR for Virtex-4, Virtex-5, Virtex-6, 7 Series, Ultrascale
// Use IODDR2 for Spartan-6
parameter IODDR_STYLE = "IODDR2",
parameter IODDR_STYLE = "IODDR",
// Clock input style ("BUFG", "BUFR", "BUFIO", "BUFIO2")
// Use BUFR for Virtex-6, 7-series
// Use BUFG for Virtex-5, Spartan-6, Ultrascale
parameter CLOCK_INPUT_STYLE = "BUFG",
parameter CLOCK_INPUT_STYLE = "BUFIO",
// Use 90 degree clock for RGMII transmit ("TRUE", "FALSE")
parameter USE_CLK90 = "TRUE",
parameter INSERT_BUFFERS = "TRUE"
parameter INSERT_BUFFERS = "TRUE",
// Delay value for input data in count or time units
parameter [8:0] DELAY_VALUE = 9'h19
)
(
// Reset, synchronous to gmii_gtx_clk
Expand Down Expand Up @@ -93,17 +95,16 @@ module rgmii_phy_if #
wire clk;

// receive

wire rgmii_rx_ctl_1;
wire rgmii_rx_ctl_2;

ssio_ddr_in #
(
.TARGET(TARGET),
.CLOCK_INPUT_STYLE(CLOCK_INPUT_STYLE),
.IODDR_STYLE(IODDR_STYLE),
.WIDTH(5),
.INSERT_BUFFERS(INSERT_BUFFERS)
.INSERT_BUFFERS(INSERT_BUFFERS),
.DELAY_VALUE (DELAY_VALUE)
)
rx_ssio_ddr_inst (
.input_clk(rgmii_rxc),
Expand Down
14 changes: 6 additions & 8 deletions rtl/ssio_ddr_in.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ module ssio_ddr_in #
(
// target ("SIM", "GENERIC", "XILINX", "ALTERA")
parameter TARGET = "GENERIC",
// IODDR style ("IODDR", "IODDR2")
// Use IODDR for Virtex-4, Virtex-5, Virtex-6, 7 Series, Ultrascale
// Use IODDR2 for Spartan-6
parameter IODDR_STYLE = "IODDR2",
// Clock input style ("BUFG", "BUFR", "BUFIO", "BUFIO2")
// Use BUFR for Virtex-6, 7-series
// Use BUFG for Virtex-5, Spartan-6, Ultrascale
parameter CLOCK_INPUT_STYLE = "BUFG",
// Width of register in bits
parameter WIDTH = 1,
parameter INSERT_BUFFERS = "FALSE"
parameter INSERT_BUFFERS = "FALSE",
parameter [8:0] DELAY_VALUE = 9'h19
)
(
input wire input_clk,
Expand Down Expand Up @@ -145,11 +142,12 @@ end

endgenerate



iddr #(
.TARGET(TARGET),
.IODDR_STYLE(IODDR_STYLE),
.WIDTH(WIDTH),
.INSERT_BUFFERS(INSERT_BUFFERS)
.INSERT_BUFFERS(INSERT_BUFFERS),
.DELAY_VALUE(DELAY_VALUE)
)
data_iddr_inst (
.clk(clk_io),
Expand Down
Loading