Commit 4045874d authored by francescomani's avatar francescomani

memory fixes

parent 999f5d67
...@@ -73,7 +73,6 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -73,7 +73,6 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
int slot) { 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; uint16_t cset_start_sc;
uint8_t cset_start_symb, cset_nsymb; uint8_t cset_start_symb, cset_nsymb;
int k,l,k_prime,dci_idx, dmrs_idx; int k,l,k_prime,dci_idx, dmrs_idx;
...@@ -88,6 +87,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -88,6 +87,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); 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; 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;d<pdcch_pdu_rel15->numDlDci;d++) { for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++) {
/*The coreset is initialised /*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 * in frequency: the first subcarrier is obtained by adding the first CRB overlapping the SSB and the rb_offset for coreset 0
......
...@@ -142,7 +142,8 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, ...@@ -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 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 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]; int f_bundle_j_list[max_bundles];
// for each bundle // for each bundle
......
...@@ -61,7 +61,7 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss, ...@@ -61,7 +61,7 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,
int i=0; int i=0;
int Y = 0; int Y = 0;
if (slot >= 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) { for (int maxL=16;maxL>0;maxL>>=1) {
find_aggregation_candidates(&aggregation, find_aggregation_candidates(&aggregation,
&number_of_candidates, &number_of_candidates,
...@@ -70,13 +70,13 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss, ...@@ -70,13 +70,13 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,
if (number_of_candidates>0) { if (number_of_candidates>0) {
LOG_D(NR_MAC,"L %d, number of candidates %d, aggregation %d\n",maxL,number_of_candidates,aggregation); 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; 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 i=0;i<6;i++) {
for (int t=0;t<8;t++) { 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<number_of_candidates; i++,j++) { for (int j=0; j<number_of_candidates; i++,j++) {
int first_cce = aggregation * (( Y + CEILIDIV((j*N_cces),(aggregation*number_of_candidates)) + 0 ) % CEILIDIV(N_cces,aggregation)); int first_cce = aggregation * (( Y + CEILIDIV((j*N_cces),(aggregation*number_of_candidates)) + 0 ) % CEILIDIV(N_cces,aggregation));
LOG_D(NR_MAC,"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n", j, number_of_candidates, first_cce, aggregation, N_cces, Y); LOG_D(NR_MAC,"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n", j, number_of_candidates, first_cce, aggregation, N_cces, Y);
......
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