@@ -44,7 +44,8 @@ module ssio_ddr_in #
4444 // Use BUFG for Virtex-5, Spartan-6, Ultrascale
4545 parameter CLOCK_INPUT_STYLE = "BUFG" ,
4646 // Width of register in bits
47- parameter WIDTH = 1
47+ parameter WIDTH = 1 ,
48+ parameter INSERT_BUFFERS = "FALSE"
4849)
4950(
5051 input wire input_clk,
@@ -57,11 +58,21 @@ module ssio_ddr_in #
5758 output wire [WIDTH- 1 :0 ] output_q2
5859);
5960
61+ wire input_clk_int;
6062wire clk_int;
6163wire clk_io;
6264
6365generate
6466
67+ if (INSERT_BUFFERS == "TRUE" ) begin
68+ IBUF IBUF_inst (
69+ .I(input_clk),
70+ .O(input_clk_int)
71+ );
72+ end else begin
73+ assign input_clk_int = input_clk;
74+ end
75+
6576if (TARGET == "XILINX" ) begin
6677
6778 // use Xilinx clocking primitives
@@ -71,7 +82,7 @@ if (TARGET == "XILINX") begin
7182 // buffer RX clock
7283 BUFG
7384 clk_bufg (
74- .I(input_clk ),
85+ .I(input_clk_int ),
7586 .O(clk_int)
7687 );
7788
@@ -81,7 +92,7 @@ if (TARGET == "XILINX") begin
8192
8293 end else if (CLOCK_INPUT_STYLE == "BUFR" ) begin
8394
84- assign clk_int = input_clk ;
95+ assign clk_int = input_clk_int ;
8596
8697 // pass through RX clock to input buffers
8798 BUFIO
@@ -103,7 +114,7 @@ if (TARGET == "XILINX") begin
103114
104115 end else if (CLOCK_INPUT_STYLE == "BUFIO" ) begin
105116
106- assign clk_int = input_clk ;
117+ assign clk_int = input_clk_int ;
107118
108119 // pass through RX clock to input buffers
109120 BUFIO
@@ -124,10 +135,10 @@ if (TARGET == "XILINX") begin
124135end else begin
125136
126137 // pass through RX clock to input buffers
127- assign clk_io = input_clk ;
138+ assign clk_io = input_clk_int ;
128139
129140 // pass through RX clock to logic
130- assign clk_int = input_clk ;
141+ assign clk_int = input_clk_int ;
131142 assign output_clk = clk_int;
132143
133144end
@@ -137,7 +148,8 @@ endgenerate
137148iddr #(
138149 .TARGET(TARGET),
139150 .IODDR_STYLE(IODDR_STYLE),
140- .WIDTH(WIDTH)
151+ .WIDTH(WIDTH),
152+ .INSERT_BUFFERS(INSERT_BUFFERS)
141153)
142154data_iddr_inst (
143155 .clk(clk_io),
0 commit comments