Commit 06d488bb authored by francescomani's avatar francescomani

ulsch memory optimization

parent b8935b77
...@@ -684,7 +684,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue) ...@@ -684,7 +684,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
for (int j = 0; j < 2; j++) { for (int j = 0; j < 2; j++) {
for (int k = 0; k < RX_NB_TH_MAX; k++) { for (int k = 0; k < RX_NB_TH_MAX; k++) {
free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL); free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL);
free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL); free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL, &ue->frame_parms);
} }
} }
...@@ -702,7 +702,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) ...@@ -702,7 +702,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue)
for (int k=0; k<RX_NB_TH_MAX; k++) { for (int k=0; k<RX_NB_TH_MAX; k++) {
AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n");
LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n"); AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES,&ue->frame_parms))!=NULL,"Can't get ue ulsch structures\n");
LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]);
} }
} }
......
...@@ -57,8 +57,7 @@ ...@@ -57,8 +57,7 @@
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
{ {
int i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
NR_gNB_ULSCH_t *ulsch = *ulschptr; NR_gNB_ULSCH_t *ulsch = *ulschptr;
if (N_RB_UL != 273) { if (N_RB_UL != 273) {
...@@ -66,19 +65,21 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -66,19 +65,21 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
a_segments = a_segments/273 +1; a_segments = a_segments/273 +1;
} }
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) { for (int i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
if (ulsch->harq_processes[i]->b) { if (ulsch->harq_processes[i]->b) {
free_and_zero(ulsch->harq_processes[i]->b); free_and_zero(ulsch->harq_processes[i]->b);
ulsch->harq_processes[i]->b = NULL; ulsch->harq_processes[i]->b = NULL;
} }
for (r=0; r<a_segments; r++) { for (int r=0; r<a_segments; r++) {
free_and_zero(ulsch->harq_processes[i]->c[r]); free_and_zero(ulsch->harq_processes[i]->c[r]);
free_and_zero(ulsch->harq_processes[i]->d[r]); free_and_zero(ulsch->harq_processes[i]->d[r]);
free_and_zero(ulsch->harq_processes[i]->w[r]);
nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL;
} }
free_and_zero(ulsch->harq_processes[i]->c);
free_and_zero(ulsch->harq_processes[i]->d);
free_and_zero(ulsch->harq_processes[i]->p_nrLDPC_procBuf);
free_and_zero(ulsch->harq_processes[i]); free_and_zero(ulsch->harq_processes[i]);
ulsch->harq_processes[i] = NULL; ulsch->harq_processes[i] = NULL;
} }
...@@ -92,7 +93,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -92,7 +93,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
NR_gNB_ULSCH_t *ulsch; NR_gNB_ULSCH_t *ulsch;
uint8_t i,r; uint8_t i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
if (N_RB_UL != 273) { if (N_RB_UL != 273) {
a_segments = a_segments*N_RB_UL; a_segments = a_segments*N_RB_UL;
...@@ -109,11 +110,13 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -109,11 +110,13 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
ulsch->harq_processes[i]->c = (uint8_t**)malloc16_clear(a_segments);
ulsch->harq_processes[i]->d = (int16_t**)malloc16_clear(a_segments);
ulsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16_clear(a_segments);
for (r=0; r<a_segments; r++) { for (r=0; r<a_segments; r++) {
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
} }
} }
...@@ -265,9 +268,12 @@ void nr_processULSegment(void* arg) { ...@@ -265,9 +268,12 @@ void nr_processULSegment(void* arg) {
//////////////////////////// ulsch_llr =====> ulsch_harq->e ////////////////////////////// //////////////////////////// ulsch_llr =====> ulsch_harq->e //////////////////////////////
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
int16_t harq_e[3*8448];
nr_deinterleaving_ldpc(E, nr_deinterleaving_ldpc(E,
Qm, Qm,
ulsch_harq->e[r], harq_e,
ulsch_llr+r_offset); ulsch_llr+r_offset);
//for (int i =0; i<16; i++) //for (int i =0; i<16; i++)
...@@ -292,7 +298,7 @@ void nr_processULSegment(void* arg) { ...@@ -292,7 +298,7 @@ void nr_processULSegment(void* arg) {
p_decoderParms->BG, p_decoderParms->BG,
p_decoderParms->Z, p_decoderParms->Z,
ulsch_harq->d[r], ulsch_harq->d[r],
ulsch_harq->e[r], harq_e,
ulsch_harq->C, ulsch_harq->C,
rv_index, rv_index,
ulsch_harq->new_rx, ulsch_harq->new_rx,
...@@ -539,7 +545,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -539,7 +545,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
r_offset = 0; r_offset = 0;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*n_layers; //number of segments to be allocated
if (nb_rb != 273) { if (nb_rb != 273) {
a_segments = a_segments*nb_rb; a_segments = a_segments*nb_rb;
......
...@@ -63,10 +63,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL); ...@@ -63,10 +63,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL);
*/ */
NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL);
void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,
uint16_t N_RB_UL,
NR_DL_FRAME_PARMS* frame_parms);
void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch, uint16_t N_RB_UL);
NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids); NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms);
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception. /** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception.
@param stream0_in Input from channel compensated (MR combined) stream 0 @param stream0_in Input from channel compensated (MR combined) stream 0
......
...@@ -84,9 +84,9 @@ typedef struct { ...@@ -84,9 +84,9 @@ typedef struct {
/// Pointer to the payload + CRC /// Pointer to the payload + CRC
uint8_t *b; uint8_t *b;
/// Pointers to transport block segments /// Pointers to transport block segments
uint8_t *c[MAX_NUM_NR_ULSCH_SEGMENTS]; uint8_t **c;
/// LDPC-code outputs /// LDPC-code outputs
uint8_t *d[MAX_NUM_NR_ULSCH_SEGMENTS]; uint8_t **d;
/// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17) /// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17)
uint8_t *e; uint8_t *e;
/// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30) /// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30)
......
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
//#define DEBUG_ULSCH_CODING //#define DEBUG_ULSCH_CODING
void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,
uint16_t N_RB_UL,
NR_DL_FRAME_PARMS* frame_parms) {
{
int i, r;
NR_UE_ULSCH_t *ulsch = *ulschptr; NR_UE_ULSCH_t *ulsch = *ulschptr;
if (ulsch) { if (ulsch) {
...@@ -54,15 +54,15 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -54,15 +54,15 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL)
printf("Freeing ulsch %p\n",ulsch); printf("Freeing ulsch %p\n",ulsch);
#endif #endif
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated int max_layers = (frame_parms->nb_antennas_tx<NR_MAX_NB_LAYERS) ? frame_parms->nb_antennas_tx : NR_MAX_NB_LAYERS;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated
if (N_RB_UL != 273) {
a_segments = a_segments*N_RB_UL;
a_segments = a_segments/273 +1;
}
if (N_RB_UL != 273) {
a_segments = a_segments*N_RB_UL;
a_segments = a_segments/273 +1;
}
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) { for (int i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
if (ulsch->harq_processes[i]->a) { if (ulsch->harq_processes[i]->a) {
...@@ -81,7 +81,7 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -81,7 +81,7 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL)
free16(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); free16(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8);
ulsch->harq_processes[i]->f = NULL; ulsch->harq_processes[i]->f = NULL;
} }
for (r=0; r<a_segments; r++) { for (int r=0; r<a_segments; r++) {
if (ulsch->harq_processes[i]->c[r]) { if (ulsch->harq_processes[i]->c[r]) {
free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
ulsch->harq_processes[i]->c[r] = NULL; ulsch->harq_processes[i]->c[r] = NULL;
...@@ -94,6 +94,15 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -94,6 +94,15 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL)
} }
if (ulsch->harq_processes[i]->c) {
free16(ulsch->harq_processes[i]->c,a_segments);
ulsch->harq_processes[i]->c = NULL;
}
if (ulsch->harq_processes[i]->d) {
free16(ulsch->harq_processes[i]->d,a_segments);
ulsch->harq_processes[i]->d = NULL;
}
free16(ulsch->harq_processes[i],sizeof(NR_UL_UE_HARQ_t)); free16(ulsch->harq_processes[i],sizeof(NR_UL_UE_HARQ_t));
ulsch->harq_processes[i] = NULL; ulsch->harq_processes[i] = NULL;
} }
...@@ -101,13 +110,13 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -101,13 +110,13 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL)
free16(ulsch,sizeof(NR_UE_ULSCH_t)); free16(ulsch,sizeof(NR_UE_ULSCH_t));
*ulschptr = NULL; *ulschptr = NULL;
} }
} }
NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms) {
{
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated int max_layers = (frame_parms->nb_antennas_tx<NR_MAX_NB_LAYERS) ? frame_parms->nb_antennas_tx : NR_MAX_NB_LAYERS;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated
if (N_RB_UL != 273) { if (N_RB_UL != 273) {
a_segments = a_segments*N_RB_UL; a_segments = a_segments*N_RB_UL;
...@@ -140,6 +149,8 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) ...@@ -140,6 +149,8 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids)
DevAssert(ulsch->harq_processes[i]->b); DevAssert(ulsch->harq_processes[i]->b);
bzero(ulsch->harq_processes[i]->b,ulsch_bytes); bzero(ulsch->harq_processes[i]->b,ulsch_bytes);
ulsch->harq_processes[i]->c = malloc16(a_segments);
ulsch->harq_processes[i]->d = malloc16(a_segments);
for (int r = 0; r < a_segments; r++) { for (int r = 0; r < a_segments; r++) {
// account for filler in first segment and CRCs for multiple segment case // account for filler in first segment and CRCs for multiple segment case
ulsch->harq_processes[i]->c[r] = malloc16(8448); ulsch->harq_processes[i]->c[r] = malloc16(8448);
...@@ -240,6 +251,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -240,6 +251,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
printf("\n"); printf("\n");
*/ */
int max_payload_bytes = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*harq_process->pusch_pdu.nrOfLayers*1056;
if (A > 3824) { if (A > 3824) {
// Add 24-bit crc (polynomial A) to payload // Add 24-bit crc (polynomial A) to payload
crc = crc24a(harq_process->a,A)>>8; crc = crc24a(harq_process->a,A)>>8;
...@@ -251,7 +264,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -251,7 +264,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
harq_process->B = A+24; harq_process->B = A+24;
AssertFatal((A/8)+4 <= MAX_NR_ULSCH_PAYLOAD_BYTES,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,MAX_NR_ULSCH_PAYLOAD_BYTES); AssertFatal((A/8)+4 <= max_payload_bytes,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,max_payload_bytes);
memcpy(harq_process->b,harq_process->a,(A/8)+4); memcpy(harq_process->b,harq_process->a,(A/8)+4);
} }
...@@ -265,7 +278,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -265,7 +278,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
harq_process->B = A+16; harq_process->B = A+16;
AssertFatal((A/8)+3 <= MAX_NR_ULSCH_PAYLOAD_BYTES,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,MAX_NR_ULSCH_PAYLOAD_BYTES); AssertFatal((A/8)+3 <= max_payload_bytes,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,max_payload_bytes);
memcpy(harq_process->b,harq_process->a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc memcpy(harq_process->b,harq_process->a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc
} }
......
...@@ -273,7 +273,7 @@ typedef struct { ...@@ -273,7 +273,7 @@ typedef struct {
/// The payload + CRC (24 bits) in bits (38.212 V15.4.0 section 5.1) /// The payload + CRC (24 bits) in bits (38.212 V15.4.0 section 5.1)
uint32_t B; uint32_t B;
/// Pointers to code blocks after code block segmentation and CRC attachment (38.212 V15.4.0 section 5.2.2) /// Pointers to code blocks after code block segmentation and CRC attachment (38.212 V15.4.0 section 5.2.2)
uint8_t *c[MAX_NUM_NR_ULSCH_SEGMENTS]; uint8_t **c;
/// Number of bits in each code block (38.212 V15.4.0 section 5.2.2) /// Number of bits in each code block (38.212 V15.4.0 section 5.2.2)
uint32_t K; uint32_t K;
/// Number of "Filler" bits added in the code block segmentation (38.212 V15.4.0 section 5.2.2) /// Number of "Filler" bits added in the code block segmentation (38.212 V15.4.0 section 5.2.2)
...@@ -281,13 +281,11 @@ typedef struct { ...@@ -281,13 +281,11 @@ typedef struct {
/// Number of code blocks after code block segmentation (38.212 V15.4.0 section 5.2.2) /// Number of code blocks after code block segmentation (38.212 V15.4.0 section 5.2.2)
uint32_t C; uint32_t C;
/// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2) /// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2)
int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS]; int16_t **d;
/// LDPC processing buffer /// LDPC processing buffer
t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS]; t_nrLDPC_procBuf** p_nrLDPC_procBuf;
/// LDPC lifting size (38.212 V15.4.0 table 5.3.2-1) /// LDPC lifting size (38.212 V15.4.0 table 5.3.2-1)
uint32_t Z; uint32_t Z;
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
/// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) /// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
uint32_t E; uint32_t E;
/// Number of segments processed so far /// Number of segments processed so far
...@@ -342,8 +340,6 @@ typedef struct { ...@@ -342,8 +340,6 @@ typedef struct {
int16_t q_RI[MAX_RI_PAYLOAD]; int16_t q_RI[MAX_RI_PAYLOAD];
/// 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)
int16_t *w[MAX_NUM_NR_ULSCH_SEGMENTS];
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
} NR_UL_gNB_HARQ_t; } NR_UL_gNB_HARQ_t;
......
...@@ -104,8 +104,7 @@ ...@@ -104,8 +104,7 @@
#define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34) #define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34)
#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056) #define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
#define MAX_NUM_NR_ULSCH_SEGMENTS (NR_MAX_NB_LAYERS*34) #define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#define MAX_NUM_NR_CHANNEL_BITS (4*14*273*12*8) // 14 symbols, 273 RB #define MAX_NUM_NR_CHANNEL_BITS (4*14*273*12*8) // 14 symbols, 273 RB
#define MAX_NUM_NR_RE (4*14*273*12) #define MAX_NUM_NR_RE (4*14*273*12)
......
...@@ -417,7 +417,7 @@ int main(int argc, char **argv) ...@@ -417,7 +417,7 @@ int main(int argc, char **argv)
for (sf = 0; sf < 2; sf++) { for (sf = 0; sf < 2; sf++) {
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8); UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, frame_parms);
if (!UE->ulsch[sf][0][i]) { if (!UE->ulsch[sf][0][i]) {
printf("Can't get ue ulsch structures.\n"); printf("Can't get ue ulsch structures.\n");
...@@ -628,7 +628,7 @@ int main(int argc, char **argv) ...@@ -628,7 +628,7 @@ int main(int argc, char **argv)
for (sf = 0; sf < 2; sf++) for (sf = 0; sf < 2; sf++)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL); free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL, frame_parms);
term_nr_ue_signal(UE, 1); term_nr_ue_signal(UE, 1);
free(UE); free(UE);
......
...@@ -743,7 +743,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -743,7 +743,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
} else if (get_softmodem_params()->nsa) { } else if (get_softmodem_params()->nsa) {
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES]; uint8_t mac_sdus[MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*1056];
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
int TBS_bytes = 848; int TBS_bytes = 848;
int mac_ce_len = 0; int mac_ce_len = 0;
......
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