Skip to content

Commit

Permalink
add offset normalization and remade cnode flow control
Browse files Browse the repository at this point in the history
  • Loading branch information
dshekhalev committed Feb 4, 2023
1 parent c68da7a commit ebb9a87
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
21 changes: 11 additions & 10 deletions rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
parameter int pLLR_W = 4 ;
parameter int pNODE_W = 8 ;
parameter int pNORM_FACTOR = 6 ;
parameter int pNORM_FACTOR = 7 ;
parameter int pNORM_OFFSET = 1 ;
parameter bit pUSE_SRL_FIFO = 1 ;
Expand Down Expand Up @@ -37,6 +38,7 @@
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W ) ,
.pNORM_FACTOR ( pNORM_FACTOR ) ,
.pNORM_OFFSET ( pNORM_OFFSET ) ,
.pUSE_SRL_FIFO ( pUSE_SRL_FIFO )
)
ldpc_dvb_dec_cnode
Expand Down Expand Up @@ -112,8 +114,7 @@ module ldpc_dvb_dec_cnode
obusy
);

parameter int pNORM_FACTOR = 7;
parameter bit pUSE_SRL_FIFO = 1; // use SRL based internal FIFO
parameter bit pUSE_SRL_FIFO = 1; // use SRL based internal FIFO

`include "../ldpc_dvb_constants.svh"
`include "ldpc_dvb_dec_types.svh"
Expand Down Expand Up @@ -315,7 +316,9 @@ module ldpc_dvb_dec_cnode
#(
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W ) ,
.pNORM_FACTOR ( pNORM_FACTOR )
//
.pNORM_FACTOR ( pNORM_FACTOR ) ,
.pNORM_OFFSET ( pNORM_OFFSET )
)
sort
(
Expand Down Expand Up @@ -512,9 +515,8 @@ module ldpc_dvb_dec_cnode
for (g = 0; g < cZC_MAX; g++) begin : restore_inst
ldpc_dvb_dec_cnode_restore
#(
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W ) ,
.pNORM_FACTOR ( pNORM_FACTOR )
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W )
)
restore
(
Expand Down Expand Up @@ -621,16 +623,15 @@ module ldpc_dvb_dec_cnode

//------------------------------------------------------------------------------------------------------
// obusy is look ahead signal for control
// there is 4 tick betwen write/read to node ram
// this logic save 2 tick for cBS_DELAY == 3 (!!!) for each iteration
// there is 4 tick betwen write/read to node ram this logic + matrix reorder save it for each iteration
//------------------------------------------------------------------------------------------------------

always_ff @(posedge iclk or posedge ireset) begin
if (ireset) begin
obusy <= 1'b0;
end
else if (iclkena) begin
obusy <= obs__ival | !vnode_fifo__oempty; // fifo_empty use because there can be holes in oval flow (!!!)
obusy <= !vnode_fifo__oempty; // fifo_empty use because there can be holes in oval flow (!!!)
end
end

Expand Down
12 changes: 4 additions & 8 deletions rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode_restore.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
parameter int pLLR_W = 4 ;
parameter int pNODE_W = 8 ;
parameter int pNORM_FACTOR = 6 ;
parameter int pLLR_W = 4 ;
parameter int pNODE_W = 8 ;
Expand All @@ -29,9 +28,8 @@
ldpc_dvb_dec_cnode_restore
#(
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W ) ,
.pNORM_FACTOR ( pNORM_FACTOR )
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W )
)
ldpc_dvb_dec_cnode_restore
(
Expand Down Expand Up @@ -96,8 +94,6 @@ module ldpc_dvb_dec_cnode_restore
ocnode
);

parameter int pNORM_FACTOR = 7;

`include "../ldpc_dvb_constants.svh"
`include "ldpc_dvb_dec_types.svh"

Expand Down
18 changes: 12 additions & 6 deletions rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
parameter int pLLR_W = 4 ;
parameter int pNODE_W = 8 ;
parameter int pNORM_FACTOR = 6 ;
parameter int pNORM_FACTOR = 7 ;
parameter int pNORM_OFFSET = 1 ;
Expand Down Expand Up @@ -37,7 +38,8 @@
#(
.pLLR_W ( pLLR_W ) ,
.pNODE_W ( pNODE_W ) ,
.pNORM_FACTOR ( pNORM_FACTOR )
.pNORM_FACTOR ( pNORM_FACTOR ) ,
.pNORM_OFFSET ( pNORM_OFFSET )
)
ldpc_dvb_dec_sort_engine
(
Expand Down Expand Up @@ -112,8 +114,6 @@ module ldpc_dvb_dec_sort_engine
odecfail
);

parameter int pNORM_FACTOR = 7;

`include "../ldpc_dvb_constants.svh"
`include "ldpc_dvb_dec_types.svh"

Expand Down Expand Up @@ -266,8 +266,14 @@ module ldpc_dvb_dec_sort_engine
if (vn_sort_done) begin
osort_num_m1 <= vn_sort_num_m1;
osort_rslt <= vn_sort;
osort_rslt.min1 <= normalize(vn_sort.min1);
osort_rslt.min2 <= normalize(vn_sort.min2);
if (pNORM_OFFSET) begin
osort_rslt.min1 <= vn_sort.min1 - (vn_sort.min1 != 0); // offset value is 1
osort_rslt.min2 <= vn_sort.min2 - (vn_sort.min2 != 0); // it's positive value
end
else begin
osort_rslt.min1 <= normalize(vn_sort.min1);
osort_rslt.min2 <= normalize(vn_sort.min2);
end
end
end
end
Expand Down

0 comments on commit ebb9a87

Please sign in to comment.