From f116a10de3847a4403c4a9bc167ef6579db6fcf3 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 16 Nov 2016 15:20:18 +0100 Subject: [PATCH 1/4] hotfix: turbo decoder should not fail if CRC is 0 The case of a CRC == 0 is legal. After discussion with Raymond, it is also possible to have all bits at 0 (and so a CRC==0) if there is no transmission and thus not much energy. So this hotfix may introduce new problems (false decoding). A future work is to handle this case properly by not calling the turbo decoder if there is not enough energy received. The problem might manifest itself more in the UE part, especially when it tries to decode MIB and/or SIB (if I understood correctly). --- openair1/PHY/CODING/3gpplte_turbo_decoder.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder.c b/openair1/PHY/CODING/3gpplte_turbo_decoder.c index 931758c03b..c6976df164 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder.c @@ -1058,7 +1058,7 @@ unsigned char phy_threegpplte_turbo_decoder_scalar(llr_t *y, break; } - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index 49bb9d102c..4efd366bed 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -1375,7 +1375,7 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); #endif - if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) { + if (crc == oldcrc && crc_cw2 == oldcrc_cw2) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c index abcdc0521b..085dbb723c 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c @@ -2556,7 +2556,7 @@ unsigned char phy_threegpplte_turbo_decoder(short *y, stop_meas(intl2_stats); - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c index dc789d0404..a1e408dcda 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c @@ -1612,7 +1612,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc); #endif - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c index b56aae4598..4cdfb4f794 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c @@ -1625,7 +1625,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, if (intl2_stats) stop_meas(intl2_stats); - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } From 64615dcc8ef3ada3258c891027fd233a8cb2d8da Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 18 Nov 2016 09:40:14 +0100 Subject: [PATCH 2/4] hotfix: correct PHICH generation The PHICH generation is wrong. HARQ process X is uplink scheduled at TTI n. At TTI n+4 the eNB receives the data. At TTI n+8 the eNB sends ACK/NACK on the PHICH. The problem is that PHICH generation is done after scheduling. And PHICH generation uses "first_rb" and "n_DMRS" to compute "ngroup_PHICH" and "nseq_PHICH". So at TTI n+8 if the eNB has reused the HARQ process X for a new uplink scheduling the values "first_rb" and "n_DMRS" may have changed. We need to use the previous values. One solution would have been to do PHICH generation before scheduling. The problem is that "generate_phich_top" does more than PHICH generation. It has to setup parameters to sort of "emulate" a DCI0 in case of retransmission scheduled without DCI0. So part of it has to be done after scheduling. We would have to split the function. The simple adopted fix is to store old values of "first_rb" and "n_DMRS" and use those values in "generate_phich_top". This fix has only been tested with FDD. TDD may miserably fail. --- openair1/PHY/LTE_TRANSPORT/defs.h | 8 +++++++ openair1/PHY/LTE_TRANSPORT/phich.c | 16 ++++++++----- openair1/SCHED/phy_procedures_lte_eNb.c | 32 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 83b34971da..01d6cdc449 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -360,6 +360,10 @@ typedef struct { uint8_t TPC; /// First Allocated RB uint16_t first_rb; + /// First Allocated RB - previous scheduling + /// This is needed for PHICH generation which + /// is done after a new scheduling + uint16_t previous_first_rb; /// Current Number of RBs uint16_t nb_rb; /// Transport block size @@ -444,6 +448,10 @@ typedef struct { uint8_t Nsymb_initial; /// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2) uint8_t n_DMRS; + /// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2) - previous scheduling + /// This is needed for PHICH generation which + /// is done after a new scheduling + uint8_t previous_n_DMRS; /// n_DMRS 2 for cyclic shift of DMRS (36.211 Table 5.5.1.1.-1) uint8_t n_DMRS2; /// Flag to indicate that this ULSCH is for calibration information sent from UE (i.e. no MAC SDU to pass up) diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 1727ec5324..b0665d89ce 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1453,8 +1453,12 @@ void generate_phich_top(PHY_VARS_eNB *eNB, LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n", harq_pid,ulsch[UE_id]->rnti,proc->frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active); - ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb + - ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH; + /* the HARQ process may have been reused by a new scheduling, so we use + * previous values of first_rb and n_DMRS to compute ngroup_PHICH and nseq_PHICH + */ + + ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb + + ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%Ngroup_PHICH; if ((frame_parms->tdd_config == 0) && (frame_parms->frame_type == TDD) ) { @@ -1462,20 +1466,20 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ngroup_PHICH += Ngroup_PHICH; } - nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) + - ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH); + nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb/Ngroup_PHICH) + + ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%(2*NSF_PHICH); LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n", eNB->Mod_id,harq_pid,proc->frame_tx, subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - ulsch[UE_id]->harq_processes[harq_pid]->first_rb, + ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb, ulsch[UE_id]->harq_processes[harq_pid]->dci_alloc); if (ulsch[UE_id]->Msg3_active == 1) { LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", eNB->Mod_id,harq_pid,proc->frame_tx,subframe, UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - ulsch[UE_id]->harq_processes[harq_pid]->first_rb); + ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb); } if (eNB->abstraction_flag == 0) { diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 4163b8340c..7ac6e2bf1f 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1206,6 +1206,38 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB->dlsch[i][0]->subframe_tx[subframe] = 0; } + /* save old HARQ information needed for PHICH generation */ + for (i=0; iulsch[i]) { + /* Store first_rb and n_DMRS for correct PHICH generation below. + * For PHICH generation we need "old" values of last scheduling + * for this HARQ process. 'generate_eNB_dlsch_params' below will + * overwrite first_rb and n_DMRS and 'generate_phich_top', done + * after 'generate_eNB_dlsch_params', would use the "new" values + * instead of the "old" ones. + * + * This has been tested for FDD only, may be wrong for TDD. + * + * TODO: maybe we should restructure the code to be sure it + * is done correctly. The main concern is if the code + * changes and first_rb and n_DMRS are modified before + * we reach here, then the PHICH processing will be wrong, + * using wrong first_rb and n_DMRS values to compute + * ngroup_PHICH and nseq_PHICH. + * + * TODO: check if that works with TDD. + */ + if ((subframe_select(fp,ul_subframe)==SF_UL) || + (fp->frame_type == FDD)) { + harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); + eNB->ulsch[i]->harq_processes[harq_pid]->previous_first_rb = + eNB->ulsch[i]->harq_processes[harq_pid]->first_rb; + eNB->ulsch[i]->harq_processes[harq_pid]->previous_n_DMRS = + eNB->ulsch[i]->harq_processes[harq_pid]->n_DMRS; + } + } + } + num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols, From c03f13c07b1cb4af8bf222ca0cb256dcaba0da5b Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 18 Nov 2016 10:29:48 +0100 Subject: [PATCH 3/4] T: add a trace for PHICH --- common/utils/T/T_messages.txt | 4 ++++ openair1/PHY/LTE_TRANSPORT/phich.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 321225a597..6e5e0ad7aa 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -61,6 +61,10 @@ ID = ENB_PHY_PUCCH_1_ENERGY DESC = eNodeB PUCCH 1 energy and threshold GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold +ID = ENB_PHY_PHICH + DESC = eNodeB PHICH + GROUP = ALL:PHY:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS #MAC logs ID = ENB_MAC_UE_DL_SDU diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index b0665d89ce..6b66ee0282 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1475,6 +1475,14 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb, ulsch[UE_id]->harq_processes[harq_pid]->dci_alloc); + T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe), + T_INT(UE_id), T_INT(ulsch[UE_id]->rnti), T_INT(harq_pid), + T_INT(Ngroup_PHICH), T_INT(NSF_PHICH), + T_INT(ngroup_PHICH), T_INT(nseq_PHICH), + T_INT(ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK), + T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb), + T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)); + if (ulsch[UE_id]->Msg3_active == 1) { LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", eNB->Mod_id,harq_pid,proc->frame_tx,subframe, From e86b3e31c79bcc489b67f55e3cbadd035e706fbf Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 26 Sep 2016 14:51:52 +0200 Subject: [PATCH 4/4] changing some config files --- .../CONF/enb.band4.exmimo2.conf | 147 ++++++++++++++++++ .../CONF/enb.band7.usrpb210.conf | 2 +- 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf new file mode 100644 index 0000000000..bf7861f66d --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf @@ -0,0 +1,147 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + # real_time choice in {hard, rt-preempt, no} + real_time = "no"; + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 4; + downlink_frequency = 2112500000L; + uplink_frequency_offset = -400000000; + + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + nb_antenna_ports = 1; + tx_gain = 20; + rx_gain = 20; + prach_root = 22; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -25; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 1; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 0; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 2; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 20000; //10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + + } + ); + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.70"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="high"; + hw_log_level ="info"; + hw_log_verbosity ="high"; + phy_log_level ="info"; + phy_log_verbosity ="high"; + mac_log_level ="debug"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="high"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="high"; + rrc_log_level ="info"; + rrc_log_verbosity ="high"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf index 7941441d1d..1fe3beae0e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf @@ -135,7 +135,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.171"; + mme_ip_address = ( { ipv4 = "192.168.12.70"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4";