Commit bc02d1c7 authored by hbilel's avatar hbilel

[OAI-UE] new pucch procedure to support all formats

parent f9f83b20
...@@ -3184,7 +3184,7 @@ void dlsch_channel_level_TM7(int **dl_bf_ch_estimates_ext, ...@@ -3184,7 +3184,7 @@ void dlsch_channel_level_TM7(int **dl_bf_ch_estimates_ext,
#endif #endif
} }
#define ONE_OVER_2_Q15 16384
void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp, int **rxdataF_comp,
int **dl_ch_mag, int **dl_ch_mag,
...@@ -3203,7 +3203,7 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3203,7 +3203,7 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0; uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0;
rxF0_128 = (__m128i*) &rxdataF_comp[0][jj]; rxF0_128 = (__m128i*) &rxdataF_comp[0][jj];
amp = _mm_set1_epi16(ONE_OVER_SQRT2_Q15); amp = _mm_set1_epi16(ONE_OVER_2_Q15);
// printf("Doing alamouti!\n"); // printf("Doing alamouti!\n");
rxF0 = (short*)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y rxF0 = (short*)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y
...@@ -3240,25 +3240,30 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3240,25 +3240,30 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
ch_mag0b[1] = _mm_adds_epi16(ch_mag0b[1],ch_mag1b[1]); ch_mag0b[1] = _mm_adds_epi16(ch_mag0b[1],ch_mag1b[1]);
// account for 1/sqrt(2) scaling at transmission // account for 1/sqrt(2) scaling at transmission
ch_mag0[0] = _mm_srai_epi16(ch_mag0[0],1); //ch_mag0[0] = _mm_srai_epi16(ch_mag0[0],1);
ch_mag0[1] = _mm_srai_epi16(ch_mag0[1],1); //ch_mag0[1] = _mm_srai_epi16(ch_mag0[1],1);
ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1); //ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1);
ch_mag0b[1] = _mm_srai_epi16(ch_mag0b[1],1); //ch_mag0b[1] = _mm_srai_epi16(ch_mag0b[1],1);
rxF0_128[0] = _mm_mulhi_epi16(rxF0_128[0],amp); //rxF0_128[0] = _mm_mulhi_epi16(rxF0_128[0],amp);
rxF0_128[0] = _mm_slli_epi16(rxF0_128[0],1); //rxF0_128[0] = _mm_slli_epi16(rxF0_128[0],1);
rxF0_128[1] = _mm_mulhi_epi16(rxF0_128[1],amp); //rxF0_128[1] = _mm_mulhi_epi16(rxF0_128[1],amp);
rxF0_128[1] = _mm_slli_epi16(rxF0_128[1],1); //rxF0_128[1] = _mm_slli_epi16(rxF0_128[1],1);
//rxF0_128[0] = _mm_srai_epi16(rxF0_128[0],1);
//rxF0_128[1] = _mm_srai_epi16(rxF0_128[1],1);
if (pilots==0) { if (pilots==0) {
ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]); ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]);
ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]); ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]);
ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1); //ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1);
ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1); //ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1);
//rxF0_128[2] = _mm_mulhi_epi16(rxF0_128[2],amp);
//rxF0_128[2] = _mm_slli_epi16(rxF0_128[2],1);
rxF0_128[2] = _mm_mulhi_epi16(rxF0_128[2],amp); //rxF0_128[2] = _mm_srai_epi16(rxF0_128[2],1);
rxF0_128[2] = _mm_slli_epi16(rxF0_128[2],1);
ch_mag0+=3; ch_mag0+=3;
ch_mag1+=3; ch_mag1+=3;
......
...@@ -1375,11 +1375,7 @@ void rx_phich(PHY_VARS_UE *ue, ...@@ -1375,11 +1375,7 @@ void rx_phich(PHY_VARS_UE *ue,
HI16, HI16,
nseq_PHICH, nseq_PHICH,
ngroup_PHICH); ngroup_PHICH);
get_Msg3_alloc_ret(&ue->frame_parms,
subframe,
proc->frame_rx,
&ue->ulsch_Msg3_frame[eNB_id],
&ue->ulsch_Msg3_subframe[eNB_id]);
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1; ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
// ulsch->harq_processes[harq_pid]->Ndi = 0; // ulsch->harq_processes[harq_pid]->Ndi = 0;
ulsch->harq_processes[harq_pid]->round++; ulsch->harq_processes[harq_pid]->round++;
......
...@@ -19,126 +19,126 @@ ...@@ -19,126 +19,126 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/impl_defs_lte.h" #include "PHY/impl_defs_lte.h"
//#define DEBUG_PC 1 //#define DEBUG_PC 1
/* /*
double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0}, double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0},
{ 5.0/4.0,1.0,3.0/4.0,1.0/2.0}}; { 5.0/4.0,1.0,3.0/4.0,1.0/2.0}};
*/ */
double ratioPB[2][4]= {{ 0.00000, -0.96910, -2.21849, -3.97940}, double ratioPB[2][4]= {{ 0.00000, -0.96910, -2.21849, -3.97940},
{ 0.96910, 0.00000, -1.24939, -3.01030} { 0.96910, 0.00000, -1.24939, -3.01030}
}; };
double pa_values[8]= {-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; double pa_values[8]= {-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0};
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated) double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
{ {
return(pa_values[pdsch_config_dedicated->p_a]); return(pa_values[pdsch_config_dedicated->p_a]);
} }
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off) LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off)
{ {
double rho_a_dB; double rho_a_dB;
double sqrt_rho_a_lin; double sqrt_rho_a_lin;
rho_a_dB = pa_values[ pdsch_config_dedicated->p_a]; rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
if(!dl_power_off) if(!dl_power_off)
rho_a_dB-=10*log10(2); rho_a_dB-=10*log10(2);
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB)); sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13)); dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
printf("sqrt_rho_a(eNB):%d\n",dlsch_eNB->sqrt_rho_a); printf("sqrt_rho_a(eNB):%d\n",dlsch_eNB->sqrt_rho_a);
#endif #endif
return(rho_a_dB); return(rho_a_dB);
} }
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
PDSCH_CONFIG_COMMON *pdsch_config_common, PDSCH_CONFIG_COMMON *pdsch_config_common,
uint8_t n_antenna_port, uint8_t n_antenna_port,
LTE_eNB_DLSCH_t *dlsch_eNB, LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off) int dl_power_off)
{ {
double rho_a_dB, rho_b_dB; double rho_a_dB, rho_b_dB;
double sqrt_rho_b_lin; double sqrt_rho_b_lin;
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off); rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off);
if(n_antenna_port>1) if(n_antenna_port>1)
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
else else
rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB;
sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB)); sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB));
dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13)); dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
printf("sqrt_rho_b(eNB):%d\n",dlsch_eNB->sqrt_rho_b); printf("sqrt_rho_b(eNB):%d\n",dlsch_eNB->sqrt_rho_b);
#endif #endif
return(rho_b_dB); return(rho_b_dB);
} }
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue, LTE_UE_DLSCH_t *dlsch_ue,
unsigned char dl_power_off) unsigned char dl_power_off)
{ {
double rho_a_dB; double rho_a_dB;
double sqrt_rho_a_lin; double sqrt_rho_a_lin;
rho_a_dB = pa_values[ pdsch_config_dedicated->p_a]; rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
if(!dl_power_off) if(!dl_power_off)
rho_a_dB-=10*log10(2); rho_a_dB-=10*log10(2);
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB)); sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
dlsch_ue->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13)); dlsch_ue->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
printf("sqrt_rho_a(ue):%d\n",dlsch_ue->sqrt_rho_a); printf("p_a %d, rho_a_dB: %f, sqrt_rho_a(ue):%d \n",pdsch_config_dedicated->p_a, rho_a_dB, dlsch_ue->sqrt_rho_a);
#endif #endif
return(rho_a_dB); return(rho_a_dB);
} }
double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
PDSCH_CONFIG_COMMON *pdsch_config_common, PDSCH_CONFIG_COMMON *pdsch_config_common,
uint8_t n_antenna_port, uint8_t n_antenna_port,
LTE_UE_DLSCH_t *dlsch_ue, LTE_UE_DLSCH_t *dlsch_ue,
unsigned char dl_power_off) unsigned char dl_power_off)
{ {
double rho_a_dB, rho_b_dB; double rho_a_dB, rho_b_dB;
double sqrt_rho_b_lin; double sqrt_rho_b_lin;
rho_a_dB= computeRhoA_UE(pdsch_config_dedicated,dlsch_ue,dl_power_off); rho_a_dB= computeRhoA_UE(pdsch_config_dedicated,dlsch_ue,dl_power_off);
if(n_antenna_port>1) if(n_antenna_port>1)
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
else else
rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB;
sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB)); sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB));
dlsch_ue->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13)); dlsch_ue->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
printf("sqrt_rho_b(ue):%d\n",dlsch_ue->sqrt_rho_b); printf("p_b : %d, rho_b_dB: %f, sqrt_rho_b(ue):%d\n",pdsch_config_common->p_b, rho_b_dB, dlsch_ue->sqrt_rho_b);
#endif #endif
return(rho_b_dB); return(rho_b_dB);
} }
...@@ -1849,7 +1849,7 @@ void generate_pucch2x(int32_t **txdataF, ...@@ -1849,7 +1849,7 @@ void generate_pucch2x(int32_t **txdataF,
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint16_t n2_pucch, uint16_t n2_pucch,
uint16_t *payload, uint8_t *payload,
int A, int A,
int B2, int B2,
int16_t amp, int16_t amp,
......
...@@ -473,7 +473,7 @@ void generate_pucch2x(int32_t **txdataF, ...@@ -473,7 +473,7 @@ void generate_pucch2x(int32_t **txdataF,
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint16_t n2_pucch, uint16_t n2_pucch,
uint16_t *payload, uint8_t *payload,
int A, int A,
int B2, int B2,
int16_t amp, int16_t amp,
......
...@@ -2067,7 +2067,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, ...@@ -2067,7 +2067,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
get_ack(&eNB->frame_parms, get_ack(&eNB->frame_parms,
PHY_vars_UE_g[UE_id][CC_id]->dlsch[0][0]->harq_ack, PHY_vars_UE_g[UE_id][CC_id]->dlsch[0][0]->harq_ack,
subframe, subframe,
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK); eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK,0);
} else { // get remote UEs' ack } else { // get remote UEs' ack
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[0]; eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[0];
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[1] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[1]; eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[1] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[1];
......
...@@ -305,7 +305,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n); ...@@ -305,7 +305,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH @param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
@returns status indicator for PUCCH/PUSCH transmission @returns status indicator for PUCCH/PUSCH transmission
*/ */
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK); uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK, uint8_t cw_idx);
/*! \brief Reset ACK/NACK information /*! \brief Reset ACK/NACK information
@param frame_parms Pointer to DL frame parameter descriptor @param frame_parms Pointer to DL frame parameter descriptor
...@@ -317,7 +317,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t ...@@ -317,7 +317,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms, uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack, harq_status_t *harq_ack,
unsigned char subframe, unsigned char subframe,
unsigned char *o_ACK); unsigned char *o_ACK,
uint8_t cw_idx);
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6) /*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
@param frame_parms Pointer to DL frame parameter descriptor @param frame_parms Pointer to DL frame parameter descriptor
......
...@@ -325,6 +325,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -325,6 +325,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack, harq_status_t *harq_ack,
unsigned char subframe, unsigned char subframe,
unsigned char *o_ACK, unsigned char *o_ACK,
uint8_t cw_idx,
uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
{ {
uint8_t status=0; uint8_t status=0;
...@@ -337,7 +338,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -337,7 +338,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
else else
subframe_dl0 = subframe - 4; subframe_dl0 = subframe - 4;
o_ACK[0] = harq_ack[subframe_dl0].ack; o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
status = harq_ack[subframe_dl0].send_harq_status; status = harq_ack[subframe_dl0].send_harq_status;
if(do_reset) if(do_reset)
...@@ -484,17 +485,19 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -484,17 +485,19 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms, uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack, harq_status_t *harq_ack,
unsigned char subframe, unsigned char subframe,
unsigned char *o_ACK) unsigned char *o_ACK,
uint8_t cw_idx)
{ {
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, 0); return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 0);
} }
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms, uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
harq_status_t *harq_ack, harq_status_t *harq_ack,
unsigned char subframe, unsigned char subframe,
unsigned char *o_ACK) unsigned char *o_ACK,
uint8_t cw_idx)
{ {
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, 1); return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 1);
} }
......
This diff is collapsed.
...@@ -88,17 +88,17 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u ...@@ -88,17 +88,17 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u
} }
if (pucch_fmt!=pucch_format1) { if (pucch_fmt!=pucch_format1) {
LOG_D(PHY,"[UE %d][PDSCH %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n", LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n",
ue->Mod_id, ue->Mod_id,
ue->dlsch[eNB_id][0]->rnti,proc->frame_tx,subframe, ue->dlsch[eNB_id][0]->rnti,proc->frame_tx%1024,subframe,
Po_PUCCH, Po_PUCCH,
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
get_PL(ue->Mod_id,ue->CC_id,eNB_id), get_PL(ue->Mod_id,ue->CC_id,eNB_id),
ue->dlsch[eNB_id][0]->g_pucch); ue->dlsch[eNB_id][0]->g_pucch);
} else { } else {
LOG_D(PHY,"[UE %d][SR %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n", LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n",
ue->Mod_id, ue->Mod_id,
ue->dlsch[eNB_id][0]->rnti,proc->frame_tx,subframe, ue->dlsch[eNB_id][0]->rnti,proc->frame_tx%1024,subframe,
Po_PUCCH, Po_PUCCH,
ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
get_PL(ue->Mod_id,ue->CC_id,eNB_id), get_PL(ue->Mod_id,ue->CC_id,eNB_id),
......
...@@ -1095,6 +1095,17 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio ...@@ -1095,6 +1095,17 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo, memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo,
(char*)radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo, (char*)radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo,
sizeof(physicalConfigDedicated2->antennaInfo)); sizeof(physicalConfigDedicated2->antennaInfo));
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo->choice.explicitValue.transmissionMode =
radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode;
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo->choice.explicitValue.codebookSubsetRestriction =
radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo->choice.explicitValue.codebookSubsetRestriction;
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection =
radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection;
LOG_I(PHY,"New Transmission Mode %d \n",radioResourceConfigDedicated->physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
LOG_I(PHY,"Configured Transmission Mode %d \n",UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->antennaInfo->choice.explicitValue.transmissionMode);
} }
else else
{ {
...@@ -3131,13 +3142,13 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 ) ...@@ -3131,13 +3142,13 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 )
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig ); sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig );
LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission : %d\n", LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission : %d\n",
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission ); sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission );
#if 0
/* TODO: test this - commented for the moment */ if(sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
if (sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) {
LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts : %ld\n", LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts : %ld\n",
/* TODO: check that it's okay to access [0] */ /* TODO: check that it's okay to access [0] */
sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts[0] ); sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts[0] );
#endif }
} }
// uplinkPowerControlCommon // uplinkPowerControlCommon
......
...@@ -209,6 +209,8 @@ int chain_offset=0; ...@@ -209,6 +209,8 @@ int chain_offset=0;
int phy_test = 0; int phy_test = 0;
uint8_t usim_test = 0; uint8_t usim_test = 0;
uint8_t nb_antenna_tx = 1;
uint8_t nb_antenna_rx = 1;
char ref[128] = "internal"; char ref[128] = "internal";
char channels[128] = "0"; char channels[128] = "0";
...@@ -379,6 +381,7 @@ void help (void) { ...@@ -379,6 +381,7 @@ void help (void) {
printf(" --ue-rxgain set UE RX gain\n"); printf(" --ue-rxgain set UE RX gain\n");
printf(" --ue-rxgain-off external UE amplifier offset\n"); printf(" --ue-rxgain-off external UE amplifier offset\n");
printf(" --ue-txgain set UE TX gain\n"); printf(" --ue-txgain set UE TX gain\n");
printf(" --ue-nb-ant-rx set UE number of rx antennas ");
printf(" --ue-scan_carrier set UE to scan around carrier\n"); printf(" --ue-scan_carrier set UE to scan around carrier\n");
printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n"); printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n");
printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n"); printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n");
...@@ -686,6 +689,8 @@ static void get_options (int argc, char **argv) ...@@ -686,6 +689,8 @@ static void get_options (int argc, char **argv)
LONG_OPTION_RXGAIN, LONG_OPTION_RXGAIN,
LONG_OPTION_RXGAINOFF, LONG_OPTION_RXGAINOFF,
LONG_OPTION_TXGAIN, LONG_OPTION_TXGAIN,
LONG_OPTION_NBRXANT,
LONG_OPTION_NBTXANT,
LONG_OPTION_SCANCARRIER, LONG_OPTION_SCANCARRIER,
LONG_OPTION_MAXPOWER, LONG_OPTION_MAXPOWER,
LONG_OPTION_DUMP_FRAME, LONG_OPTION_DUMP_FRAME,
...@@ -714,7 +719,9 @@ static void get_options (int argc, char **argv) ...@@ -714,7 +719,9 @@ static void get_options (int argc, char **argv)
{"calib-prach-tx", no_argument, NULL, LONG_OPTION_CALIB_PRACH_TX}, {"calib-prach-tx", no_argument, NULL, LONG_OPTION_CALIB_PRACH_TX},
{"ue-rxgain", required_argument, NULL, LONG_OPTION_RXGAIN}, {"ue-rxgain", required_argument, NULL, LONG_OPTION_RXGAIN},
{"ue-rxgain-off", required_argument, NULL, LONG_OPTION_RXGAINOFF}, {"ue-rxgain-off", required_argument, NULL, LONG_OPTION_RXGAINOFF},
{"ue-txgain", required_argument, NULL, LONG_OPTION_TXGAIN}, {"ue-txgain", required_argument, NULL, LONG_OPTION_TXGAIN},
{"ue-nb-ant-rx", required_argument, NULL, LONG_OPTION_NBRXANT},
{"ue-nb-ant-tx", required_argument, NULL, LONG_OPTION_NBTXANT},
{"ue-scan-carrier", no_argument, NULL, LONG_OPTION_SCANCARRIER}, {"ue-scan-carrier", no_argument, NULL, LONG_OPTION_SCANCARRIER},
{"ue-max-power", required_argument, NULL, LONG_OPTION_MAXPOWER}, {"ue-max-power", required_argument, NULL, LONG_OPTION_MAXPOWER},
{"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME}, {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME},
...@@ -802,7 +809,12 @@ static void get_options (int argc, char **argv) ...@@ -802,7 +809,12 @@ static void get_options (int argc, char **argv)
tx_gain[0][i] = atof(optarg); tx_gain[0][i] = atof(optarg);
break; break;
case LONG_OPTION_NBRXANT:
nb_antenna_rx = atof(optarg);
break;
case LONG_OPTION_NBTXANT:
nb_antenna_tx = atof(optarg);
break;
case LONG_OPTION_SCANCARRIER: case LONG_OPTION_SCANCARRIER:
UE_scan_carrier=1; UE_scan_carrier=1;
...@@ -1353,7 +1365,7 @@ void init_openair0() { ...@@ -1353,7 +1365,7 @@ void init_openair0() {
openair0_cfg[card].clock_source = clock_source; openair0_cfg[card].clock_source = clock_source;
openair0_cfg[card].tx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx)); openair0_cfg[card].tx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
openair0_cfg[card].rx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx)); openair0_cfg[card].rx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
...@@ -1548,9 +1560,11 @@ int main( int argc, char **argv ) ...@@ -1548,9 +1560,11 @@ int main( int argc, char **argv )
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (UE_flag==1) { if (UE_flag==1) {
frame_parms[CC_id]->nb_antennas_tx = 1; frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
frame_parms[CC_id]->nb_antennas_rx = 1; frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
} }
init_ul_hopping(frame_parms[CC_id]); init_ul_hopping(frame_parms[CC_id]);
......
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