Commit cd28e3fb authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/crash-gcc-O0' into integration_2021_wk44

parents 9d246a01 2d3bfb9b
...@@ -329,11 +329,11 @@ endif () ...@@ -329,11 +329,11 @@ endif ()
add_definitions("-DASN_DISABLE_OER_SUPPORT") add_definitions("-DASN_DISABLE_OER_SUPPORT")
######################### #########################
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb3 -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
######################### #########################
# set a flag for changes in the source code # set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files # these changes are related to hardcoded path to include .h files
set(debugOpt "-ggdb3 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks") set(debugOpt "-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks")
set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0") set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2")
set(CMAKE_C_FLAGS_RELEASE "-O3") set(CMAKE_C_FLAGS_RELEASE "-O3")
......
...@@ -238,7 +238,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -238,7 +238,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
// x_n contains the sequence r_u_v_alpha_delta(n) // x_n contains the sequence r_u_v_alpha_delta(n)
int n,i,l; int n,i;
int prb_offset[2] = {pucch_pdu->bwp_start+pucch_pdu->prb_start, pucch_pdu->bwp_start+pucch_pdu->prb_start}; int prb_offset[2] = {pucch_pdu->bwp_start+pucch_pdu->prb_start, pucch_pdu->bwp_start+pucch_pdu->prb_start};
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,0,slot,&u[0],&v[0]); // calculating u and v value first hop nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,0,slot,&u[0],&v[0]); // calculating u and v value first hop
...@@ -266,14 +266,14 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -266,14 +266,14 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
int64_t xrtmag=0,xrtmag_next=0; int64_t xrtmag=0,xrtmag_next=0;
uint8_t maxpos=0; uint8_t maxpos=0;
uint8_t index=0; uint8_t index=0;
for (l=0; l<pucch_pdu->nr_of_symbols; l++) { for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) { for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
memset((void*)xr[aarx][l],0,24*sizeof(int16_t)); memset((void*)xr[aarx][l],0,24*sizeof(int16_t));
} }
} }
int n2; int n2;
for (l=0; l<pucch_pdu->nr_of_symbols; l++) { for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
l2 = l+pucch_pdu->start_symbol_index; l2 = l+pucch_pdu->start_symbol_index;
re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset; re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
if (re_offset[l]>= frame_parms->ofdm_symbol_size) if (re_offset[l]>= frame_parms->ofdm_symbol_size)
...@@ -300,11 +300,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -300,11 +300,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
//int32_t no_corr = 0; //int32_t no_corr = 0;
int seq_index; int seq_index;
int64_t temp; int64_t temp;
int64_t av_corr=0;
for(i=0;i<nr_sequences;i++){ for(i=0;i<nr_sequences;i++){
for (l=0;l<pucch_pdu->nr_of_symbols;l++) { for (int l=0;l<pucch_pdu->nr_of_symbols;l++) {
seq_index = (pucch_pdu->initial_cyclic_shift+ seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+ mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12; gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
...@@ -322,26 +321,30 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -322,26 +321,30 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
} }
} }
} }
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",mcs[i],seq_index,corr_re[0][0],corr_im[0][0],10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0])); LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",
if (l>1) LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",mcs[i],seq_index,corr_re[0][1],corr_im[0][1],10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1])); mcs[i],seq_index,corr_re[0][0],corr_im[0][0],
if (pucch_pdu->freq_hop_flag == 0 && l==1) {// non-coherent correlation 10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0]));
temp=0; if (pucch_pdu->nr_of_symbols==2)
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",
temp+=(int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]; mcs[i],seq_index,corr_re[0][1],corr_im[0][1],
} 10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1]));
if (pucch_pdu->freq_hop_flag == 0) {
else if (pucch_pdu->freq_hop_flag == 0 && l==2) { if (pucch_pdu->nr_of_symbols==1) {// non-coherent correlation
int64_t corr_re2=0; temp=0;
int64_t corr_im2=0; for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
temp=0; temp+=(int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0];
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) { } else {
corr_re2 = (int64_t)corr_re[aa][0]+corr_re[aa][1]; int64_t corr_re2=0;
corr_im2 = (int64_t)corr_im[aa][0]+corr_im[aa][1]; int64_t corr_im2=0;
// coherent combining of 2 symbols and then complex modulus for single-frequency case temp=0;
temp+=corr_re2*corr_re2 + corr_im2*corr_im2; for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
} corr_re2 = (int64_t)corr_re[aa][0]+corr_re[aa][1];
} corr_im2 = (int64_t)corr_im[aa][0]+corr_im[aa][1];
else if (pucch_pdu->freq_hop_flag == 1) { // coherent combining of 2 symbols and then complex modulus for single-frequency case
temp+=corr_re2*corr_re2 + corr_im2*corr_im2;
}
}
} else if (pucch_pdu->freq_hop_flag == 1) {
// full non-coherent combining of 2 symbols for frequency-hopping case // full non-coherent combining of 2 symbols for frequency-hopping case
temp=0; temp=0;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
...@@ -349,7 +352,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -349,7 +352,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
} }
else AssertFatal(1==0,"shouldn't happen\n"); else AssertFatal(1==0,"shouldn't happen\n");
av_corr+=temp;
if (temp>xrtmag) { if (temp>xrtmag) {
xrtmag_next = xrtmag; xrtmag_next = xrtmag;
xrtmag=temp; xrtmag=temp;
...@@ -359,19 +361,19 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -359,19 +361,19 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
int64_t temp2=0,temp3=0;; int64_t temp2=0,temp3=0;;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) { for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
temp2 += ((int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]); temp2 += ((int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]);
if (l==2) temp3 += ((int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]); if (pucch_pdu->nr_of_symbols==2)
temp3 += ((int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]);
} }
uci_stats->current_pucch0_stat0= dB_fixed64(temp2); uci_stats->current_pucch0_stat0= dB_fixed64(temp2);
if (l==2) uci_stats->current_pucch0_stat1= dB_fixed64(temp3); if ( pucch_pdu->nr_of_symbols==2)
uci_stats->current_pucch0_stat1= dB_fixed64(temp3);
} }
else if (temp>xrtmag_next) else if (temp>xrtmag_next)
xrtmag_next = temp; xrtmag_next = temp;
} }
av_corr/=nr_sequences/l; int xrtmag_dBtimes10 = 10*(int)dB_fixed64(xrtmag/(12*pucch_pdu->nr_of_symbols));
int xrtmag_next_dBtimes10 = 10*(int)dB_fixed64(xrtmag_next/(12*pucch_pdu->nr_of_symbols));
int xrtmag_dBtimes10 = 10*(int)dB_fixed64(xrtmag/(12*l));
int xrtmag_next_dBtimes10 = 10*(int)dB_fixed64(xrtmag_next/(12*l));
#ifdef DEBUG_NR_PUCCH_RX #ifdef DEBUG_NR_PUCCH_RX
printf("PUCCH 0 : maxpos %d\n",maxpos); printf("PUCCH 0 : maxpos %d\n",maxpos);
#endif #endif
......
...@@ -166,13 +166,26 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl ...@@ -166,13 +166,26 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) { void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) {
NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommon_t *scc = mac->scc;
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup; NR_BWP_UplinkDedicated_t *ubwpd=NULL;
if (mac->cg &&
mac->cg->spCellConfig &&
mac->cg->spCellConfig->spCellConfigDedicated &&
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)
ubwpd = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0] ?
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup :
(ubwpd?
ubwpd->pusch_Config->choice.setup:
NULL);
long transformPrecoder; long transformPrecoder;
if (pusch_Config->transformPrecoder) if (pusch_Config && pusch_Config->transformPrecoder)
transformPrecoder = *pusch_Config->transformPrecoder; transformPrecoder = *pusch_Config->transformPrecoder;
else { else {
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder) if(scc && scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder)
transformPrecoder = NR_PUSCH_Config__transformPrecoder_enabled; transformPrecoder = NR_PUSCH_Config__transformPrecoder_enabled;
else else
transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled; transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
......
...@@ -294,6 +294,7 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, ...@@ -294,6 +294,7 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
} }
else else
AssertFatal(1==0,"Other configurations not yet implemented\n"); AssertFatal(1==0,"Other configurations not yet implemented\n");
return -1;
} }
void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
......
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