Skip to content

Commit 6cd7013

Browse files
Merge pull request #39 from muhammadhamza15/main
Simulation Models Updates
2 parents 9327db9 + 348ab1d commit 6cd7013

File tree

16 files changed

+980
-839
lines changed

16 files changed

+980
-839
lines changed

models_customer/verilog/I_SERDES.v

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ module I_SERDES #(
250250
parameter DPA_MODE = "NONE" // Select Dynamic Phase Alignment or Clock Data Recovery (NONE/DPA/CDR)
251251
) (
252252
input D, // Data input (connect to input port, buffer or I_DELAY)
253-
input RX_RST, // Active-low asycnhronous reset
253+
input RST, // Active-low asycnhronous reset
254254
input BITSLIP_ADJ, // BITSLIP_ADJ input
255255
input EN, // EN input data (input data is low when driven low)
256256
input CLK_IN, // Fabric clock input
@@ -380,9 +380,9 @@ end
380380
// DPA BLOCK //
381381

382382
// clk 0 check
383-
always@(posedge clk_0 or negedge RX_RST)
383+
always@(posedge clk_0 or negedge RST)
384384
begin
385-
if(!RX_RST)
385+
if(!RST)
386386
begin
387387
clk0_data_reg<=0;
388388
clk0_data_comp<=0;
@@ -409,9 +409,9 @@ begin
409409
end
410410

411411
// clk 90 check
412-
always@(posedge clk_90 or negedge RX_RST)
412+
always@(posedge clk_90 or negedge RST)
413413
begin
414-
if(!RX_RST)
414+
if(!RST)
415415
begin
416416
clk90_data_reg<=0;
417417
clk90_data_comp<=0;
@@ -438,9 +438,9 @@ begin
438438
end
439439

440440
// clk 180 check
441-
always@(posedge clk_180 or negedge RX_RST)
441+
always@(posedge clk_180 or negedge RST)
442442
begin
443-
if(!RX_RST)
443+
if(!RST)
444444
begin
445445
clk180_data_reg<=0;
446446
clk180_data_comp<=0;
@@ -467,9 +467,9 @@ begin
467467
end
468468

469469
// clk 270 check
470-
always@(posedge clk_270 or negedge RX_RST)
470+
always@(posedge clk_270 or negedge RST)
471471
begin
472-
if(!RX_RST)
472+
if(!RST)
473473
begin
474474
clk270_data_reg<=0;
475475
clk270_data_comp<=0;
@@ -538,9 +538,9 @@ assign DPA_ERROR= dpa_error;
538538

539539
// FOR FAST CLOCK
540540
// count cycles after PLL LOCK
541-
always@(posedge PLL_CLK or negedge RX_RST)
541+
always@(posedge PLL_CLK or negedge RST)
542542
begin
543-
if(!RX_RST)
543+
if(!RST)
544544
pll_lock_count<=0;
545545
else if(!PLL_LOCK)
546546
pll_lock_count<=0;
@@ -551,9 +551,9 @@ else if(PLL_LOCK && pll_lock_count<=255)
551551
end
552552

553553
// Generate Core CLK And Word Load Enable
554-
always@(posedge PLL_CLK or negedge RX_RST)
554+
always@(posedge PLL_CLK or negedge RST)
555555
begin
556-
if(!RX_RST)
556+
if(!RST)
557557
begin
558558
core_clk<=0;
559559
core_clk_count<=0;
@@ -577,9 +577,9 @@ end
577577
// FOR CDR CLOCK
578578

579579
// count cycles after PLL LOCK
580-
always@(posedge cdr_clk or negedge RX_RST)
580+
always@(posedge cdr_clk or negedge RST)
581581
begin
582-
if(!RX_RST)
582+
if(!RST)
583583
cdr_pll_lock_count<=0;
584584
else if(!PLL_LOCK)
585585
cdr_pll_lock_count<=0;
@@ -589,9 +589,9 @@ else if(PLL_LOCK && cdr_pll_lock_count<=255)
589589
end
590590

591591
// Generate CDR Core CLK And Word Load Enable
592-
always@(posedge cdr_clk or negedge RX_RST)
592+
always@(posedge cdr_clk or negedge RST)
593593
begin
594-
if(!RX_RST)
594+
if(!RST)
595595
begin
596596
cdr_core_clk<=0;
597597
cdr_core_clk_count<=0;
@@ -626,12 +626,12 @@ afifo # (
626626
)
627627
afifo_dpa (
628628
.wclk(cdr_clk),
629-
.wr_reset(!RX_RST),
629+
.wr_reset(!RST),
630630
.wr(!dpa_fifo_full),
631631
.wr_data(dpa_dout),
632632
.wr_full(dpa_fifo_full),
633633
.rclk(PLL_CLK),
634-
.rd_reset(!RX_RST),
634+
.rd_reset(!RST),
635635
.rd(!dpa_fifo_empty),
636636
.rd_data(dpa_fifo_dout),
637637
.rd_empty(dpa_fifo_empty)
@@ -658,9 +658,9 @@ end
658658
assign bitslip_adj_pulse = (bitslip_adj_1) && (!bitslip_adj_0);
659659

660660
// bitslip counter
661-
always @(posedge bitslip_des_clk or negedge RX_RST)
661+
always @(posedge bitslip_des_clk or negedge RST)
662662
begin
663-
if(!RX_RST)
663+
if(!RST)
664664
begin
665665
bitslip_counter<=0;
666666
bitslip_shifter_out<=0;
@@ -679,9 +679,9 @@ end
679679
end
680680

681681
// bit shifter
682-
always @(posedge bitslip_des_clk or negedge RX_RST)
682+
always @(posedge bitslip_des_clk or negedge RST)
683683
begin
684-
if(!RX_RST)
684+
if(!RST)
685685
bit_shifter<=0;
686686
else
687687
bit_shifter<={bit_shifter[WIDTH-2:0],bitslip_din};
@@ -703,9 +703,9 @@ case(bitslip_counter)
703703
endcase
704704
end
705705

706-
always @(posedge bitslip_des_clk or negedge RX_RST)
706+
always @(posedge bitslip_des_clk or negedge RST)
707707
begin
708-
if(!RX_RST)
708+
if(!RST)
709709
bitslip_dout<=0;
710710
else
711711
bitslip_dout<=bitslip_shifter_out;
@@ -715,9 +715,9 @@ end
715715
// DE-SERIALIZER //
716716

717717
// SHIFTER+PARALLEL-REGISTER
718-
always@(posedge bitslip_des_clk or negedge RX_RST)
718+
always@(posedge bitslip_des_clk or negedge RST)
719719
begin
720-
if(!RX_RST)
720+
if(!RST)
721721
begin
722722
des_shifter<=0;
723723
des_parallel_reg<=0;
@@ -738,12 +738,12 @@ afifo # (
738738
)
739739
afifo_inst (
740740
.wclk(bitslip_des_clk),
741-
.wr_reset(!RX_RST),
741+
.wr_reset(!RST),
742742
.wr(!des_fifo_full && des_word_load_en),
743743
.wr_data(des_parallel_reg),
744744
.wr_full(des_fifo_full),
745745
.rclk(CLK_IN),
746-
.rd_reset(!RX_RST),
746+
.rd_reset(!RST),
747747
.rd(!des_fifo_empty),
748748
.rd_data(Q),
749749
.rd_empty(des_fifo_empty)

models_customer/verilog/O_SERDES.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module O_SERDES #(
6969
) (
7070
input [WIDTH-1:0] D, // D input bus
7171
input RST, // Active-low, asynchronous reset
72-
input LOAD_WORD, // Load word input
72+
input DATA_VALID, // Active high data valid signal
7373
input CLK_IN, // Fabric clock input
7474
input OE_IN, // Output tri-state enable input
7575
output OE_OUT, // Output tri-state enable output (conttect to O_BUFT or inferred tri-state signal)
@@ -81,7 +81,6 @@ module O_SERDES #(
8181
);
8282

8383

84-
8584
// GBOX CLK GEN
8685
reg core_clk=0;
8786
reg word_load_en;
@@ -194,7 +193,7 @@ module O_SERDES #(
194193
fifo_read_en <= 1'b1;
195194
end
196195

197-
assign word_load_en_sync = LOAD_WORD && fifo_read_en ;
196+
assign word_load_en_sync = DATA_VALID && fifo_read_en && word_load_en ;
198197

199198

200199
// Parallel data register

0 commit comments

Comments
 (0)