Skip to content

Commit 51e2db4

Browse files
authored
Merge pull request #417 from os-fpga/example_designs
updated RTL of primitive_example_design_14 and primitive_example_desi…
2 parents 8b982f4 + e5eb21c commit 51e2db4

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_14/rtl/primitive_example_design_14.v

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ module primitive_example_design_14
33
input clk_in,
44
input reset,
55
input i1,
6-
input i2,
6+
input [WIDTH-1:0] i2,
77
output reg [WIDTH-1:0] data_out,
8-
input RX_RST,
98
input BITSLIP_ADJ,
109
output CLK_OUT,
1110
output DATA_VALID,
@@ -14,45 +13,57 @@ module primitive_example_design_14
1413
input PLL_CLK
1514
);
1615

17-
wire data_in;
1816
reg [WIDTH-1:0] data_out_flop;
1917
reg enable, pll_lock;
18+
wire i1_ibuf;
19+
reg [WIDTH-1:0] dff_out;
20+
21+
I_BUF i_buf_inst1 (.I(clk_in),.EN(en),.O(clk_in_ibuf));
22+
I_BUF i_buf_inst2 (.I(i1),.EN(en),.O(i1_ibuf));
23+
CLK_BUF clk_buf_inst (.I(clk_in_ibuf), .O(clk_in_clkbuf));
2024

2125
I_SERDES inst(
22-
.D(data_in),
23-
.RST(RX_RST),
26+
.D(i1_ibuf),
27+
.RST(reset),
2428
.BITSLIP_ADJ(BITSLIP_ADJ),
2529
.EN(enable),
26-
.CLK_IN(clk_in),
30+
.CLK_IN(clk_in_clkbuf),
2731
.CLK_OUT(CLK_OUT),
2832
.Q(data_out_flop),
2933
.DATA_VALID(DATA_VALID),
3034
.DPA_LOCK(DPA_LOCK),
3135
.DPA_ERROR(DPA_ERROR),
3236
.PLL_LOCK(pll_lock),
33-
.PLL_CLK(PLL_CLK)
37+
.PLL_CLK(pll_clk)
38+
);
39+
40+
PLL #(.PLL_MULT(50), .PLL_DIV(1), .PLL_POST_DIV(17)) clk_pll_gen0 (
41+
.PLL_EN(1'b1),
42+
.CLK_IN(clk_pll_in),
43+
.CLK_OUT(pll_clk),
44+
.LOCK(pll_lock)
3445
);
3546

36-
assign data_in = i1*i2;
47+
BOOT_CLOCK boot_clk_inst (clk_pll_in);
48+
49+
assign data_out = (dff_out + i2) * (dff_out - i2);
3750

38-
always @ (posedge clk_in or negedge reset)
51+
always @ (posedge clk_in_clkbuf or negedge reset)
3952
begin
4053
if(!reset) begin
4154
enable <= 1'b0;
42-
pll_lock <= 1'b0;
4355
end
4456
else begin
4557
enable <= 1'b1;
46-
pll_lock <= 1'b1;
4758
end
4859
end
4960

50-
always @ (posedge clk_in or negedge reset)
61+
always @ (posedge clk_in_clkbuf or negedge reset)
5162
begin
5263
if(!reset)
53-
data_out <= 0;
64+
dff_out <= 0;
5465
else
55-
data_out <= data_out_flop;
66+
dff_out <= data_out_flop;
5667
end
5768

5869
endmodule

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_6/rtl/primitive_example_design_6.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
module primitive_example_design_6(clk,in,rst,q_p,q_n,oddr_en,ibuf_oe1,ibuf_oe2,ibuf_oe3,ibuf_oe4);
1+
module primitive_example_design_6(clk,in,rst,q,q_p,q_n,oddr_en,ibuf_oe1,ibuf_oe2,ibuf_oe3,ibuf_oe4);
22

33
input [1:0] in;
44
input clk, rst;
55
input ibuf_oe1,ibuf_oe2,ibuf_oe3,ibuf_oe4;
66
input oddr_en;
7+
output q;
78
output q_p;
89
output q_n;
910

@@ -16,14 +17,15 @@ wire i_clk_buf_out;
1617

1718
I_BUF i_buf_inst (.I(clk),.EN(ibuf_oe1),.O(i_clk_buf_out));
1819
CLK_BUF clk_buf_inst (.I(i_clk_buf_out), .O(clk_buf_out));
19-
O_DDR iddr_ist1 (.D(i_buf_out),.R(rst_i_buf_out),.E(oddr_en),.C(clk_buf_out),.Q(oddr_out));
20+
O_DDR iddr_ist1 (.D(oddr_in),.R(rst_i_buf_out),.E(oddr_en),.C(clk_buf_out),.Q(q));
2021

21-
O_BUFT_DS o_buft_inst1 (.I(dffre_out),.O_N(q_n),.O_P(q_p),.T(1'b1));
22+
O_BUFT_DS o_buft_inst1 (.I(o_buf_ds_in),.O_N(q_n),.O_P(q_p),.T(1'b1));
2223

2324
I_BUF ibuf_inst1 (.I(in[0]),.EN(ibuf_oe2),.O(i_buf_out[0]));
2425
I_BUF ibuf_inst2 (.I(in[1]),.EN(ibuf_oe3),.O(i_buf_out[1]));
2526
I_BUF ibuf_inst4 (.I(rst),.EN(ibuf_oe4),.O(rst_i_buf_out));
2627

27-
DFFRE ff_inst1 (.D(oddr_out),.R(rst_i_buf_out),.E(1'b1),.C(clk_buf_out),.Q(dffre_out));
28+
DFFRE ff_inst1 (.D(i_buf_out[0]),.R(rst_i_buf_out),.E(1'b1),.C(clk_buf_out),.Q(oddr_in));
29+
DFFRE ff_inst2 (.D(i_buf_out[1]),.R(rst_i_buf_out),.E(1'b1),.C(clk_buf_out),.Q(o_buf_ds_in));
2830

2931
endmodule

0 commit comments

Comments
 (0)