Commit 1ad336fa authored by knopp's avatar knopp

commiting a patch on behalf of Raymond that fixes the some timing issues in the HARQ process


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7800 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 539f8785
...@@ -153,6 +153,9 @@ set(CMAKE_C_FLAGS ...@@ -153,6 +153,9 @@ set(CMAKE_C_FLAGS
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP" "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
) )
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR}"
)
# 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
add_definitions(-DCMAKER) add_definitions(-DCMAKER)
......
...@@ -861,7 +861,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti) ...@@ -861,7 +861,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti)
return(PHY_vars_eNB_g[Mod_id][CC_id]->transmission_mode[UE_id]); return(PHY_vars_eNB_g[Mod_id][CC_id]->transmission_mode[UE_id]);
} }
int generate_eNB_dlsch_params_from_dci(uint8_t subframe, int generate_eNB_dlsch_params_from_dci(int frame,
uint8_t subframe,
void *dci_pdu, void *dci_pdu,
uint16_t rnti, uint16_t rnti,
DCI_format_t dci_format, DCI_format_t dci_format,
...@@ -886,7 +887,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -886,7 +887,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
uint8_t rv=0,rv1=0,rv2=0; uint8_t rv=0,rv1=0,rv2=0;
uint8_t rah=0; uint8_t rah=0;
uint8_t TPC=0; uint8_t TPC=0;
LTE_DL_eNB_HARQ_t *dlsch0_harq,*dlsch1_harq; LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
// printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu); // printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu);
...@@ -2630,6 +2631,16 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -2630,6 +2631,16 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
break; break;
} }
if (dlsch0_harq) {
dlsch0_harq->frame = frame;
dlsch0_harq->subframe = subframe;
}
if (dlsch1_harq) {
dlsch1_harq->frame = frame;
dlsch1_harq->subframe = subframe;
}
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
if (dlsch0) { if (dlsch0) {
...@@ -3963,7 +3974,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -3963,7 +3974,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq->rb_alloc_even[1] = localRIV2alloc_LUT50_1[rballoc]; dlsch0_harq->rb_alloc_even[1] = localRIV2alloc_LUT50_1[rballoc];
dlsch0_harq->rb_alloc_odd[0] = localRIV2alloc_LUT50_0[rballoc]; dlsch0_harq->rb_alloc_odd[0] = localRIV2alloc_LUT50_0[rballoc];
dlsch0_harq->rb_alloc_odd[1] = localRIV2alloc_LUT50_1[rballoc]; dlsch0_harq->rb_alloc_odd[1] = localRIV2alloc_LUT50_1[rballoc];
printf("rballoc: %08x.%08x\n",dlsch0_harq->rb_alloc_even[0],dlsch0_harq->rb_alloc_even[1]); // printf("rballoc: %08x.%08x\n",dlsch0_harq->rb_alloc_even[0],dlsch0_harq->rb_alloc_even[1]);
} else { // DISTRIBUTED } else { // DISTRIBUTED
if ((rballoc&(1<<10)) == 0) { if ((rballoc&(1<<10)) == 0) {
rballoc = rballoc&(~(1<<10)); rballoc = rballoc&(~(1<<10));
......
...@@ -114,6 +114,10 @@ typedef struct { ...@@ -114,6 +114,10 @@ typedef struct {
uint8_t *c[MAX_NUM_DLSCH_SEGMENTS]; uint8_t *c[MAX_NUM_DLSCH_SEGMENTS];
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15) /// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
uint32_t RTC[MAX_NUM_DLSCH_SEGMENTS]; uint32_t RTC[MAX_NUM_DLSCH_SEGMENTS];
/// Frame where current HARQ round was sent
uint32_t frame;
/// Subframe where current HARQ round was sent
uint32_t subframe;
/// Index of current HARQ round for this DLSCH /// Index of current HARQ round for this DLSCH
uint8_t round; uint8_t round;
/// MCS format for this DLSCH /// MCS format for this DLSCH
......
...@@ -231,7 +231,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -231,7 +231,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
subframe, subframe,
phy_vars_ue->high_speed_flag, phy_vars_ue->high_speed_flag,
frame_parms); frame_parms);
else
nb_rb = dlsch_extract_rbs_single(lte_ue_common_vars->rxdataF, nb_rb = dlsch_extract_rbs_single(lte_ue_common_vars->rxdataF,
lte_ue_common_vars->dl_ch_estimates[eNB_id], lte_ue_common_vars->dl_ch_estimates[eNB_id],
lte_ue_pdsch_vars[eNB_id_i]->rxdataF_ext, lte_ue_pdsch_vars[eNB_id_i]->rxdataF_ext,
......
...@@ -1354,7 +1354,8 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -1354,7 +1354,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
uint16_t ra_rnti, uint16_t ra_rnti,
uint16_t p_rnti); uint16_t p_rnti);
int32_t generate_eNB_dlsch_params_from_dci(uint8_t subframe, int32_t generate_eNB_dlsch_params_from_dci(int frame,
uint8_t subframe,
void *dci_pdu, void *dci_pdu,
rnti_t rnti, rnti_t rnti,
DCI_format_t dci_format, DCI_format_t dci_format,
......
...@@ -442,10 +442,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -442,10 +442,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
{ {
static int first_call=1;
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
// PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id]; // PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id];
int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB; int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_power_dB[0];
int32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH); int32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm); int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm);
int32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below); int32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
...@@ -478,6 +479,15 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -478,6 +479,15 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1]; uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)]; uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
if (first_call == 1) {
for (i=0;i<10;i++) {
for (j=0;j<NUMBER_OF_UE_MAX;j++) {
phy_vars_eNB->pucch1_stats_cnt[j][i]=0;
phy_vars_eNB->pucch1ab_stats_cnt[j][i]=0;
}
}
first_call=0;
}
switch (frame_parms->N_RB_UL) { switch (frame_parms->N_RB_UL) {
...@@ -496,6 +506,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -496,6 +506,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
default: default:
sigma2_dB -= 14; sigma2_dB -= 14;
} }
if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) { if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) {
LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift); LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift);
...@@ -516,7 +527,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -516,7 +527,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
LOG_D(PHY,"[eNB] PUCCH: cNcs1/deltaPUCCH_Shift %d, Nprime %d, n1_pucch %d\n",thres,Nprime,n1_pucch); LOG_D(PHY,"[eNB] PUCCH: cNcs1/deltaPUCCH_Shift %d, Nprime %d, n1_pucch %d\n",thres,Nprime,n1_pucch);
#endif #endif
N_UL_symb = (frame_parms->Ncp==0) ? 7 : 6; N_UL_symb = (frame_parms->Ncp==NORMAL) ? 7 : 6;
if (n1_pucch < thres) if (n1_pucch < thres)
nprime0=n1_pucch; nprime0=n1_pucch;
...@@ -559,6 +570,12 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -559,6 +570,12 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
S=0; // 1 S=0; // 1
else else
S=1; // j S=1; // j
/*
if (fmt==pucch_format1)
LOG_I(PHY,"[eNB] subframe %d => PUCCH1: u%d %d, v%d %d : ", subframe,ns&1,u,ns&1,v);
else
LOG_I(PHY,"[eNB] subframe %d => PUCCH1a/b: u%d %d, v%d %d : ", subframe,ns&1,u,ns&1,v);
*/
//loop over symbols in slot //loop over symbols in slot
for (l=0; l<N_UL_symb; l++) { for (l=0; l<N_UL_symb; l++) {
...@@ -572,6 +589,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -572,6 +589,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
} }
refs=0; refs=0;
// Comput W_noc(m) (36.211 p. 19) // Comput W_noc(m) (36.211 p. 19)
...@@ -596,11 +614,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -596,11 +614,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
if (l<2) { // data if (l<2) { // data
W_re=W4[n_oc][l]; W_re=W4[n_oc][l];
W_im=0; W_im=0;
} else if ((l<N_UL_symb-2)&&(frame_parms->Ncp==0)) { // reference and normal CP } else if ((l<N_UL_symb-2)&&(frame_parms->Ncp==NORMAL)) { // reference and normal CP
W_re=W3_re[n_oc][l-2]; W_re=W3_re[n_oc][l-2];
W_im=W3_im[n_oc][l-2]; W_im=W3_im[n_oc][l-2];
refs=1; refs=1;
} else if ((l<N_UL_symb-2)&&(frame_parms->Ncp==1)) { // reference and extended CP } else if ((l<N_UL_symb-2)&&(frame_parms->Ncp==EXTENDED)) { // reference and extended CP
W_re=W4[n_oc][l-2]; W_re=W4[n_oc][l-2];
W_im=0; W_im=0;
refs=1; refs=1;
...@@ -637,6 +655,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -637,6 +655,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
LOG_D(PHY,"[eNB] PUCCH subframe %d z(%d,%d) => %d,%d, alpha(%d) => %d,%d\n",subframe,l,n,zptr[n<<1],zptr[(n<<1)+1], LOG_D(PHY,"[eNB] PUCCH subframe %d z(%d,%d) => %d,%d, alpha(%d) => %d,%d\n",subframe,l,n,zptr[n<<1],zptr[(n<<1)+1],
alpha_ind,alpha_re[alpha_ind],alpha_im[alpha_ind]); alpha_ind,alpha_re[alpha_ind],alpha_im[alpha_ind]);
#endif #endif
alpha_ind = (alpha_ind + n_cs)%12; alpha_ind = (alpha_ind + n_cs)%12;
} // n } // n
...@@ -751,25 +770,41 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -751,25 +770,41 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
phase_max = phase; phase_max = phase;
} }
stat_max /= nsymb; // normalize to energy per symbol } //phase
stat_max /= nsymb; // normalize to energy per symbol
#ifdef DEBUG_PUCCH_RX #ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max); LOG_D(PHY,"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
#endif #endif
} //phase
#ifdef DEBUG_PUCCH_RX #ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d, phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phase_max); LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max);
#endif #endif
phy_vars_eNB->pucch1_stats[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max;
phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
/*
if (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] == 0) {
write_output("pucch_debug.m","pucch_energy",
&phy_vars_eNB->pucch1_stats[UE_id][(subframe<<10)],
1024,1,2);
AssertFatal(0,"Exiting for PUCCH 1 debug\n");
}
*/
// This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold // This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) { if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {
*payload = 1; *payload = 1;
*Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10; *Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10;
} }
else { else {
*payload = 0; *payload = 0;
*Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10; *Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10;
} }
LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
*Po_PUCCH_update = 1; *Po_PUCCH_update = 1;
} else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) { } else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) {
...@@ -854,7 +889,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -854,7 +889,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
// Do detection now // Do detection now
stat_re=0; stat_re=0;
stat_im=0; stat_im=0;
LOG_D(PHY,"PUCCH1A : Po_PUCCH before %d (%d) dB",dB_fixed(*Po_PUCCH),*Po_PUCCH); LOG_D(PHY,"PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH);
*Po_PUCCH = ((*Po_PUCCH<<9) + (stat_max<<9)+1024)>>10; *Po_PUCCH = ((*Po_PUCCH<<9) + (stat_max<<9)+1024)>>10;
*Po_PUCCH_dBm = dB_fixed(*Po_PUCCH) - phy_vars_eNB->rx_total_gain_eNB_dB; *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH) - phy_vars_eNB->rx_total_gain_eNB_dB;
*Po_PUCCH_update = 1; *Po_PUCCH_update = 1;
...@@ -973,8 +1008,14 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -973,8 +1008,14 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
} // aa } // aa
#ifdef DEBUG_PUCCH_RX #ifdef DEBUG_PUCCH_RX
LOG_I(PHY,"stat %d,%d\n",stat_re,stat_im); LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]));
#endif #endif
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[0] = stat_re;
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[1] = stat_im;
phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
*payload = (stat_re<0) ? 1 : 0; *payload = (stat_re<0) ? 1 : 0;
if (fmt==pucch_format1b) if (fmt==pucch_format1b)
......
...@@ -77,10 +77,10 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) ...@@ -77,10 +77,10 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui ); FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui );
// Define form // Define form
fdui->lte_phy_scope_enb = fl_bgn_form( FL_NO_BOX, 800, 600 ); fdui->lte_phy_scope_enb = fl_bgn_form( FL_NO_BOX, 800, 800 );
// This the whole UI box // This the whole UI box
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 600, "" ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 800, "" );
fl_set_object_color( obj, FL_BLACK, FL_BLACK ); fl_set_object_color( obj, FL_BLACK, FL_BLACK );
// Received signal // Received signal
...@@ -118,6 +118,14 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) ...@@ -118,6 +118,14 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_xyplot_symbolsize( fdui->pusch_comp,2); fl_set_xyplot_symbolsize( fdui->pusch_comp,2);
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR); fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
// I/Q PUCCH comp
fdui->pucch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 540, 240, 200, "PUCCH I/Q of MF Output" );
fl_set_object_boxtype( fdui->pucch_comp, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pucch_comp, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pucch_comp, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pucch_comp,2);
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
// Throughput on PUSCH // Throughput on PUSCH
fdui->pusch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 480, 500, 100, "PUSCH Throughput [frame]/[kbit/s]" ); fdui->pusch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 480, 500, 100, "PUSCH Throughput [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->pusch_tput, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pusch_tput, FL_EMBOSSED_BOX );
...@@ -154,9 +162,12 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -154,9 +162,12 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int16_t **chest_f; int16_t **chest_f;
int16_t *pusch_llr; int16_t *pusch_llr;
int16_t *pusch_comp; int16_t *pusch_comp;
int32_t *pucch1_comp;
int16_t *pucch1ab_comp;
float Re,Im,ymax; float Re,Im,ymax;
float *llr, *bit; float *llr, *bit;
float I[nsymb_ce*2], Q[nsymb_ce*2]; float I[nsymb_ce*2], Q[nsymb_ce*2];
float I_pucch[10240],Q_pucch[10240];
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES]; float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size]; float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
float *chest_f_abs; float *chest_f_abs;
...@@ -186,6 +197,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -186,6 +197,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
chest_f = (int16_t**) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->drs_ch_estimates[eNB_id]; chest_f = (int16_t**) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->drs_ch_estimates[eNB_id];
pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr; pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr;
pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0]; pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id];
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
...@@ -313,6 +326,19 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -313,6 +326,19 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
fl_set_xyplot_data(form->pusch_comp,I,Q,ind,"","",""); fl_set_xyplot_data(form->pusch_comp,I,Q,ind,"","","");
} }
// PUSCH I/Q of MF Output
if (pucch1ab_comp!=NULL) {
for (ind=0; ind<10240; ind++) {
I_pucch[ind] = pucch1ab_comp[2*ind];
Q_pucch[ind] = pucch1ab_comp[2*ind+1];
ind++;
}
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,ind,"","","");
fl_set_xyplot_xbounds(form->pucch_comp,-200,200);
fl_set_xyplot_ybounds(form->pucch_comp,-200,200);
}
// PUSCH Throughput // PUSCH Throughput
memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
......
...@@ -46,6 +46,7 @@ typedef struct { ...@@ -46,6 +46,7 @@ typedef struct {
FL_OBJECT * chest_f; FL_OBJECT * chest_f;
FL_OBJECT * chest_t; FL_OBJECT * chest_t;
FL_OBJECT * pusch_comp; FL_OBJECT * pusch_comp;
FL_OBJECT * pucch_comp;
FL_OBJECT * pusch_llr; FL_OBJECT * pusch_llr;
FL_OBJECT * pusch_tput; FL_OBJECT * pusch_tput;
FL_OBJECT * button_0; FL_OBJECT * button_0;
......
...@@ -65,7 +65,11 @@ ...@@ -65,7 +65,11 @@
//use msg in the real-time thread context //use msg in the real-time thread context
#define msg_nrt printf #define msg_nrt printf
//use msg_nrt in the non real-time context (for initialization, ...) //use msg_nrt in the non real-time context (for initialization, ...)
#ifdef __AVX2__
#define malloc16(x) memalign(32,x)
#else
#define malloc16(x) memalign(16,x) #define malloc16(x) memalign(16,x)
#endif
#define free16(y,x) free(y) #define free16(y,x) free(y)
#define bigmalloc malloc #define bigmalloc malloc
#define bigmalloc16 malloc16 #define bigmalloc16 malloc16
...@@ -76,7 +80,11 @@ ...@@ -76,7 +80,11 @@
//! If no more memory is available, this function will terminate the program with an assertion error. //! If no more memory is available, this function will terminate the program with an assertion error.
static inline void* malloc16_clear( size_t size ) static inline void* malloc16_clear( size_t size )
{ {
#ifdef __AVX2__
void* ptr = memalign(32, size);
#else
void* ptr = memalign(16, size); void* ptr = memalign(16, size);
#endif
DevAssert(ptr); DevAssert(ptr);
memset( ptr, 0, size ); memset( ptr, 0, size );
return ptr; return ptr;
...@@ -368,6 +376,11 @@ typedef struct PHY_VARS_eNB_s { ...@@ -368,6 +376,11 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t localization_stats; time_stats_t localization_stats;
#endif #endif
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][10*1024];
#if ENABLE_RAL #if ENABLE_RAL
hash_table_t *ral_thresholds_timed; hash_table_t *ral_thresholds_timed;
SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX]; SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
......
...@@ -249,9 +249,9 @@ ...@@ -249,9 +249,9 @@
#define AMP_OVER_2 (AMP>>1) #define AMP_OVER_2 (AMP>>1)
/// Threshold for PUCCH Format 1 detection /// Threshold for PUCCH Format 1 detection
#define PUCCH1_THRES 3 #define PUCCH1_THRES 10
/// Threshold for PUCCH Format 1a/1b detection /// Threshold for PUCCH Format 1a/1b detection
#define PUCCH1a_THRES 2 #define PUCCH1a_THRES 4
#ifndef OPENAIR_LTE #ifndef OPENAIR_LTE
/// ///
......
...@@ -227,12 +227,11 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -227,12 +227,11 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
LTE_eNB_DLSCH_t *DLSCH_ptr; LTE_eNB_DLSCH_t *DLSCH_ptr;
LTE_eNB_ULSCH_t *ULSCH_ptr; LTE_eNB_ULSCH_t *ULSCH_ptr;
// uint8_t subframe_m4;
uint8_t ulsch_subframe,ulsch_frame; uint8_t ulsch_subframe,ulsch_frame;
uint8_t i; uint8_t i;
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]); int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
// int frame = PHY_vars_eNB_g[Mod_id][CC_id]->proc[sched_subframe].frame_tx; int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
// int subframe = PHY_vars_eNB_g[Mod_id][CC_id]->proc[sched_subframe].subframe_tx; int first_proc_found=0;
if (UE_id==-1) { if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id); LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
...@@ -242,42 +241,45 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -242,42 +241,45 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
if (ul_flag == 0) {// this is a DL request if (ul_flag == 0) {// this is a DL request
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0]; DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0];
/*
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] get_ue_active_harq_pid: Frame %d subframe %d, current harq_id %d\n",
Mod_id,frame,subframe,DLSCH_ptr->harq_ids[subframe]);
#endif
*/
// switch on TDD or FDD configuration here later
*harq_pid = DLSCH_ptr->harq_ids[subframe];
if ((*harq_pid<DLSCH_ptr->Mdlharq) &&
((DLSCH_ptr->harq_processes[*harq_pid]->round > 0))) {
*round = DLSCH_ptr->harq_processes[*harq_pid]->round; // set to no available process first
LOG_D(PHY,"round %d\n",*round); *harq_pid = -1;
// else if ((subframe_m4==5) || (subframe_m4==6)) { for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
// *harq_pid = 0;//DLSCH_ptr->harq_ids[subframe_m4];//Ankit if (DLSCH_ptr->harq_processes[i]!=NULL) {
// *round = DLSCH_ptr->harq_processes[*harq_pid]->round; if (DLSCH_ptr->harq_processes[i]->status != ACTIVE) {
// } // store first inactive process
} else { if (first_proc_found == 0) {
// get first free harq_pid (i.e. round 0) first_proc_found = 1;
for (i=0; i<DLSCH_ptr->Mdlharq; i++) { *harq_pid = i;
if (DLSCH_ptr->harq_processes[i]!=NULL) { *round = 0;
if (DLSCH_ptr->harq_processes[i]->status != ACTIVE) { LOG_D(PHY,"process %d is first free process\n",i);
*harq_pid = i;//0;//i; //(Ankit) }
*round = 0; else {
return(0); LOG_D(PHY,"process %d is free\n",i);
} else { }
LOG_D(PHY,"process %d is active\n",i); } else {
} sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
} else { if (sf2<=sf1)
LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id); sfdiff = sf1-sf2;
return(-1); else // this happens when wrapping around 1024 frame barrier
} sfdiff = 10240 + sf1-sf2;
LOG_D(PHY,"process %d is active, round %d (waiting %d)\n",i,DLSCH_ptr->harq_processes[i]->round,sfdiff);
if (sfdiff>sfdiff_max) { // this is an active process that is waiting longer than the others (and longer than 7 ms)
sfdiff_max = sfdiff;
*harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round;
first_proc_found = 1;
}
}
} else { // a process is not defined
LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id);
return(-1);
} }
} }
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
frame,subframe,*harq_pid);
} else { // This is a UL request } else { // This is a UL request
ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id]; ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id];
...@@ -1388,7 +1390,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1388,7 +1390,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef Rel10 #ifdef Rel10
MCH_PDU *mch_pduP; MCH_PDU *mch_pduP;
MCH_PDU mch_pdu; MCH_PDU mch_pdu;
uint8_t sync_area=255; // uint8_t sync_area=255;
#endif #endif
#if defined(SMBV) && !defined(EXMIMO) #if defined(SMBV) && !defined(EXMIMO)
// counts number of allocations in subframe // counts number of allocations in subframe
...@@ -1848,7 +1850,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1848,7 +1850,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %"PRIu8"] SI generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); LOG_D(PHY,"[eNB %"PRIu8"] SI generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id);
#endif #endif
generate_eNB_dlsch_params_from_dci(subframe, generate_eNB_dlsch_params_from_dci(frame,
subframe,
&DCI_pdu->dci_alloc[i].dci_pdu[0], &DCI_pdu->dci_alloc[i].dci_pdu[0],
DCI_pdu->dci_alloc[i].rnti, DCI_pdu->dci_alloc[i].rnti,
DCI_pdu->dci_alloc[i].format, DCI_pdu->dci_alloc[i].format,
...@@ -1888,7 +1891,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1888,7 +1891,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %"PRIu8"] RA generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); LOG_D(PHY,"[eNB %"PRIu8"] RA generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id);
#endif #endif
generate_eNB_dlsch_params_from_dci(subframe, generate_eNB_dlsch_params_from_dci(frame,
subframe,
&DCI_pdu->dci_alloc[i].dci_pdu[0], &DCI_pdu->dci_alloc[i].dci_pdu[0],
DCI_pdu->dci_alloc[i].rnti, DCI_pdu->dci_alloc[i].rnti,
DCI_pdu->dci_alloc[i].format, DCI_pdu->dci_alloc[i].format,
...@@ -1949,7 +1953,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e ...@@ -1949,7 +1953,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
} }
#endif #endif
generate_eNB_dlsch_params_from_dci(subframe, generate_eNB_dlsch_params_from_dci(frame,
subframe,
&DCI_pdu->dci_alloc[i].dci_pdu[0], &DCI_pdu->dci_alloc[i].dci_pdu[0],
DCI_pdu->dci_alloc[i].rnti, DCI_pdu->dci_alloc[i].rnti,
DCI_pdu->dci_alloc[i].format,