...
 
Commits (3)
...@@ -126,7 +126,7 @@ else ...@@ -126,7 +126,7 @@ else
} else { } else {
//msg("nr_segmentation.c: Illegal codeword size !!!\n"); //msg("nr_segmentation.c: Illegal codeword size !!!\n");
return(-1); return -1;
} }
*Zout = *K; *Zout = *K;
*K = *K*Kb; *K = *K*Kb;
...@@ -140,10 +140,11 @@ else ...@@ -140,10 +140,11 @@ else
if ((input_buffer) && (output_buffers)) { if ((input_buffer) && (output_buffers)) {
s=0; s = 0;
for (r=0; r<*C; r++) { for (r=0; r<*C; r++) {
k = 0;
Kprime = Bprime_by_C; Kprime = Bprime_by_C;
while (k<((Kprime - L)>>3)) { while (k<((Kprime - L)>>3)) {
...@@ -153,10 +154,11 @@ else ...@@ -153,10 +154,11 @@ else
s++; s++;
} }
if (*F>0) if (*F>0) {
for (k=Kprime>>3; k<(*K)>>3; k++) { for (k=Kprime>>3; k<(*K)>>3; k++) {
output_buffers[r][k] = NR_NULL; output_buffers[r][k] = NR_NULL;
//printf("r %d filler bits [%d] = %d Kprime %d \n", r,k, output_buffers[r][k], Kprime); //printf("r %d filler bits [%d] = %d Kprime %d \n", r,k, output_buffers[r][k], Kprime);
}
} }
if (*C > 1) { // add CRC if (*C > 1) { // add CRC
...@@ -165,12 +167,10 @@ else ...@@ -165,12 +167,10 @@ else
output_buffers[r][1+((Kprime-L)>>3)] = ((uint8_t*)&crc)[1]; output_buffers[r][1+((Kprime-L)>>3)] = ((uint8_t*)&crc)[1];
output_buffers[r][2+((Kprime-L)>>3)] = ((uint8_t*)&crc)[0]; output_buffers[r][2+((Kprime-L)>>3)] = ((uint8_t*)&crc)[0];
} }
k=0;
} }
} }
return(0); return 0;
} }
......
...@@ -375,6 +375,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu, ...@@ -375,6 +375,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,
gNB_config->sch_config.ssb_subcarrier_offset.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
gNB_config->sch_config.physical_cell_id.value=Nid_cell; gNB_config->sch_config.physical_cell_id.value=Nid_cell;
gNB_config->sch_config.ssb_scg_position_in_burst.value=position_in_burst; gNB_config->sch_config.ssb_scg_position_in_burst.value=position_in_burst;
gNB_config->subframe_config.dl_cyclic_prefix_type.value = (fp->Ncp == NORMAL) ? NFAPI_CP_NORMAL : NFAPI_CP_EXTENDED;
gNB->mac_enabled = 1; gNB->mac_enabled = 1;
fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value); fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
......
...@@ -670,7 +670,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -670,7 +670,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
// many memory allocation sizes are hard coded // many memory allocation sizes are hard coded
AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" ); AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
AssertFatal( ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" ); AssertFatal( nb_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
// init phy_vars_ue // init phy_vars_ue
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
...@@ -922,7 +922,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) { ...@@ -922,7 +922,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) {
for (k=0; k<RX_NB_TH_MAX; k++) { for (k=0; k<RX_NB_TH_MAX; k++) {
AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n");
LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[i][j]); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
} }
} }
......
...@@ -169,6 +169,9 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, ...@@ -169,6 +169,9 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
} }
fp->slots_per_frame = 10* fp->slots_per_subframe; fp->slots_per_frame = 10* fp->slots_per_subframe;
fp->nb_antenna_ports_eNB = 1; // default value until overwritten by RRCConnectionReconfiguration
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe; fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
fp->samples_per_frame_wCP = 10 * fp->samples_per_subframe_wCP; fp->samples_per_frame_wCP = 10 * fp->samples_per_subframe_wCP;
......
...@@ -386,6 +386,7 @@ int main(int argc, char **argv) { ...@@ -386,6 +386,7 @@ int main(int argc, char **argv) {
frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_tx = n_tx;
frame_parms->nb_antennas_rx = n_rx; frame_parms->nb_antennas_rx = n_rx;
frame_parms->N_RB_DL = N_RB_DL; frame_parms->N_RB_DL = N_RB_DL;
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
crcTableInit(); crcTableInit();
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions); nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions);
phy_init_nr_gNB(gNB, 0, 0); phy_init_nr_gNB(gNB, 0, 0);
...@@ -495,7 +496,7 @@ int main(int argc, char **argv) { ...@@ -495,7 +496,7 @@ int main(int argc, char **argv) {
test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[UE->current_thread_id[subframe]][0][0]; NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[0][0][0];
NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid]; NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid];
harq_process->mcs = Imcs; harq_process->mcs = Imcs;
harq_process->Nl = Nl; harq_process->Nl = Nl;
...@@ -648,7 +649,7 @@ int main(int argc, char **argv) { ...@@ -648,7 +649,7 @@ int main(int argc, char **argv) {
printf("gNB %d\n", i); printf("gNB %d\n", i);
free_gNB_dlsch(gNB->dlsch[0][i]); free_gNB_dlsch(gNB->dlsch[0][i]);
printf("UE %d\n", i); printf("UE %d\n", i);
free_nr_ue_dlsch(UE->dlsch[UE->current_thread_id[subframe]][0][i]); free_nr_ue_dlsch(UE->dlsch[0][0][i]);
} }
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
......