Skip to content

Commit 3be4e17

Browse files
authored
Merge pull request #418 from os-fpga/rtl_update
updated rtl and testbench for primitive_example_design_14 and primiti…
2 parents 51e2db4 + 586b847 commit 3be4e17

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_14/rtl/primitive_example_design_14.v

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ reg [WIDTH-1:0] data_out_flop;
1717
reg enable, pll_lock;
1818
wire i1_ibuf;
1919
reg [WIDTH-1:0] dff_out;
20+
wire clk_in_ibuf;
21+
wire clk_in_clkbuf;
22+
wire pll_clk;
23+
wire clk_pll_in;
2024

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));
25+
I_BUF i_buf_inst1 (.I(clk_in),.EN(1'b1),.O(clk_in_ibuf));
26+
I_BUF i_buf_inst2 (.I(i1),.EN(1'b1),.O(i1_ibuf));
2327
CLK_BUF clk_buf_inst (.I(clk_in_ibuf), .O(clk_in_clkbuf));
2428

2529
I_SERDES inst(

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_14/sim/co_sim_tb/co_sim_primitive_example_design_14.v

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ module co_sim_primitive_example_design_14;
66
reg clk_in;
77
reg reset;
88
reg i1;
9-
reg i2;
9+
reg [WIDTH-1:0] i2;
1010
wire [WIDTH-1:0] data_out,data_out_netlist;
11-
reg RX_RST;
1211
reg BITSLIP_ADJ;
1312
wire CLK_OUT,CLK_OUT_netlist;
1413
wire DATA_VALID,DATA_VALID_netlist;
@@ -18,22 +17,21 @@ module co_sim_primitive_example_design_14;
1817

1918
integer mismatch=0;
2019

21-
primitive_example_design_14 # (.WIDTH(WIDTH)) golden (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out),.RX_RST(RX_RST),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT),.DATA_VALID(DATA_VALID),.DPA_LOCK(DPA_LOCK),.DPA_ERROR(DPA_ERROR),.PLL_CLK(PLL_CLK));
20+
primitive_example_design_14 # (.WIDTH(WIDTH)) golden (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT),.DATA_VALID(DATA_VALID),.DPA_LOCK(DPA_LOCK),.DPA_ERROR(DPA_ERROR),.PLL_CLK(PLL_CLK));
2221
`ifdef PNR
23-
primitive_example_design_14_post_route netlist (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out_netlist),.RX_RST(RX_RST),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT_netlist),.DATA_VALID(DATA_VALID_netlist),.DPA_LOCK(DPA_LOCK_netlist),.DPA_ERROR(DPA_ERROR_netlist),.PLL_CLK(PLL_CLK));
22+
primitive_example_design_14_post_route netlist (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out_netlist),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT_netlist),.DATA_VALID(DATA_VALID_netlist),.DPA_LOCK(DPA_LOCK_netlist),.DPA_ERROR(DPA_ERROR_netlist),.PLL_CLK(PLL_CLK));
2423
`else
25-
primitive_example_design_14_post_synth netlist (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out_netlist),.RX_RST(RX_RST),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT_netlist),.DATA_VALID(DATA_VALID_netlist),.DPA_LOCK(DPA_LOCK_netlist),.DPA_ERROR(DPA_ERROR_netlist),.PLL_CLK(PLL_CLK));
24+
primitive_example_design_14_post_synth netlist (.clk_in(clk_in),.reset(reset),.i1(i1),.i2(i2),.data_out(data_out_netlist),.BITSLIP_ADJ(BITSLIP_ADJ),.CLK_OUT(CLK_OUT_netlist),.DATA_VALID(DATA_VALID_netlist),.DPA_LOCK(DPA_LOCK_netlist),.DPA_ERROR(DPA_ERROR_netlist),.PLL_CLK(PLL_CLK));
2625
`endif
2726

2827
always #1 clk_in = !clk_in;
2928
always #2.5 PLL_CLK = !PLL_CLK;
3029

3130
initial begin
32-
{clk_in,reset,i1,i2,RX_RST,BITSLIP_ADJ,PLL_CLK}<=0;
31+
{clk_in,reset,i1,i2,BITSLIP_ADJ,PLL_CLK}<=0;
3332

3433
repeat(5)@(negedge clk_in);
3534
reset<=1;
36-
RX_RST<=1;
3735
compare();
3836
repeat(5)@(negedge clk_in);
3937
// BITSLIP_ADJ<=1;
@@ -46,13 +44,13 @@ module co_sim_primitive_example_design_14;
4644
i2<=$random();
4745
compare();
4846
end
49-
RX_RST<=0;
47+
reset<=0;
5048
repeat(2)@(negedge clk_in) begin
5149
i1<=$random();
5250
i2<=$random();
5351
compare();
5452
end
55-
RX_RST<=1;
53+
reset<=1;
5654
repeat(2000)@(negedge clk_in) begin
5755
i1<=$random();
5856
i2<=$random();

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_6/rtl/primitive_example_design_6.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ wire [1:0] i_buf_out;
1414
wire rst_i_buf_out;
1515
wire clk_buf_out;
1616
wire i_clk_buf_out;
17+
wire oddr_in;
18+
wire o_buf_ds_in;
1719

1820
I_BUF i_buf_inst (.I(clk),.EN(ibuf_oe1),.O(i_clk_buf_out));
1921
CLK_BUF clk_buf_inst (.I(i_clk_buf_out), .O(clk_buf_out));

RTL_testcases/RS_Primitive_example_designs/primitive_example_design_6/sim/co_sim_tb/co_sim_primitive_example_design_6.v

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ module co_sim_primitive_example_design_6;
99
reg ibuf_oe3;
1010
reg ibuf_oe4;
1111
reg oddr_en;
12+
wire q,q_netlist;
1213
wire q_p,q_p_netlist;
1314
wire q_n,q_n_netlist;
1415

1516
integer mismatch=0;
1617

17-
primitive_example_design_6 golden (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q_p(q_p),.q_n(q_n));
18+
primitive_example_design_6 golden (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q(q),.q_p(q_p),.q_n(q_n));
1819
`ifdef PNR
19-
primitive_example_design_6_post_route netlist (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q_p(q_p_netlist),.q_n(q_n_netlist));
20+
primitive_example_design_6_post_route netlist (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q(q_netlist),.q_p(q_p_netlist),.q_n(q_n_netlist));
2021
`else
21-
primitive_example_design_6_post_synth netlist (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q_p(q_p_netlist),.q_n(q_n_netlist));
22+
primitive_example_design_6_post_synth netlist (.in(in),.clk(clk),. rst( rst),.ibuf_oe1(ibuf_oe1),.ibuf_oe2(ibuf_oe2),.ibuf_oe3(ibuf_oe3),.ibuf_oe4(ibuf_oe4),.oddr_en(oddr_en),.q(q_netlist),.q_p(q_p_netlist),.q_n(q_n_netlist));
2223
`endif
2324

2425
always #1 clk = !clk ;
@@ -73,12 +74,12 @@ module co_sim_primitive_example_design_6;
7374
end
7475

7576
task compare();
76-
if(q_n !== q_n_netlist || q_p !== q_p_netlist) begin
77-
$display("Data Mismatch. Golden q_n: %0d, Netlist q_n: %0d, Golden q_p: %0d, Netlist q_p: %0d, Time: %0t", q_n, q_n_netlist,q_p,q_p_netlist,$time);
77+
if(q_n !== q_n_netlist || q_p !== q_p_netlist || q !== q_netlist ) begin
78+
$display("Data Mismatch. Golden q_n: %0d, Netlist q_n: %0d, Golden q_p: %0d, Netlist q_p: %0d, Golden q: %0d, Netlist q: %0d, Time: %0t", q_n, q_n_netlist,q_p,q_p_netlist,q,q_netlist,$time);
7879
mismatch = mismatch+1;
7980
end
8081
else
81-
$display("Data Matched. Golden q_n: %0d, Netlist q_n: %0d, Golden q_p: %0d, Netlist q_p: %0d, Time: %0t", q_n, q_n_netlist,q_p,q_p_netlist,$time);
82+
$display("Data Matched. Golden q_n: %0d, Netlist q_n: %0d, Golden q_p: %0d, Netlist q_p: %0d, Golden q: %0d, Netlist q: %0d, Time: %0t", q_n, q_n_netlist,q_p,q_p_netlist,q,q_netlist,$time);
8283
endtask
8384

8485
initial begin

0 commit comments

Comments
 (0)