Commit 9938bd5d authored by fnabet's avatar fnabet

[OAI-UE] SRS feature

                   1- Implement SRS procedures
                   2- Implement SRS procedures part2
                   3- Implement SRS: SRS valid on CMW
parent 9d5621e6
...@@ -2865,7 +2865,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2865,7 +2865,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
} }
} }
LOG_D(PHY,"DCI decoding CRNTI [format_c: %d, nCCE[subframe: %d]: %d ]\n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe]); LOG_D(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2);
// memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes); // memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes);
......
...@@ -50,6 +50,8 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) ...@@ -50,6 +50,8 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
// This is from Section 5.5.1.3 // This is from Section 5.5.1.3
uint32_t fss_pusch = frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH; uint32_t fss_pusch = frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
uint32_t fss_pucch = frame_parms->Nid_cell;
x2 = frame_parms->Nid_cell/30; x2 = frame_parms->Nid_cell/30;
#ifdef DEBUG_GROUPHOP #ifdef DEBUG_GROUPHOP
printf("[PHY] GroupHop:"); printf("[PHY] GroupHop:");
...@@ -57,7 +59,10 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) ...@@ -57,7 +59,10 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
for (ns=0; ns<20; ns++) { for (ns=0; ns<20; ns++) {
if (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == 0) if (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == 0)
{
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns] = fss_pusch%30; frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns] = fss_pusch%30;
frame_parms->pucch_config_common.grouphop[ns] = fss_pucch%30;
}
else { else {
if ((ns&3) == 0) { if ((ns&3) == 0) {
s = lte_gold_generic(&x1,&x2,reset); s = lte_gold_generic(&x1,&x2,reset);
...@@ -65,6 +70,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) ...@@ -65,6 +70,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
} }
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns] = (((uint8_t*)&s)[ns&3]+fss_pusch)%30; frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns] = (((uint8_t*)&s)[ns&3]+fss_pusch)%30;
frame_parms->pucch_config_common.grouphop[ns] = (((uint8_t*)&s)[ns&3]+fss_pucch)%30;
} }
#ifdef DEBUG_GROUPHOP #ifdef DEBUG_GROUPHOP
......
...@@ -137,11 +137,10 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, ...@@ -137,11 +137,10 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue,
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id];
int32_t *txdataF = ue->common_vars.txdataF[0]; 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,symbol_offset;
uint16_t *Msc_idx_ptr; uint16_t *Msc_idx_ptr;
int32_t k0; int32_t k0;
uint32_t T_SFC;
uint32_t subframe_offset; uint32_t subframe_offset;
uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth; uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth;
uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig; uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig;
...@@ -149,6 +148,16 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, ...@@ -149,6 +148,16 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue,
uint8_t n_RRC = soundingrs_ul_config_dedicated->freqDomainPosition; uint8_t n_RRC = soundingrs_ul_config_dedicated->freqDomainPosition;
uint8_t kTC = soundingrs_ul_config_dedicated->transmissionComb; uint8_t kTC = soundingrs_ul_config_dedicated->transmissionComb;
// u is the PUCCH sequence-group number defined in Section 5.5.1.3
// ν is the base sequence number defined in Section 5.5.1.4
uint32_t u=frame_parms->pucch_config_common.grouphop[1+(subframe<<1)];;
uint32_t v=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
LOG_D(PHY,"SRS root sequence: u %d, v %d\n",u,v);
LOG_D(PHY,"CommonSrsConfig: Csrs %d, Ssrs %d, AnSrsSimultan %d \n",Csrs,Ssrs,frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
LOG_D(PHY,"DedicatedSrsConfig: Bsrs %d, bhop %d, nRRC %d, Isrs %d, kTC %d, n_SRS %d\n",Bsrs,soundingrs_ul_config_dedicated->srs_HoppingBandwidth,n_RRC
,soundingrs_ul_config_dedicated->srs_ConfigIndex,kTC
,soundingrs_ul_config_dedicated->cyclicShift);
if (frame_parms->N_RB_UL < 41) { if (frame_parms->N_RB_UL < 41) {
msrs0 = msrsb_6_40[Csrs][0]; msrs0 = msrsb_6_40[Csrs][0];
...@@ -169,7 +178,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, ...@@ -169,7 +178,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue,
} }
Msc_RS = msrsb * 6; Msc_RS = msrsb * 6;
k0 = (((frame_parms->N_RB_UL>>1)-(msrs0>>1))*12) + kTC; k0 = ( ( (int16_t)(frame_parms->N_RB_UL>>1) - (int16_t)(msrs0>>1) ) * 12 ) + kTC;
nb = (4*n_RRC/msrsb)%Nb; nb = (4*n_RRC/msrsb)%Nb;
for (b=0; b<=Bsrs; b++) { for (b=0; b<=Bsrs; b++) {
...@@ -208,51 +217,30 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue, ...@@ -208,51 +217,30 @@ int32_t generate_srs_tx(PHY_VARS_UE *ue,
msg("generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d\n",Msc_RS, Msc_RS_idx); msg("generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d\n",Msc_RS, Msc_RS_idx);
#endif #endif
T_SFC = (Ssrs<=7 ? 5 : 10); carrier_pos = (frame_parms->first_carrier_offset + k0);
if (carrier_pos>frame_parms->ofdm_symbol_size) {
if ((1<<(subframe%T_SFC))&transmission_offset_tdd[Ssrs]) { carrier_pos -= frame_parms->ofdm_symbol_size;
#ifndef IFFT_FPGA_UE
carrier_pos = (frame_parms->first_carrier_offset + k0) % frame_parms->ofdm_symbol_size;
//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;
for (k=0; k<Msc_RS; k++) {
((short*) txdataF)[2*(symbol_offset + carrier_pos)] = (short) (((int32_t) amp * (int32_t) ul_ref_sigs[0][0][Msc_RS_idx][k<<1])>>15);
((short*) txdataF)[2*(symbol_offset + carrier_pos)+1] = (short) (((int32_t) amp * (int32_t) ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1])>>15);
carrier_pos+=2;
if (carrier_pos >= frame_parms->ofdm_symbol_size)
carrier_pos=1;
} }
uint16_t nsymb = (frame_parms->Ncp==0) ? 14:12;
symbol_offset = (int)frame_parms->ofdm_symbol_size*((subframe*nsymb)+(nsymb-1));
#else
carrier_pos = (frame_parms->N_RB_UL*12/2 + k0) % (frame_parms->N_RB_UL*12);
//msg("carrier_pos = %d\n",carrier_pos); //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;
subframe_offset = subframe*frame_parms->symbols_per_tti*frame_parms->N_RB_UL*12; int32_t *txptr;
symbol_offset = subframe_offset+(frame_parms->symbols_per_tti-1)*frame_parms->N_RB_UL*12; txptr = &txdataF[0][symbol_offset];
for (k=0; k<Msc_RS; k++) { for (k=0; k<Msc_RS; k++) {
if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) int32_t real = ((int32_t) amp * (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][k<<1]) >> 15;
txdataF[symbol_offset+carrier_pos] = (int32_t) 4; int32_t imag = ((int32_t) amp * (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][(k<<1)+1]) >> 15;
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) txptr[carrier_pos] = (real&0xFFFF) + ((imag<<16)&0xFFFF0000);
txdataF[symbol_offset+carrier_pos] = (int32_t) 2;
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0))
txdataF[symbol_offset+carrier_pos] = (int32_t) 3;
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0))
txdataF[symbol_offset+carrier_pos] = (int32_t) 1;
carrier_pos+=2;
if (carrier_pos >= frame_parms->N_RB_UL*12) carrier_pos = carrier_pos+2;
carrier_pos=0;
}
#endif if (carrier_pos >= frame_parms->ofdm_symbol_size)
// write_output("srs_txF.m","srstxF",&txdataF[symbol_offset],512,1,1); carrier_pos=carrier_pos-frame_parms->ofdm_symbol_size;
} }
return(0); return(0);
......
...@@ -148,6 +148,11 @@ typedef struct { ...@@ -148,6 +148,11 @@ typedef struct {
uint8_t nCS_AN; uint8_t nCS_AN;
/// Parameter: \f$N^{(1)}_\text{PUCCH}\f$ see TS 36.213 (10.1). \vr{[0..2047]} /// Parameter: \f$N^{(1)}_\text{PUCCH}\f$ see TS 36.213 (10.1). \vr{[0..2047]}
uint16_t n1PUCCH_AN; uint16_t n1PUCCH_AN;
/// group hopping sequence for DRS \note not part of offical UL-PUCCH_CONFIG_COMMON ASN1 specification.
uint8_t grouphop[20];
/// sequence hopping sequence for DRS \note not part of offical UL-PUCCH_CONFIG_COMMON ASN1 specification.
uint8_t seqhop[20];
} PUCCH_CONFIG_COMMON; } PUCCH_CONFIG_COMMON;
/// UL-ReferenceSignalsPUSCH from 36.331 RRC spec /// UL-ReferenceSignalsPUSCH from 36.331 RRC spec
......
...@@ -205,7 +205,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb ...@@ -205,7 +205,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb
int gain_dB = power_dBm - power_max_dBm; int gain_dB = power_dBm - power_max_dBm;
double gain_lin; double gain_lin;
LOG_I(PHY,"Get Tx Amp; Gain[dB]: %d, AMP: %d\n",gain_dB,AMP);
if (gain_dB < -20) if (gain_dB < -20)
return(AMP/10); return(AMP/10);
...@@ -492,17 +491,19 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id ...@@ -492,17 +491,19 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
int frame_tx = proc->frame_tx; int frame_tx = proc->frame_tx;
int subframe_tx = proc->subframe_tx; int subframe_tx = proc->subframe_tx;
uint8_t isSubframeSRS = 0; // SRS Cell Occasion uint8_t isSubframeSRS = 0; // SRS Cell Occasion
uint8_t isSubframeSRSTx = 0; // SRS UE Occasion
SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id];
// check for SRS opportunity // check for SRS opportunity
pSoundingrs_ul_config_dedicated->srsUeSubframe = 0; pSoundingrs_ul_config_dedicated->srsUeSubframe = 0;
pSoundingrs_ul_config_dedicated->srsCellSubframe = 0; pSoundingrs_ul_config_dedicated->srsCellSubframe = 0;
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) if(frame_parms->soundingrs_ul_config_common.enabled_flag)
{ {
LOG_I(PHY," SRS SUBFRAMECONFIG: %d, Isrs: %d \n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig, pSoundingrs_ul_config_dedicated->srs_ConfigIndex); 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; uint8_t TSFC;
uint16_t deltaTSFC; // bitmap uint16_t deltaTSFC; // bitmap
...@@ -536,12 +537,14 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id ...@@ -536,12 +537,14 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
isSubframeSRS = 1; isSubframeSRS = 1;
pSoundingrs_ul_config_dedicated->srsCellSubframe = 1; pSoundingrs_ul_config_dedicated->srsCellSubframe = 1;
} }
LOG_I(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," 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(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); compute_srs_pos(frame_parms->frame_type, pSoundingrs_ul_config_dedicated->srs_ConfigIndex, &srsPeriodicity, &srsOffset);
LOG_D(PHY," srsPeriodicity: %d srsOffset: %d isSubframeSRS %d \n",srsPeriodicity,srsOffset,isSubframeSRS);
// transmit SRS if the four following constraints are respected: // transmit SRS if the four following constraints are respected:
// - UE is configured to transmit SRS // - UE is configured to transmit SRS
// - SRS are configured in current subframe // - SRS are configured in current subframe
...@@ -553,11 +556,12 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id ...@@ -553,11 +556,12 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
//(! is_pucch_per_cqi_report)) //(! is_pucch_per_cqi_report))
) )
{ {
isSubframeSRSTx = 1;
pSoundingrs_ul_config_dedicated->srsUeSubframe = 1; pSoundingrs_ul_config_dedicated->srsUeSubframe = 1;
ue->ulsch[eNB_id]->srs_active = 1;
ue->ulsch[eNB_id]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)- ue->ulsch[eNB_id]->srs_active;
} }
LOG_I(PHY," isSubframeSRS: %d, isSubframeSRSTx: %d \n", isSubframeSRS, isSubframeSRSTx);
} }
LOG_D(PHY," srsCellSubframe: %d, srsUeSubframe: %d, Nsymb-pusch: %d \n", pSoundingrs_ul_config_dedicated->srsCellSubframe, pSoundingrs_ul_config_dedicated->srsUeSubframe, ue->ulsch[eNB_id]->Nsymb_pusch);
} }
} }
...@@ -1289,14 +1293,21 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8 ...@@ -1289,14 +1293,21 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8
} }
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
if (ue->mac_enabled==1)
{
tx_amp = get_tx_amp(Po_SRS, tx_amp = get_tx_amp(Po_SRS,
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
nb_rb_srs); nb_rb_srs);
}
else
{
tx_amp = AMP;
}
#else #else
tx_amp = AMP; tx_amp = AMP;
#endif #endif
LOG_I(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm, LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm,
Po_SRS, Po_SRS,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
nb_rb_srs, nb_rb_srs,
...@@ -1323,7 +1334,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1323,7 +1334,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
int8_t Po_PUCCH; int8_t Po_PUCCH;
SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id];
uint8_t isShortenPucch = pSoundingrs_ul_config_dedicated->srsCellSubframe; uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode;
...@@ -1397,9 +1408,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1397,9 +1408,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
#endif #endif
if (SR_payload>0) { if (SR_payload>0) {
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1a/1b payload %d,%d (with SR for PUSCH), shorten_pucch %d, n1_pucch %d, Po_PUCCH, amp %d\n", LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1a/1b payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH, amp %d\n",
Mod_id, Mod_id,
ue->dlsch[eNB_id][0]->rnti, ue->dlsch[eNB_id][0]->rnti,
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
isShortenPucch, isShortenPucch,
frame_tx, subframe_tx, frame_tx, subframe_tx,
pucch_ack_payload[0],pucch_ack_payload[1], pucch_ack_payload[0],pucch_ack_payload[1],
...@@ -1407,10 +1419,11 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1407,10 +1419,11 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
Po_PUCCH, Po_PUCCH,
tx_amp); tx_amp);
} else { } else {
LOG_I(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating PUCCH 1a/1b, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n", LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating PUCCH 1a/1b, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
Mod_id, Mod_id,
ue->dlsch[eNB_id][0]->rnti, ue->dlsch[eNB_id][0]->rnti,
frame_tx, subframe_tx, frame_tx, subframe_tx,
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
isShortenPucch, isShortenPucch,
n1_pucch,pucch_ack_payload[0],pucch_ack_payload[1],SR_payload, n1_pucch,pucch_ack_payload[0],pucch_ack_payload[1],SR_payload,
Po_PUCCH, Po_PUCCH,
...@@ -1460,10 +1473,11 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1460,10 +1473,11 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
#else #else
tx_amp = AMP; tx_amp = AMP;
#endif #endif
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n", LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
Mod_id, Mod_id,
ue->dlsch[eNB_id][0]->rnti, ue->dlsch[eNB_id][0]->rnti,
frame_tx, subframe_tx, frame_tx, subframe_tx,
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
isShortenPucch, isShortenPucch,
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
Po_PUCCH); Po_PUCCH);
...@@ -1526,14 +1540,14 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui ...@@ -1526,14 +1540,14 @@ 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) { 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);
ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag); ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag);
} }
if (ue->UE_mode[eNB_id] == PUSCH) { if (ue->UE_mode[eNB_id] == PUSCH) {
// check cell srs subframe and ue srs subframe
ue_compute_srs_occasion(ue,proc,eNB_id);
// check if we need to use PUCCH 1a/1b // check if we need to use PUCCH 1a/1b
ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag); ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag);
// check if we need to use SRS // check if we need to use SRS
......
...@@ -46,7 +46,8 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t ...@@ -46,7 +46,8 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t
{ {
int16_t PL; int16_t PL;
int8_t P_opusch; int8_t p0_NominalPUSCH;
int8_t p0_UE_PUSCH;
int8_t Psrs_offset; int8_t Psrs_offset;
int16_t P_srs; int16_t P_srs;
int16_t f_pusch; int16_t f_pusch;
...@@ -59,7 +60,7 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t ...@@ -59,7 +60,7 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t
uint8_t Bsrs = psoundingrs_ul_config_dedicated->srs_Bandwidth; uint8_t Bsrs = psoundingrs_ul_config_dedicated->srs_Bandwidth;
uint8_t Csrs = pframe_parms->soundingrs_ul_config_common.srs_BandwidthConfig; uint8_t Csrs = pframe_parms->soundingrs_ul_config_common.srs_BandwidthConfig;
LOG_I(PHY," SRS Power Control; AbsSubframe %d.%d, eNB_id %d, N_RB_UL %d, srs_Bandwidth %d, srs_BandwidthConfig %d \n",proc->frame_tx,proc->subframe_tx,eNB_id,pframe_parms->N_RB_UL,Bsrs,Csrs); LOG_D(PHY," SRS Power Control; AbsSubframe %d.%d, eNB_id %d, N_RB_UL %d, srs_Bandwidth %d, srs_BandwidthConfig %d \n",proc->frame_tx,proc->subframe_tx,eNB_id,pframe_parms->N_RB_UL,Bsrs,Csrs);
if (pframe_parms->N_RB_UL < 41) if (pframe_parms->N_RB_UL < 41)
{ {
...@@ -81,20 +82,27 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t ...@@ -81,20 +82,27 @@ void srs_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t
// SRS Power control 36.213 5.1.3.1 // SRS Power control 36.213 5.1.3.1
// P_srs = P_srs_offset+ 10log10(Msrs) + P_opusch(j) + alpha*PL + f(i)) // P_srs = P_srs_offset+ 10log10(Msrs) + P_opusch(j) + alpha*PL + f(i))
p0_NominalPUSCH = ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
p0_UE_PUSCH = ue->ul_power_control_dedicated[eNB_id].p0_UE_PUSCH;
Psrs_offset = (ue->ul_power_control_dedicated[eNB_id].pSRS_Offset - 3); Psrs_offset = (ue->ul_power_control_dedicated[eNB_id].pSRS_Offset - 3);
P_opusch = ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
f_pusch = ue->ulsch[eNB_id]->f_pusch; f_pusch = ue->ulsch[eNB_id]->f_pusch;
alpha = alpha_lut[ue->frame_parms.ul_power_control_config_common.alpha]; alpha = alpha_lut[ue->frame_parms.ul_power_control_config_common.alpha];
PL = get_PL(ue->Mod_id,ue->CC_id,eNB_id); PL = get_PL(ue->Mod_id,ue->CC_id,eNB_id);
LOG_I(PHY," SRS Power Control; eNB_id %d, p0_NominalPUSCH %d, alpha %d \n",eNB_id,P_opusch,alpha); LOG_D(PHY," SRS Power Control; eNB_id %d, p0_NominalPUSCH %d, p0_UE_PUSCH %d, alpha %d \n",eNB_id,p0_NominalPUSCH,p0_UE_PUSCH,alpha);
LOG_I(PHY," SRS Power Control; eNB_id %d, pSRS_Offset[dB] %d, Msrs %d, PL %d, f_pusch %d \n",eNB_id,Psrs_offset,Msrs,PL,f_pusch); LOG_D(PHY," SRS Power Control; eNB_id %d, pSRS_Offset[dB] %d, Msrs %d, PL %d, f_pusch %d \n",eNB_id,Psrs_offset,Msrs,PL,f_pusch);
P_srs = P_opusch + Psrs_offset + f_pusch; P_srs = (p0_NominalPUSCH + p0_UE_PUSCH) + Psrs_offset + f_pusch;
P_srs += (((int32_t)alpha * (int32_t)PL) + hundred_times_log10_NPRB[Msrs-1])/100 ; P_srs += (((int32_t)alpha * (int32_t)PL) + hundred_times_log10_NPRB[Msrs-1])/100 ;
ue->ulsch[eNB_id]->Po_SRS = P_srs < ue->tx_power_max_dBm ? P_srs:ue->tx_power_max_dBm; // MIN(PcMax,Psrs) ue->ulsch[eNB_id]->Po_SRS = P_srs;
if(ue->ulsch[eNB_id]->Po_SRS > ue->tx_power_max_dBm)
{
ue->ulsch[eNB_id]->Po_SRS = ue->tx_power_max_dBm;
}
pnb_rb_srs[0] = Msrs; pnb_rb_srs[0] = Msrs;
LOG_I(PHY," SRS Power Control; eNB_id %d, P_srs[dBm] %d, P_cmax[dBm] %d, Psrs[dBm] %d\n",eNB_id,P_srs,ue->tx_power_max_dBm,ue->ulsch[eNB_id]->Po_SRS); LOG_D(PHY," SRS Power Control; eNB_id %d, Psrs_pc[dBm] %d, Pcmax[dBm] %d, Psrs[dBm] %d\n",eNB_id,P_srs,ue->tx_power_max_dBm,ue->ulsch[eNB_id]->Po_SRS);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment