From 4045874d7414bf870bcb6d0bba1765c8fa91cdd6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 4 May 2022 16:56:23 +0200 Subject: [PATCH] memory fixes --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 3 ++- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 3 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 22556747d3..2812b65d96 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -73,7 +73,6 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_parms, int slot) { - int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; uint8_t cset_start_symb, cset_nsymb; int k,l,k_prime,dci_idx, dmrs_idx; @@ -88,6 +87,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB; + int16_t mod_dmrs[pdcch_pdu_rel15->DurationSymbols][(n_rb+rb_offset)*6] __attribute__((aligned(16))); // 3 for the max coreset duration + for (int d=0;dnumDlDci;d++) { /*The coreset is initialised * in frequency: the first subcarrier is obtained by adding the first CRB overlapping the SSB and the rb_offset for coreset 0 diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 5fe29b1f28..76dd8c1104 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -142,7 +142,8 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, int B_rb = reg_bundle_size_L/coreset_time_dur; // nb of RBs occupied by each REG bundle int num_bundles_per_cce = 6/reg_bundle_size_L; - int max_bundles = NR_MAX_PDCCH_AGG_LEVEL*num_bundles_per_cce; + int n_cce = N_regs/6; + int max_bundles = n_cce*num_bundles_per_cce; int f_bundle_j_list[max_bundles]; // for each bundle diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 586a4dc60f..54f9537e2b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -61,7 +61,7 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss, int i=0; int Y = 0; if (slot >= 0) - Y = get_Y(*ss->controlResourceSetId, slot, rnti); + Y = get_Y((*ss->controlResourceSetId)%3, slot, rnti); for (int maxL=16;maxL>0;maxL>>=1) { find_aggregation_candidates(&aggregation, &number_of_candidates, @@ -70,13 +70,13 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss, if (number_of_candidates>0) { LOG_D(NR_MAC,"L %d, number of candidates %d, aggregation %d\n",maxL,number_of_candidates,aggregation); rel15->number_of_candidates += number_of_candidates; - int N_cce_sym = 0; // nb of rbs of coreset per symbol + int n_rb = 0; // nb of rbs of coreset per symbol for (int i=0;i<6;i++) { for (int t=0;t<8;t++) { - N_cce_sym+=((rel15->coreset.frequency_domain_resource[i]>>t)&1); + n_rb+=((rel15->coreset.frequency_domain_resource[i]>>t)&1); } } - int N_cces = N_cce_sym*rel15->coreset.duration; + int N_cces = n_rb*rel15->coreset.duration/NR_NB_REG_PER_CCE; for (int j=0; j