merge with latest develop

This commit is contained in:
laurent
2018-09-06 09:43:26 +02:00
204 changed files with 10695 additions and 14709 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ int load_codinglib(void) {
shlib_fdesc[ENCODE_SSE_FPTRIDX].fname= "threegpplte_turbo_encoder_sse";
shlib_fdesc[ENCODE_C_FPTRIDX].fname= "threegpplte_turbo_encoder";
shlib_fdesc[ENCODE_INIT_SSE_FPTRIDX].fname= "init_encoder_sse";
ret=load_module_shlib("coding",shlib_fdesc,DECODE_NUM_FPTR);
ret=load_module_shlib("coding",shlib_fdesc,DECODE_NUM_FPTR,NULL);
if (ret < 0) exit_fun("Error loading coding library");
/* execute encoder/decoder init functions */
+2 -4
View File
@@ -67,15 +67,12 @@ void generate_qpsk_table(void)
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
{
ccodedot11_init();
ccodedot11_init_inv();
ccodelte_init();
ccodelte_init_inv();
init_dfts();
phy_generate_viterbi_tables();
phy_generate_viterbi_tables_lte();
load_codinglib();
@@ -86,6 +83,7 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
generate_64qam_table();
generate_16qam_table();
generate_qpsk_table();
generate_RIV_tables();
init_unscrambling_lut();
+3 -3
View File
@@ -450,11 +450,11 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 1;
fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
+3 -3
View File
@@ -165,11 +165,11 @@ void phy_config_sib2_ue(module_id_t Mod_id,int CC_id,
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 1;
fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
*/
#include "phy_init.h"
#include "log.h"
#include "common/utils/LOG/log.h"
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0};
+2
View File
@@ -373,6 +373,8 @@ void phy_config_request(PHY_Config_t *phy_config);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
void init_dfts(void);
/** @} */
#endif
@@ -61,8 +61,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<1)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
@@ -81,7 +81,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
// do not filter to have proactive timing adjustment
max_pos_fil = max_pos;
if(subframe == 6)
if(subframe == 5)
{
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
@@ -62,8 +62,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<1)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
@@ -82,7 +82,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
// do not filter to have proactive timing adjustment
max_pos_fil = max_pos;
if(subframe == 6)
if(subframe == 5)
{
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
+15 -15
View File
@@ -274,11 +274,11 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
LOG_M_BEGIN(DEBUG_LTEESTIM);
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M_END
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
}
return (1);
}
@@ -460,18 +460,18 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
LOG_I(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
LOG_M_BEGIN(DEBUG_LTEESTIM)
static int debug_cnt;
if (debug_cnt == 0) {
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
LOG_M("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
LOG_M("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
// exit(-1);
} else {
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
static int debug_cnt;
if (debug_cnt == 0) {
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
LOG_M("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
LOG_M("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
// exit(-1);
} else {
debug_cnt++;
}
LOG_M_END
}
return(peak_pos);
@@ -81,7 +81,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
//compute frequency-domain representation of 6144-sample chunk
dft6144((int16_t *)rxp,
sp);
sp,1);
/*
@@ -23,7 +23,7 @@
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#include "PHY/sse_intrin.h"
//#define k1 1000
+34 -37
View File
@@ -25,9 +25,9 @@
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
#include "common/utils/LOG/log.h"
//extern unsigned int lte_gold_table[3][20][2][14];
//#define DEBUG_DL_CELL_SPEC
@@ -64,7 +64,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
else if ((p==1) && (l>0))
nu = 0;
else {
printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
LOG_E(PHY,"lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
@@ -85,19 +85,19 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
LOG_I(PHY,"Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_I(PHY,"index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
}
mprime++;
#ifdef DEBUG_DL_CELL_SPEC
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
if (m<4)
printf("Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
LOG_I(PHY,"Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
}
k+=6;//b
if (k >= eNB->frame_parms.ofdm_symbol_size) {
@@ -105,7 +105,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
k-=eNB->frame_parms.ofdm_symbol_size;
}
// printf("** k %d\n",k);
// LOG_I(PHY,"** k %d\n",k);
}
return(0);
@@ -143,7 +143,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
else if ((p==1) && (l>0))
nu = 0;
else {
printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
LOG_E(PHY,"lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
@@ -168,27 +168,24 @@ int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
LOG_I(PHY,"Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_I(PHY,"index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
}
mprime++;
#ifdef DEBUG_DL_CELL_SPEC
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
if (m<4)
LOG_I(PHY,"Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
}
if (m<4)
printf("Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
k+=6;
if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=eNB->frame_parms.ofdm_symbol_size;
}
// printf("** k %d\n",k);
// LOG_I(PHY,"** k %d\n",k);
}
return(0);
@@ -231,21 +228,21 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *ue,
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
LOG_I(PHY,"Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_I(PHY,"index = %d (k %d)\n",(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
}
mprime++;
#ifdef DEBUG_DL_CELL_SPEC
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
if (m<4)
printf("Ns %d l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
if (m<4)
LOG_I(PHY,"Ns %d l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
k++;
// printf("** k %d\n",k);
}
k++;
// LOG_I(PHY,"** k %d\n",k);
}
return(0);
+1 -1
View File
@@ -36,7 +36,7 @@
#include "lte_refsig.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#include "PHY/impl_defs_top.h"
//extern unsigned int lte_gold_table[3][20][2][14];
+2 -2
View File
@@ -54,9 +54,9 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl
for (l=0; l<3; l++) {
if (l==0)
x2 = (Nid_mbsfn) + (((1+(Nid_mbsfn<<1))*(1 + 2 + (7*(1+(sfn>>1)))))<<9); //cinit
x2 = (Nid_mbsfn) + (((1+(Nid_mbsfn<<1))*(1 + 2 + (7*(1+(sfn<<1)))))<<9); //cinit
else
x2 = (Nid_mbsfn) + (((1+(Nid_mbsfn<<1))*(1 + ((l-1)<<2) + (7*(2+(sfn>>1)))))<<9); //cinit
x2 = (Nid_mbsfn) + (((1+(Nid_mbsfn<<1))*(1 + ((l-1)<<2) + (7*(2+(sfn<<1)))))<<9); //cinit
//x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit
//n = 0
+8
View File
@@ -346,6 +346,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
y[0] = &yseq0[0];
y[1] = &yseq1[0];
#if BASIC_SIMULATOR
/* this should be the normal case
* but it has to be validated for all the various cases
* so let's just do it for the basic simulator
*/
memset(e, 2, DCI_BITS_MAX);
#else
#if 1
// reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX);
@@ -358,6 +365,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
* (not sure about this, to be checked somehow)
*/
//memset(e, 0, DCI_BITS_MAX);
#endif /* BASIC_SIMULATOR */
e_ptr = e;
+2 -2
View File
@@ -220,7 +220,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
break;
}
LOG_I(PHY,"%d.%d: DCI 1A: rnti %x, PDCCH order to do PRACH\n",
LOG_T(PHY,"%d.%d: DCI 1A: rnti %x, PDCCH order to do PRACH\n",
proc->frame_tx, proc->subframe_tx, rel8->rnti);
}
@@ -1791,7 +1791,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
#ifdef T_TRACER
T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe),
T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((frame*10+subframe+4) % 8) /* TODO: correct harq pid */),
T_INT(pdu->dci_pdu_rel8.rnti), T_INT(pdu->dci_pdu_rel8.harq_pid),
T_INT(mcs), T_INT(-1 /* TODO: remove round? */),
T_INT(pdu->dci_pdu_rel8.resource_block_start),
T_INT(pdu->dci_pdu_rel8.number_of_resource_block),
+3 -4
View File
@@ -511,16 +511,15 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
proc->tep[i].total_worker = worker_num;
proc->tep[i].current_worker = i;
if (pthread_cond_signal(&proc->tep[i].cond_te) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
exit_fun( "ERROR pthread_cond_signal" );
return (-1);
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
exit_fun( "ERROR pthread_cond_signal" );
return (-1);
}
}
}
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
// outputs for each code segment, see Section 5.1.5 p.20
for (r=0,r_offset=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
// get information for E for the segments that are handled by the worker thread
+220 -67
View File
@@ -39,7 +39,7 @@
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
//#define DEBUG_DLSCH_MODULATION
#define NEW_ALLOC_RE
//#define NEW_ALLOC_RE
//#define is_not_pilot(pilots,re,nushift,use2ndpilots) ((pilots==0) || ((re!=nushift) && (re!=nushift+6)&&((re!=nushift+3)||(use2ndpilots==1))&&((re!=nushift+9)||(use2ndpilots==1)))?1:0)
@@ -165,10 +165,19 @@ int allocate_REs_in_RB_no_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re,last_re;
last_re=12;
first_re=0;
if (skip_half==1)
last_re=6;
else if (skip_half==2)
first_re=6;
re=first_re;
if (skip_dc == 0) {
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
re<12;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
re<last_re;
re++,x0p+=2,tti_offset++) {
qpsk_table_offset_re=x0p[0];
@@ -199,8 +208,16 @@ int allocate_REs_in_RB_no_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qpsk_table_offset_im];
}
}
*re_allocated = *re_allocated + 12;
*jj=*jj + 24;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 6;
*jj=*jj + 12;
}
else
{
*re_allocated = *re_allocated + 12;
*jj=*jj + 24;
}
return(0);
}
@@ -238,12 +255,20 @@ int allocate_REs_in_RB_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re,last_re;
last_re=12;
first_re=0;
if (skip_half==1)
last_re=6;
else if (skip_half==2)
first_re=6;
re=first_re+P1_SHIFT[0];
if (skip_dc == 0) {
// printf("pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+P1_SHIFT[0],re=P1_SHIFT[0];
re<12;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
re<last_re;
x0p+=2) {
qpsk_table_offset_re=x0p[0];
@@ -260,8 +285,8 @@ int allocate_REs_in_RB_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
re<6;
x0p+=2) {
qpsk_table_offset_re+=x0p[0];
qpsk_table_offset_im+=x0p[1];
qpsk_table_offset_re=x0p[0];
qpsk_table_offset_im=x0p[1];
((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qpsk_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qpsk_table_offset_im];
tti_offset+=P1_SHIFT[re+1];
@@ -272,16 +297,24 @@ int allocate_REs_in_RB_pilots_QPSK_siso(PHY_VARS_eNB* phy_vars_eNB,
re<12;
x0p+=2) {
qpsk_table_offset_re+=x0p[0];
qpsk_table_offset_im+=x0p[1];
qpsk_table_offset_re=x0p[0];
qpsk_table_offset_im=x0p[1];
((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qpsk_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qpsk_table_offset_im];
tti_offset+=P1_SHIFT[re+1];
re+=P1_SHIFT[re+1];
}
}
*re_allocated = *re_allocated + 10;
*jj=*jj + 20;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 5;
*jj=*jj + 10;
}
else
{
*re_allocated = *re_allocated + 10;
*jj=*jj + 20;
}
return(0);
}
@@ -317,10 +350,19 @@ int allocate_REs_in_RB_no_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re,last_re;
last_re=12;
first_re=0;
if (skip_half==1)
last_re=6;
else if (skip_half==2)
first_re=6;
re=first_re;
if (skip_dc == 0) {
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
re<12;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
re<last_re;
re++,x0p+=4,tti_offset++) {
qam16_table_offset_re=TWO[x0p[0]];
@@ -357,8 +399,16 @@ int allocate_REs_in_RB_no_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qam16_table_offset_im];
}
}
*re_allocated = *re_allocated + 12;
*jj=*jj + 48;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 6;
*jj=*jj + 24;
}
else
{
*re_allocated = *re_allocated + 12;
*jj=*jj + 48;
}
return(0);
}
@@ -396,12 +446,21 @@ int allocate_REs_in_RB_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re,last_re;
last_re=12;
first_re=0;
if (skip_half==1)
last_re=6;
else if (skip_half==2)
first_re=6;
re=first_re+P1_SHIFT[0];
if (skip_dc == 0) {
// LOG_I(PHY,"pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+P1_SHIFT[0],re=P1_SHIFT[0];
re<12;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
re<last_re;
x0p+=4) {
qam16_table_offset_re=TWO[x0p[0]];
@@ -444,8 +503,16 @@ int allocate_REs_in_RB_pilots_16QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
re+=P1_SHIFT[re+1];
}
}
*re_allocated = *re_allocated + 10;
*jj=*jj + 40;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 5;
*jj=*jj + 20;
}
else
{
*re_allocated = *re_allocated + 10;
*jj=*jj + 40;
}
return(0);
}
@@ -482,10 +549,16 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re;
first_re=0;
if (skip_half==2)
first_re=6;
re=first_re;
if (skip_dc == 0) {
x0p=&x0[*jj],tti_offset=symbol_offset+re_offset;
x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
/* for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
re<12;
@@ -521,36 +594,38 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
((int16_t *)&txdataF[0][tti_offset])[10]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[11]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[36]<<2)|(x0p[38]<<1)|x0p[40];
qam64_table_offset_im=(x0p[37]<<2)|(x0p[39]<<1)|x0p[41];
((int16_t *)&txdataF[0][tti_offset])[12]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[13]=qam_table_s0[qam64_table_offset_im];
if(skip_half==0)
{
qam64_table_offset_re=(x0p[36]<<2)|(x0p[38]<<1)|x0p[40];
qam64_table_offset_im=(x0p[37]<<2)|(x0p[39]<<1)|x0p[41];
((int16_t *)&txdataF[0][tti_offset])[12]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[13]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[42]<<2)|(x0p[44]<<1)|x0p[46];
qam64_table_offset_im=(x0p[43]<<2)|(x0p[45]<<1)|x0p[47];
((int16_t *)&txdataF[0][tti_offset])[14]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[15]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[42]<<2)|(x0p[44]<<1)|x0p[46];
qam64_table_offset_im=(x0p[43]<<2)|(x0p[45]<<1)|x0p[47];
((int16_t *)&txdataF[0][tti_offset])[14]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[15]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[48]<<2)|(x0p[50]<<1)|x0p[52];
qam64_table_offset_im=(x0p[49]<<2)|(x0p[51]<<1)|x0p[53];
((int16_t *)&txdataF[0][tti_offset])[16]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[17]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[48]<<2)|(x0p[50]<<1)|x0p[52];
qam64_table_offset_im=(x0p[49]<<2)|(x0p[51]<<1)|x0p[53];
((int16_t *)&txdataF[0][tti_offset])[16]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[17]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[54]<<2)|(x0p[56]<<1)|x0p[58];
qam64_table_offset_im=(x0p[55]<<2)|(x0p[57]<<1)|x0p[59];
((int16_t *)&txdataF[0][tti_offset])[18]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[19]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[54]<<2)|(x0p[56]<<1)|x0p[58];
qam64_table_offset_im=(x0p[55]<<2)|(x0p[57]<<1)|x0p[59];
((int16_t *)&txdataF[0][tti_offset])[18]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[19]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[60]<<2)|(x0p[62]<<1)|x0p[64];
qam64_table_offset_im=(x0p[61]<<2)|(x0p[63]<<1)|x0p[65];
((int16_t *)&txdataF[0][tti_offset])[20]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[21]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[66]<<2)|(x0p[68]<<1)|x0p[70];
qam64_table_offset_im=(x0p[67]<<2)|(x0p[69]<<1)|x0p[71];
((int16_t *)&txdataF[0][tti_offset])[22]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[23]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[60]<<2)|(x0p[62]<<1)|x0p[64];
qam64_table_offset_im=(x0p[61]<<2)|(x0p[63]<<1)|x0p[65];
((int16_t *)&txdataF[0][tti_offset])[20]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[21]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[66]<<2)|(x0p[68]<<1)|x0p[70];
qam64_table_offset_im=(x0p[67]<<2)|(x0p[69]<<1)|x0p[71];
((int16_t *)&txdataF[0][tti_offset])[22]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[23]=qam_table_s0[qam64_table_offset_im];
}
// }
}
@@ -584,8 +659,16 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
}
}
*re_allocated = *re_allocated + 12;
*jj=*jj + 72;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 6;
*jj=*jj + 36;
}
else
{
*re_allocated = *re_allocated + 12;
*jj=*jj + 72;
}
return(0);
}
@@ -623,12 +706,21 @@ int allocate_REs_in_RB_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
uint32_t tti_offset;
uint8_t re;
uint8_t *x0p;
uint8_t first_re,last_re;
last_re=12;
first_re=0;
if (skip_half==1)
last_re=6;
else if (skip_half==2)
first_re=6;
re=first_re+P1_SHIFT[0];
if (skip_dc == 0) {
// LOG_I(PHY,"pilots: P1_SHIFT[0] %d\n",P1_SHIFT[0]);
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+P1_SHIFT[0],re=P1_SHIFT[0];
re<12;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset+re;
re<last_re;
x0p+=6) {
qam64_table_offset_re=FOUR[x0p[0]];
@@ -677,8 +769,16 @@ int allocate_REs_in_RB_pilots_64QAM_siso(PHY_VARS_eNB* phy_vars_eNB,
re+=P1_SHIFT[re+1];
}
}
*re_allocated = *re_allocated + 10;
*jj=*jj + 60;
if(skip_half!=0)
{
*re_allocated = *re_allocated + 5;
*jj=*jj + 30;
}
else
{
*re_allocated = *re_allocated + 10;
*jj=*jj + 60;
}
return(0);
}
@@ -706,6 +806,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
int *P2_SHIFT)
{
uint8_t *x0 = NULL;
MIMO_mode_t mimo_mode = -1;
@@ -2099,10 +2200,33 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
uint8_t mod_order0 = 0;
uint8_t mod_order1 = 0;
int16_t amp_rho_a, amp_rho_b;
int16_t qam16_table_a0[4],qam64_table_a0[8],qam16_table_b0[4],qam64_table_b0[8];//qpsk_table_a0[2],qpsk_table_b0[2]
int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8];//qpsk_table_a1[2],qpsk_table_b1[2]
int16_t qam16_table_a0[4],qam64_table_a0[8],qam16_table_b0[4],qam64_table_b0[8],qpsk_table_a0[2],qpsk_table_b0[2];
int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8],qpsk_table_a1[2],qpsk_table_b1[2];
int16_t *qam_table_s0=NULL,*qam_table_s1=NULL;
int (*allocate_REs)(PHY_VARS_eNB*,
int **,
uint32_t*,
uint32_t*,
uint16_t,
uint32_t,
LTE_DL_eNB_HARQ_t *,
LTE_DL_eNB_HARQ_t *,
uint8_t,
int16_t,
uint8_t,
int16_t *,
int16_t *,
uint32_t *,
uint8_t,
uint8_t,
uint8_t,
uint8_t,
uint8_t,
int *,
int *);
int P1_SHIFT[13],P2_SHIFT[13];
int offset,nushiftmod3;
@@ -2201,7 +2325,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13);
}
/*if(mod_order0 == 2)
if(mod_order0 == 2)
{
for(i=0;i<2;i++)
{
@@ -2209,7 +2333,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
qpsk_table_b0[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_b)>>15);
}
}
else*/ if (mod_order0 == 4)
else if (mod_order0 == 4)
for (i=0;i<4; i++) {
qam16_table_a0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
qam16_table_b0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_b)>>15);
@@ -2220,14 +2344,14 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
qam64_table_b0[i] = (int16_t)(((int32_t)qam64_table[i]*amp_rho_b)>>15);
}
/*if (mod_order1 == 2)
if (mod_order1 == 2)
{
for (i=0; i<2; i++) {
qpsk_table_a1[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_a)>>15);
qpsk_table_b1[i] = (int16_t)(((int32_t)qpsk_table[i]*amp_rho_b)>>15);
}
}
else*/ if (mod_order1 == 4)
else if (mod_order1 == 4)
for (i=0; i<4; i++) {
qam16_table_a1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
qam16_table_b1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_b)>>15);
@@ -2348,24 +2472,36 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
re_offset = frame_parms->first_carrier_offset;
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe_offset*nsymb));
allocate_REs = allocate_REs_in_RB;
switch (mod_order0) {
case 2:
qam_table_s0 = NULL;
/*if (pilots) {
if (pilots) {
qam_table_s0 = qpsk_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_QPSK_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qpsk_table_a0;
}*/
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_QPSK_siso :
allocate_REs_in_RB;
}
break;
case 4:
if (pilots) {
qam_table_s0 = qam16_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_16QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam16_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_16QAM_siso :
allocate_REs_in_RB;
}
break;
@@ -2373,23 +2509,42 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
case 6:
if (pilots) {
qam_table_s0 = qam64_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_64QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam64_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_64QAM_siso :
allocate_REs_in_RB;
}
/* TODO: this is a quick hack to be removed. There is a problem
* with above code that needs to be analyzed and fixed. In the
* meantime, let's use the generic function.
*/
//allocate_REs = allocate_REs_in_RB;
break;
}
/* TODO: hack, to be removed. The power is too different from
* previous version. Some more work/validation is needed before
* we switch to the new version.
*/
//if (frame_parms->N_RB_DL==25)
//allocate_REs = allocate_REs_in_RB;
switch (mod_order1) {
case 2:
qam_table_s1 = NULL;
/*if (pilots) {
allocate_REs = allocate_REs_in_RB;
if (pilots) {
qam_table_s1 = qpsk_table_b1;
}
else {
qam_table_s1 = qpsk_table_a1;
}*/
}
break;
case 4:
if (pilots) {
@@ -2432,8 +2587,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
skip_half = check_skiphalf(rb,subframe_offset,frame_parms,l,nsymb);
skip_dc = check_skip_dc(rb,frame_parms);
if (dlsch0) {
if (dlsch0_harq->Nlayers>1) {
LOG_E(PHY,"Nlayers %d: re_offset %d, symbol %d offset %d\n",dlsch0_harq->Nlayers,re_offset,l,symbol_offset);
@@ -2465,7 +2618,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
rb);
allocate_REs_in_RB(phy_vars_eNB,
allocate_REs(phy_vars_eNB,
txdataF,
&jj,
&jj2,
+91 -3
View File
@@ -27,6 +27,7 @@ int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_par
uint32_t period;
uint8_t i;
uint8_t j;
// LOG_D(PHY,"is_pmch_subframe: frame %d, subframe %d, num_MBSFN_config %d\n",
// frame,subframe,frame_parms->num_MBSFN_config);
@@ -34,8 +35,8 @@ int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_par
for (i=0; i<frame_parms->num_MBSFN_config; i++) { // we have at least one MBSFN configuration
period = 1<<frame_parms->MBSFN_config[i].radioframeAllocationPeriod;
if ((frame % period) == frame_parms->MBSFN_config[i].radioframeAllocationOffset) {
if (frame_parms->MBSFN_config[i].fourFrames_flag == 0) {
if (frame_parms->MBSFN_config[i].fourFrames_flag == 0) {
if ((frame % period) == frame_parms->MBSFN_config[i].radioframeAllocationOffset) {
if (frame_parms->frame_type == FDD) {
switch (subframe) {
@@ -108,9 +109,96 @@ int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_par
break;
}
}
}
} else { // handle 4 frames case
} else { // handle 4 frames case
for(j=0;j<4;j++) {
if ((frame % period) == (frame_parms->MBSFN_config[i].radioframeAllocationOffset + j)) {
if (frame_parms->frame_type == FDD) {
switch (subframe) {
case 1:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x800000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x800000>>(j*6));
return(1);
}
break;
case 2:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x400000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x400000>>(j*6));
return(1);
}
break;
case 3:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x200000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x200000>>(j*6));
return(1);
}
break;
case 6:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x100000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x100000>>(j*6));
return(1);
}
break;
case 7:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x80000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x80000>>(j*6));
return(1);
}
break;
case 8:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig) & (0x40000>>(j*6))) > 0) {
//LOG_E(PHY,"SubframeConfig<<6(%x),MBSFN_FDD_SF1(%x)\n",frame_parms->MBSFN_config[i].mbsfn_SubframeConfig,0x40000>>(j*6));
return(1);
}
break;
}
} else {
switch (subframe) {
case 3:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig>>j*6) & MBSFN_TDD_SF3) > 0)
return(1);
break;
case 4:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig>>j*6) & MBSFN_TDD_SF4) > 0)
return(1);
break;
case 7:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig>>j*6) & MBSFN_TDD_SF7) > 0)
return(1);
break;
case 8:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig>>j*6) & MBSFN_TDD_SF8) > 0)
return(1);
break;
case 9:
if (((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig>>j*6) & MBSFN_TDD_SF9) > 0)
return(1);
break;
}
}
}
}
}
}
+117 -117
View File
@@ -153,25 +153,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
subframe = eNB->proc.subframe_prach_br;
prachF = eNB->prach_vars_br.prachF;
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
LOG_DEBUG_BEGIN(PRACH)
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,ru->proc.frame_prach,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
prach_ConfigIndex,rootSequenceIndex,
eNB->prach_vars_br.repetition_number[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]);
LOG_DEBUG_END
}
else
if (LOG_DEBUGFLAG(PRACH)){
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,ru->proc.frame_prach,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
prach_ConfigIndex,rootSequenceIndex,
eNB->prach_vars_br.repetition_number[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]);
}
} else
#endif
{
prach_ifftp = eNB->prach_vars.prach_ifft[0];
subframe = eNB->proc.subframe_prach;
prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF[0];
LOG_DEBUG_BEGIN(PRACH)
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)){
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
}
}
}
else {
@@ -179,20 +178,19 @@ LOG_DEBUG_END
if (br_flag == 1) {
subframe = ru->proc.subframe_prach_br;
rxsigF = ru->prach_rxsigF_br[ce_level];
LOG_DEBUG_BEGIN(PRACH)
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,ru->proc.frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
LOG_DEBUG_END
}
else
if (LOG_DEBUGFLAG(PRACH)){
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,ru->proc.frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
}
} else
#endif
{
subframe = ru->proc.subframe_prach;
rxsigF = ru->prach_rxsigF;
LOG_DEBUG_BEGIN(PRACH)
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)){
if (((ru->proc.frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
}
}
}
@@ -204,27 +202,25 @@ LOG_DEBUG_END
// DJP - indexing below in subframe zero takes us off the beginning of the array???
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
LOG_M_BEGIN(PRACH)
int32_t en0=signal_energy((int32_t*)prach[aa],fp->samples_per_tti);
int8_t dbEn0 = dB_fixed(en0);
int8_t rach_dBm = dbEn0 - ru->rx_total_gain_dB;
char buffer[80];
if (dbEn0>32 && prach[0]!= NULL)
{
static int counter=0;
sprintf(buffer, "%s%d", "/tmp/prach_rx",counter);
LOG_M(buffer,"prach_rx",prach[0],fp->samples_per_tti,1,13);
if (LOG_DUMPFLAG(PRACH)){
int32_t en0=signal_energy((int32_t*)prach[aa],fp->samples_per_tti);
int8_t dbEn0 = dB_fixed(en0);
int8_t rach_dBm = dbEn0 - ru->rx_total_gain_dB;
char buffer[80];
if (dbEn0>32 && prach[0]!= NULL) {
static int counter=0;
sprintf(buffer, "%s%d", "/tmp/prach_rx",counter);
LOG_M(buffer,"prach_rx",prach[0],fp->samples_per_tti,1,13);
}
if (dB_fixed(en0)>32) {
sprintf(buffer, "rach_dBm:%d",rach_dBm);
if (prach[0]!= NULL) LOG_M("prach_rx","prach_rx",prach[0],fp->samples_per_tti,1,1);
LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d per_tti:%d prach:%p (energy %d) TA:%d %s rxdata:%p index:%d\n",
ru->idx,br_flag,ce_level,ru->proc.frame_prach,subframe,fp->samples_per_tti,
prach[aa],dbEn0,ru->N_TA_offset,buffer,ru->common.rxdata[aa],
(subframe*fp->samples_per_tti)-ru->N_TA_offset);
}
if (dB_fixed(en0)>32)
{
sprintf(buffer, "rach_dBm:%d",rach_dBm);
if (prach[0]!= NULL) LOG_M("prach_rx","prach_rx",prach[0],fp->samples_per_tti,1,1);
LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d per_tti:%d prach:%p (energy %d) TA:%d %s rxdata:%p index:%d\n",
ru->idx,br_flag,ce_level,ru->proc.frame_prach,subframe,fp->samples_per_tti,
prach[aa],dbEn0,ru->N_TA_offset,buffer,ru->common.rxdata[aa],
(subframe*fp->samples_per_tti)-ru->N_TA_offset);
}
LOG_M_END
}
}
}
@@ -306,9 +302,9 @@ LOG_M_END
if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))||
((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources
// Do forward transform
LOG_DEBUG_BEGIN(PRACH)
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)) {
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
}
for (aa=0; aa<nb_rx; aa++) {
AssertFatal(prach[aa]!=NULL,"prach[%d] is null\n",aa);
prach2 = prach[aa] + (Ncp<<1);
@@ -331,10 +327,10 @@ LOG_DEBUG_END
if (prach_fmt == 4) {
dft256(prach2,rxsigF[aa],1);
} else {
dft3072(prach2,rxsigF[aa]);
dft3072(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft3072(prach2+6144,rxsigF[aa]+6144);
dft3072(prach2+6144,rxsigF[aa]+6144,1);
}
break;
@@ -345,10 +341,10 @@ LOG_DEBUG_END
dft1024(prach2,rxsigF[aa],1);
fft_size = 1024;
} else {
dft6144(prach2,rxsigF[aa]);
dft6144(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft6144(prach2+12288,rxsigF[aa]+12288);
dft6144(prach2+12288,rxsigF[aa]+12288,1);
fft_size = 6144;
}
@@ -359,22 +355,22 @@ LOG_DEBUG_END
if (prach_fmt == 4) {
dft2048(prach2,rxsigF[aa],1);
} else {
dft12288(prach2,rxsigF[aa]);
dft12288(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft12288(prach2+24576,rxsigF[aa]+24576);
dft12288(prach2+24576,rxsigF[aa]+24576,1);
}
break;
case 75:
if (prach_fmt == 4) {
dft3072(prach2,rxsigF[aa]);
dft3072(prach2,rxsigF[aa],1);
} else {
dft18432(prach2,rxsigF[aa]);
dft18432(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft18432(prach2+36864,rxsigF[aa]+36864);
dft18432(prach2+36864,rxsigF[aa]+36864,1);
}
break;
@@ -384,19 +380,19 @@ LOG_DEBUG_END
if (prach_fmt == 4) {
dft4096(prach2,rxsigF[aa],1);
} else {
dft24576(prach2,rxsigF[aa]);
dft24576(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft24576(prach2+49152,rxsigF[aa]+49152);
dft24576(prach2+49152,rxsigF[aa]+49152,1);
}
} else {
if (prach_fmt == 4) {
dft3072(prach2,rxsigF[aa]);
dft3072(prach2,rxsigF[aa],1);
} else {
dft18432(prach2,rxsigF[aa]);
dft18432(prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft18432(prach2+36864,rxsigF[aa]+36864);
dft18432(prach2+36864,rxsigF[aa]+36864,1);
}
}
@@ -439,10 +435,10 @@ LOG_DEBUG_END
return;
} else if (eNB!=NULL) {
LOG_DEBUG_BEGIN(PRACH)
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
LOG_DEBUG_END
if ( LOG_DEBUGFLAG(PRACH)) {
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
}
}
// in case of RAU and prach received rx_thread wakes up prach
@@ -477,10 +473,10 @@ LOG_DEBUG_END
*max_preamble_energy=0;
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
LOG_DEBUG_BEGIN(PRACH)
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",ru->proc.frame_prach,subframe,preamble_index,br_flag);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)){
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",ru->proc.frame_prach,subframe,preamble_index,br_flag);
}
if (restricted_set == 0) {
// This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
@@ -563,11 +559,11 @@ LOG_DEBUG_END
}
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
LOG_DEBUG_BEGIN(PRACH)
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
ru->proc.frame_prach,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)) {
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
ru->proc.frame_prach,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
}
log2_ifft_size = 10;
fft_size = 6144;
@@ -589,13 +585,13 @@ LOG_DEBUG_END
}
memset(prachF, 0, sizeof(int16_t)*2*1024 );
LOG_M_BEGIN(PRACH)
if (prach[0]!= NULL) LOG_M("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],24576,1,1);
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
LOG_M_END
if (LOG_DUMPFLAG(PRACH)) {
if (prach[0]!= NULL) LOG_M("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],24576,1,1);
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
}
for (aa=0;aa<nb_rx; aa++) {
// Do componentwise product with Xu* on each antenna
@@ -623,10 +619,10 @@ LOG_M_END
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
}
LOG_M_BEGIN(PRACH)
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
LOG_M_END
if (LOG_DUMPFLAG(PRACH)) {
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
}
}// antennas_rx
} // new dft
@@ -637,10 +633,10 @@ LOG_M_END
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]))
#endif
{
LOG_DEBUG_BEGIN(PRACH)
if (LOG_DEBUGFLAG(PRACH)){
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",ru->proc.frame_prach,subframe,br_flag,en);
LOG_DEBUG_END
}
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
@@ -652,44 +648,48 @@ LOG_DEBUG_END
*max_preamble_energy = levdB;
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
*max_preamble = preamble_index;
LOG_DEBUG_BEGIN(PRACH)
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if ((en>60) && (br_flag==1)) LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",ru->proc.frame_prach,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev);
LOG_DEBUG_END
if (LOG_DEBUGFLAG(PRACH)){
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if ((en>60) && (br_flag==1))
LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",
ru->proc.frame_prach,subframe,
*max_preamble_energy,*max_preamble_delay,
*max_preamble,br_flag,ce_level,levdB,lev);
}
}
}
}
}// preamble_index
LOG_M_BEGIN(PRACH)
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
if (br_flag == 0) {
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
}
else {
LOG_E(PHY,"Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
LOG_M("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
LOG_M("Xu_br.m","xu_br",Xu,N_ZC,1,1);
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
exit(-1);
}
if (LOG_DUMPFLAG(PRACH)) {
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
if (br_flag == 0) {
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
}
else {
LOG_E(PHY,"Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
LOG_M("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
LOG_M("Xu_br.m","xu_br",Xu,N_ZC,1,1);
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
exit(-1);
}
}
LOG_M_END
}
} /* LOG_DUMPFLAG(PRACH) */
if (eNB) stop_meas(&eNB->rx_prach);
}
+33 -60
View File
@@ -33,7 +33,6 @@
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "transport_eNB.h"
//#define DEBUG_ULSCH
#include "PHY/sse_intrin.h"
#include "transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
@@ -67,7 +66,7 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH)
// printf("Doing lte_idft for Msc_PUSCH %d\n",Msc_PUSCH);
LOG_T(PHY,"Doing lte_idft for Msc_PUSCH %d\n",Msc_PUSCH);
if (frame_parms->Ncp == 0) { // Normal prefix
z0 = z;
@@ -388,13 +387,13 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH)
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
z0[i] = ((uint32_t*)idft_out0)[ip];
/*
printf("out0 (%d,%d),(%d,%d),(%d,%d),(%d,%d)\n",
((int16_t*)&idft_out0[ip])[0],((int16_t*)&idft_out0[ip])[1],
((int16_t*)&idft_out0[ip+1])[0],((int16_t*)&idft_out0[ip+1])[1],
((int16_t*)&idft_out0[ip+2])[0],((int16_t*)&idft_out0[ip+2])[1],
((int16_t*)&idft_out0[ip+3])[0],((int16_t*)&idft_out0[ip+3])[1]);
*/
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
LOG_I(PHY,"out0 (%d,%d),(%d,%d),(%d,%d),(%d,%d)\n",
((int16_t*)&idft_out0[ip])[0],((int16_t*)&idft_out0[ip])[1],
((int16_t*)&idft_out0[ip+1])[0],((int16_t*)&idft_out0[ip+1])[1],
((int16_t*)&idft_out0[ip+2])[0],((int16_t*)&idft_out0[ip+2])[1],
((int16_t*)&idft_out0[ip+3])[0],((int16_t*)&idft_out0[ip+3])[1]);
}
z1[i] = ((uint32_t*)idft_out0)[ip+1];
z2[i] = ((uint32_t*)idft_out0)[ip+2];
z3[i] = ((uint32_t*)idft_out0)[ip+3];
@@ -479,10 +478,7 @@ int32_t ulsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
int i;
// printf("qpsk llr for symbol %d (pos %d), llr offset %d\n",symbol,(symbol*frame_parms->N_RB_DL*12),llr128U-(__m128i*)ulsch_llr);
for (i=0; i<(nb_rb*3); i++) {
//printf("%d,%d,%d,%d,%d,%d,%d,%d\n",((int16_t *)rxF)[0],((int16_t *)rxF)[1],((int16_t *)rxF)[2],((int16_t *)rxF)[3],((int16_t *)rxF)[4],((int16_t *)rxF)[5],((int16_t *)rxF)[6],((int16_t *)rxF)[7]);
*(*llrp128) = *rxF;
rxF++;
(*llrp128)++;
@@ -593,7 +589,9 @@ void ulsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
ch_mag =(int16x8_t*)&ul_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
ch_magb =(int16x8_t*)&ul_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
#endif
// printf("symbol %d: mag %d, magb %d\n",symbol,_mm_extract_epi16(ch_mag[0],0),_mm_extract_epi16(ch_magb[0],0));
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
LOG_UI(PHY,"symbol %d: mag %d, magb %d\n",symbol,_mm_extract_epi16(ch_mag[0],0),_mm_extract_epi16(ch_magb[0],0));
}
for (i=0; i<(nb_rb*3); i++) {
@@ -736,9 +734,9 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
nb_rb1 = cmin(cmax((int)(frame_parms->N_RB_UL) - (int)(2*first_rb),(int)0),(int)(2*nb_rb)); // 2 times no. RBs before the DC
nb_rb2 = 2*nb_rb - nb_rb1; // 2 times no. RBs after the DC
#ifdef DEBUG_ULSCH
printf("ulsch_extract_rbs_single: 2*nb_rb1 = %d, 2*nb_rb2 = %d\n",nb_rb1,nb_rb2);
#endif
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
LOG_UI(PHY,"ulsch_extract_rbs_single: 2*nb_rb1 = %d, 2*nb_rb2 = %d\n",nb_rb1,nb_rb2);
}
rxF_ext = &rxdataF_ext[aarx][(symbol*frame_parms->N_RB_UL*12)];
@@ -838,7 +836,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
#endif
for (rb=0; rb<nb_rb; rb++) {
// printf("comp: symbol %d rb %d\n",symbol,rb);
LOG_D(PHY,"comp: symbol %d rb %d\n",symbol,rb);
// just compute channel magnitude without scaling, this is done after equalization for SC-FDMA
@@ -861,7 +859,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0);
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
// printf("comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t*)&ul_ch_mag128[0]),*((int16_t*)&ul_ch_mag128[1]),*((int16_t*)&ul_ch_mag128[2]),output_shift);
LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t*)&ul_ch_mag128[0]),*((int16_t*)&ul_ch_mag128[1]),*((int16_t*)&ul_ch_mag128[2]),output_shift);
#elif defined(__arm__)
@@ -1125,10 +1123,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
Qm = ulsch[UE_id]->harq_processes[harq_pid]->Qm;
#ifdef DEBUG_ULSCH
printf("rx_ulsch: harq_pid %d, nb_rb %d first_rb %d\n",harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
#endif //DEBUG_ULSCH
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
LOG_I(PHY,"rx_ulsch: harq_pid %d, nb_rb %d first_rb %d\n",harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
}
if (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb == 0) {
LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti);
@@ -1137,13 +1134,13 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
#ifdef DEBUG_ULSCH
printf("rx_ulsch : symbol %d (first_rb %d,nb_rb %d), rxdataF %p, rxdataF_ext %p\n",l,
if(LOG_DEBUGFLAG(DEBUG_ULSCH)) {
LOG_I(PHY,"rx_ulsch : symbol %d (first_rb %d,nb_rb %d), rxdataF %p, rxdataF_ext %p\n",l,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
common_vars->rxdataF,
pusch_vars->rxdataF_ext);
#endif //DEBUG_ULSCH
}
ulsch_extract_rbs_single(common_vars->rxdataF,
pusch_vars->rxdataF_ext,
@@ -1179,21 +1176,16 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)/correction_factor;
/* printf("%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i]));
*/
LOG_D(PHY,"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i]));
}
//LOG_M("rxdataF_ext.m","rxF_ext",pusch_vars->rxdataF_ext[eNB_id][0],300*(frame_parms->symbols_per_tti-ulsch[UE_id]->srs_active),1,1);
//LOG_M("ulsch_chest.m","drs_est",pusch_vars->drs_ch_estimates[eNB_id][0],300*(frame_parms->symbols_per_tti-ulsch[UE_id]->srs_active),1,1);
ulsch_channel_level(pusch_vars->drs_ch_estimates,
frame_parms,
avgU,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb);
// printf("[ULSCH] avg[0] %d\n",avgU[0]);
LOG_D(PHY,"[ULSCH] avg[0] %d\n",avgU[0]);
avgs = 0;
@@ -1205,9 +1197,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
#ifdef DEBUG_ULSCH
printf("[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
#endif
LOG_D(PHY,"[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
@@ -1229,9 +1221,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
log2_maxh); // log2_maxh+I0_shift
if (frame_parms->nb_antennas_rx > 1)
ulsch_detection_mrc(frame_parms,
pusch_vars->rxdataF_comp,
@@ -1240,9 +1229,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
l,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb);
// if ((eNB->measurements.n0_power_dB[0]+3)<pusch_vars->ulsch_power[0]) {
// if ((eNB->measurements.n0_power_dB[0]+3)<pusch_vars->ulsch_power[0])
if (23<pusch_vars->ulsch_power[0]) {
freq_equalization(frame_parms,
pusch_vars->rxdataF_comp,
@@ -1254,22 +1241,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
}
//#ifdef DEBUG_ULSCH
// Inverse-Transform equalized outputs
// printf("Doing IDFTs\n");
lte_idft(frame_parms,
(uint32_t*)pusch_vars->rxdataF_comp[0],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
// printf("Done\n");
//#endif //DEBUG_ULSCH
llrp = (int16_t*)&pusch_vars->llr[0];
@@ -1316,9 +1290,8 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
break;
default:
#ifdef DEBUG_ULSCH
printf("ulsch_demodulation.c (rx_ulsch): Unknown Qm!!!!\n");
#endif //DEBUG_ULSCH
LOG_E(PHY,"ulsch_demodulation.c (rx_ulsch): Unknown Qm!!!!\n");
break;
}
}
@@ -1329,7 +1302,7 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_index)
{
printf("[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, UE_index %d\n",eNB->Mod_id,proc->subframe_rx,UE_index);
LOG_I(PHY,"[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, UE_index %d\n",eNB->Mod_id,proc->subframe_rx,UE_index);
eNB->pusch_vars[UE_index]->ulsch_power[0] = 31622; //=45dB;
eNB->pusch_vars[UE_index]->ulsch_power[1] = 31622; //=45dB;
@@ -1344,7 +1317,7 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
printf("Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
LOG_UI(PHY,"Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
subframe,harq_pid,round,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
+12 -11
View File
@@ -179,29 +179,29 @@ void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_
uint32_t rballoc=0;
uint8_t mcs=0;
uint8_t Ngap=0;
switch (N_RB_DL) {
case 6:
mcs = ((DCI1C_5MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_5MHz_t *)dci_pdu)->rballoc,6);
mcs = ((DCI1C_1_5MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_1_5MHz_t *)dci_pdu)->rballoc, 6);
break;
case 25:
mcs = ((DCI1C_5MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_5MHz_t *)dci_pdu)->rballoc,6);
mcs = ((DCI1C_5MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_5MHz_t *)dci_pdu)->rballoc, 25);
break;
case 50:
mcs = ((DCI1C_10MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_10MHz_t *)dci_pdu)->rballoc,6);
mcs = ((DCI1C_10MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_10MHz_t *)dci_pdu)->rballoc, 50);
Ngap = ((DCI1C_10MHz_t *)dci_pdu)->Ngap;
break;
case 100:
mcs = ((DCI1C_20MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_20MHz_t *)dci_pdu)->rballoc,6);
mcs = ((DCI1C_20MHz_t *)dci_pdu)->mcs;
rballoc = conv_1C_RIV(((DCI1C_20MHz_t *)dci_pdu)->rballoc, 100);
Ngap = ((DCI1C_20MHz_t *)dci_pdu)->Ngap;
break;
default:
@@ -211,6 +211,7 @@ void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_
pdci_info_extarcted->mcs1 = mcs;
pdci_info_extarcted->rballoc = rballoc;
pdci_info_extarcted->Ngap = Ngap;
}
void extract_dci1_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
@@ -40,8 +40,14 @@
#include<math.h>
#include <stdlib.h>
#include <string.h>
#include <linux/version.h>
#if RHEL_RELEASE_CODE >= 1796
#include <lapacke/lapacke_utils.h>
#include <lapacke/lapacke.h>
#else
#include <lapacke_utils.h>
#include <lapacke.h>
#endif
#include <cblas.h>
#include "linear_preprocessing_rec.h"
@@ -1314,14 +1320,17 @@ void dlsch_channel_compensation(int **rxdataF_ext,
}
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
/* TODO: hack to be removed. There is crash for 1 antenna case, so
* for 1 antenna case, I put back the value 2 as it was before
* Elena's commit.
*/
int x = frame_parms->nb_antennas_rx > 1 ? frame_parms->nb_antennas_rx : 2;
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
//print_shorts("dl_ch128[0]=",&dl_ch128[0]);*/
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*2 + aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*x + aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) {
if (mod_order>2) {
@@ -1771,12 +1780,17 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
}
for (aarx=0; aarx<n_rx; aarx++) {
/* TODO: hack to be removed. There is crash for 1 antenna case, so
* for 1 antenna case, I put back the value 2 as it was before
* Elena's commit.
*/
int x = n_rx > 1 ? n_rx : 2;
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*2 + aarx][start_point];
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*2 + aarx][start_point];
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*2 + aarx][start_point];
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*x + aarx][start_point];
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aatx*x + aarx][start_point];
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aatx*x + aarx][start_point];
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][start_point];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*2 + aarx][start_point];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*x + aarx][start_point];
length_mod8 = length&7;
if (length_mod8 == 0){
@@ -3974,17 +3988,12 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext,
((int32_t*)&norm128D)[2] +
((int32_t*)&norm128D)[3];
if (ii<1){
// print_ints("norm128D",&norm128D[0]);
printf("norm_pack[%d] %d\n", aatx*n_rx + aarx, norm_pack);
}
if (norm_pack > max)
max = norm_pack;
if (norm_pack < min)
min = norm_pack;
dl_ch128+=1;
dl_ch128+=1;
}
median[aatx*n_rx + aarx] = (max+min)>>1;
@@ -13,9 +13,14 @@ data storage. */
#include <stdlib.h>
#include <cblas.h>
#include <string.h>
#include <linux/version.h>
#if RHEL_RELEASE_CODE >= 1796
#include <lapacke/lapacke_utils.h>
#include <lapacke/lapacke.h>
#else
#include <lapacke_utils.h>
#include <lapacke.h>
#endif
//#define DEBUG_PREPROC
@@ -366,4 +371,4 @@ float sqrt_float(float x, float sqrt_x)
{
sqrt_x = (float)(sqrt((double)(x)));
return sqrt_x;
}
}
+8 -8
View File
@@ -376,7 +376,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
memmove( prach, prach+1024, Ncp<<2 );
prach_len = 512+Ncp;
} else {
idft3072(prachF,prach2);
idft3072(prachF,prach2,1);
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
@@ -395,7 +395,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
memmove( prach, prach+2048, Ncp<<2 );
prach_len = 1024+Ncp;
} else {
idft6144(prachF,prach2);
idft6144(prachF,prach2,1);
/*for (i=0;i<6144*2;i++)
prach2[i]<<=1;*/
memmove( prach, prach+12288, Ncp<<2 );
@@ -415,7 +415,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
memmove( prach, prach+4096, Ncp<<2 );
prach_len = 2048+Ncp;
} else {
idft12288(prachF,prach2);
idft12288(prachF,prach2,1);
memmove( prach, prach+24576, Ncp<<2 );
prach_len = 12288+Ncp;
@@ -429,12 +429,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 75:
if (prach_fmt == 4) {
idft3072(prachF,prach2);
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
} else {
idft18432(prachF,prach2);
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
@@ -453,7 +453,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
memmove( prach, prach+8192, Ncp<<2 );
prach_len = 4096+Ncp;
} else {
idft24576(prachF,prach2);
idft24576(prachF,prach2,1);
memmove( prach, prach+49152, Ncp<<2 );
prach_len = 24576+Ncp;
@@ -465,12 +465,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
}
else {
if (prach_fmt == 4) {
idft3072(prachF,prach2);
idft3072(prachF,prach2,1);
//TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp;
} else {
idft18432(prachF,prach2);
idft18432(prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp;
printf("Generated prach for 100 PRB, 3/4 sampling\n");
+4 -4
View File
@@ -1,14 +1,14 @@
lte_dfts_sse4: lte_dfts.c
gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -std=gnu99 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
lte_dfts_avx2: lte_dfts.c
gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -std=gnu99 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
lte_dfts_avx2.s: lte_dfts.c
gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -std=gnu99 -mavx2 -S lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
lte_dfts_sse4.s: lte_dfts.c
gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -std=gnu99 -msse4.1 -S lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm # -DD256STATS #-DD64STATS
dft_cycles_avx2: lte_dfts_avx2
./lte_dfts_avx2 | egrep cycles
+1057 -10675
View File
File diff suppressed because one or more lines are too long
+10 -10
View File
@@ -174,27 +174,27 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
void idft1536(int16_t *sigF,int16_t *sig,int scale);
void idft6144(int16_t *sigF,int16_t *sig);
void idft6144(int16_t *sigF,int16_t *sig,int scale);
void idft12288(int16_t *sigF,int16_t *sig);
void idft12288(int16_t *sigF,int16_t *sig,int scale);
void idft18432(int16_t *sigF,int16_t *sig);
void idft18432(int16_t *sigF,int16_t *sig,int scale);
void idft3072(int16_t *sigF,int16_t *sig);
void idft3072(int16_t *sigF,int16_t *sig,int scale);
void idft24576(int16_t *sigF,int16_t *sig);
void idft24576(int16_t *sigF,int16_t *sig,int scale);
void dft1536(int16_t *sigF,int16_t *sig,int scale);
void dft6144(int16_t *sigF,int16_t *sig);
void dft6144(int16_t *sigF,int16_t *sig,int scale);
void dft12288(int16_t *sigF,int16_t *sig);
void dft12288(int16_t *sigF,int16_t *sig,int scale);
void dft18432(int16_t *sigF,int16_t *sig);
void dft18432(int16_t *sigF,int16_t *sig,int scale);
void dft3072(int16_t *sigF,int16_t *sig);
void dft3072(int16_t *sigF,int16_t *sig,int scale);
void dft24576(int16_t *sigF,int16_t *sig);
void dft24576(int16_t *sigF,int16_t *sig,int scale);
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -52,7 +52,7 @@
# include "COMMON/ral_messages_types.h"
# include "UTIL/queue.h"
# endif
# include "log.h"
# include "common/utils/LOG/log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
# define msg printf
+1 -1
View File
@@ -93,7 +93,7 @@
# include "COMMON/ral_messages_types.h"
# include "UTIL/queue.h"
# endif
# include "log.h"
# include "common/utils/LOG/log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
# define msg printf
+4 -3
View File
@@ -194,11 +194,11 @@ typedef struct RU_proc_t_s {
pthread_cond_t cond_synch;
/// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx;
/// condition varible for RU RX FEP thread
/// condition variable for RU RX FEP thread
pthread_cond_t cond_fep;
/// condition varible for RU TX FEP thread
/// condition variable for RU TX FEP thread
pthread_cond_t cond_feptx;
/// condition varible for emulated RF
/// condition variable for emulated RF
pthread_cond_t cond_emulateRF;
/// condition variable for eNB signal
pthread_cond_t cond_eNBs;
@@ -260,6 +260,7 @@ typedef struct RU_proc_t_s {
/// pipeline ready state
int ru_rx_ready;
int ru_tx_ready;
int emulate_rf_busy;
} RU_proc_t;
typedef enum {
-1
View File
@@ -668,7 +668,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id);
eNB = RC.eNB[Mod_id][CC_id];
fp = &eNB->frame_parms;
proc = &eNB->proc.proc_rxtx[0];
+30 -44
View File
@@ -347,7 +347,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
dlsch_harq->rvidx,
dlsch_harq->round);
}
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_TX_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE,
NULL,0,
@@ -368,7 +368,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
dlsch_harq->rvidx,
dlsch_harq->round);
#endif
if (ue_stats) ue_stats->dlsch_sliding_cnt++;
@@ -412,7 +412,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
&eNB->dlsch_turbo_encoding_wakeup_stats1,
&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats);
//////////////////////////////////////////////////*******************************************
if(eNB->dlsch_encoding_stats.diff_now>500*3000 && opp_enabled == 1)
{
print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr);
@@ -1376,7 +1375,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
ulsch->harq_mask &= ~(1 << harq_pid);
ulsch_harq->round = 0;
}
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_RX_DISCARDED_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE,
NULL,0,
@@ -1385,7 +1384,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
ulsch->rnti,harq_pid,
ulsch_harq->round-1
);
#endif
/* Mark the HARQ process to release it later if max transmission reached
* (see below).
@@ -1404,7 +1403,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti),
T_INT(harq_pid));
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_RX_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE,
NULL,0,
@@ -1412,7 +1411,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
frame,subframe,
ulsch->rnti,harq_pid
);
#endif
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_ULSCH
@@ -1501,7 +1500,7 @@ void init_te_thread(PHY_VARS_eNB *eNB) {
pthread_cond_init( &proc->tep[i].cond_te, NULL);
pthread_attr_init( &proc->tep[i].attr_te);
printf("Creating te_thread 0\n");
LOG_I(PHY,"Creating te_thread %d\n",i);
pthread_create(&proc->tep[i].pthread_te, &proc->tep[i].attr_te, te_thread, (void*)&proc->tep[i]);
}
}
@@ -1605,6 +1604,16 @@ static void do_release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,ui
dlsch1_harq = dlsch1->harq_processes[harq_pid];
AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n");
#if T_TRACER
if (after_rounds != -1) {
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(dlsch0->rnti), T_INT(harq_pid));
} else {
T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(dlsch0->rnti), T_INT(harq_pid));
}
#endif
if (dlsch0_harq->round >= after_rounds) {
dlsch0_harq->status = SCH_IDLE;
/*if ((dlsch1_harq == NULL)||
@@ -1632,6 +1641,15 @@ static void do_release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,ui
dlsch1_harq = dlsch1->harq_processes[harq_pid];
AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n");
#if T_TRACER
if (after_rounds != -1) {
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(dlsch0->rnti), T_INT(harq_pid));
} else {
T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(dlsch0->rnti), T_INT(harq_pid));
}
#endif
if (dlsch0_harq->round >= after_rounds) {
dlsch0_harq->status = SCH_IDLE;
if ((dlsch1_harq == NULL)||
@@ -1754,22 +1772,6 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2-ulsch_harq->o_ACK[i];
// release DLSCH if needed
release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
#if T_TRACER
/* TODO: get correct harq pid */
{
int subframe_tx = (subframe+6)%10;
int frame_tx = subframe_tx >= 6 ? (frame+1023)%1024 : frame;
if (ulsch_harq->o_ACK[i] != 1) {
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx]));
} else {
T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx]));
}
}
#endif
}
}
else { // TDD
@@ -1858,21 +1860,6 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
// release DLSCH if needed
release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
#if T_TRACER
{
int subframe_tx = (subframe+6)%10;
int frame_tx = subframe_tx >= 6 ? (frame+1023)%1024 : frame;
if (harq_ack[0] != 1) {
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(uci->rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx]));
} else {
T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(uci->rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx]));
}
}
#endif
}
else if (uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
@@ -2042,16 +2029,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx;
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe));
/* TODO: use correct rxdata */
T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0),
T_BUFFER(&eNB->RU_list[0]->common.rxdata[0][subframe*eNB->frame_parms.samples_per_tti],
eNB->frame_parms.samples_per_tti * 4));
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 );
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe);
+29 -1
View File
@@ -150,6 +150,7 @@ static void *feptx_thread(void *param) {
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
if (oai_exit) break;
//stop_meas(&ru->ofdm_mod_wakeup_stats);
feptx0(ru,1);
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
@@ -247,7 +248,6 @@ void feptx_ofdm(RU_t *ru) {
// int CC_id = ru->proc.CC_id;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
slot_offset_F = 0;
slot_offset = subframe*fp->samples_per_tti;
@@ -455,6 +455,7 @@ static void *fep_thread(void *param) {
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
if (oai_exit) break;
//stop_meas(&ru->ofdm_demod_wakeup_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
fep0(ru,0);
@@ -504,6 +505,33 @@ void init_fep_thread(RU_t *ru,pthread_attr_t *attr_fep) {
}
extern void kill_fep_thread(RU_t *ru)
{
RU_proc_t *proc = &ru->proc;
pthread_mutex_lock( &proc->mutex_fep );
proc->instance_cnt_fep = 0;
pthread_cond_signal(&proc->cond_fep);
pthread_mutex_unlock( &proc->mutex_fep );
LOG_D(PHY, "Joining pthread_fep\n");
pthread_join(proc->pthread_fep, NULL);
pthread_mutex_destroy( &proc->mutex_fep );
pthread_cond_destroy( &proc->cond_fep );
}
extern void kill_feptx_thread(RU_t *ru)
{
RU_proc_t *proc = &ru->proc;
pthread_mutex_lock( &proc->mutex_feptx );
proc->instance_cnt_feptx = 0;
pthread_cond_signal(&proc->cond_feptx);
pthread_mutex_unlock( &proc->mutex_feptx );
LOG_D(PHY, "Joining pthread_feptx\n");
pthread_join(proc->pthread_feptx, NULL);
pthread_mutex_destroy( &proc->mutex_feptx );
pthread_cond_destroy( &proc->cond_feptx );
}
void ru_fep_full_2thread(RU_t *ru) {
RU_proc_t *proc = &ru->proc;
File diff suppressed because it is too large Load Diff
+9 -21
View File
@@ -67,6 +67,7 @@
#include "common/config/config_load_configmodule.h"
#include "PHY/INIT/phy_init.h"
void feptx_ofdm(RU_t *ru);
void feptx_prec(RU_t *ru);
@@ -83,6 +84,8 @@ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
int codingw = 0;
int emulate_rf = 0;
void handler(int sig)
{
void *array[10];
@@ -520,7 +523,7 @@ int main(int argc, char **argv)
int c;
int k,i,j,aa;
int re;
int loglvl=OAILOG_DEBUG;
int s,Kr,Kr_bytes;
@@ -998,7 +1001,7 @@ int main(int argc, char **argv)
break;
case 'L':
set_glog(atoi(optarg));
loglvl = atoi(optarg);
break;
case 'h':
@@ -1046,7 +1049,7 @@ int main(int argc, char **argv)
"cannot load configuration module, exiting\n");
logInit();
// enable these lines if you need debug info
set_glog(LOG_DEBUG);
set_glog(loglvl);
// moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt
@@ -2043,24 +2046,9 @@ int main(int argc, char **argv)
qsort (table_rx, time_vector_rx.size, sizeof(double), &compare);
if (dump_table == 1 ) {
set_component_filelog(USIM); // file located in /tmp/usim.txt
int n;
LOG_F(USIM,"The transmitter raw data: \n");
for (n=0; n< time_vector_tx.size; n++) {
printf("%f ", table_tx[n]);
LOG_F(USIM,"%f ", table_tx[n]);
}
LOG_F(USIM,"\n");
LOG_F(USIM,"The receiver raw data: \n");
for (n=0; n< time_vector_rx.size; n++) {
// printf("%f ", table_rx[n]);
LOG_F(USIM,"%f ", table_rx[n]);
}
LOG_F(USIM,"\n");
set_component_filelog(SIM); // file located in /tmp/usim.txt
LOG_UDUMPMSG(SIM,table_tx,time_vector_tx.size,LOG_DUMP_DOUBLE,"The transmitter raw data: \n");
LOG_UDUMPMSG(SIM,table_rx,time_vector_rx.size,LOG_DUMP_DOUBLE,"Thereceiver raw data: \n");
}
double tx_median = table_tx[time_vector_tx.size/2];
+4 -17
View File
@@ -5016,24 +5016,11 @@ int main(int argc, char **argv)
if (dump_table == 1 ) {
set_component_filelog(USIM); // file located in /tmp/usim.txt
int n;
LOG_F(USIM,"The transmitter raw data: \n");
LOG_UDUMPMSG(RRC,(char *)table_tx,time_vector_tx.size,LOG_DUMP_DOUBLE,
"The transmitter raw data: \n");
LOG_UDUMPMSG(RRC,(char *)table_rx,time_vector_rx.size,LOG_DUMP_DOUBLE,
"The receiver raw data: \n");
for (n=0; n< time_vector_tx.size; n++) {
printf("%f ", table_tx[n]);
LOG_F(USIM,"%f ", table_tx[n]);
}
LOG_F(USIM,"\n");
LOG_F(USIM,"The receiver raw data: \n");
for (n=0; n< time_vector_rx.size; n++) {
// printf("%f ", table_rx[n]);
LOG_F(USIM,"%f ", table_rx[n]);
}
LOG_F(USIM,"\n");
}
double tx_median = table_tx[time_vector_tx.size/2];
double tx_q1 = table_tx[time_vector_tx.size/4];
+3 -18
View File
@@ -3851,24 +3851,9 @@ PMI_FEEDBACK:
qsort (table_rx, time_vector_rx.size, sizeof(double), &compare);
if (dump_table == 1 ) {
set_component_filelog(USIM); // file located in /tmp/usim.txt
int n;
LOG_F(USIM,"The transmitter raw data: \n");
for (n=0; n< time_vector_tx.size; n++) {
printf("%f ", table_tx[n]);
LOG_F(USIM,"%f ", table_tx[n]);
}
LOG_F(USIM,"\n");
LOG_F(USIM,"The receiver raw data: \n");
for (n=0; n< time_vector_rx.size; n++) {
// printf("%f ", table_rx[n]);
LOG_F(USIM,"%f ", table_rx[n]);
}
LOG_F(USIM,"\n");
set_component_filelog(SIM); // file located in /tmp/usim.txt
LOG_UDUMPMSG(SIM,table_tx,time_vector_tx.size,LOG_DUMP_DOUBLE,"The transmitter raw data: \n");
LOG_UDUMPMSG(SIM,table_rx,time_vector_rx.size,LOG_DUMP_DOUBLE,"The receiver raw data: \n");
}
double tx_median = table_tx[time_vector_tx.size/2];
+2 -17
View File
@@ -1491,24 +1491,9 @@ int main(int argc, char **argv)
qsort (table_rx, time_vector_rx.size, sizeof(double), &compare);
if (dump_table == 1 ) {
int n;
set_component_filelog(SIM); // file located in /tmp/usim.txt
LOG_F(SIM,"The transmitter raw data: \n");
for (n=0; n< time_vector_tx.size; n++) {
// printf("%f ", table_tx[n]);
LOG_F(SIM,"%f ", table_tx[n]);
}
LOG_F(SIM,"\n");
LOG_F(SIM,"The receiver raw data: \n");
for (n=0; n< time_vector_rx.size; n++) {
// printf("%f ", table_rx[n]);
LOG_F(SIM,"%f ", table_rx[n]);
}
LOG_F(SIM,"\n");
LOG_UDUMPMSG(SIM,table_tx,time_vector_tx.size,LOG_DUMP_DOUBLE,"The transmitter raw data: \n");
LOG_UDUMPMSG(SIM,table_rx,time_vector_rx.size,LOG_DUMP_DOUBLE,"The receiver raw data: \n");
}
double tx_median = table_tx[time_vector_tx.size/2];