Merge remote-tracking branch 'origin/NR_RRCConfiguration' into NR_RRC_CP_bugfix
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#define MAX_TURBO_ITERATIONS_MBSFN 8
|
||||
#define MAX_TURBO_ITERATIONS max_turbo_iterations
|
||||
|
||||
#define MAX_LDPC_ITERATIONS 10//5
|
||||
#define MAX_LDPC_ITERATIONS 5
|
||||
#define MAX_LDPC_ITERATIONS_MBSFN 4
|
||||
|
||||
#define LTE_NULL 2
|
||||
|
||||
@@ -360,12 +360,16 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &gNB->gNB_config;
|
||||
//overwrite for new NR parameters
|
||||
|
||||
uint64_t rev_burst=0;
|
||||
for (int i=0; i<64; i++)
|
||||
rev_burst |= (((position_in_burst>>(63-i))&0x01)<<i);
|
||||
|
||||
gNB_config->cell_config.phy_cell_id.value = Nid_cell;
|
||||
gNB_config->ssb_config.scs_common.value = mu;
|
||||
gNB_config->ssb_table.ssb_subcarrier_offset.value = 0;
|
||||
gNB_config->ssb_table.ssb_offset_point_a.value = (N_RB_DL-20)>>1;
|
||||
gNB_config->ssb_table.ssb_mask_list[0].ssb_mask.value = position_in_burst;
|
||||
gNB_config->ssb_table.ssb_mask_list[1].ssb_mask.value = position_in_burst>>32;
|
||||
gNB_config->ssb_table.ssb_mask_list[1].ssb_mask.value = (rev_burst)&(0xFFFFFFFF);
|
||||
gNB_config->ssb_table.ssb_mask_list[0].ssb_mask.value = (rev_burst>>32)&(0xFFFFFFFF);
|
||||
gNB_config->cell_config.frame_duplex_type.value = TDD;
|
||||
gNB_config->ssb_table.ssb_period.value = 1; //10ms
|
||||
gNB_config->carrier_config.dl_grid_size[mu].value = N_RB_DL;
|
||||
@@ -381,6 +385,9 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
fp->ul_CarrierFreq = 3500000000;//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
fp->nr_band = 78;
|
||||
fp->threequarter_fs= 0;
|
||||
|
||||
gNB_config->carrier_config.dl_bandwidth.value = config_bandwidth(mu, N_RB_DL, fp->nr_band);
|
||||
|
||||
nr_init_frame_parms(gNB_config, fp);
|
||||
gNB->configured = 1;
|
||||
LOG_I(PHY,"gNB configured\n");
|
||||
|
||||
@@ -99,12 +99,12 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, uint16_t bw)
|
||||
|
||||
// selection of SS block pattern according to TS 38101-1 Table 5.4.3.3-1 for SCS 30kHz
|
||||
if (fp->nr_band == 5 || fp->nr_band == 66)
|
||||
fp->ssb_type = nr_ssb_type_B;
|
||||
fp->ssb_type = nr_ssb_type_B;
|
||||
else{
|
||||
if (fp->nr_band == 41 || ( fp->nr_band > 76 && fp->nr_band < 80) )
|
||||
fp->ssb_type = nr_ssb_type_C;
|
||||
fp->ssb_type = nr_ssb_type_C;
|
||||
else
|
||||
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
|
||||
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
|
||||
}
|
||||
|
||||
switch(bw){
|
||||
@@ -148,21 +148,21 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, uint16_t bw)
|
||||
break;
|
||||
|
||||
case 90:
|
||||
AssertFatal(fp->threequarter_fs==0,"3/4 sampling impossible for N_RB %d and MU %d\n",fp->N_RB_DL,mu);
|
||||
AssertFatal(fp->threequarter_fs==0,"3/4 sampling impossible for %d MHz band and MU %d\n",bw,mu);
|
||||
fp->ofdm_symbol_size = 4096;
|
||||
fp->first_carrier_offset = 2626; //4096 - ( (245*12) / 2 )
|
||||
fp->nb_prefix_samples0 = 352;
|
||||
fp->nb_prefix_samples = 288;
|
||||
break;
|
||||
case 100:
|
||||
AssertFatal(fp->threequarter_fs==0,"3/4 sampling impossible for N_RB %d and MU %d\n",fp->N_RB_DL,mu);
|
||||
AssertFatal(fp->threequarter_fs==0,"3/4 sampling impossible for %d MHz band and MU %d\n",bw,mu);
|
||||
fp->ofdm_symbol_size = 4096;
|
||||
fp->first_carrier_offset = 2458; //4096 - ( (273*12) / 2 )
|
||||
fp->nb_prefix_samples0 = 352;
|
||||
fp->nb_prefix_samples = 288;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of resource blocks %d undefined for mu %d, frame parms = %p\n", fp->N_RB_DL, mu, fp);
|
||||
AssertFatal(1==0,"%d MHz band undefined for mu %d, frame parms = %p\n", bw, mu, fp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -184,7 +184,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, uint16_t bw)
|
||||
case 90:
|
||||
case 100:
|
||||
default:
|
||||
AssertFatal(1==0,"Bandwidth of %d MHz undefined for mu %d, frame parms = %p\n", bw, mu, fp);
|
||||
AssertFatal(1==0,"%d MHz band undefined for mu %d, frame parms = %p\n", bw, mu, fp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -206,7 +206,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, uint16_t bw)
|
||||
fp->nb_prefix_samples = 36;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of resource blocks %d undefined for mu %d, frame parms = %p\n", fp->N_RB_DL, mu, fp);
|
||||
AssertFatal(1==0,"%d MHz band undefined for mu %d, frame parms = %p\n", bw, mu, fp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -252,7 +252,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
{
|
||||
|
||||
fp->frame_type = cfg->cell_config.frame_duplex_type.value;
|
||||
fp->L_ssb = (((uint64_t) cfg->ssb_table.ssb_mask_list[1].ssb_mask.value)<<32) | cfg->ssb_table.ssb_mask_list[0].ssb_mask.value ;
|
||||
fp->L_ssb = (((uint64_t) cfg->ssb_table.ssb_mask_list[0].ssb_mask.value)<<32) | cfg->ssb_table.ssb_mask_list[1].ssb_mask.value ;
|
||||
fp->N_RB_DL = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
fp->N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
|
||||
@@ -385,7 +385,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->Lmax = 64;
|
||||
}
|
||||
|
||||
fp->L_ssb = (((uint64_t) config->ssb_table.ssb_mask_list[1].ssb_mask)<<32) | config->ssb_table.ssb_mask_list[0].ssb_mask;
|
||||
fp->L_ssb = (((uint64_t) config->ssb_table.ssb_mask_list[1].ssb_mask)<<32) | config->ssb_table.ssb_mask_list[1].ssb_mask;
|
||||
|
||||
fp->N_ssb = 0;
|
||||
for (int p=0; p<fp->Lmax; p++)
|
||||
|
||||
@@ -166,7 +166,7 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
int k,l,k_prime,dci_idx, dmrs_idx;
|
||||
/*First iteration: single DCI*/
|
||||
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15=NULL;
|
||||
|
||||
|
||||
// find coreset descriptor
|
||||
@@ -243,8 +243,8 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
printf("Encoded Payload (length:%d dwords):\n", encoded_length>>5);
|
||||
|
||||
for (int i=0; i<encoded_length>>5; i++)
|
||||
printf("[%d]->0x%08x \t", i,encoder_output[i]);
|
||||
|
||||
printf("[%d]->0x%08x \t", i,encoder_output[i]);
|
||||
|
||||
printf("\n");
|
||||
#endif
|
||||
/// Scrambling
|
||||
@@ -273,9 +273,10 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
|
||||
/*Reorder REG list for a freq first mapping*/
|
||||
uint8_t nb_regs = pdcch_pdu_rel15->AggregationLevel[d]*NR_NB_REG_PER_CCE;
|
||||
uint8_t reg_idx0 = pdcch_pdu_rel15->CceIndex[d]*NR_NB_REG_PER_CCE;
|
||||
|
||||
/*Mapping the encoded DCI along with the DMRS */
|
||||
for (int reg_idx=0; reg_idx<nb_regs; reg_idx++) {
|
||||
for (int reg_idx=reg_idx0; reg_idx<(nb_regs+reg_idx0); reg_idx++) {
|
||||
k = cset_start_sc + (12*reg_idx/cset_nsymb);
|
||||
|
||||
if (k >= frame_parms.ofdm_symbol_size)
|
||||
|
||||
@@ -684,7 +684,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
|
||||
harq_process->handled = 1;
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -705,29 +705,28 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
{
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",phy_vars_gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS);
|
||||
}
|
||||
}
|
||||
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
memcpy(harq_process->b+offset,
|
||||
harq_process->c[r],
|
||||
Kr_bytes- - (harq_process->F>>3) -((harq_process->C>1)?3:0));
|
||||
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
memcpy(harq_process->b+offset,
|
||||
harq_process->c[r],
|
||||
Kr_bytes- - (harq_process->F>>3) -((harq_process->C>1)?3:0));
|
||||
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("Segment %u : Kr = %u bytes\n", r, Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n", (Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)), harq_pid);
|
||||
printf("b[0] = %x, c[%d] = %x\n", harq_process->b[offset], harq_process->F>>3, harq_process->c[r]);
|
||||
printf("Segment %u : Kr = %u bytes\n", r, Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n", (Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)), harq_pid);
|
||||
printf("b[0] = %x, c[%d] = %x\n", harq_process->b[offset], harq_process->F>>3, harq_process->c[r]);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ulsch->last_iteration_cnt = ret;
|
||||
|
||||
return(ret);
|
||||
|
||||
@@ -150,7 +150,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
|
||||
for (int i=0; i<9; i++) {
|
||||
z[index_z + i] = llr[index_llr + i];
|
||||
LOG_DDD("[reg=%d,bundle_j=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
|
||||
LOG_D(PHY,"[reg=%d,bundle_j=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
|
||||
reg,bundle_j,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
|
||||
f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
|
||||
}
|
||||
@@ -678,7 +678,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
int n_rb,rb_offset;
|
||||
get_coreset_rballoc(rel15->coreset.frequency_domain_resource,&n_rb,&rb_offset);
|
||||
for (int s=rel15->coreset.StartSymbolIndex; s<(rel15->coreset.StartSymbolIndex+rel15->coreset.duration); s++) {
|
||||
LOG_DD("in nr_pdcch_extract_rbs_single(rxdataF -> rxdataF_ext || dl_ch_estimates -> dl_ch_estimates_ext)\n");
|
||||
LOG_D(PHY,"in nr_pdcch_extract_rbs_single(rxdataF -> rxdataF_ext || dl_ch_estimates -> dl_ch_estimates_ext)\n");
|
||||
|
||||
nr_pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[slot]].rxdataF,
|
||||
pdcch_vars->dl_ch_estimates,
|
||||
@@ -690,8 +690,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
n_rb,
|
||||
rel15->BWPStart);
|
||||
|
||||
LOG_DD("we enter nr_pdcch_channel_level(avgP=%d) => compute channel level based on ofdm symbol 0, pdcch_vars[eNB_id]->dl_ch_estimates_ext\n",*avgP);
|
||||
LOG_DD("in nr_pdcch_channel_level(dl_ch_estimates_ext -> dl_ch_estimates_ext)\n");
|
||||
LOG_D(PHY,"we enter nr_pdcch_channel_level(avgP=%d) => compute channel level based on ofdm symbol 0, pdcch_vars[eNB_id]->dl_ch_estimates_ext\n",*avgP);
|
||||
LOG_D(PHY,"in nr_pdcch_channel_level(dl_ch_estimates_ext -> dl_ch_estimates_ext)\n");
|
||||
// compute channel level based on ofdm symbol 0
|
||||
nr_pdcch_channel_level(pdcch_vars->dl_ch_estimates_ext,
|
||||
frame_parms,
|
||||
@@ -710,8 +710,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
T(T_UE_PHY_PDCCH_ENERGY, T_INT(0), T_INT(0), T_INT(frame%1024), T_INT(slot),
|
||||
T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3]));
|
||||
#endif
|
||||
LOG_DD("we enter nr_pdcch_channel_compensation(log2_maxh=%d)\n",log2_maxh);
|
||||
LOG_DD("in nr_pdcch_channel_compensation(rxdataF_ext x dl_ch_estimates_ext -> rxdataF_comp)\n");
|
||||
LOG_D(PHY,"we enter nr_pdcch_channel_compensation(log2_maxh=%d)\n",log2_maxh);
|
||||
LOG_D(PHY,"in nr_pdcch_channel_compensation(rxdataF_ext x dl_ch_estimates_ext -> rxdataF_comp)\n");
|
||||
// compute LLRs for ofdm symbol 0 only
|
||||
nr_pdcch_channel_compensation(pdcch_vars->rxdataF_ext,
|
||||
pdcch_vars->dl_ch_estimates_ext,
|
||||
@@ -722,12 +722,12 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
log2_maxh,
|
||||
n_rb); // log2_maxh+I0_shift
|
||||
if (frame_parms->nb_antennas_rx > 1) {
|
||||
LOG_DD("we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx);
|
||||
LOG_D(PHY,"we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx);
|
||||
nr_pdcch_detection_mrc(frame_parms, pdcch_vars->rxdataF_comp,s);
|
||||
}
|
||||
|
||||
LOG_DD("we enter nr_pdcch_llr(for symbol %d), pdcch_vars[eNB_id]->rxdataF_comp ---> pdcch_vars[eNB_id]->llr \n",s);
|
||||
LOG_DD("in nr_pdcch_llr(rxdataF_comp -> llr)\n");
|
||||
LOG_D(PHY,"we enter nr_pdcch_llr(for symbol %d), pdcch_vars[eNB_id]->rxdataF_comp ---> pdcch_vars[eNB_id]->llr \n",s);
|
||||
LOG_D(PHY,"in nr_pdcch_llr(rxdataF_comp -> llr)\n");
|
||||
nr_pdcch_llr(frame_parms,
|
||||
pdcch_vars->rxdataF_comp,
|
||||
pdcch_vars->llr,
|
||||
@@ -745,7 +745,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
}
|
||||
|
||||
LOG_DD("we enter nr_pdcch_demapping_deinterleaving()\n");
|
||||
LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving()\n");
|
||||
nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr,
|
||||
(uint32_t *) pdcch_vars->e_rx,
|
||||
frame_parms,
|
||||
@@ -754,6 +754,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
rel15->coreset.RegBundleSize,
|
||||
rel15->coreset.InterleaverSize,
|
||||
rel15->coreset.ShiftIndex);
|
||||
/*
|
||||
nr_pdcch_unscrambling(rel15->rnti,
|
||||
frame_parms,
|
||||
slot,
|
||||
@@ -761,8 +762,9 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
rel15->coreset.duration*n_rb*9*2,
|
||||
// get_nCCE(n_pdcch_symbols, frame_parms, mi) * 72,
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id);
|
||||
LOG_DD("we end nr_pdcch_unscrambling()\n");
|
||||
LOG_DD("Ending nr_rx_pdcch() function\n");
|
||||
*/
|
||||
LOG_D(PHY,"we end nr_pdcch_unscrambling()\n");
|
||||
LOG_D(PHY,"Ending nr_rx_pdcch() function\n");
|
||||
|
||||
}
|
||||
return (0);
|
||||
@@ -798,7 +800,7 @@ void pdcch_scrambling(NR_DL_FRAME_PARMS *frame_parms,
|
||||
#ifdef NR_PDCCH_DCI_RUN
|
||||
|
||||
void nr_pdcch_unscrambling(uint16_t crnti, NR_DL_FRAME_PARMS *frame_parms, uint8_t slot,
|
||||
int16_t *z, uint32_t length, uint16_t pdcch_DMRS_scrambling_id) {
|
||||
int16_t *z, int16_t *z2,uint32_t length, uint16_t pdcch_DMRS_scrambling_id) {
|
||||
int i;
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s = 0;
|
||||
@@ -818,7 +820,8 @@ void nr_pdcch_unscrambling(uint16_t crnti, NR_DL_FRAME_PARMS *frame_parms, uint8
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
if (((s >> (i % 32)) & 1) == 1) z[i] = -z[i];
|
||||
if (((s >> (i % 32)) & 1) == 1) z2[i] = -z[i];
|
||||
else z2[i]=z[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,15 +840,29 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
|
||||
rel15 = &pdcch_vars->pdcch_config[i];
|
||||
int dci_length = rel15->dci_length;
|
||||
int16_t tmp_e[16*108];
|
||||
|
||||
for (int j=0;j<rel15->number_of_candidates;j++) {
|
||||
LOG_D(PHY,"Trying DCI candidate %d, CCE %d (%d), L %d\n",j,rel15->CCE[j],rel15->CCE[j]*9*6*2,rel15->L[j]);
|
||||
int CCEind = rel15->CCE[j];
|
||||
int L = rel15->L[j];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
const t_nrPolar_params *currentPtrDCI=nr_polar_params(1, dci_length, L,1,&ue->polarList);
|
||||
uint16_t crc = polar_decoder_int16(&pdcch_vars->e_rx[CCEind*9*6*2],
|
||||
|
||||
nr_pdcch_unscrambling(rel15->rnti,
|
||||
&ue->frame_parms,
|
||||
slot,
|
||||
&pdcch_vars->e_rx[CCEind*108],
|
||||
tmp_e,
|
||||
L*108,
|
||||
// get_nCCE(n_pdcch_symbols, frame_parms, mi) * 72,
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id);
|
||||
|
||||
uint16_t crc = polar_decoder_int16(tmp_e,
|
||||
dci_estimation,
|
||||
1,
|
||||
currentPtrDCI);
|
||||
LOG_D(PHY,"Decoded crc %x\n",crc);
|
||||
if (crc == rel15->rnti) {
|
||||
dci_ind->SFN = frame;
|
||||
dci_ind->slot = slot;
|
||||
|
||||
@@ -546,7 +546,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
//LOG_E(PHY,"AbsSubframe %d.%d Start LDPC segment %d/%d A %d ",frame%1024,nr_tti_rx,r,harq_process->C-1, A);
|
||||
|
||||
printf("harq process dr iteration %d\n", p_decParams->numMaxIter);
|
||||
//printf("harq process dr iteration %d\n", p_decParams->numMaxIter);
|
||||
|
||||
memset(pv,0,2*harq_process->Z*sizeof(int16_t));
|
||||
//memset(pl,0,2*p_decParams->Z*sizeof(int8_t));
|
||||
|
||||
@@ -1539,7 +1539,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,NR_DL_FRAME
|
||||
void pdcch_interleaving(NR_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi);
|
||||
|
||||
void nr_pdcch_unscrambling(uint16_t crnti, NR_DL_FRAME_PARMS *frame_parms, uint8_t slot,
|
||||
int16_t *z, uint32_t length, uint16_t pdcch_DMRS_scrambling_id);
|
||||
int16_t *z, int16_t *z2,uint32_t length, uint16_t pdcch_DMRS_scrambling_id);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME
|
||||
sco = cfg->ssb_table.ssb_subcarrier_offset.value;
|
||||
|
||||
fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + sco);
|
||||
LOG_I(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco);
|
||||
}
|
||||
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
|
||||
@@ -95,8 +95,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
|
||||
|
||||
ssb_index = i + SSB_Table[rel_slot]; // computing the ssb_index
|
||||
|
||||
if ((ssb_index<64) && ((fp->L_ssb >> ssb_index) & 0x01)) { // generating the ssb only if the bit of L_ssb at current ssb index is 1
|
||||
|
||||
if ((ssb_index<64) && ((fp->L_ssb >> (63-ssb_index)) & 0x01)) { // generating the ssb only if the bit of L_ssb at current ssb index is 1
|
||||
fp->ssb_index = ssb_index;
|
||||
int ssb_start_symbol_abs = nr_get_ssb_start_symbol(fp); // computing the starting symbol for current ssb
|
||||
ssb_start_symbol = ssb_start_symbol_abs % fp->symbols_per_slot; // start symbol wrt slot
|
||||
@@ -279,9 +278,9 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
0);
|
||||
|
||||
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations)
|
||||
LOG_I(PHY, "ULSCH in error\n");
|
||||
LOG_I(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
else
|
||||
LOG_I(PHY, "ULSCH received ok\n");
|
||||
LOG_I(PHY, "ULSCH %d received ok\n",ULSCH_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -229,17 +229,18 @@ int main(int argc, char **argv)
|
||||
int mcsIndex_set=0,rbStart_set=0,rbSize_set=0;
|
||||
int print_perf = 0;
|
||||
|
||||
FILE *scg_fd=NULL;
|
||||
|
||||
while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:e:m:")) != -1) {
|
||||
switch (c) {
|
||||
/*case 'f':
|
||||
write_output_file=1;
|
||||
output_fd = fopen(optarg,"w");
|
||||
case 'f':
|
||||
scg_fd = fopen(optarg,"r");
|
||||
|
||||
if (output_fd==NULL) {
|
||||
if (scg_fd==NULL) {
|
||||
printf("Error opening %s\n",optarg);
|
||||
exit(-1);
|
||||
}
|
||||
break;*/
|
||||
break;
|
||||
|
||||
/*case 'd':
|
||||
frame_type = 1;
|
||||
@@ -429,7 +430,7 @@ int main(int argc, char **argv)
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
|
||||
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
|
||||
//printf("-f Output filename (.txt format) for Pe/SNR results\n");
|
||||
printf("-f raw file containing RRC configuration (generated by gNB)\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
printf("-E used CSS scheduler\n");
|
||||
printf("-o CORESET offset\n");
|
||||
@@ -470,8 +471,8 @@ int main(int argc, char **argv)
|
||||
gNB_mac = RC.nrmac[0];
|
||||
gNB_RRC_INST rrc;
|
||||
memset((void*)&rrc,0,sizeof(rrc));
|
||||
|
||||
// read in SCGroupConfig
|
||||
FILE *scg_fd = fopen("reconfig.raw","r");
|
||||
AssertFatal(scg_fd != NULL,"no reconfig.raw file\n");
|
||||
char buffer[1024];
|
||||
int msg_len=fread(buffer,1,1024,scg_fd);
|
||||
|
||||
@@ -589,7 +589,8 @@ int main(int argc, char **argv)
|
||||
while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb
|
||||
frame_parms->ssb_index = ssb_index;
|
||||
UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms);
|
||||
int ssb_slot = (ssb_index/2)+(n_hf*frame_parms->slots_per_frame);
|
||||
|
||||
int ssb_slot = (ssb_index>>1)+(n_hf*frame_parms->slots_per_frame);
|
||||
for (int i=UE->symbol_offset+1; i<UE->symbol_offset+4; i++) {
|
||||
nr_slot_fep(UE,
|
||||
i%frame_parms->symbols_per_slot,
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
#include "openair1/SIMULATION/TOOLS/sim.h"
|
||||
#include "openair1/SIMULATION/RF/rf.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
@@ -63,6 +62,7 @@ PHY_VARS_NR_UE *UE;
|
||||
RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
int sf_ahead=4, phy_test = 0;
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
@@ -116,7 +116,10 @@ int generate_dlsch_header(unsigned char *mac_header,
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
int rlc_module_init (int enb) {return(0);}
|
||||
void pdcp_layer_init (void) {}
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
int rrc_init_nr_global_param(void){return(0);}
|
||||
|
||||
|
||||
// needed for some functions
|
||||
uint16_t n_rnti = 0x1234;
|
||||
@@ -128,9 +131,9 @@ int main(int argc, char **argv)
|
||||
int i,sf;
|
||||
double SNR, snr0 = -2.0, snr1 = 2.0;
|
||||
double sigma, sigma_dB;
|
||||
double snr_step = 0.1;
|
||||
double snr_step = 1;
|
||||
uint8_t snr1set = 0;
|
||||
int slot = 0;
|
||||
int slot = 0, frame = 0;
|
||||
FILE *output_fd = NULL;
|
||||
//uint8_t write_output_file = 0;
|
||||
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0, delay = 0;
|
||||
@@ -144,13 +147,12 @@ int main(int argc, char **argv)
|
||||
SCM_t channel_model = AWGN; //Rayleigh1_anticorr;
|
||||
uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1;
|
||||
//unsigned char frame_type = 0;
|
||||
int number_of_frames = 1;
|
||||
int frame_length_complex_samples,frame_length_complex_samples_no_prefix;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
int loglvl = OAILOG_WARNING;
|
||||
uint64_t SSB_positions=0x01;
|
||||
uint16_t nb_symb_sch = 12;
|
||||
int start_symbol = 2;
|
||||
int start_symbol = 0;
|
||||
uint16_t nb_rb = 50;
|
||||
uint8_t Imcs = 9;
|
||||
uint8_t precod_nbr_layers = 1;
|
||||
@@ -161,11 +163,13 @@ int main(int argc, char **argv)
|
||||
int32_t txlev;
|
||||
int start_rb = 0;
|
||||
int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
|
||||
|
||||
float target_error_rate = 0.01;
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
|
||||
UE_nr_rxtx_proc_t UE_proc;
|
||||
FILE *scg_fd=NULL;
|
||||
|
||||
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) {
|
||||
@@ -187,19 +191,14 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
number_of_frames = atoi(optarg);
|
||||
break;
|
||||
scg_fd = fopen(optarg, "r");
|
||||
|
||||
/*case 'f':
|
||||
write_output_file = 1;
|
||||
output_fd = fopen(optarg, "w");
|
||||
|
||||
if (output_fd == NULL) {
|
||||
if (scg_fd == NULL) {
|
||||
printf("Error opening %s\n", optarg);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;*/
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
switch ((char) *optarg) {
|
||||
@@ -356,10 +355,10 @@ int main(int argc, char **argv)
|
||||
//printf("-x Transmission mode (1,2,6 for the moment)\n");
|
||||
printf("-y Number of TX antennas used in eNB\n");
|
||||
printf("-z Number of RX antennas used in UE\n");
|
||||
|
||||
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
|
||||
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
printf("-G raw file containing RRC configuration (generated by gNB)\n");
|
||||
printf("-M Multiple SSB positions in burst\n");
|
||||
printf("-N Nid_cell\n");
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
@@ -403,12 +402,74 @@ int main(int argc, char **argv)
|
||||
frame_parms->N_RB_UL = N_RB_UL;
|
||||
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
||||
|
||||
crcTableInit();
|
||||
RC.nb_nr_macrlc_inst = 1;
|
||||
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
|
||||
for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
|
||||
RC.nb_nr_mac_CC[i] = 1;
|
||||
mac_top_init_gNB();
|
||||
gNB_MAC_INST* gNB_mac = RC.nrmac[0];
|
||||
gNB_RRC_INST rrc;
|
||||
memset((void*)&rrc,0,sizeof(rrc));
|
||||
|
||||
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions);
|
||||
// read in SCGroupConfig
|
||||
AssertFatal(scg_fd != NULL,"no reconfig.raw file\n");
|
||||
char buffer[1024];
|
||||
int msg_len=fread(buffer,1,1024,scg_fd);
|
||||
NR_RRCReconfiguration_t *NR_RRCReconfiguration;
|
||||
|
||||
phy_init_nr_gNB(gNB, 0, 0);
|
||||
//init_eNB_afterRU();
|
||||
printf("Decoding NR_RRCReconfiguration (%d bytes)\n",msg_len);
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_RRCReconfiguration,
|
||||
(void **)&NR_RRCReconfiguration,
|
||||
(uint8_t *)buffer,
|
||||
msg_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_RRCReConfiguration decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_RRCReconfiguration, NR_RRCReconfiguration, 1 );
|
||||
exit(-1);
|
||||
}
|
||||
fclose(scg_fd);
|
||||
|
||||
AssertFatal(NR_RRCReconfiguration->criticalExtensions.present == NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration,"wrong NR_RRCReconfiguration->criticalExstions.present type\n");
|
||||
|
||||
NR_RRCReconfiguration_IEs_t *reconfig_ies = NR_RRCReconfiguration->criticalExtensions.choice.rrcReconfiguration;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup;
|
||||
dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_CellGroupConfig,
|
||||
(void **)&secondaryCellGroup,
|
||||
(uint8_t *)reconfig_ies->secondaryCellGroup->buf,
|
||||
reconfig_ies->secondaryCellGroup->size);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_CellGroupConfig decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_CellGroupConfig, secondaryCellGroup, 1 );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
rrc.carrier.servingcellconfigcommon = secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
printf("%p,%p\n",
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon,
|
||||
rrc.carrier.servingcellconfigcommon);
|
||||
|
||||
AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface");
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0,1,scc,0,0,NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0,1,NULL,1,secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
phy_init_nr_gNB(gNB,0,0);
|
||||
N_RB_DL = gNB->frame_parms.N_RB_DL;
|
||||
|
||||
//crcTableInit();
|
||||
|
||||
//nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions);
|
||||
|
||||
frame_length_complex_samples = frame_parms->samples_per_subframe;
|
||||
frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP;
|
||||
@@ -428,7 +489,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
//nr_init_frame_parms_ue(&UE->frame_parms);
|
||||
//init_nr_ue_transport(UE, 0);
|
||||
init_nr_ue_transport(UE, 0);
|
||||
|
||||
/*
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
@@ -438,9 +501,29 @@ int main(int argc, char **argv)
|
||||
printf("Can't get ue ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
nr_l2_init_ue(NULL);
|
||||
NR_UE_MAC_INST_t* UE_mac = get_mac_inst(0);
|
||||
|
||||
UE->if_inst = nr_ue_if_module_init(0);
|
||||
UE->if_inst->scheduled_response = nr_ue_scheduled_response;
|
||||
UE->if_inst->phy_config_request = nr_ue_phy_config_request;
|
||||
UE->if_inst->dl_indication = nr_ue_dl_indication;
|
||||
UE->if_inst->ul_indication = nr_ue_ul_indication;
|
||||
|
||||
UE_mac->if_module = nr_ue_if_module_init(0);
|
||||
|
||||
//Configure UE
|
||||
rrc.carrier.MIB = (uint8_t*) malloc(4);
|
||||
rrc.carrier.sizeof_MIB = do_MIB_NR(&rrc,0);
|
||||
|
||||
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib,secondaryCellGroup->spCellConfig);
|
||||
|
||||
nr_ue_phy_config_request(&UE_mac->phy_config);
|
||||
|
||||
|
||||
unsigned char harq_pid = 0;
|
||||
|
||||
@@ -455,7 +538,6 @@ int main(int argc, char **argv)
|
||||
unsigned char *test_input_bit;
|
||||
uint32_t errors_decoding = 0;
|
||||
uint32_t errors_scrambling = 0;
|
||||
uint32_t is_frame_in_error = 0;
|
||||
|
||||
test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
|
||||
estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
|
||||
@@ -493,13 +575,6 @@ int main(int argc, char **argv)
|
||||
|
||||
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
|
||||
|
||||
printf("-------------------\n");
|
||||
printf("SNR %f\n", SNR);
|
||||
printf("-------------------\n");
|
||||
|
||||
is_frame_in_error = 0;
|
||||
for (int frame = 0; frame < number_of_frames; frame++) {
|
||||
|
||||
UE_proc.nr_tti_tx = slot;
|
||||
UE_proc.frame_tx = frame;
|
||||
|
||||
@@ -589,7 +664,7 @@ int main(int argc, char **argv)
|
||||
|
||||
phy_procedures_nrUE_TX(UE, &UE_proc, gNB_id, 0);
|
||||
|
||||
if (number_of_frames==1)
|
||||
if (n_trials==1)
|
||||
LOG_M("txsig0.m","txs0", UE->common_vars.txdata[0],frame_length_complex_samples,1,1);
|
||||
|
||||
///////////
|
||||
@@ -629,12 +704,16 @@ int main(int argc, char **argv)
|
||||
//----------------------------------------------------------
|
||||
phy_procedures_gNB_common_RX(gNB, frame, slot);
|
||||
|
||||
if (number_of_frames==1)
|
||||
if (n_trials==1)
|
||||
LOG_M("rxsigF0.m","rxsF0",gNB->common_vars.rxdataF[0],frame_length_complex_samples_no_prefix,1,1);
|
||||
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame, slot);
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
if (gNB->ulsch[0][0]->last_iteration_cnt >=
|
||||
gNB->ulsch[0][0]->max_ldpc_iterations+1)
|
||||
n_errors++;
|
||||
|
||||
//----------------------------------------------------------
|
||||
//----------------- count and print errors -----------------
|
||||
//----------------------------------------------------------
|
||||
@@ -644,14 +723,15 @@ int main(int argc, char **argv)
|
||||
if(((ulsch_ue[0]->g[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) ||
|
||||
((ulsch_ue[0]->g[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0)))
|
||||
{
|
||||
if(errors_scrambling == 0)
|
||||
printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);
|
||||
/*if(errors_scrambling == 0)
|
||||
printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/
|
||||
errors_scrambling++;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors_scrambling > 0) {
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %d\n" "\x1B[0m", frame, trial, errors_scrambling);
|
||||
if (n_trials==1)
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %d\n" "\x1B[0m", frame, trial, errors_scrambling);
|
||||
}
|
||||
|
||||
for (i = 0; i < TBS; i++) {
|
||||
@@ -660,38 +740,39 @@ int main(int argc, char **argv)
|
||||
test_input_bit[i] = (ulsch_ue[0]->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
|
||||
|
||||
if (estimated_output_bit[i] != test_input_bit[i]) {
|
||||
if(errors_decoding == 0)
|
||||
printf("\x1B[34m""[frame %d][trial %d]\t1st bit in error in decoding = %d\n" "\x1B[0m", frame, trial, i);
|
||||
/*if(errors_decoding == 0)
|
||||
printf("\x1B[34m""[frame %d][trial %d]\t1st bit in error in decoding = %d\n" "\x1B[0m", frame, trial, i);*/
|
||||
errors_decoding++;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors_decoding > 0) {
|
||||
is_frame_in_error = 1;
|
||||
n_false_positive++;
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %d\n" "\x1B[0m", frame, trial, errors_decoding);
|
||||
} else {
|
||||
is_frame_in_error = 0;
|
||||
break;
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
if (n_trials==1)
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %d\n" "\x1B[0m", frame, trial, errors_decoding);
|
||||
}
|
||||
|
||||
} // trial loop
|
||||
|
||||
if (is_frame_in_error == 1)
|
||||
break;
|
||||
} // frame loop
|
||||
printf("*****************************************\n");
|
||||
printf("SNR %f: n_errors (negative CRC) = %d/%d, false_positive %d/%d, errors_scrambling %d/%d\n", SNR, n_errors, n_trials, n_false_positive, n_trials, errors_scrambling, n_trials);
|
||||
printf("\n");
|
||||
printf("SNR %f: Channel BLER %e, Channel BER %e\n", SNR,(double)n_errors/n_trials,(double)errors_scrambling/available_bits/n_trials);
|
||||
printf("*****************************************\n");
|
||||
printf("\n");
|
||||
|
||||
if(is_frame_in_error == 0)
|
||||
break;
|
||||
if(n_trials==1)
|
||||
break;
|
||||
|
||||
if ((float)n_errors/(float)n_trials <= target_error_rate) {
|
||||
printf("*************\n");
|
||||
printf("PUSCH test OK\n");
|
||||
printf("*************\n");
|
||||
break;
|
||||
}
|
||||
|
||||
} // SNR loop
|
||||
|
||||
if(is_frame_in_error == 0) {
|
||||
printf("\n");
|
||||
printf("*************\n");
|
||||
printf("PUSCH test OK\n");
|
||||
printf("*************\n");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
free(test_input_bit);
|
||||
|
||||
Reference in New Issue
Block a user