From 83149e5100ec91874f41539533b79c2e9e211aeb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Mar 2022 18:46:22 +0100 Subject: [PATCH] Base graph selection: create function in nr_common.c --- common/utils/nr/nr_common.c | 7 +++++++ common/utils/nr/nr_common.h | 1 + openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 5 +---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 6add03c324..1f925d08f0 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -494,3 +494,10 @@ void SLIV2SL(int SLIV,int *S,int *L) { *S=13-SLIVmod14; } } + +int get_BG(uint32_t A, float code_rate) { + if ((A <=292) || ((A<=3824) && (code_rate <= 0.6667)) || code_rate <= 0.25) + return 2; + else + return 1; +} diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 5f7f670ce9..c286c0ad6a 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -76,6 +76,7 @@ uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols); int get_nb_periods_per_frame(uint8_t tdd_period); int get_supported_band_index(int scs, int band, int n_rbs); long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS); +int get_BG(uint32_t A, float code_rate); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index f0f9f4fe34..0e82de276d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -380,10 +380,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, float Coderate = (float) rel15->targetCodeRate[0] / 10240.0f; LOG_D(PHY,"DLSCH Coderate %f\n",Coderate); - if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) - impp.BG = 2; - else - impp.BG = 1; + impp.BG = get_BG(A, Coderate); start_meas(dlsch_segmentation_stats); impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG);