Commit 053914d5 authored by Francesco Mani's avatar Francesco Mani

dynamic allocation also for w vectors at decoding sides

parent 94b7762b
...@@ -440,7 +440,7 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -440,7 +440,7 @@ int nr_dlsch_encoding(unsigned char *a,
//ldpc_encoder_optim((unsigned char*)dlsch->harq_processes[harq_pid]->c[r],(unsigned char*)&dlsch->harq_processes[harq_pid]->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL); //ldpc_encoder_optim((unsigned char*)dlsch->harq_processes[harq_pid]->c[r],(unsigned char*)&dlsch->harq_processes[harq_pid]->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL);
} }
for(int j=0;j<(dlsch->harq_processes[harq_pid]->C/8+1);j++) { for(int j=0;j<((dlsch->harq_processes[harq_pid]->C-1)/8+1);j++) {
ldpc_encoder_optim_8seg_multi(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,BG,dlsch->harq_processes[harq_pid]->C,j,NULL,NULL,NULL,NULL); ldpc_encoder_optim_8seg_multi(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,BG,dlsch->harq_processes[harq_pid]->C,j,NULL,NULL,NULL,NULL);
} }
......
...@@ -88,6 +88,12 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch,uint8_t N_RB_UL) ...@@ -88,6 +88,12 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch,uint8_t N_RB_UL)
ulsch->harq_processes[i]->d[r] = NULL; ulsch->harq_processes[i]->d[r] = NULL;
} }
} }
for (r=0; r<a_segments; r++) {
if (ulsch->harq_processes[i]->w[r]) {
free16(ulsch->harq_processes[i]->w[r],(3*(6144+64))*sizeof(int16_t));
ulsch->harq_processes[i]->w[r] = NULL;
}
}
for (r=0; r<a_segments; r++) { for (r=0; r<a_segments; r++) {
if (ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]){ if (ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]){
nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
...@@ -160,6 +166,13 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8 ...@@ -160,6 +166,13 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t)); memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t));
else else
exit_flag=2; exit_flag=2;
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t));
if (ulsch->harq_processes[i]->w[r])
memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t));
else
exit_flag=2;
} }
} }
} else { } else {
......
...@@ -88,6 +88,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch,uint8_t N_RB_DL) ...@@ -88,6 +88,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch,uint8_t N_RB_DL)
dlsch->harq_processes[i]->d[r] = NULL; dlsch->harq_processes[i]->d[r] = NULL;
} }
for (r=0; r<a_segments; r++)
if (dlsch->harq_processes[i]->w[r]) {
free16(dlsch->harq_processes[i]->w[r],(3*8448)*sizeof(short));
dlsch->harq_processes[i]->w[r] = NULL;
}
for (r=0; r<a_segments; r++) { for (r=0; r<a_segments; r++) {
if (dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]){ if (dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]){
nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
...@@ -160,6 +166,13 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint ...@@ -160,6 +166,13 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
memset(dlsch->harq_processes[i]->d[r],0,(3*8448)*sizeof(short)); memset(dlsch->harq_processes[i]->d[r],0,(3*8448)*sizeof(short));
else else
exit_flag=2; exit_flag=2;
dlsch->harq_processes[i]->w[r] = (short*)malloc16((3*8448)*sizeof(short));
if (dlsch->harq_processes[i]->w[r])
memset(dlsch->harq_processes[i]->w[r],0,(3*8448)*sizeof(short));
else
exit_flag=2;
} }
} }
} else { } else {
......
...@@ -278,7 +278,7 @@ typedef struct { ...@@ -278,7 +278,7 @@ typedef struct {
/// MIMO mode for this DLSCH /// MIMO mode for this DLSCH
MIMO_nrmode_t mimo_mode; MIMO_nrmode_t mimo_mode;
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t w[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; int16_t *w[MAX_NUM_NR_DLSCH_SEGMENTS];
/// for abstraction soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// for abstraction soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
//double w_abs[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; //double w_abs[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
......
...@@ -285,7 +285,7 @@ typedef struct { ...@@ -285,7 +285,7 @@ typedef struct {
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled /// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS]; uint8_t h[MAX_NUM_CHANNEL_BITS];
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t w[MAX_NUM_NR_ULSCH_SEGMENTS][3*(6144+64)]; int16_t *w[MAX_NUM_NR_ULSCH_SEGMENTS];
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
} NR_UL_gNB_HARQ_t; } NR_UL_gNB_HARQ_t;
......
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