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)
set(XFORMS True)
set(RRC_ASN1_VERSION "Rel10")
set(ENABLE_VCD_FIFO False )
set(RF_BOARD "EXMIMO")
set(RF_BOARD "OAI_USRP")
set(ENABLE_ITTI True)
set(ENABLE_USE_MME False)
set(PDCP_USE_NETLINK True)
set(LINK_ENB_PDCP_TO_IP_DRIVER True)
set(LINK_ENB_PDCP_TO_GTPV1U False)
set(PDCP_USE_NETLINK True )
set(PDCP_USE_NETLINK_QUEUES False)
set(LINUX True)
set(SECU False)
set(NAS_UE False)
......
......@@ -39,9 +39,7 @@
#include "SCHED/extern.h"
#include "MAC_INTERFACE/defs.h"
#include "MAC_INTERFACE/extern.h"
#ifdef USER_MODE
#include <math.h>
#endif
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
......@@ -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
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_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
#endif
#endif
return (1);
}
......@@ -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)
{
#ifdef USER_MODE
if (sync_corr_ue0) {
msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue0);
......@@ -342,7 +337,6 @@ void lte_sync_time_free(void)
free(primary_synch2_time);
}
#endif
sync_corr_ue0 = NULL;
sync_corr_ue1 = NULL;
sync_corr_ue2 = NULL;
......@@ -502,7 +496,7 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
sync_source,peak_pos,peak_val);
#ifdef USER_MODE
if (debug_cnt == 0) {
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
debug_cnt++;
}
#endif
#endif
......@@ -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];
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);
//#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+1] += ((short*) &result)[1];
sync_corr_eNB[n] += abs32(result);
......
......@@ -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 (dlsch0_harq->round == 4) {
// if ((dlsch0_harq->round == 4) || ( {
dlsch0_harq->round = 0;
dlsch0_harq->first_tx = 1;
}
// }
// if (dlsch0_harq->round == 0)
// ndi = 1-dlsch0_harq->DCINdi;
......@@ -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->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,
//dlsch0_harq->first_tx,dlsch0_harq->status);
LOG_D(PHY,"UE (%x/%d): Subframe %d Format1A DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d, round %d\n",
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
(dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0;
......@@ -3746,7 +3753,14 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->DCINdi = ndi;
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;
dlsch0 = dlsch[0];
//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,
dlsch0_harq->mcs = mcs;
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);
dlsch[0]->current_harq_pid = harq_pid;
......@@ -4238,9 +4258,17 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if (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
dlsch0_harq->TBS =0;
/*
if (dlsch0_harq->mcs > 18)
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,
if (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
dlsch1_harq->TBS = 0;
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
......@@ -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];
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1];
if ((dlsch0->active==1) && (dlsch1->active==1)) {
dlsch0_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,
dlsch0_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];
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
break;
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,
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("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);
......
......@@ -515,6 +515,8 @@ typedef struct {
uint8_t round;
/// MCS format for this DLSCH
uint8_t mcs;
/// Qm (modulation order) for this DLSCH
uint8_t Qm;
/// Redundancy-version of the current sub-frame
uint8_t rvidx;
/// MIMO mode for this DLSCH
......
......@@ -244,8 +244,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
*/
A = harq_process->TBS; //2072 for QPSK 1/3
// mod_order = get_Qm(harq_process->mcs);
ret = dlsch->max_turbo_iterations;
......@@ -278,8 +276,33 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
err_flag = 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++) {
// Get Turbo interleaver parameters
if (r<harq_process->Cminus)
Kr = harq_process->Kminus;
......@@ -316,7 +339,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
harq_pid,r, G,
Kr*3,
harq_process->TBS,
get_Qm(harq_process->mcs),
harq_process->Qm,
harq_process->nb_rb,
harq_process->Nl,
harq_process->rvidx,
......@@ -335,7 +358,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
dlsch->Kmimo,
harq_process->rvidx,
(harq_process->round==0)?1:0,
get_Qm(harq_process->mcs),
harq_process->Qm,
harq_process->Nl,
r,
&E)==-1) {
......
......@@ -325,7 +325,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
frame_parms,
symbol,
first_symbol_flag,
get_Qm(dlsch0_harq->mcs),
dlsch0_harq->Qm,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift
......@@ -380,7 +380,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
avg, symbol, nb_rb);
// 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);
// 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,
phy_measurements,
eNB_id,
symbol,
get_Qm(dlsch0_harq->mcs),
get_Qm(dlsch1_harq->mcs),
dlsch0_harq->Qm,
dlsch1_harq->Qm,
dlsch0_harq->round,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh);
......@@ -451,7 +451,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_measurements,
eNB_id,
symbol,
get_Qm(dlsch0_harq->mcs),
dlsch0_harq->Qm,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
dlsch0_harq->dl_power_off);
......@@ -526,7 +526,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_measurements,
eNB_id,
symbol,
get_Qm(dlsch0_harq->mcs),
dlsch0_harq->Qm,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
1);
......@@ -599,7 +599,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// printf("LLR");
switch (get_Qm(dlsch0_harq->mcs)) {
switch (dlsch0_harq->Qm) {
case 2 :
if (dlsch0_harq->mimo_mode != LARGE_CDD) {
if (dual_stream_flag == 0)
......@@ -643,7 +643,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
} else { // TM3
DevAssert(dlsch1_harq);
if (get_Qm(dlsch1_harq->mcs) == 2) {
if (dlsch1_harq->Qm == 2) {
/* dlsch_qpsk_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
......@@ -667,7 +667,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc,2,subframe,symbol),
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,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
......
......@@ -52,7 +52,7 @@
#include "common_lib.h"
extern openair0_config_t openair0_cfg[];
#endif
//#define DEBUG_INITIAL_SYNCH
#define DEBUG_INITIAL_SYNCH
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)
frame_parms->frame_type=FDD;
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
for (aarx = 0; aarx<frame_parms->nb_antennas_rx;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)
frame_parms,
(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)
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
else
......@@ -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);
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
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
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)
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);
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
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);
......@@ -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);
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
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)
lte_gold(frame_parms,phy_vars_ue->lte_gold_table[0],frame_parms->Nid_cell);
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
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);
......@@ -590,6 +595,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
}
// exit_fun("debug exit");
return ret;
}
......@@ -33,23 +33,6 @@
#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,
unsigned char l,
......@@ -148,18 +131,11 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
memcpy((void *)tmp_dft_in,
(void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
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,
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly
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],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
stop_meas(&phy_vars_ue->rx_dft_stats);
......@@ -186,17 +162,10 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
memcpy((void *)tmp_dft_in,
(void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
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,
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} 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],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
}
......
......@@ -114,7 +114,7 @@ typedef struct {
int32_t freq_offset;
uint32_t tx_rx_switch_point;
uint32_t manual_timing_advance; /// 1 to override automatic timing advance
uint32_t timing_advance;
int32_t timing_advance;
uint32_t dual_tx; /// 1 for dual-antenna TX, 0 for single-antenna TX
uint32_t tdd; /// 1 for TDD mode, 0 for FDD mode
uint32_t rx_rf_mode;
......
......@@ -135,7 +135,7 @@ void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t
coded_bits_per_codeword = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Qm,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame_rx,subframe);
......@@ -164,7 +164,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
coded_bits_per_codeword = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs),
2,
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame_rx,subframe);
......@@ -265,7 +265,7 @@ void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
coded_bits_per_codeword = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->mcs),
2,
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame_rx,subframe);
......@@ -985,7 +985,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#else
tx_amp = AMP;
#endif
LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm, amp %d\n",
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm, amp %d\n",
Mod_id,harq_pid,frame_tx,subframe_tx,phy_vars_ue->tx_power_dBm, tx_amp);
start_meas(&phy_vars_ue->ulsch_modulation_stats);
ulsch_modulation(phy_vars_ue->lte_ue_common_vars.txdataF,
......@@ -1246,14 +1246,15 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#else //this is the normal case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-phy_vars_ue->N_TA_offset; //-phy_vars_ue->timing_advance;
#endif //else EXMIMO
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
Mod_id,frame_tx,subframe_tx,
ulsch_start,
phy_vars_ue->rx_offset,
openair_daq_vars.timing_advance,
phy_vars_ue->timing_advance,
phy_vars_ue->N_TA_offset);
if ((frame_tx%100) == 0)
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
Mod_id,frame_tx,subframe_tx,
ulsch_start,
phy_vars_ue->rx_offset,
openair_daq_vars.timing_advance,
phy_vars_ue->timing_advance,
phy_vars_ue->N_TA_offset);
if (generate_ul_signal == 1 ) {
......@@ -1379,7 +1380,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#endif
if (abstraction_flag == 0) {
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
Mod_id,
frame_tx,
subframe_tx,
......@@ -1410,7 +1411,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp = AMP;
#endif
if ((mode == calib_prach_tx) && (((phy_vars_ue->frame_tx&0xfffe)%100)==0))
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n",Mod_id,phy_vars_ue->frame_rx,phy_vars_ue->slot_tx>>1,phy_vars_ue->tx_power_dBm,
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n",Mod_id,phy_vars_ue->frame_rx,phy_vars_ue->slot_tx>>1,phy_vars_ue->tx_power_dBm,
phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp);
......@@ -2473,15 +2474,16 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d (%d)=> %d\n",phy_vars_ue->Mod_id,subframe_rx,slot_rx,phy_vars_ue->dlsch_ue[eNB_id][0]->active);
// This is normal processing (i.e. not MBSFN)
// RX processing of symbols in slot_rx
for (l=0; l<n_symb; l++) {
if (abstraction_flag == 0) {
start_meas(&phy_vars_ue->ofdm_demod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN);
slot_fep(phy_vars_ue,
l,
slot_rx,
......@@ -2576,7 +2578,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
(openair_daq_vars.use_ia_receiver ==1)) {
dual_stream_UE = 1;
eNB_id_i = phy_vars_ue->n_connected_eNB;
i_mod = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
i_mod = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Qm;
if (frame_rx%100==0) {
LOG_I(PHY,"using IA receiver\n");
......@@ -2624,7 +2626,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->G = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Qm,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
frame_rx,subframe_prev);
......@@ -2782,7 +2784,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs),1,
2,
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
frame_rx,subframe_prev);
......@@ -2835,7 +2838,17 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
if (ret == (1+phy_vars_ue->dlsch_ue_SI[eNB_id]->max_turbo_iterations)) {
phy_vars_ue->dlsch_SI_errors[eNB_id]++;
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI in error\n",phy_vars_ue->Mod_id,frame_rx,subframe_prev);
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
phy_vars_ue->Mod_id,
frame_rx,
subframe_prev,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rvidx,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[0],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[1],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[2],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[3]);
#endif
//dump_dlsch_SI(phy_vars_ue,eNB_id,subframe_prev);
......@@ -2847,9 +2860,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
#ifdef DEBUG_PHY_PROC
//if ((frame_rx % 100) == 0)
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI for TBS %d, mcs %d\n",
phy_vars_ue->Mod_id,frame_rx,subframe_prev,phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs);
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI for TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
phy_vars_ue->Mod_id,frame_rx,subframe_prev,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rvidx,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[0],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[1],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[2],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc[3]);
#endif
#ifdef OPENAIR2
......@@ -2923,10 +2942,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
if (abstraction_flag==0) {
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->G = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->mcs),1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->rb_alloc,
2,
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
frame_rx,
subframe_prev);
......@@ -2950,7 +2970,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
phy_vars_ue->dlsch_ue_ra[eNB_id],
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0],
subframe_prev, // subframe
harq_pid,
phy_vars_ue->dlsch_ue_ra[eNB_id]->current_harq_pid,
0,0);
}
......@@ -3104,7 +3124,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
(openair_daq_vars.use_ia_receiver ==1)) {
dual_stream_UE = 1;
eNB_id_i = phy_vars_ue->n_connected_eNB;
i_mod = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
i_mod = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Qm;
} else {
dual_stream_UE = 0;
eNB_id_i = eNB_id+1;
......@@ -3173,7 +3193,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
(openair_daq_vars.use_ia_receiver ==1)) {
dual_stream_UE = 1;
eNB_id_i = phy_vars_ue->n_connected_eNB;
i_mod = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
i_mod = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Qm;
} else {
dual_stream_UE = 0;
eNB_id_i = eNB_id+1;
......@@ -3301,7 +3321,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs