Commit 65f8298a authored by knopp's avatar knopp

modifications in UE system information handling to allow for decoding of all...

modifications in UE system information handling to allow for decoding of all SIBs. For USRP targets, timing advance and TX power control.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7563 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9ae11fb8
...@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 2.8) ...@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 2.8)
set(XFORMS True) set(XFORMS True)
set(RRC_ASN1_VERSION "Rel10") set(RRC_ASN1_VERSION "Rel10")
set(ENABLE_VCD_FIFO False ) set(ENABLE_VCD_FIFO False )
set(RF_BOARD "EXMIMO") set(RF_BOARD "OAI_USRP")
set(ENABLE_ITTI True) set(ENABLE_ITTI True)
set(ENABLE_USE_MME False) set(ENABLE_USE_MME False)
set(PDCP_USE_NETLINK True) set(PDCP_USE_NETLINK True)
set(LINK_ENB_PDCP_TO_IP_DRIVER True) set(LINK_ENB_PDCP_TO_IP_DRIVER True)
set(LINK_ENB_PDCP_TO_GTPV1U False) set(LINK_ENB_PDCP_TO_GTPV1U False)
set(PDCP_USE_NETLINK True ) set(PDCP_USE_NETLINK_QUEUES False)
set(LINUX True) set(LINUX True)
set(SECU False) set(SECU False)
set(NAS_UE False) set(NAS_UE False)
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "MAC_INTERFACE/defs.h" #include "MAC_INTERFACE/defs.h"
#include "MAC_INTERFACE/extern.h" #include "MAC_INTERFACE/extern.h"
#ifdef USER_MODE
#include <math.h> #include <math.h>
#endif
#ifdef OPENAIR2 #ifdef OPENAIR2
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
...@@ -296,12 +294,10 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -296,12 +294,10 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
#ifdef USER_MODE
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
write_output("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1); write_output("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
write_output("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1); write_output("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
write_output("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1); write_output("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
#endif
#endif #endif
return (1); return (1);
} }
...@@ -310,7 +306,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -310,7 +306,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
void lte_sync_time_free(void) void lte_sync_time_free(void)
{ {
#ifdef USER_MODE
if (sync_corr_ue0) { if (sync_corr_ue0) {
msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue0); msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue0);
...@@ -342,7 +337,6 @@ void lte_sync_time_free(void) ...@@ -342,7 +337,6 @@ void lte_sync_time_free(void)
free(primary_synch2_time); free(primary_synch2_time);
} }
#endif
sync_corr_ue0 = NULL; sync_corr_ue0 = NULL;
sync_corr_ue1 = NULL; sync_corr_ue1 = NULL;
sync_corr_ue2 = NULL; sync_corr_ue2 = NULL;
...@@ -502,7 +496,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain ...@@ -502,7 +496,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
sync_source,peak_pos,peak_val); sync_source,peak_pos,peak_val);
#ifdef USER_MODE
if (debug_cnt == 0) { if (debug_cnt == 0) {
write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2); write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
...@@ -514,7 +508,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain ...@@ -514,7 +508,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
debug_cnt++; debug_cnt++;
} }
#endif
#endif #endif
...@@ -574,11 +568,8 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain ...@@ -574,11 +568,8 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) { for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
//#ifndef USER_MODE
result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
//#else
// result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples, 12);
//#endif
//((short*)sync_corr)[2*n] += ((short*) &result)[0]; //((short*)sync_corr)[2*n] += ((short*) &result)[0];
//((short*)sync_corr)[2*n+1] += ((short*) &result)[1]; //((short*)sync_corr)[2*n+1] += ((short*) &result)[1];
sync_corr_eNB[n] += abs32(result); sync_corr_eNB[n] += abs32(result);
......
...@@ -3714,10 +3714,10 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3714,10 +3714,10 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
}*/ }*/
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { // if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { //
if (dlsch0_harq->round == 4) { // if ((dlsch0_harq->round == 4) || ( {
dlsch0_harq->round = 0; dlsch0_harq->round = 0;
dlsch0_harq->first_tx = 1; dlsch0_harq->first_tx = 1;
} // }
// if (dlsch0_harq->round == 0) // if (dlsch0_harq->round == 0)
// ndi = 1-dlsch0_harq->DCINdi; // ndi = 1-dlsch0_harq->DCINdi;
...@@ -3731,8 +3731,15 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3731,8 +3731,15 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->mimo_mode = frame_parms->mode1_flag == 1 ?SISO : ALAMOUTI; dlsch0_harq->mimo_mode = frame_parms->mode1_flag == 1 ?SISO : ALAMOUTI;
dlsch0_harq->dl_power_off = 1; //no power offset dlsch0_harq->dl_power_off = 1; //no power offset
//LOG_I(PHY,"UE (%x/%d): Subframe %d Format1A DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, LOG_D(PHY,"UE (%x/%d): Subframe %d Format1A DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d, round %d\n",
//dlsch0_harq->first_tx,dlsch0_harq->status); dlsch[0]->rnti,
harq_pid,
subframe,
ndi,
dlsch0_harq->DCINdi,
dlsch0_harq->first_tx,
dlsch0_harq->status,
dlsch0_harq->round);
if ((ndi!=dlsch0_harq->DCINdi)|| // DCI has been toggled or this is the first transmission if ((ndi!=dlsch0_harq->DCINdi)|| // DCI has been toggled or this is the first transmission
(dlsch0_harq->first_tx==1)) { (dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0; dlsch0_harq->round = 0;
...@@ -3746,7 +3753,14 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3746,7 +3753,14 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->DCINdi = ndi; dlsch0_harq->DCINdi = ndi;
dlsch0_harq->mcs = mcs; dlsch0_harq->mcs = mcs;
dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1]; if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) {
dlsch0_harq->TBS = TBStable[mcs][NPRB-1];
dlsch0_harq->Qm = 2;
}
else {
dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1];
dlsch0_harq->Qm = get_Qm(mcs);
}
dlsch[0]->rnti = rnti; dlsch[0]->rnti = rnti;
dlsch0 = dlsch[0]; dlsch0 = dlsch[0];
//printf("Format 1A: harq_pid %d, nb_rb %d, round %d\n",harq_pid,dlsch0_harq->nb_rb,dlsch0_harq->round); //printf("Format 1A: harq_pid %d, nb_rb %d, round %d\n",harq_pid,dlsch0_harq->nb_rb,dlsch0_harq->round);
...@@ -3898,6 +3912,12 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3898,6 +3912,12 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->mcs = mcs; dlsch0_harq->mcs = mcs;
dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1];
if (mcs <= 28)
dlsch0_harq->Qm = get_Qm(mcs);
else if (mcs<=31)
dlsch0_harq->Qm = (mcs-28)<<1;
else
LOG_E(PHY,"invalid mcs %d\n",mcs);
// msg("test: MCS %d, NPRB %d, TBS %d\n",mcs,NPRB,dlsch0_harq->TBS); // msg("test: MCS %d, NPRB %d, TBS %d\n",mcs,NPRB,dlsch0_harq->TBS);
dlsch[0]->current_harq_pid = harq_pid; dlsch[0]->current_harq_pid = harq_pid;
...@@ -4238,9 +4258,17 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4238,9 +4258,17 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if (dlsch0_harq->nb_rb>1) { if (dlsch0_harq->nb_rb>1) {
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
if (mcs1 <= 28)
dlsch0_harq->Qm = get_Qm(mcs1);
else if (mcs1<=31)
dlsch0_harq->Qm = (mcs1-28)<<1;
else
LOG_E(PHY,"invalid mcs1 %d\n",mcs1);
} else } else
dlsch0_harq->TBS =0; dlsch0_harq->TBS =0;
/* /*
if (dlsch0_harq->mcs > 18) if (dlsch0_harq->mcs > 18)
printf("mcs %d, TBS %d\n",dlsch0_harq->mcs,dlsch0_harq->TBS); printf("mcs %d, TBS %d\n",dlsch0_harq->mcs,dlsch0_harq->TBS);
...@@ -4256,9 +4284,16 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4256,9 +4284,16 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if (dlsch1_harq->nb_rb>1) { if (dlsch1_harq->nb_rb>1) {
dlsch1_harq->TBS = TBStable[dlsch1_harq->mcs][dlsch1_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[dlsch1_harq->mcs][dlsch1_harq->nb_rb-1];
if (mcs2 <= 28)
dlsch1_harq->Qm = get_Qm(mcs2);
else if (mcs1<=31)
dlsch1_harq->Qm = (mcs2-28)<<1;
else
LOG_E(PHY,"invalid mcs2 %d\n",mcs2);
} else } else
dlsch1_harq->TBS = 0; dlsch1_harq->TBS = 0;
dlsch0->rnti = rnti; dlsch0->rnti = rnti;
dlsch1->rnti = rnti; dlsch1->rnti = rnti;
...@@ -4626,6 +4661,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4626,6 +4661,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1];
if ((dlsch0->active==1) && (dlsch1->active==1)) { if ((dlsch0->active==1) && (dlsch1->active==1)) {
dlsch0_harq->mimo_mode = LARGE_CDD; dlsch0_harq->mimo_mode = LARGE_CDD;
dlsch1_harq->mimo_mode = LARGE_CDD; dlsch1_harq->mimo_mode = LARGE_CDD;
...@@ -4644,7 +4681,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4644,7 +4681,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->dl_power_off = 0; //apply power offset dlsch0_harq->dl_power_off = 0; //apply power offset
dlsch1_harq->dl_power_off = 0; //apply power offset dlsch1_harq->dl_power_off = 0; //apply power offset
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
break; break;
case 1: // one-layers on TB 0, two on TB 1 case 1: // one-layers on TB 0, two on TB 1
...@@ -4721,6 +4759,20 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4721,6 +4759,20 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
LOG_E(PHY,"Illegal number of antennas for eNB %d\n",frame_parms->nb_antennas_tx_eNB); LOG_E(PHY,"Illegal number of antennas for eNB %d\n",frame_parms->nb_antennas_tx_eNB);
} }
if (mcs1 <= 28)
dlsch0_harq->Qm = get_Qm(mcs1);
else if (mcs1<=31)
dlsch0_harq->Qm = (mcs1-28)<<1;
else
LOG_E(PHY,"invalid mcs1 %d\n",mcs1);
if (mcs2 <= 28)
dlsch1_harq->Qm = get_Qm(mcs2);
else if (mcs2<=31)
dlsch1_harq->Qm = (mcs2-28)<<1;
else
LOG_E(PHY,"invalid mcs2 %d\n",mcs2);
// printf("Format 2A: NPRB=%d (rballoc %x,mcs1 %d, mcs2 %d, frame_type %d N_RB_DL %d,active %d/%d)\n",NPRB,rballoc,mcs1,mcs2,frame_parms->frame_type,frame_parms->N_RB_DL,dlsch0->active,dlsch1->active); // printf("Format 2A: NPRB=%d (rballoc %x,mcs1 %d, mcs2 %d, frame_type %d N_RB_DL %d,active %d/%d)\n",NPRB,rballoc,mcs1,mcs2,frame_parms->frame_type,frame_parms->N_RB_DL,dlsch0->active,dlsch1->active);
//printf("UE (%x/%d): Subframe %d Format2A DCI: ndi1 %d, old_ndi1 %d, ndi2 %d, old_ndi2 %d (first tx1 %d, first tx2 %d) harq_status1 %d, harq_status2 %d\n",dlsch0->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, //printf("UE (%x/%d): Subframe %d Format2A DCI: ndi1 %d, old_ndi1 %d, ndi2 %d, old_ndi2 %d (first tx1 %d, first tx2 %d) harq_status1 %d, harq_status2 %d\n",dlsch0->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
// dlsch0_harq->first_tx,dlsch1_harq->first_tx,dlsch0_harq->status,dlsch1_harq->status); // dlsch0_harq->first_tx,dlsch1_harq->first_tx,dlsch0_harq->status,dlsch1_harq->status);
......
...@@ -515,6 +515,8 @@ typedef struct { ...@@ -515,6 +515,8 @@ typedef struct {
uint8_t round; uint8_t round;
/// MCS format for this DLSCH /// MCS format for this DLSCH
uint8_t mcs; uint8_t mcs;
/// Qm (modulation order) for this DLSCH
uint8_t Qm;
/// Redundancy-version of the current sub-frame /// Redundancy-version of the current sub-frame
uint8_t rvidx; uint8_t rvidx;
/// MIMO mode for this DLSCH /// MIMO mode for this DLSCH
......
...@@ -244,8 +244,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -244,8 +244,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
*/ */
A = harq_process->TBS; //2072 for QPSK 1/3 A = harq_process->TBS; //2072 for QPSK 1/3
// mod_order = get_Qm(harq_process->mcs);
ret = dlsch->max_turbo_iterations; ret = dlsch->max_turbo_iterations;
...@@ -278,8 +276,33 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -278,8 +276,33 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
err_flag = 0; err_flag = 0;
r_offset = 0; r_offset = 0;
unsigned char bw_scaling =1;
switch (frame_parms->N_RB_DL) {
case 6:
bw_scaling =16;
break;
case 25:
bw_scaling =4;
break;
case 50:
bw_scaling =2;
break;
default:
bw_scaling =1;
break;
}
if (harq_process->C >= MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling);
return((1+dlsch->max_turbo_iterations));
}
for (r=0; r<harq_process->C; r++) { for (r=0; r<harq_process->C; r++) {
// Get Turbo interleaver parameters // Get Turbo interleaver parameters
if (r<harq_process->Cminus) if (r<harq_process->Cminus)
Kr = harq_process->Kminus; Kr = harq_process->Kminus;
...@@ -316,7 +339,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -316,7 +339,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
harq_pid,r, G, harq_pid,r, G,
Kr*3, Kr*3,
harq_process->TBS, harq_process->TBS,
get_Qm(harq_process->mcs), harq_process->Qm,
harq_process->nb_rb, harq_process->nb_rb,
harq_process->Nl, harq_process->Nl,
harq_process->rvidx, harq_process->rvidx,
...@@ -335,7 +358,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -335,7 +358,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
dlsch->Kmimo, dlsch->Kmimo,
harq_process->rvidx, harq_process->rvidx,
(harq_process->round==0)?1:0, (harq_process->round==0)?1:0,
get_Qm(harq_process->mcs), harq_process->Qm,
harq_process->Nl, harq_process->Nl,
r, r,
&E)==-1) { &E)==-1) {
......
...@@ -325,7 +325,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -325,7 +325,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
frame_parms, frame_parms,
symbol, symbol,
first_symbol_flag, first_symbol_flag,
get_Qm(dlsch0_harq->mcs), dlsch0_harq->Qm,
nb_rb, nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh, lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift phy_measurements); // log2_maxh+I0_shift
...@@ -380,7 +380,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -380,7 +380,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
avg, symbol, nb_rb); avg, symbol, nb_rb);
// LOG_D(PHY,"llr_offset = %d\n",offset_mumimo_llr_drange[dlsch0_harq->mcs][(dlsch1_harq->mcs>>1)-1]); // LOG_D(PHY,"llr_offset = %d\n",offset_mumimo_llr_drange[dlsch0_harq->mcs][(dlsch1_harq->mcs>>1)-1]);
avg[0] = log2_approx(avg[0]) - 13 + offset_mumimo_llr_drange[dlsch0_harq->mcs][(get_Qm(dlsch1_harq->mcs)>>1)-1]; avg[0] = log2_approx(avg[0]) - 13 + offset_mumimo_llr_drange[dlsch0_harq->mcs][(dlsch1_harq->Qm>>1)-1];
lte_ue_pdsch_vars[eNB_id]->log2_maxh = cmax(avg[0],0); lte_ue_pdsch_vars[eNB_id]->log2_maxh = cmax(avg[0],0);
// printf("log2_maxh =%d\n",lte_ue_pdsch_vars[eNB_id]->log2_maxh); // printf("log2_maxh =%d\n",lte_ue_pdsch_vars[eNB_id]->log2_maxh);
...@@ -391,8 +391,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -391,8 +391,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_measurements, phy_measurements,
eNB_id, eNB_id,
symbol, symbol,
get_Qm(dlsch0_harq->mcs), dlsch0_harq->Qm,
get_Qm(dlsch1_harq->mcs), dlsch1_harq->Qm,
dlsch0_harq->round, dlsch0_harq->round,
nb_rb, nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh); lte_ue_pdsch_vars[eNB_id]->log2_maxh);
...@@ -451,7 +451,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -451,7 +451,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_measurements, phy_measurements,
eNB_id, eNB_id,
symbol, symbol,
get_Qm(dlsch0_harq->mcs), dlsch0_harq->Qm,
nb_rb, nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh, lte_ue_pdsch_vars[eNB_id]->log2_maxh,
dlsch0_harq->dl_power_off); dlsch0_harq->dl_power_off);
...@@ -526,7 +526,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -526,7 +526,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_measurements, phy_measurements,
eNB_id, eNB_id,
symbol, symbol,
get_Qm(dlsch0_harq->mcs), dlsch0_harq->Qm,
nb_rb, nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh, lte_ue_pdsch_vars[eNB_id]->log2_maxh,
1); 1);
...@@ -599,7 +599,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -599,7 +599,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// printf("LLR"); // printf("LLR");
switch (get_Qm(dlsch0_harq->mcs)) { switch (dlsch0_harq->Qm) {
case 2 : case 2 :
if (dlsch0_harq->mimo_mode != LARGE_CDD) { if (dlsch0_harq->mimo_mode != LARGE_CDD) {
if (dual_stream_flag == 0) if (dual_stream_flag == 0)
...@@ -643,7 +643,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -643,7 +643,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
} else { // TM3 } else { // TM3
DevAssert(dlsch1_harq); DevAssert(dlsch1_harq);
if (get_Qm(dlsch1_harq->mcs) == 2) { if (dlsch1_harq->Qm == 2) {
/* dlsch_qpsk_llr(frame_parms, /* dlsch_qpsk_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0, lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0], lte_ue_pdsch_vars[eNB_id]->llr[0],
...@@ -667,7 +667,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -667,7 +667,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
symbol,first_symbol_flag,nb_rb, symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc,2,subframe,symbol), adjust_G2(frame_parms,dlsch1_harq->rb_alloc,2,subframe,symbol),
lte_ue_pdsch_vars[eNB_id]->llr128_2ndstream); lte_ue_pdsch_vars[eNB_id]->llr128_2ndstream);
} else if (get_Qm(dlsch1_harq->mcs) == 4) { } else if (dlsch1_harq->Qm == 4) {
dlsch_qpsk_16qam_llr(frame_parms, dlsch_qpsk_16qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0, lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round], lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include "common_lib.h" #include "common_lib.h"
extern openair0_config_t openair0_cfg[]; extern openair0_config_t openair0_cfg[];
#endif #endif
//#define DEBUG_INITIAL_SYNCH #define DEBUG_INITIAL_SYNCH
int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
{ {
...@@ -292,6 +292,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -292,6 +292,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
frame_parms->frame_type=FDD; frame_parms->frame_type=FDD;
init_frame_parms(frame_parms,1); init_frame_parms(frame_parms,1);
// write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef OAI_USRP #ifdef OAI_USRP
for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) { for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) {
rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx]; rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx];
...@@ -304,6 +306,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -304,6 +306,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
frame_parms, frame_parms,
(int *)&phy_vars_ue->lte_ue_common_vars.eNb_id); (int *)&phy_vars_ue->lte_ue_common_vars.eNb_id);
// write_output("rxdata1.m","rxd1",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
if (sync_pos >= frame_parms->nb_prefix_samples) if (sync_pos >= frame_parms->nb_prefix_samples)
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples; sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
else else
...@@ -361,6 +364,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -361,6 +364,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
init_frame_parms(&phy_vars_ue->lte_frame_parms,1); init_frame_parms(&phy_vars_ue->lte_frame_parms,1);
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(phy_vars_ue,mode); ret = pbch_detection(phy_vars_ue,mode);
// write_output("rxdata2.m","rxd2",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
...@@ -407,7 +411,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -407,7 +411,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
init_frame_parms(&phy_vars_ue->lte_frame_parms,1); init_frame_parms(&phy_vars_ue->lte_frame_parms,1);
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(phy_vars_ue,mode); ret = pbch_detection(phy_vars_ue,mode);
// write_output("rxdata3.m","rxd3",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret); frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
...@@ -454,7 +458,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -454,7 +458,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(phy_vars_ue,mode); ret = pbch_detection(phy_vars_ue,mode);
// write_output("rxdata4.m","rxd4",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
...@@ -501,6 +505,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -501,6 +505,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(phy_vars_ue,mode); ret = pbch_detection(phy_vars_ue,mode);
// write_output("rxdata5.m","rxd5",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret);
...@@ -590,6 +595,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -590,6 +595,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
} }
// exit_fun("debug exit");
return ret; return ret;
} }
...@@ -33,23 +33,6 @@ ...@@ -33,23 +33,6 @@
#define SOFFSET 0 #define SOFFSET 0
void rescale(int16_t *input,int length)
{
#if defined(__x86_64__) || defined(__i386__)
__m128i *input128 = (__m128i *)input;
#elif defined(__arm__)
int16x8_t *input128 = (int16x8_t *)input;
#endif
int i;
for (i=0; i<length>>2; i++) {
#if defined(__x86_64__) || defined(__i386__)
input128[i] = _mm_srai_epi16(input128[i],4);
#elif defined(__arm__)
input128[i] = vshrq_n_s16(input128[i],4);
#endif
}
}
int slot_fep(PHY_VARS_UE *phy_vars_ue, int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
...@@ -148,18 +131,11 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, ...@@ -148,18 +131,11 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples], (void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
#ifdef OAI_USRP
rescale((int16_t *)tmp_dft_in,
frame_parms->ofdm_symbol_size);
#endif
dft((int16_t *)tmp_dft_in, dft((int16_t *)tmp_dft_in,
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
start_meas(&phy_vars_ue->rx_dft_stats); start_meas(&phy_vars_ue->rx_dft_stats);
#ifdef OAI_USRP
rescale((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
frame_parms->ofdm_symbol_size+nb_prefix_samples0);
#endif
dft((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
stop_meas(&phy_vars_ue->rx_dft_stats); stop_meas(&phy_vars_ue->rx_dft_stats);
...@@ -186,17 +162,10 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, ...@@ -186,17 +162,10 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
#ifdef OAI_USRP
rescale((int16_t *)tmp_dft_in,
frame_parms->ofdm_symbol_size);
#endif
dft((int16_t *)tmp_dft_in, dft((int16_t *)tmp_dft_in,
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
#ifdef OAI_USRP
rescale((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples) % frame_length_samples],
frame_parms->ofdm_symbol_size+nb_prefix_samples);
#endif
dft((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} }
......
...@@ -114,7 +114,7 @@ typedef struct { ...@@ -114,7 +114,7 @@ typedef struct {
int32_t freq_offset; int32_t freq_offset;
uint32_t tx_rx_switch_point; uint32_t tx_rx_switch_point;