Commit dfce841d authored by unknown's avatar unknown
Browse files

- PRBS gen uses genvar i

parent 453c10ff
......@@ -31,11 +31,10 @@ module prbs_gen_40b # (
//*************
//Declarations:
//*************
genvar i;
reg LFb;
reg [30:0] Lsr_qb31; // prbs-31
reg [39:0] prbs_qb40;
reg [ 5:0] i;
//***********
//User Logic:
......@@ -45,41 +44,38 @@ module prbs_gen_40b # (
if (Reset_ir) begin
LFb <= #1 1'b0;
Lsr_qb31 <= #1 g_PrbsSeed;
i <= #1 1'b0;
prbs_qb40 <= #1 40'b0;
Dv_o <= #1 1'b0;
TxData_ob40 <= #1 40'b0;
end else begin
repeat (40) begin
for (i=0;i<40;i++) begin
prbs_qb40[i] = Lsr_qb31[30];
LFb = Lsr_qb31[30]^Lsr_qb31[27]; // See Xilinx XAPP210
Lsr_qb31 = {Lsr_qb31[29:0],LFb};
i = i+1;
end
i <= #1 1'b0;
if (RxDataAligned_i) begin
Dv_o <= #1 1'b1;
TxData_ob40 <= #1 prbs_qb40;
if (SingleErrorInject_i) begin
TxData_ob40[0] <= #1 ~prbs_qb40[0];
TxData_ob40[0] <= #1 ~prbs_qb40[0];
end else if (MultiErrorInject_i) begin
TxData_ob40[ 0] <= #1 ~prbs_qb40[ 0];
TxData_ob40[ 1] <= #1 ~prbs_qb40[ 1];
TxData_ob40[ 2] <= #1 ~prbs_qb40[ 2];
TxData_ob40[ 3] <= #1 ~prbs_qb40[ 3];
TxData_ob40[ 4] <= #1 ~prbs_qb40[ 4];
TxData_ob40[ 5] <= #1 ~prbs_qb40[ 5];
TxData_ob40[ 6] <= #1 ~prbs_qb40[ 6];
TxData_ob40[ 7] <= #1 ~prbs_qb40[ 7];
TxData_ob40[ 0] <= #1 ~prbs_qb40[ 0];
TxData_ob40[ 1] <= #1 ~prbs_qb40[ 1];
TxData_ob40[ 2] <= #1 ~prbs_qb40[ 2];
TxData_ob40[ 3] <= #1 ~prbs_qb40[ 3];
TxData_ob40[ 4] <= #1 ~prbs_qb40[ 4];
TxData_ob40[ 5] <= #1 ~prbs_qb40[ 5];
TxData_ob40[ 6] <= #1 ~prbs_qb40[ 6];
TxData_ob40[ 7] <= #1 ~prbs_qb40[ 7];
//---
TxData_ob40[24] <= #1 ~prbs_qb40[24];
TxData_ob40[25] <= #1 ~prbs_qb40[25];
TxData_ob40[26] <= #1 ~prbs_qb40[26];
TxData_ob40[27] <= #1 ~prbs_qb40[27];
TxData_ob40[28] <= #1 ~prbs_qb40[28];
TxData_ob40[29] <= #1 ~prbs_qb40[29];
TxData_ob40[30] <= #1 ~prbs_qb40[30];
TxData_ob40[31] <= #1 ~prbs_qb40[31];
TxData_ob40[24] <= #1 ~prbs_qb40[24];
TxData_ob40[25] <= #1 ~prbs_qb40[25];
TxData_ob40[26] <= #1 ~prbs_qb40[26];
TxData_ob40[27] <= #1 ~prbs_qb40[27];
TxData_ob40[28] <= #1 ~prbs_qb40[28];
TxData_ob40[29] <= #1 ~prbs_qb40[29];
TxData_ob40[30] <= #1 ~prbs_qb40[30];
TxData_ob40[31] <= #1 ~prbs_qb40[31];
end
end else begin
Dv_o <= #1 1'b0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment