From 7f24927c43a0b450d4f474b68520716dba58e3ef Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Fri, 10 Mar 2017 12:42:04 +0100 Subject: [PATCH 01/11] WIP: SRS configuration of PUSCH and PUCCH. No SRS detection yet. To be tested on HW --- openair1/PHY/impl_defs_lte.h | 2 +- openair1/SCHED/defs.h | 4 + openair1/SCHED/phy_procedures_lte_common.c | 145 +++++++++++++++ openair1/SCHED/phy_procedures_lte_eNb.c | 40 ++-- openair1/SCHED/phy_procedures_lte_ue.c | 176 ++---------------- openair1/SIMULATION/LTE_PHY/ulsim.c | 2 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- .../CONF/enb.band7.tm1.usrpb210.conf | 10 +- 8 files changed, 206 insertions(+), 175 deletions(-) diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index e9604a36f6..5707aedd27 100755 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -320,7 +320,7 @@ typedef struct { uint16_t srs_ConfigIndex; /// Parameter: \f$n^\text{CS}_\text{SRS}\f$. See TS 36.211 (5.5.3.1). \vr{[0..7]} \note the specification sais it is an enumerated value. uint8_t cyclicShift; - // Parameter: ue srs subframe for internal implementation + // Parameter: internal implementation: UE SRS configured uint8_t srsConfigDedicatedSetup; // Parameter: cell srs subframe for internal implementation uint8_t srsCellSubframe; diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index ac2d7957f2..f283014af7 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -514,6 +514,10 @@ void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, uint16_t coded_bits_per_codeword,int round, unsigned char harq_pid); +int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx); + +void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); + /*@}*/ diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index ae61f7be0d..e5753483da 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -942,3 +942,148 @@ MU_MIMO_mode *get_mu_mimo_mode (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti) return &PHY_vars_eNB_g[Mod_id][CC_id]->mu_mimo_mode[UE_id]; } + +int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx) +{ + uint8_t isSubframeSRS = 0; // SRS Cell Occasion + + //ue->ulsch[eNB_id]->srs_active = 0; + //ue->ulsch[eNB_id]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)- ue->ulsch[eNB_id]->srs_active; + if(frame_parms->soundingrs_ul_config_common.enabled_flag) + { + + LOG_D(PHY," SRS SUBFRAMECONFIG: %d\n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig); + + uint8_t TSFC; + uint16_t deltaTSFC; // bitmap + uint8_t srs_SubframeConfig; + + // table resuming TSFC (Period) and deltaSFC (offset) + const uint16_t deltaTSFCTabType1[15][2] = { {1,1},{1,2},{2,2},{1,5},{2,5},{4,5},{8,5},{3,5},{12,5},{1,10},{2,10},{4,10},{8,10},{351,10},{383,10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD + const uint16_t deltaTSFCTabType2[14][2] = { {2,5},{6,5},{10,5},{18,5},{14,5},{22,5},{26,5},{30,5},{70,10},{74,10},{194,10},{326,10},{586,10},{210,10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD + + srs_SubframeConfig = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; + if (FDD == frame_parms->frame_type) + { + // srs_SubframeConfig =< 14 + deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; + } + else + { + // srs_SubframeConfig =< 13 + deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; + } + + // Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC + uint16_t tmp = (subframe_tx % TSFC); + if((1<frame_type, TSFC, deltaTSFC, frame_tx, subframe_tx); + } + return(isSubframeSRS); +} + +void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) +{ + if(TDD == frameType) + { + if(isrs<10) + { + mac_xface->macphy_exit("2 ms SRS periodicity not supported"); + } + + if((isrs>9)&&(isrs<15)) + { + *psrsPeriodicity=5; + *psrsOffset=isrs-10; + } + if((isrs>14)&&(isrs<25)) + { + *psrsPeriodicity=10; + *psrsOffset=isrs-15; + } + if((isrs>24)&&(isrs<45)) + { + *psrsPeriodicity=20; + *psrsOffset=isrs-25; + } + if((isrs>44)&&(isrs<85)) + { + *psrsPeriodicity=40; + *psrsOffset=isrs-45; + } + if((isrs>84)&&(isrs<165)) + { + *psrsPeriodicity=80; + *psrsOffset=isrs-85; + } + if((isrs>164)&&(isrs<325)) + { + *psrsPeriodicity=160; + *psrsOffset=isrs-165; + } + if((isrs>324)&&(isrs<645)) + { + *psrsPeriodicity=320; + *psrsOffset=isrs-325; + } + + if(isrs>644) + { + mac_xface->macphy_exit("Isrs out of range"); + } + + } + else + { + if(isrs<2) + { + *psrsPeriodicity=2; + *psrsOffset=isrs; + } + if((isrs>1)&&(isrs<7)) + { + *psrsPeriodicity=5; + *psrsOffset=isrs-2; + } + if((isrs>6)&&(isrs<17)) + { + *psrsPeriodicity=10; + *psrsOffset=isrs-7; + } + if((isrs>16)&&(isrs<37)) + { + *psrsPeriodicity=20; + *psrsOffset=isrs-17; + } + if((isrs>36)&&(isrs<77)) + { + *psrsPeriodicity=40; + *psrsOffset=isrs-37; + } + if((isrs>76)&&(isrs<157)) + { + *psrsPeriodicity=80; + *psrsOffset=isrs-77; + } + if((isrs>156)&&(isrs<317)) + { + *psrsPeriodicity=160; + *psrsOffset=isrs-157; + } + if((isrs>316)&&(isrs<637)) + { + *psrsPeriodicity=320; + *psrsOffset=isrs-317; + } + if(isrs>636) + { + mac_xface->macphy_exit("Isrs out of range"); + } + } +} diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e9f1125a34..9257b0d48f 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -307,8 +307,6 @@ void phy_procedures_emos_eNB_TX(unsigned char subframe, PHY_VARS_eNB *eNB) } #endif - - void phy_procedures_eNB_S_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type) { UNUSED(r_type); @@ -824,6 +822,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int frame = proc->frame_tx; int subframe = proc->subframe_tx; + uint16_t srsPeriodicity; + uint16_t srsOffset; + uint16_t do_srs=0; LOG_D(PHY, "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8"), aggregation %d\n", @@ -839,6 +840,12 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC dci_alloc->dci_pdu[0], 1<L); + if (is_srs_occasion_common(fp,frame,subframe)) { + compute_srs_pos(fp->frame_type, eNB->physicalConfigDedicated[UE_id]->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); + if ((((10*frame+subframe) % srsPeriodicity) == srsOffset)) + do_srs = 1; + } + generate_eNB_ulsch_params_from_dci(eNB, proc, &dci_alloc->dci_pdu[0], @@ -849,7 +856,7 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC 0, P_RNTI, CBA_RNTI, - 0); // do_srs + do_srs); // do_srs LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d\n", eNB->Mod_id,frame,subframe,dci_alloc->rnti, @@ -1344,7 +1351,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, // Apply physicalConfigDedicated if needed // This is for UEs that have received this IE, which changes these DL and UL configuration, we apply after a delay for the eNodeB UL parameters phy_config_dedicated_eNB_step2(eNB); - + // Now loop again over the DCIs for UL configuration for (i=0; iNum_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { dci_alloc = &DCI_pdu->dci_alloc[i]; @@ -2083,6 +2090,9 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq PUCCH_FMT_t format; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; + uint16_t srsPeriodicity; + uint16_t srsOffset; + uint16_t do_srs=0; if ((eNB->dlsch[UE_id][0]) && (eNB->dlsch[UE_id][0]->rnti>0) && @@ -2092,6 +2102,14 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq do_SR = is_SR_subframe(eNB,proc,UE_id); // do_SR = 0; + // check if there is SRS and we have to use shortened format + // TODO: check for exceptions in transmission of SRS together with ACK/NACK + if (is_srs_occasion_common(fp,frame,subframe)) { + compute_srs_pos(fp->frame_type, eNB->physicalConfigDedicated[UE_id]->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); + if ((((10*frame+subframe) % srsPeriodicity) == srsOffset)) + do_srs = 1; + } + // Now ACK/NAK // First check subframe_tx flag for earlier subframes @@ -2150,7 +2168,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, 0, // n2_pucch - 0, // shortened format, should be use_srs flag, later + do_srs, // shortened format &SR_payload, frame, subframe, @@ -2190,7 +2208,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, (uint16_t)n1_pucch0, 0, //n2_pucch - 0, // shortened format + do_srs, // shortened format pucch_payload0, frame, subframe, @@ -2220,7 +2238,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, 0, //n2_pucch - 0, // shortened format + do_srs, // shortened format pucch_payload0, frame, subframe, @@ -2281,7 +2299,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, 0, //n2_pucch - 0, // shortened format + do_srs, // shortened format pucch_payload0, frame, subframe, @@ -2313,7 +2331,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, (uint16_t)n1_pucch0, 0, // n2_pucch - 0, // shortened format + do_srs, // shortened format pucch_payload0, frame, subframe, @@ -2338,7 +2356,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq UE_id, (uint16_t)n1_pucch1, 0, //n2_pucch - 0, // shortened format + do_srs, // shortened format pucch_payload1, frame, subframe, @@ -2886,8 +2904,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->rb_mask_ul[2]=0; eNB->rb_mask_ul[3]=0; - - // Check for active processes in current subframe harq_pid = subframe2harq_pid(fp, frame,subframe); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index cd8fbdbc8e..381ea547e4 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -435,163 +435,26 @@ uint8_t is_ri_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) return(0); } -void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) + + +void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t isSubframeSRS) { - if(TDD == frameType) - { - if(isrs<10) - { - mac_xface->macphy_exit("2 ms SRS periodicity not supported"); - } - - if((isrs>9)&&(isrs<15)) - { - *psrsPeriodicity=5; - *psrsOffset=isrs-10; - } - if((isrs>14)&&(isrs<25)) - { - *psrsPeriodicity=10; - *psrsOffset=isrs-15; - } - if((isrs>24)&&(isrs<45)) - { - *psrsPeriodicity=20; - *psrsOffset=isrs-25; - } - if((isrs>44)&&(isrs<85)) - { - *psrsPeriodicity=40; - *psrsOffset=isrs-45; - } - if((isrs>84)&&(isrs<165)) - { - *psrsPeriodicity=80; - *psrsOffset=isrs-85; - } - if((isrs>164)&&(isrs<325)) - { - *psrsPeriodicity=160; - *psrsOffset=isrs-165; - } - if((isrs>324)&&(isrs<645)) - { - *psrsPeriodicity=320; - *psrsOffset=isrs-325; - } - - if(isrs>644) - { - mac_xface->macphy_exit("Isrs out of range"); - } - - } - else - { - if(isrs<2) - { - *psrsPeriodicity=2; - *psrsOffset=isrs; - } - if((isrs>1)&&(isrs<7)) - { - *psrsPeriodicity=5; - *psrsOffset=isrs-2; - } - if((isrs>6)&&(isrs<17)) - { - *psrsPeriodicity=10; - *psrsOffset=isrs-7; - } - if((isrs>16)&&(isrs<37)) - { - *psrsPeriodicity=20; - *psrsOffset=isrs-17; - } - if((isrs>36)&&(isrs<77)) - { - *psrsPeriodicity=40; - *psrsOffset=isrs-37; - } - if((isrs>76)&&(isrs<157)) - { - *psrsPeriodicity=80; - *psrsOffset=isrs-77; - } - if((isrs>156)&&(isrs<317)) - { - *psrsPeriodicity=160; - *psrsOffset=isrs-157; - } - if((isrs>316)&&(isrs<637)) - { - *psrsPeriodicity=320; - *psrsOffset=isrs-317; - } - if(isrs>636) - { - mac_xface->macphy_exit("Isrs out of range"); - } - } -} - -void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) -{ - LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - int frame_tx = proc->frame_tx; - int subframe_tx = proc->subframe_tx; - uint8_t isSubframeSRS = 0; // SRS Cell Occasion - - uint8_t is_pucch2_subframe = 0; - uint8_t is_sr_an_subframe = 0; - - SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; + + LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + int frame_tx = proc->frame_tx; + int subframe_tx = proc->subframe_tx; + SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; + uint16_t srsPeriodicity; + uint16_t srsOffset; + uint8_t is_pucch2_subframe = 0; + uint8_t is_sr_an_subframe = 0; // check for SRS opportunity pSoundingrs_ul_config_dedicated->srsUeSubframe = 0; - pSoundingrs_ul_config_dedicated->srsCellSubframe = 0; + pSoundingrs_ul_config_dedicated->srsCellSubframe = isSubframeSRS; - ue->ulsch[eNB_id]->srs_active = 0; - ue->ulsch[eNB_id]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)- ue->ulsch[eNB_id]->srs_active; - if(frame_parms->soundingrs_ul_config_common.enabled_flag) - { - - LOG_D(PHY," SRS SUBFRAMECONFIG: %d, Isrs: %d \n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig, pSoundingrs_ul_config_dedicated->srs_ConfigIndex); - - uint8_t TSFC; - uint16_t deltaTSFC; // bitmap - uint8_t srs_SubframeConfig; - uint16_t srsPeriodicity; - uint16_t srsOffset; - - // table resuming TSFC (Period) and deltaSFC (offset) - const uint16_t deltaTSFCTabType1[15][2] = { {1,1},{1,2},{2,2},{1,5},{2,5},{4,5},{8,5},{3,5},{12,5},{1,10},{2,10},{4,10},{8,10},{351,10},{383,10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD - const uint16_t deltaTSFCTabType2[14][2] = { {2,5},{6,5},{10,5},{18,5},{14,5},{22,5},{26,5},{30,5},{70,10},{74,10},{194,10},{326,10},{586,10},{210,10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD - - srs_SubframeConfig = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; - if (FDD == frame_parms->frame_type) - { - // srs_SubframeConfig =< 14 - deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; - TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; - } - else - { - // srs_SubframeConfig =< 13 - deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; - TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; - } - - // Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC - uint16_t tmp = (subframe_tx % TSFC); - if((1<srsCellSubframe = 1; - } - LOG_D(PHY," ISTDD: %d, TSFC: %d, deltaTSFC: %d, AbsSubframeTX: %d.%d, srsCellSubframe: %d \n", frame_parms->frame_type, TSFC, deltaTSFC, frame_tx, subframe_tx, pSoundingrs_ul_config_dedicated->srsCellSubframe); - LOG_D(PHY," SrsDedicatedSetup: %d \n",pSoundingrs_ul_config_dedicated->srsConfigDedicatedSetup); + if (isSubframeSRS) { + LOG_D(PHY," SrsDedicatedSetup: %d \n",pSoundingrs_ul_config_dedicated->srsConfigDedicatedSetup); if(pSoundingrs_ul_config_dedicated->srsConfigDedicatedSetup) { compute_srs_pos(frame_parms->frame_type, pSoundingrs_ul_config_dedicated->srs_ConfigIndex, &srsPeriodicity, &srsOffset); @@ -666,6 +529,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id } } + void get_cqipmiri_params(PHY_VARS_UE *ue,uint8_t eNB_id) { @@ -2131,9 +1995,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui int subframe_tx = proc->subframe_tx; int frame_tx = proc->frame_tx; unsigned int aa; - - - + uint8_t isSubframeSRS; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN); @@ -2161,7 +2023,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui if (ue->UE_mode[eNB_id] != PRACH) { // check cell srs subframe and ue srs subframe. This has an impact on pusch encoding - ue_compute_srs_occasion(ue,proc,eNB_id); + isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx); + + ue_compute_srs_occasion(ue,proc,eNB_id,isSubframeSRS); ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 55c6b8387e..543cc8023e 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -632,12 +632,14 @@ int main(int argc, char **argv) UE->pdcch_vars[0]->crnti = 14; + UE->frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag; UE->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2; UE->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7; UE->soundingrs_ul_config_dedicated[eNB_id].srs_Bandwidth = 0; UE->soundingrs_ul_config_dedicated[eNB_id].transmissionComb = 0; UE->soundingrs_ul_config_dedicated[eNB_id].freqDomainPosition = 0; + eNB->frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag; eNB->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2; eNB->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6d0044b346..585d9c2c1c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -885,7 +885,7 @@ abort(); rb_table_index=UE_template->pre_allocated_rb_table_index_ul; } else { mcs=10;//cmin (10, openair_daq_vars.target_ue_ul_mcs); - rb_table_index=5; // for PHR + rb_table_index=13; // for PHR } UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 5ef5a4f50b..19a77a04ec 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -62,11 +62,11 @@ eNBs = pusch_nDMRS1 = 1; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ + srs_enable = "ENBABLE"; + srs_BandwidthConfig = 2; + srs_SubframeConfig = 3; + srs_ackNackST = "FALSE"; + srs_MaxUpPts = "DISABLE"; pusch_p0_Nominal = -90; pusch_alpha = "AL1"; From 02f3298a583cf4e38bc242bb72e303f0ecc13715 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 10 Mar 2017 14:10:00 +0100 Subject: [PATCH 02/11] several fixes to previous commit. First tests in FDD with USRP and UE ok. --- openair1/PHY/INIT/lte_init.c | 3 +- openair1/SCHED/phy_procedures_lte_eNb.c | 28 +++++++++++++------ openair2/RRC/LITE/MESSAGES/asn1_msg.c | 2 +- .../CONF/enb.band7.tm1.usrpb210.conf | 16 +++++------ 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index d0556a0235..9d8818a444 100755 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -483,7 +483,8 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) { if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { - + + eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup = 1; eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration; eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 9257b0d48f..5b12008a99 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -822,9 +822,11 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int frame = proc->frame_tx; int subframe = proc->subframe_tx; - uint16_t srsPeriodicity; - uint16_t srsOffset; + uint16_t srsPeriodicity=0; + uint16_t srsOffset=0; + uint16_t srsConfigIndex=0; uint16_t do_srs=0; + uint16_t is_srs_pos=0; LOG_D(PHY, "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8"), aggregation %d\n", @@ -840,12 +842,19 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC dci_alloc->dci_pdu[0], 1<L); - if (is_srs_occasion_common(fp,frame,subframe)) { - compute_srs_pos(fp->frame_type, eNB->physicalConfigDedicated[UE_id]->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); - if ((((10*frame+subframe) % srsPeriodicity) == srsOffset)) + is_srs_pos = is_srs_occasion_common(fp,pdcch_alloc2ul_frame(fp,frame,subframe),pdcch_alloc2ul_subframe(fp,subframe)); + if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup) { + srsConfigIndex = eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex; + compute_srs_pos(fp->frame_type, srsConfigIndex, &srsPeriodicity, &srsOffset); + if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { do_srs = 1; + } } + LOG_D(PHY,"frame %d (%d), subframe %d (%d), UE_id %d: is_srs_pos %d, do_SRS %d, index %d, period %d, offset %d \n", + frame,pdcch_alloc2ul_frame(fp,frame,subframe),subframe,pdcch_alloc2ul_subframe(fp,subframe), + UE_id,is_srs_pos,do_srs,srsConfigIndex,srsPeriodicity,srsOffset); + generate_eNB_ulsch_params_from_dci(eNB, proc, &dci_alloc->dci_pdu[0], @@ -2093,6 +2102,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq uint16_t srsPeriodicity; uint16_t srsOffset; uint16_t do_srs=0; + uint16_t is_srs_pos=0; if ((eNB->dlsch[UE_id][0]) && (eNB->dlsch[UE_id][0]->rnti>0) && @@ -2104,10 +2114,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq // check if there is SRS and we have to use shortened format // TODO: check for exceptions in transmission of SRS together with ACK/NACK - if (is_srs_occasion_common(fp,frame,subframe)) { - compute_srs_pos(fp->frame_type, eNB->physicalConfigDedicated[UE_id]->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); - if ((((10*frame+subframe) % srsPeriodicity) == srsOffset)) + is_srs_pos = is_srs_occasion_common(fp,pdcch_alloc2ul_frame(fp,frame,subframe),pdcch_alloc2ul_subframe(fp,subframe)); + if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup ) { + compute_srs_pos(fp->frame_type, eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex, &srsPeriodicity, &srsOffset); + if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { do_srs = 1; + } } // Now ACK/NAK diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 4537303fca..67f93a960e 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1593,7 +1593,7 @@ do_RRCConnectionSetup( SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=45; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=19; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 19a77a04ec..debed67f72 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "94"; + mobile_network_code = "92"; ////////// Physical parameters: @@ -62,10 +62,10 @@ eNBs = pusch_nDMRS1 = 1; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; - srs_enable = "ENBABLE"; + srs_enable = "ENABLE"; srs_BandwidthConfig = 2; srs_SubframeConfig = 3; - srs_ackNackST = "FALSE"; + srs_ackNackST = "DISABLE"; srs_MaxUpPts = "DISABLE"; pusch_p0_Nominal = -90; @@ -137,7 +137,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,10 +147,10 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.147/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.147/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth6"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.82/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth6"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.82/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; From e14f3677e5cd54617a681b5ea14467280df58892 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Thu, 16 Feb 2017 17:33:43 +0100 Subject: [PATCH 03/11] sending full rx signal to T in TDD mode --- openair1/SCHED/phy_procedures_lte_eNb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 5b12008a99..2947ce2ce7 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2896,6 +2896,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const const int frame = proc->frame_rx; int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; + T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); + + T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), + T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti], + eNB->frame_parms.samples_per_tti * 4)); if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return; @@ -2905,11 +2910,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); #endif - T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); - - T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), - T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti], - eNB->frame_parms.samples_per_tti * 4)); eNB->rb_mask_ul[0]=0; eNB->rb_mask_ul[1]=0; From c135dd611bb88592da791fa24e850020f6639988 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Thu, 16 Feb 2017 17:34:20 +0100 Subject: [PATCH 04/11] scheduling also UL SF 4 in TDD mode 3 --- openair2/LAYER2/MAC/eNB_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index dee7c51a6e..cab865754e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -383,10 +383,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->frame_parms->frame_type == FDD) { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); - } else if ((mac_xface->frame_parms->tdd_config == TDD) || //TDD + } else if ((mac_xface->frame_parms->tdd_config == 0) || //TDD (mac_xface->frame_parms->tdd_config == 3) || (mac_xface->frame_parms->tdd_config == 6)) { - //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); } #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); From 39c7e629fbd6fb40a91155bcc19108166c4f6d83 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 20 Feb 2017 13:48:54 +0100 Subject: [PATCH 05/11] bugfix: bundling flag was initialized after its use --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 9f4749cdc6..9876b4b169 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -7943,6 +7943,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, print_CQI(ulsch->o,ulsch->uci_format,eNB_id,ue->frame_parms.N_RB_DL); + ulsch->bundling = 1-AckNackFBMode; if (frame_parms->frame_type == FDD) { int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4); @@ -7974,7 +7975,6 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ulsch->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); ulsch->srs_active = use_srs; - ulsch->bundling = 1-AckNackFBMode; if ((rnti >= cba_rnti) && (rnti < p_rnti)) ulsch->harq_processes[harq_pid]->status = CBA_ACTIVE; @@ -8577,6 +8577,8 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; } + ulsch->bundling = 1-AckNackFBMode; + if (frame_parms->frame_type == FDD) { int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4); @@ -8600,7 +8602,6 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); ulsch->harq_processes[harq_pid]->srs_active = use_srs; - ulsch->bundling = 1-AckNackFBMode; //Mapping of cyclic shift field in DCI format0 to n_DMRS2 (3GPP 36.211, Table 5.5.2.1.1-1) if(cshift == 0) From 1e193853eb007a2378d401269a8777e29bbdc669 Mon Sep 17 00:00:00 2001 From: Calisson Date: Tue, 14 Mar 2017 17:13:14 +0100 Subject: [PATCH 06/11] WIP: adding srs channel estimation to eNB. estimation results yet to be checked. --- .../lte_ul_channel_estimation.c | 36 +++++++------ openair1/PHY/LTE_TRANSPORT/proto.h | 8 +-- openair1/PHY/LTE_TRANSPORT/srs_modulation.c | 50 +++++++----------- openair1/PHY/TOOLS/lte_phy_scope.c | 13 +++-- openair1/SCHED/phy_procedures_lte_eNb.c | 52 ++++++++++++------- openair1/SCHED/phy_procedures_lte_ue.c | 8 ++- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 2 +- .../CONF/enb.band7.tm1.usrpb210.conf | 2 +- 8 files changed, 92 insertions(+), 79 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 4fef74dd1c..22ed10ebb7 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -667,28 +667,28 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, } extern uint16_t transmission_offset_tdd[16]; -#define DEBUG_SRS +//#define DEBUG_SRS int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, LTE_eNB_COMMON *common_vars, LTE_eNB_SRS *srs_vars, SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, - unsigned char sub_frame_number, + unsigned char subframe, unsigned char eNB_id) { - int T_SFC,aa; + int aa; int N_symb,symbol; - uint8_t nb_antennas_rx = frame_parms->nb_antenna_ports_eNB; + uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx; #ifdef DEBUG_SRS char fname[40], vname[40]; #endif - uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; + //uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; + //uint8_t T_SFC = (Ssrs<=7 ? 5 : 10); N_symb = 2*7-frame_parms->Ncp; - symbol = (sub_frame_number+1)*N_symb-1; //SRS is always in last symbol of subframe - T_SFC = (Ssrs<=7 ? 5 : 10); + symbol = N_symb-1; //SRS is always in last symbol of subframe /* msg("SRS channel estimation eNB %d, subframs %d, %d %d %d %d %d\n",eNB_id,sub_frame_number, @@ -699,19 +699,21 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, SRS_parms->Ssrs); */ - if ((1<<(sub_frame_number%T_SFC))&transmission_offset_tdd[Ssrs]) { + //if ((1<<(sub_frame_number%T_SFC))&transmission_offset_tdd[Ssrs]) { - if (generate_srs_rx(frame_parms, - soundingrs_ul_config_dedicated, - srs_vars->srs)==-1) { - msg("lte_srs_channel_estimation: Error in generate_srs_rx\n"); + if (generate_srs(frame_parms, + soundingrs_ul_config_dedicated, + &srs_vars->srs[eNB_id], + 0x7FFF, + subframe)==-1) { + LOG_E(PHY,"lte_srs_channel_estimation: Error in generate_srs_rx\n"); return(-1); } for (aa=0; aarxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol], + &common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol], srs_vars->srs, srs_vars->srs_ch_estimates[eNB_id][aa]); #endif @@ -719,14 +721,15 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, //write_output("eNB_rxF.m","rxF",&common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1); //write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1); - mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol], - (int16_t*) srs_vars->srs, + //memcpy(srs_vars->srs_ch_estimates[eNB_id][aa],&srs_vars->srs[eNB_id],frame_parms->ofdm_symbol_size*sizeof(int32_t)); + //memcpy(srs_vars->srs_ch_estimates[eNB_id][aa],&common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],frame_parms->ofdm_symbol_size*sizeof(int32_t)); + mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol], + (int16_t*) &srs_vars->srs[eNB_id], (int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa], frame_parms->ofdm_symbol_size, 15, 0); - //msg("SRS channel estimation cmult out\n"); #ifdef USER_MODE #ifdef DEBUG_SRS sprintf(fname,"eNB_id%d_an%d_srs_ch_est.m",eNB_id,aa); @@ -735,7 +738,6 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, #endif #endif } - } /* else { diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 5fc8dea986..aaa0a28043 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1538,9 +1538,11 @@ uint8_t SE2I_TBS(float SE, @param soundingrs_ul_config_dedicated Dynamic configuration from RRC during Connection Establishment @param txdataF pointer to the frequency domain TX signal @returns 0 on success*/ -int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, - SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, - int *txdataF); +int generate_srs(LTE_DL_FRAME_PARMS *frame_parms, + SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, + int *txdataF, + int16_t amp, + uint32_t subframe); int32_t generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue, uint8_t subframe); diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 7e29d998a1..97dd1c5745 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -120,17 +120,15 @@ int compareints (const void * a, const void * b) return ( *(unsigned short*)a - *(unsigned short*)b ); } - -int32_t generate_srs_tx(PHY_VARS_UE *ue, - uint8_t eNB_id, - int16_t amp, - uint32_t subframe) +#define DEBUG_SRS +int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms, + SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, + int32_t *txptr, + int16_t amp, + uint32_t subframe) { - LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; - int32_t **txdataF = ue->common_vars.txdataF; - uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset; + uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos; uint16_t *Msc_idx_ptr; int32_t k0; //uint32_t subframe_offset; @@ -178,7 +176,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, } if (k0<0) { - msg("generate_srs: invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0); + LOG_E(PHY,"generate_srs: invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0); return(-1); } @@ -188,7 +186,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, if (Msc_idx_ptr) Msc_RS_idx = Msc_idx_ptr - dftsizes; else { - msg("generate_srs: index for Msc_RS=%d not found\n",Msc_RS); + LOG_E(PHY,"generate_srs: index for Msc_RS=%d not found\n",Msc_RS); return(-1); } @@ -199,29 +197,20 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, else if (Msc_RS==144) Msc_RS_idx = 9; else { - msg("generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS); + LOG_E(PHY,"generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS); return(-1); } #endif #ifdef DEBUG_SRS - msg("generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d\n",Msc_RS, Msc_RS_idx); + LOG_I(PHY,"generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d, k0 = %d\n",Msc_RS, Msc_RS_idx,k0); #endif carrier_pos = (frame_parms->first_carrier_offset + k0); if (carrier_pos>frame_parms->ofdm_symbol_size) { carrier_pos -= frame_parms->ofdm_symbol_size; } - uint16_t nsymb = (frame_parms->Ncp==0) ? 14:12; - symbol_offset = (int)frame_parms->ofdm_symbol_size*((subframe*nsymb)+(nsymb-1)); - - //msg("carrier_pos = %d\n",carrier_pos); - //subframe_offset = subframe*frame_parms->symbols_per_tti*frame_parms->ofdm_symbol_size; - //symbol_offset = subframe_offset+(frame_parms->symbols_per_tti-1)*frame_parms->ofdm_symbol_size; - - int32_t *txptr; - txptr = &txdataF[0][symbol_offset]; for (k=0; k> 15; @@ -245,6 +234,7 @@ int generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue,uint8_t subframe) return(0); } +#if 0 int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, int *txdataF) @@ -285,7 +275,7 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, } if (k0<0) { - msg("Invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0); + LOG_E(PHY,"Invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0); return(-1); } @@ -295,7 +285,7 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, if (Msc_idx_ptr) Msc_RS_idx = Msc_idx_ptr - dftsizes; else { - msg("generate_srs: index for Msc_RS=%d not found\n",Msc_RS); + LOG_E(PHY,"generate_srs: index for Msc_RS=%d not found\n",Msc_RS); return(-1); } @@ -306,23 +296,21 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, else if (Msc_RS==144) Msc_RS_idx = 9; else { - msg("generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS); + LOG_E(PHY,"generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS); return(-1); } #endif #ifdef DEBUG_SRS - msg("generate_srs_rx: Msc_RS = %d, Msc_RS_idx = %d, k0=%d\n",Msc_RS, Msc_RS_idx,k0); + LOG_I(PHY,"generate_srs_rx: Msc_RS = %d, Msc_RS_idx = %d, k0=%d\n",Msc_RS, Msc_RS_idx,k0); #endif carrier_pos = (frame_parms->first_carrier_offset + k0) % frame_parms->ofdm_symbol_size; for (k=0; k= frame_parms->ofdm_symbol_size) @@ -365,7 +353,7 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, // write_output("srs_rx.m","srsrx",txdataF,1024,2,1); return(0); } - +#endif #ifdef MAIN main() diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index ca08f87519..72035f9296 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -84,7 +84,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) fl_set_xyplot_ybounds(fdui->rxsig_t,10,70); // Time-domain channel response - fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" ); + fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "SRS Frequency Response (samples, abs)" ); fl_set_object_boxtype( fdui->chest_t, FL_EMBOSSED_BOX ); fl_set_object_color( fdui->chest_t, FL_BLACK, FL_RED ); fl_set_object_lcolor( fdui->chest_t, FL_WHITE ); // Label color @@ -196,7 +196,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, bit = malloc(coded_bits_per_codeword*sizeof(float)); rxsig_t = (int16_t**) phy_vars_enb->common_vars.rxdata[eNB_id]; - chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id]; + //chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id]; + chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates[eNB_id]; chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id]; pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr; pusch_comp = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[eNB_id][0]; @@ -232,8 +233,10 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, if (chest_t[0] !=NULL) { for (i=0; i<(frame_parms->ofdm_symbol_size); i++) { - i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size; - time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1)); + //i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size; + i2=i; + //time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1)); + time2[i] = (float)i; chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1])); if (chest_t_abs[0][i] > ymax) @@ -768,4 +771,4 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, } free(chest_t_abs); -} \ No newline at end of file +} diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 2947ce2ce7..95fa3d4715 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2087,7 +2087,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); } -void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid) +void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid,uint8_t do_srs) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; @@ -2099,10 +2099,6 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq PUCCH_FMT_t format; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; - uint16_t srsPeriodicity; - uint16_t srsOffset; - uint16_t do_srs=0; - uint16_t is_srs_pos=0; if ((eNB->dlsch[UE_id][0]) && (eNB->dlsch[UE_id][0]->rnti>0) && @@ -2112,16 +2108,6 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq do_SR = is_SR_subframe(eNB,proc,UE_id); // do_SR = 0; - // check if there is SRS and we have to use shortened format - // TODO: check for exceptions in transmission of SRS together with ACK/NACK - is_srs_pos = is_srs_occasion_common(fp,pdcch_alloc2ul_frame(fp,frame,subframe),pdcch_alloc2ul_subframe(fp,subframe)); - if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup ) { - compute_srs_pos(fp->frame_type, eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex, &srsPeriodicity, &srsOffset); - if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { - do_srs = 1; - } - } - // Now ACK/NAK // First check subframe_tx flag for earlier subframes @@ -2896,6 +2882,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const const int frame = proc->frame_rx; int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; + uint16_t srsPeriodicity; + uint16_t srsOffset; + uint16_t do_srs=0; + uint16_t is_srs_pos=0; + T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), @@ -2925,13 +2916,34 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->cba_last_reception[i]=0; } - // Do PUCCH processing first - for (i=0; isoundingrs_ul_config_dedicated[i].srsConfigDedicatedSetup ) { + compute_srs_pos(fp->frame_type, eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex, &srsPeriodicity, &srsOffset); + if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { + do_srs = 1; + } + } + + if (do_srs==1) { + if (lte_srs_channel_estimation(fp, + &eNB->common_vars, + &eNB->srs_vars[i], + &eNB->soundingrs_ul_config_dedicated[i], + subframe, + 0/*eNB_id*/)) { + LOG_E(PHY,"problem processing SRS\n"); + } + } + + // Do PUCCH processing + + pucch_procedures(eNB,proc,i,harq_pid, do_srs); + // check for Msg3 if (eNB->mac_enabled==1) { diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 381ea547e4..43113744a2 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1579,7 +1579,13 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8 nb_rb_srs, tx_amp); - generate_srs_tx(ue, eNB_id, tx_amp, subframe_tx); + uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; + uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((subframe_tx*nsymb)+(nsymb-1)); + generate_srs(&ue->frame_parms, + &ue->soundingrs_ul_config_dedicated[eNB_id], + &ue->common_vars.txdataF[eNB_id][symbol_offset], + tx_amp, + subframe_tx); } } diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 67f93a960e..f6a5a0c9df 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1593,7 +1593,7 @@ do_RRCConnectionSetup( SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=19; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=2; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index debed67f72..a9933a6444 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -137,7 +137,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "192.168.12.70"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; From 65f49f9ffd517f9c89d72110c00416f85f9adb57 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 15 Mar 2017 17:43:18 +0100 Subject: [PATCH 07/11] bugfixes to previous commit and ulsim. now srs estimaton seems to work. at least in ulsim. --- cmake_targets/lte-simulators/CMakeLists.txt | 1 + openair1/PHY/LTE_TRANSPORT/srs_modulation.c | 2 +- openair1/SCHED/defs.h | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 6 ++-- openair1/SCHED/phy_procedures_lte_ue.c | 12 ++++---- openair1/SIMULATION/LTE_PHY/ulsim.c | 32 ++++++++++++++++----- 6 files changed, 39 insertions(+), 16 deletions(-) diff --git a/cmake_targets/lte-simulators/CMakeLists.txt b/cmake_targets/lte-simulators/CMakeLists.txt index 5ed4d93d80..79ff0bfbd2 100644 --- a/cmake_targets/lte-simulators/CMakeLists.txt +++ b/cmake_targets/lte-simulators/CMakeLists.txt @@ -3,6 +3,7 @@ set(PACKAGE_NAME "unitary_tests_simulators") set(PHYSIM True) set(RF_BOARD None) set(XFORMS True) +set(ENABLE_ITTI False) set(DEBUG_PHY False) set(MU_RECIEVER False) diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 97dd1c5745..8381eca5e4 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -204,7 +204,7 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms, #endif #ifdef DEBUG_SRS - LOG_I(PHY,"generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d, k0 = %d\n",Msc_RS, Msc_RS_idx,k0); + LOG_D(PHY,"generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d, k0 = %d\n",Msc_RS, Msc_RS_idx,k0); #endif carrier_pos = (frame_parms->first_carrier_offset + k0); diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index f283014af7..4aad186f76 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -379,7 +379,7 @@ void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,ui unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb); -void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); +void phy_reset_ue( PHY_VARS_UE *ue ); /*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 95fa3d4715..f4cc7f8c41 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2916,15 +2916,17 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->cba_last_reception[i]=0; } + is_srs_pos = is_srs_occasion_common(fp,frame,subframe); + for (i=0; isoundingrs_ul_config_dedicated[i].srsConfigDedicatedSetup ) { compute_srs_pos(fp->frame_type, eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex, &srsPeriodicity, &srsOffset); - if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { + if (((10*frame+subframe) % srsPeriodicity) == srsOffset) { do_srs = 1; } } diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 43113744a2..ca9ee8df7c 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -259,14 +259,13 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s } -void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) +void phy_reset_ue(PHY_VARS_UE *ue) { // This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later // for more flexibility uint8_t i,j,k,s; - PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; //[NUMBER_OF_CONNECTED_eNB_MAX][2]; for(i=0; icqi_PMI_ConfigIndex, // (((10*frame + subframe) % cqirep->Npd) == cqirep->N_OFFSET_CQI)); - if (((10*frame + subframe) % cqirep->Npd) == cqirep->N_OFFSET_CQI) + if (cqirep->cqi_PMI_ConfigIndex==-1) + return(0); + else if (((10*frame + subframe) % cqirep->Npd) == cqirep->N_OFFSET_CQI) return(1); else return(0); @@ -428,8 +429,9 @@ uint8_t is_ri_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) // ue->Mod_id,ue->pdcch_vars[eNB_id]->crnti,frame,subframe, // cqirep->ri_ConfigIndex, // (((10*frame + subframe + cqirep->N_OFFSET_CQI - N_OFFSET_RI) % (cqirep->Npd<N_OFFSET_CQI - N_OFFSET_RI) % (cqirep->Npd<ri_ConfigIndex==-1) + return(0); + else if (((10*frame + subframe + cqirep->N_OFFSET_CQI - N_OFFSET_RI) % (cqirep->Npd<frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag; UE->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2; - UE->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7; + UE->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 3; + UE->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = srs_flag; + UE->soundingrs_ul_config_dedicated[eNB_id].duration = 1; + UE->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex = 2; UE->soundingrs_ul_config_dedicated[eNB_id].srs_Bandwidth = 0; UE->soundingrs_ul_config_dedicated[eNB_id].transmissionComb = 0; UE->soundingrs_ul_config_dedicated[eNB_id].freqDomainPosition = 0; + UE->soundingrs_ul_config_dedicated[eNB_id].cyclicShift = 0; eNB->frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag; eNB->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2; - eNB->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7; - - eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = 1; + eNB->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 3; + eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup = srs_flag; + eNB->soundingrs_ul_config_dedicated[UE_id].duration = 1; + eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = 2; eNB->soundingrs_ul_config_dedicated[UE_id].srs_Bandwidth = 0; eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = 0; eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = 0; + eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = 0; + eNB->cooperation_flag = cooperation_flag; - // eNB->eNB_UE_stats[0].SRS_parameters = UE->SRS_parameters; eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK; eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI; @@ -659,6 +668,11 @@ int main(int argc, char **argv) UE->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled = 1; + // disable periodic cqi/ri reporting + UE->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1; + UE->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1; + + printf("PUSCH Beta : ACK %f, RI %f, CQI %f\n",(double)beta_ack[beta_ACK]/8,(double)beta_ri[beta_RI]/8,(double)beta_cqi[beta_CQI]/8); UE2eNB = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx, @@ -700,8 +714,8 @@ int main(int argc, char **argv) } - - + UE->dlsch_SI[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); + UE->dlsch_ra[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); UE->measurements.rank[0] = 0; UE->transmission_mode[0] = 2; @@ -917,6 +931,10 @@ int main(int argc, char **argv) initialize(&time_vector_rx_dec); ndi=0; + + phy_reset_ue(UE); + UE->UE_mode[eNB_id]=PUSCH; + for (trials = 0; trialsframe++; From e2d46f8040bc1e693e58a7bb44171abd1f03818e Mon Sep 17 00:00:00 2001 From: Calisson Date: Mon, 20 Mar 2017 09:49:03 +0100 Subject: [PATCH 08/11] adding mechanism for SRS scheduling of multiple UEs. --- openair1/SCHED/defs.h | 2 +- openair1/SCHED/phy_procedures_lte_ue.c | 4 +-- openair1/SIMULATION/LTE_PHY/ulsim.c | 3 +- openair2/ENB_APP/enb_config.c | 2 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 31 +++++++++++++++++-- .../CONF/enb.band7.tm1.usrpb210.conf | 6 ++-- 6 files changed, 37 insertions(+), 11 deletions(-) diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 4aad186f76..f283014af7 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -379,7 +379,7 @@ void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,ui unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb); -void phy_reset_ue( PHY_VARS_UE *ue ); +void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); /*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index ca9ee8df7c..41ea1339d5 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -258,14 +258,14 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars_ra[0]->dl_ch_magb0,300*nsymb,1,1); } - -void phy_reset_ue(PHY_VARS_UE *ue) +void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) { // This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later // for more flexibility uint8_t i,j,k,s; + PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; //[NUMBER_OF_CONNECTED_eNB_MAX][2]; for(i=0; iUE_mode[eNB_id]=PUSCH; for (trials = 0; trialssrs_enable[j]) { printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_BandwidthConfig[j]); - printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_SubframeConfig[j]); + printf( "\tsrs_SubframeConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_SubframeConfig[j]); printf( "\tsrs_ackNackST for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_ackNackST[j]); printf( "\tsrs_MaxUpPts for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_MaxUpPts[j]); } diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index f6a5a0c9df..08584c883b 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -99,7 +99,7 @@ int errno; # endif #endif -//#define XER_PRINT +#define XER_PRINT extern Enb_properties_array_t enb_properties; typedef struct xer_sprint_string_s { @@ -1593,8 +1593,33 @@ do_RRCConnectionSetup( SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=2; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; + if (frame_parms->frame_type==FDD) { + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=2) + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 2, but current config is %d. Expect undefined behaviour!\n", + enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]); + if (ue_context_pP->local_uid >=10) + LOG_W(RRC,"This code has been optimized for up to 10 UEs, but current UE_id is %d. Expect undefined behaviour!\n", + ue_context_pP->local_uid); + //the current code will allow for 20 UEs - to be revised for more + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=8+2*(ue_context_pP->local_uid/2); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; + } + else { + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=6) { + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 6 and TDD config 3, but current configs are %d and %d. Expect undefined behaviour!\n", + enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id], + enb_properties.properties[ctxt_pP->module_id]->tdd_config[CC_id]); + } + if (ue_context_pP->local_uid >=6) + LOG_W(RRC,"This code has been optimized for up to 4 UEs, but current UE_id is %d. Expect undefined behaviour!\n", + ue_context_pP->local_uid); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=18+ue_context_pP->local_uid/2; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; + } + LOG_W(RRC,"local UID %d, srs ConfigIndex %d, TransmissionComb %d\n",ue_context_pP->local_uid, + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index a9933a6444..878daf4cf8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -62,9 +62,9 @@ eNBs = pusch_nDMRS1 = 1; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; - srs_enable = "ENABLE"; + srs_enable = "DISABLE"; srs_BandwidthConfig = 2; - srs_SubframeConfig = 3; + srs_SubframeConfig = 2; srs_ackNackST = "DISABLE"; srs_MaxUpPts = "DISABLE"; @@ -137,7 +137,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; From 98efcd522077cb4cd3c08b6c50cf1d0cf1ec1191 Mon Sep 17 00:00:00 2001 From: Calisson Date: Tue, 21 Mar 2017 09:37:08 +0100 Subject: [PATCH 09/11] fixing a bug related to SRS procedures --- openair1/SCHED/phy_procedures_lte_eNb.c | 5 +++-- .../GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index b9fdc5d226..36d6ca8ff9 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -843,6 +843,7 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC 1<L); is_srs_pos = is_srs_occasion_common(fp,pdcch_alloc2ul_frame(fp,frame,subframe),pdcch_alloc2ul_subframe(fp,subframe)); + /* if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup) { srsConfigIndex = eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex; compute_srs_pos(fp->frame_type, srsConfigIndex, &srsPeriodicity, &srsOffset); @@ -850,10 +851,10 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC do_srs = 1; } } - LOG_D(PHY,"frame %d (%d), subframe %d (%d), UE_id %d: is_srs_pos %d, do_SRS %d, index %d, period %d, offset %d \n", frame,pdcch_alloc2ul_frame(fp,frame,subframe),subframe,pdcch_alloc2ul_subframe(fp,subframe), UE_id,is_srs_pos,do_srs,srsConfigIndex,srsPeriodicity,srsOffset); + */ generate_eNB_ulsch_params_from_dci(eNB, proc, @@ -865,7 +866,7 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC 0, P_RNTI, CBA_RNTI, - do_srs); // do_srs + is_srs_pos); LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d\n", eNB->Mod_id,frame,subframe,dci_alloc->rnti, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf index 024be3b775..a33c2eb41b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf @@ -62,11 +62,11 @@ eNBs = pusch_nDMRS1 = 1; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ + srs_enable = "ENABLE"; + srs_BandwidthConfig = 2; + srs_SubframeConfig = 7; + srs_ackNackST = "DISABLE"; + srs_MaxUpPts = "DISABLE"; pusch_p0_Nominal = -90; pusch_alpha = "AL1"; From 7685cf18118bc3f6042c202959d8049596029500 Mon Sep 17 00:00:00 2001 From: Calisson Date: Tue, 21 Mar 2017 14:05:16 +0100 Subject: [PATCH 10/11] fixing srs in msg3. now all SRS subframe configs work. --- openair1/PHY/LTE_TRANSPORT/rar_tools.c | 17 +++++++++++++++-- openair1/SCHED/phy_procedures_lte_eNb.c | 11 +++-------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 16 ++++++++-------- .../CONF/enb.band7.tm1.usrpb210.conf | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 60fa52df16..2629c6ba7f 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -31,6 +31,7 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" +#include "SCHED/defs.h" #include "SCHED/extern.h" #include "LAYER2/MAC/defs.h" #include "SCHED/defs.h" @@ -69,6 +70,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, uint8_t cqireq; uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; uint16_t RIV_max; + uint16_t use_srs=0; LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); @@ -133,8 +135,6 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ulsch->beta_offset_ri_times8 = 10; ulsch->beta_offset_harqack_times8 = 16; - - ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1); ulsch->rnti = (((uint16_t)rar[4])<<8)+rar[5]; if (ulsch->harq_processes[harq_pid]->round == 0) { @@ -151,6 +151,19 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ulsch->harq_processes[harq_pid]->round++; } + + ulsch->Msg3_active = 1; + + get_Msg3_alloc(frame_parms, + subframe, + frame, + &ulsch->Msg3_frame, + &ulsch->Msg3_subframe); + + use_srs = is_srs_occasion_common(frame_parms,ulsch->Msg3_frame,ulsch->Msg3_subframe); + ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); + ulsch->harq_processes[harq_pid]->srs_active = use_srs; + #ifdef DEBUG_RAR msg("ulsch ra (eNB): harq_pid %d\n",harq_pid); msg("ulsch ra (eNB): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 36d6ca8ff9..821cfef7df 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -822,10 +822,12 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int frame = proc->frame_tx; int subframe = proc->subframe_tx; + /* uint16_t srsPeriodicity=0; uint16_t srsOffset=0; uint16_t srsConfigIndex=0; uint16_t do_srs=0; + */ uint16_t is_srs_pos=0; LOG_D(PHY, @@ -1006,17 +1008,10 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *d generate_eNB_ulsch_params_from_rar(DLSCH_pdu, frame, - (subframe), + subframe, eNB->ulsch[(uint32_t)UE_id], fp); - eNB->ulsch[(uint32_t)UE_id]->Msg3_active = 1; - - get_Msg3_alloc(fp, - subframe, - frame, - &eNB->ulsch[(uint32_t)UE_id]->Msg3_frame, - &eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe); LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", frame, subframe, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 08584c883b..13fafcade8 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1594,26 +1594,26 @@ do_RRCConnectionSetup( physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; if (frame_parms->frame_type==FDD) { - if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=2) - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 2, but current config is %d. Expect undefined behaviour!\n", + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=0) + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 0, but current config is %d. Expect undefined behaviour!\n", enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]); - if (ue_context_pP->local_uid >=10) + if (ue_context_pP->local_uid >=20) LOG_W(RRC,"This code has been optimized for up to 10 UEs, but current UE_id is %d. Expect undefined behaviour!\n", ue_context_pP->local_uid); //the current code will allow for 20 UEs - to be revised for more - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=8+2*(ue_context_pP->local_uid/2); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=7+ue_context_pP->local_uid/2; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; } else { - if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=6) { - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 6 and TDD config 3, but current configs are %d and %d. Expect undefined behaviour!\n", + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=7) { + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 7 and TDD config 3, but current configs are %d and %d. Expect undefined behaviour!\n", enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id], enb_properties.properties[ctxt_pP->module_id]->tdd_config[CC_id]); } if (ue_context_pP->local_uid >=6) - LOG_W(RRC,"This code has been optimized for up to 4 UEs, but current UE_id is %d. Expect undefined behaviour!\n", + LOG_W(RRC,"This code has been optimized for up to 6 UEs, but current UE_id is %d. Expect undefined behaviour!\n", ue_context_pP->local_uid); - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=18+ue_context_pP->local_uid/2; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=17+ue_context_pP->local_uid/2; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; } LOG_W(RRC,"local UID %d, srs ConfigIndex %d, TransmissionComb %d\n",ue_context_pP->local_uid, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 878daf4cf8..d563f3af7e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -64,7 +64,7 @@ eNBs = phich_resource = "ONESIXTH"; srs_enable = "DISABLE"; srs_BandwidthConfig = 2; - srs_SubframeConfig = 2; + srs_SubframeConfig = 0; srs_ackNackST = "DISABLE"; srs_MaxUpPts = "DISABLE"; From 9d3eed3b433bf2c3b7a31451076778c70f7c4816 Mon Sep 17 00:00:00 2001 From: Calisson Date: Tue, 21 Mar 2017 15:02:20 +0100 Subject: [PATCH 11/11] fixing ulsim --- cmake_targets/lte-simulators/CMakeLists.txt | 1 - openair1/SIMULATION/LTE_PHY/ulsim.c | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cmake_targets/lte-simulators/CMakeLists.txt b/cmake_targets/lte-simulators/CMakeLists.txt index 79ff0bfbd2..5ed4d93d80 100644 --- a/cmake_targets/lte-simulators/CMakeLists.txt +++ b/cmake_targets/lte-simulators/CMakeLists.txt @@ -3,7 +3,6 @@ set(PACKAGE_NAME "unitary_tests_simulators") set(PHYSIM True) set(RF_BOARD None) set(XFORMS True) -set(ENABLE_ITTI False) set(DEBUG_PHY False) set(MU_RECIEVER False) diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 013b65c249..d5f1407224 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -42,6 +42,7 @@ #include "SCHED/vars.h" #include "LAYER2/MAC/vars.h" #include "OCG_vars.h" +#include "intertask_interface_init.h" #include "unitary_defs.h" @@ -285,11 +286,15 @@ int main(int argc, char **argv) printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz); - logInit(); + /* + // enable these lines if you need debug info + // however itti will catch all signals, so ctrl-c won't work anymore + // alternatively you can disable ITTI completely in CMakeLists.txt + itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); set_comp_log(PHY,LOG_DEBUG,LOG_MED,1); - set_glog(LOG_INFO,LOG_MED); - + set_glog(LOG_DEBUG,LOG_MED); + */ while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) { switch (c) { @@ -571,6 +576,11 @@ int main(int argc, char **argv) osf, 0); + // for a call to phy_reset_ue later we need PHY_vars_UE_g allocated and pointing to UE + PHY_vars_UE_g = (PHY_VARS_UE***)malloc(sizeof(PHY_VARS_UE**)); + PHY_vars_UE_g[0] = (PHY_VARS_UE**) malloc(sizeof(PHY_VARS_UE*)); + PHY_vars_UE_g[0][0] = UE; + if (nb_rb_set == 0) nb_rb = eNB->frame_parms.N_RB_UL; @@ -585,8 +595,6 @@ int main(int argc, char **argv) txdata = UE->common_vars.txdata; - - nsymb = (eNB->frame_parms.Ncp == NORMAL) ? 14 : 12; @@ -934,7 +942,6 @@ int main(int argc, char **argv) ndi=0; - PHY_vars_UE_g = UE; phy_reset_ue(0,0,0); UE->UE_mode[eNB_id]=PUSCH;