From ebb9a87834489baebcd22ae3fd45ea56e6950275 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 4 Feb 2023 15:48:28 +0700 Subject: [PATCH] add offset normalization and remade cnode flow control --- rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv | 21 ++++++++++--------- .../dec/ldpc_dvb_dec_cnode_restore.sv | 12 ++++------- rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv | 18 ++++++++++------ 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv index b7767a1..3d2ba76 100644 --- a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv +++ b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode.sv @@ -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 ; @@ -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 @@ -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" @@ -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 ( @@ -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 ( @@ -621,8 +623,7 @@ 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 @@ -630,7 +631,7 @@ module ldpc_dvb_dec_cnode 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 diff --git a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode_restore.sv b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode_restore.sv index 4098d29..f9d207f 100644 --- a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode_restore.sv +++ b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_cnode_restore.sv @@ -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 ; @@ -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 ( @@ -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" diff --git a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv index 6218fb1..f17a598 100644 --- a/rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv +++ b/rtl/ldpc_dvb/dec/ldpc_dvb_dec_sort_engine.sv @@ -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 ; @@ -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 ( @@ -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" @@ -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