Commit 0c408e96 authored by Francesco Mani's avatar Francesco Mani

adopting NR values for DLSCH/ULSCH segments

parent 615f2787
...@@ -63,7 +63,7 @@ int32_t nr_segmentation(unsigned char *input_buffer, ...@@ -63,7 +63,7 @@ int32_t nr_segmentation(unsigned char *input_buffer,
#endif #endif
} }
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { if ((*C)>MAX_NUM_NR_DLSCH_SEGMENTS) {
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
return(-1); return(-1);
} }
......
...@@ -69,7 +69,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) ...@@ -69,7 +69,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
#endif #endif
if (dlsch->harq_processes[i]->b) { if (dlsch->harq_processes[i]->b) {
free16(dlsch->harq_processes[i]->b,MAX_DLSCH_PAYLOAD_BYTES); //this should be MAX_NR_DLSCH_PAYLOAD_BYTES free16(dlsch->harq_processes[i]->b,MAX_NR_DLSCH_PAYLOAD_BYTES);
dlsch->harq_processes[i]->b = NULL; dlsch->harq_processes[i]->b = NULL;
#ifdef DEBUG_DLSCH_FREE #ifdef DEBUG_DLSCH_FREE
printf("Freeing dlsch process %d b (%p)\n",i,dlsch->harq_processes[i]->b); printf("Freeing dlsch process %d b (%p)\n",i,dlsch->harq_processes[i]->b);
...@@ -80,7 +80,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) ...@@ -80,7 +80,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
printf("Freeing dlsch process %d c (%p)\n",i,dlsch->harq_processes[i]->c); printf("Freeing dlsch process %d c (%p)\n",i,dlsch->harq_processes[i]->c);
#endif #endif
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) { for (r=0; r<MAX_NUM_NR_DLSCH_SEGMENTS; r++) {
#ifdef DEBUG_DLSCH_FREE #ifdef DEBUG_DLSCH_FREE
printf("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]); printf("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]);
...@@ -260,7 +260,7 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) ...@@ -260,7 +260,7 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
dlsch->harq_processes[i]->round = 0; dlsch->harq_processes[i]->round = 0;
for (j=0; j<96; j++) for (j=0; j<96; j++)
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) for (r=0; r<MAX_NUM_NR_DLSCH_SEGMENTS; r++)
if (dlsch->harq_processes[i]->d[r]) if (dlsch->harq_processes[i]->d[r])
dlsch->harq_processes[i]->d[r][j] = NR_NULL; dlsch->harq_processes[i]->d[r][j] = NR_NULL;
...@@ -288,7 +288,7 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -288,7 +288,7 @@ int nr_dlsch_encoding(unsigned char *a,
uint8_t mod_order = rel15.modulation_order; uint8_t mod_order = rel15.modulation_order;
uint16_t Kr=0,r; uint16_t Kr=0,r;
uint32_t r_offset=0; uint32_t r_offset=0;
//uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS]; //uint8_t *d_tmp[MAX_NUM_NR_DLSCH_SEGMENTS];
uint8_t BG=1; uint8_t BG=1;
uint32_t E; uint32_t E;
uint8_t Ilbrm = 1; uint8_t Ilbrm = 1;
...@@ -300,8 +300,8 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -300,8 +300,8 @@ int nr_dlsch_encoding(unsigned char *a,
uint8_t Nl = 4; uint8_t Nl = 4;
/* /*
uint8_t *channel_input[MAX_NUM_DLSCH_SEGMENTS]; //unsigned char uint8_t *channel_input[MAX_NUM_NR_DLSCH_SEGMENTS]; //unsigned char
for(j=0;j<MAX_NUM_DLSCH_SEGMENTS;j++) { for(j=0;j<MAX_NUM_NR_DLSCH_SEGMENTS;j++) {
channel_input[j] = (unsigned char *)malloc16(sizeof(unsigned char) * 68*384); channel_input[j] = (unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
} }
*/ */
...@@ -339,7 +339,7 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -339,7 +339,7 @@ int nr_dlsch_encoding(unsigned char *a,
dlsch->harq_processes[harq_pid]->B = A+24; dlsch->harq_processes[harq_pid]->B = A+24;
// dlsch->harq_processes[harq_pid]->b = a; // dlsch->harq_processes[harq_pid]->b = a;
AssertFatal((A/8)+4 <= MAX_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,MAX_DLSCH_PAYLOAD_BYTES); AssertFatal((A/8)+4 <= MAX_NR_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,MAX_NR_DLSCH_PAYLOAD_BYTES);
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); // why is this +4 if the CRC is only 3 bytes? memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); // why is this +4 if the CRC is only 3 bytes?
} }
...@@ -354,7 +354,7 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -354,7 +354,7 @@ int nr_dlsch_encoding(unsigned char *a,
dlsch->harq_processes[harq_pid]->B = A+16; dlsch->harq_processes[harq_pid]->B = A+16;
// dlsch->harq_processes[harq_pid]->b = a; // dlsch->harq_processes[harq_pid]->b = a;
AssertFatal((A/8)+3 <= MAX_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,MAX_DLSCH_PAYLOAD_BYTES); AssertFatal((A/8)+3 <= MAX_NR_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,MAX_NR_DLSCH_PAYLOAD_BYTES);
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc
} }
......
...@@ -264,7 +264,7 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) ...@@ -264,7 +264,7 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
/// 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_ULSCH_SEGMENTS][3*(6144+64)]; //int16_t w[MAX_NUM_NR_ULSCH_SEGMENTS][3*(6144+64)];
} }
} }
} }
......
...@@ -65,7 +65,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch) ...@@ -65,7 +65,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch)
for (i=0; i<dlsch->Mdlharq; i++) { for (i=0; i<dlsch->Mdlharq; i++) {
if (dlsch->harq_processes[i]) { if (dlsch->harq_processes[i]) {
if (dlsch->harq_processes[i]->b) { if (dlsch->harq_processes[i]->b) {
free16(dlsch->harq_processes[i]->b,MAX_DLSCH_PAYLOAD_BYTES); free16(dlsch->harq_processes[i]->b,MAX_NR_DLSCH_PAYLOAD_BYTES);
dlsch->harq_processes[i]->b = NULL; dlsch->harq_processes[i]->b = NULL;
} }
...@@ -140,10 +140,10 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint ...@@ -140,10 +140,10 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
if (dlsch->harq_processes[i]) { if (dlsch->harq_processes[i]) {
memset(dlsch->harq_processes[i],0,sizeof(NR_DL_UE_HARQ_t)); memset(dlsch->harq_processes[i],0,sizeof(NR_DL_UE_HARQ_t));
dlsch->harq_processes[i]->first_tx=1; dlsch->harq_processes[i]->first_tx=1;
dlsch->harq_processes[i]->b = (uint8_t*)malloc16(MAX_DLSCH_PAYLOAD_BYTES/bw_scaling); dlsch->harq_processes[i]->b = (uint8_t*)malloc16(MAX_NR_DLSCH_PAYLOAD_BYTES/bw_scaling);
if (dlsch->harq_processes[i]->b) if (dlsch->harq_processes[i]->b)
memset(dlsch->harq_processes[i]->b,0,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling); memset(dlsch->harq_processes[i]->b,0,MAX_NR_DLSCH_PAYLOAD_BYTES/bw_scaling);
else else
exit_flag=3; exit_flag=3;
...@@ -752,7 +752,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -752,7 +752,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
uint32_t A,E; uint32_t A,E;
uint32_t G; uint32_t G;
uint32_t ret,offset; uint32_t ret,offset;
//short dummy_w[MAX_NUM_DLSCH_SEGMENTS][3*(8448+64)]; //short dummy_w[MAX_NUM_NR_DLSCH_SEGMENTS][3*(8448+64)];
uint32_t r,r_offset=0,Kr=8424,Kr_bytes,err_flag=0,K_bytes_F; uint32_t r,r_offset=0,Kr=8424,Kr_bytes,err_flag=0,K_bytes_F;
uint8_t crc_type; uint8_t crc_type;
//UE_rxtx_proc_t *proc = &phy_vars_ue->proc; //UE_rxtx_proc_t *proc = &phy_vars_ue->proc;
...@@ -930,8 +930,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -930,8 +930,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
break; break;
} }
if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { if (harq_process->C > MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling) {
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling); LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling);
return((1+dlsch->max_ldpc_iterations)); return((1+dlsch->max_ldpc_iterations));
} }
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -1370,7 +1370,7 @@ void *nr_dlsch_decoding_process(void *arg) ...@@ -1370,7 +1370,7 @@ void *nr_dlsch_decoding_process(void *arg)
uint32_t A,E; uint32_t A,E;
uint32_t G; uint32_t G;
uint32_t ret,offset; uint32_t ret,offset;
// short dummy_w[MAX_NUM_DLSCH_SEGMENTS][3*(8448+64)]; // short dummy_w[MAX_NUM_NR_DLSCH_SEGMENTS][3*(8448+64)];
uint32_t r,r_offset=0,Kr,Kr_bytes,err_flag=0,K_bytes_F; uint32_t r,r_offset=0,Kr,Kr_bytes,err_flag=0,K_bytes_F;
uint8_t crc_type; uint8_t crc_type;
uint8_t C,Cprime; uint8_t C,Cprime;
...@@ -1509,8 +1509,8 @@ void *nr_dlsch_decoding_process(void *arg) ...@@ -1509,8 +1509,8 @@ void *nr_dlsch_decoding_process(void *arg)
break; break;
} }
if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { if (harq_process->C > MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling) {
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling); LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling);
return((1+dlsch->max_ldpc_iterations)); return((1+dlsch->max_ldpc_iterations));
}*/ }*/
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
......
...@@ -284,7 +284,7 @@ typedef struct { ...@@ -284,7 +284,7 @@ typedef struct {
/// 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)
int16_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; int16_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
/// LDPC processing buffers /// LDPC processing buffers
t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_DLSCH_SEGMENTS]; t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_DLSCH_SEGMENTS];
/// Number of code segments /// Number of code segments
uint32_t C; uint32_t C;
/// Number of bits in code segments /// Number of bits in code segments
......
...@@ -239,8 +239,8 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -239,8 +239,8 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
/* /*
uint8_t *channel_input[MAX_NUM_DLSCH_SEGMENTS]; //unsigned char uint8_t *channel_input[MAX_NUM_NR_ULSCH_SEGMENTS]; //unsigned char
for(j=0;j<MAX_NUM_DLSCH_SEGMENTS;j++) { for(j=0;j<MAX_NUM_NR_ULSCH_SEGMENTS;j++) {
channel_input[j] = (unsigned char *)malloc16(sizeof(unsigned char) * 68*384); channel_input[j] = (unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
} }
*/ */
......
...@@ -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_ULSCH_SEGMENTS][3*(6144+64)]; int16_t w[MAX_NUM_NR_ULSCH_SEGMENTS][3*(6144+64)];
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
} NR_UL_gNB_HARQ_t; } NR_UL_gNB_HARQ_t;
......
...@@ -332,7 +332,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -332,7 +332,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
uint16_t sdu_lengths[NB_RB_MAX]; uint16_t sdu_lengths[NB_RB_MAX];
int num_sdus = 0; int num_sdus = 0;
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; unsigned char dlsch_buffer[MAX_NR_DLSCH_PAYLOAD_BYTES];
int offset; int offset;
int UE_id = 0; int UE_id = 0;
unsigned char sdu_lcids[NB_RB_MAX]; unsigned char sdu_lcids[NB_RB_MAX];
......
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