Commit ed83cbd1 authored by Xiwen JIANG's avatar Xiwen JIANG

TM7 dlsim works

parent 0d681a0e
......@@ -119,6 +119,7 @@ endmacro(add_list_string_option)
####################################################
# compilation flags
#############################################
set(CMAKE_BUILD_TYPE "Debug")
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
......@@ -406,7 +407,7 @@ include_directories ("${X2AP_DIR}")
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "OAI_BLADERF" "CPRIGW")
......@@ -819,6 +820,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/beamforming.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
......
......@@ -11,8 +11,8 @@ CFLAGS += -Wall -g -ggdb -Wstrict-prototypes -fno-strict-aliasing
CFLAGS += $(call cc-option,-mpreferred-stack-boundary=4)
#For performance, if some option doesn't exist in all gcc versions, use $(call cc-option,MY_OPTION)
CFLAGS += -O2
CFLAGS += -funroll-loops
#CFLAGS += -O2
#CFLAGS += -funroll-loops
CFLAGS += -Wno-packed-bitfield-compat
# This is the minimum CPU faetures for OAI
......
......@@ -77,7 +77,7 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
lte_frame_parms->nushift = Nid_cell%6;
lte_frame_parms->Ncp = Ncp;
lte_frame_parms->frame_type = frame_type;
lte_frame_parms->nb_antennas_tx_eNB = p_eNB;
lte_frame_parms->nb_antenna_ports_eNB = p_eNB;
lte_frame_parms->phich_config_common.phich_resource = phich_config->phich_resource;
lte_frame_parms->phich_config_common.phich_duration = phich_config->phich_duration;
}
......@@ -1262,8 +1262,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
phy_vars_eNB->physicalConfigDedicated[UE_id] = NULL;
}
phy_vars_eNB->first_run_I0_measurements =
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
phy_vars_eNB->first_run_I0_measurements = 1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
#ifndef USER_MODE
AssertFatal( frame_parms->nb_antennas_tx <= NB_ANTENNAS_TX, "nb_antennas_tx too large" );
......@@ -1275,24 +1274,57 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
if (abstraction_flag==0) {
// TX vars
eNB_common_vars->txdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*) );
eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16(frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
eNB_common_vars->txdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(mod_sym_t*));
eNB_common_vars->txdataF_BF[eNB_id] = (mod_sym_t ***)malloc16(frame_parms->nb_antennas_tx*sizeof(mod_sym_t**));
for (i=0; i<14; i++) {
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
eNB_id,i,eNB_common_vars->txdataF[eNB_id][i],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#endif
}
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
eNB_common_vars->txdataF_BF[eNB_id][i] = (mod_sym_t*)malloc16_clear( OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(mod_sym_t*) );
#ifdef USER_MODE
eNB_common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
#else // USER_MODE
#else // USER_MODE
eNB_common_vars->txdata[eNB_id][i] = TX_DMA_BUFFER[eNB_id][i];
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
#endif //USER_MODE
#endif // USER_MODE
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF_BF[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->txdataF_BF[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(mod_sym_t));
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]);
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
eNB_id,i,eNB_common_vars->txdataF[eNB_id][i],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#endif
}
for (i=0; i<2; i++) { // 2 is the total number of cell specific antenna ports
eNB_common_vars->cell_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j] = (int32_t*)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#ifdef DEBUG_PUY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->cell_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif
}
}
for (i=0; i<8; i++) { //antenna port 5 for TM7, antenna port 7-15 for TM8-10
eNB_common_vars->ue_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j] = (int32_t*)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#ifdef DEBUG_PUY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->ue_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif
}
}
// RX vars
eNB_common_vars->rxdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*) );
......
......@@ -728,7 +728,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// do ifft of channel estimate
for (aarx=0; aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx; aarx++)
for (p=0; p<phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB; p++) {
for (p=0; p<phy_vars_ue->lte_frame_parms.nb_antenna_ports_eNB; p++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
......
......@@ -453,7 +453,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// signal measurements
for (eNB_id=0; eNB_id<phy_vars_ue->n_connected_eNB; eNB_id++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx] =
(signal_energy_nodc(&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
(N_RB_DL*12)));
......
......@@ -84,7 +84,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
int16_t ul_ch_estimates_re,ul_ch_estimates_im;
int32_t rx_power_correction;
//uint8_t nb_antennas_rx = frame_parms->nb_antennas_tx_eNB;
//uint8_t nb_antennas_rx = frame_parms->nb_antenna_ports_eNB;
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
uint8_t cyclic_shift;
......@@ -678,7 +678,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
int T_SFC,aa;
int N_symb,symbol;
uint8_t nb_antennas_rx = frame_parms->nb_antennas_tx_eNB;
uint8_t nb_antennas_rx = frame_parms->nb_antenna_ports_eNB;
#ifdef DEBUG_SRS
char fname[40], vname[40];
#endif
......
This diff is collapsed.
This diff is collapsed.
......@@ -240,6 +240,8 @@ typedef struct {
typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
uint32_t *txdataF[8];
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
uint32_t **ue_spec_bf_weights[4];
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t rnti;
/// Active flag for baseband transmitter processing
......
......@@ -117,12 +117,13 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
}
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag)
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms)
{
LTE_eNB_DLSCH_t *dlsch;
unsigned char exit_flag = 0,i,j,r;
unsigned char exit_flag = 0,i,j,r,aa;
unsigned char bw_scaling =1;
uint8_t nb_antennas_tx = frame_parms->nb_antennas_tx;
switch (N_RB_DL) {
case 6:
......@@ -193,6 +194,15 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
exit_flag=3;
}
}
for (i=0; i<4; i++) {
dlsch->ue_spec_bf_weights[i] = (int32_t **)malloc16(nb_antennas_tx*sizeof(int32_t*));
dlsch->ue_spec_bf_weights[i] = (int32_t **)malloc16(nb_antennas_tx*sizeof(int32_t*));
for (aa=0; aa<nb_antennas_tx; aa++) {
dlsch->ue_spec_bf_weights[i][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
}
}
if (exit_flag==0) {
for (i=0; i<Mdlharq; i++) {
......
......@@ -163,7 +163,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
else
rballoc = dlsch0_harq->rb_alloc_even;
if (frame_parms->nb_antennas_tx_eNB>1 && beamforming_mode==0) {
if (frame_parms->nb_antenna_ports_eNB>1 && beamforming_mode==0) {
#ifdef DEBUG_DLSCH_MOD
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch_ue[0],dlsch0_harq->rb_alloc_even[0]);
#endif
......@@ -296,7 +296,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// in case of precoding we add an additional factor of two for the precoding gain
avgs = 0;
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++)
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
......@@ -304,7 +304,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2);
// + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits
// + log2_approx(frame_parms->nb_antenna_ports_eNB-1) //-1 because log2_approx counts the number of bits
// + log2_approx(frame_parms->nb_antennas_rx-1);
if ((dlsch0_harq->mimo_mode>=UNIFORM_PRECODING11) &&
......@@ -317,11 +317,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
Nb_tx*Nb_rx in TM2,4,5
Nb_tx^2*Nb_rx in TM6 */
/*
K = frame_parms->nb_antennas_rx*frame_parms->nb_antennas_tx_eNB; //that also covers TM1 since Nb_tx=1
K = frame_parms->nb_antennas_rx*frame_parms->nb_antenna_ports_eNB; //that also covers TM1 since Nb_tx=1
if ((dlsch0_harq->mimo_mode>=UNIFORM_PRECODING11) &&
(dlsch0_harq->mimo_mode< DUALSTREAM_UNIFORM_PRECODING1) &&
(dlsch0_harq->dl_power_off==1)) // we are in TM 6
K *= frame_parms->nb_antennas_tx_eNB;
K *= frame_parms->nb_antenna_ports_eNB;
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(K*avgs)/2);
*/
......@@ -332,7 +332,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
#endif
}
aatx = frame_parms->nb_antennas_tx_eNB;
aatx = frame_parms->nb_antenna_ports_eNB;
aarx = frame_parms->nb_antennas_rx;
if (dlsch0_harq->mimo_mode<LARGE_CDD) {// SISO or ALAMOUTI
......@@ -393,7 +393,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
}
} else if (dlsch0_harq->mimo_mode == LARGE_CDD) { // TM3
// LOG_I(PHY,"Running PDSCH RX for TM3\n");
if (frame_parms->nb_antennas_tx_eNB == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
if (first_symbol_flag==1) {
// effective channel of desired user is always stronger than interfering eff. channel
dlsch_channel_level_TM3(lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
......@@ -573,7 +573,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// printf("MRC\n");
if (frame_parms->nb_antennas_rx > 1) {
if (dlsch0_harq->mimo_mode == LARGE_CDD) {
if (frame_parms->nb_antennas_tx_eNB == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
dlsch_detection_mrc(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
......@@ -870,7 +870,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
pilots=1;
}
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = _mm_setzero_si128();
......@@ -1130,7 +1130,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
}
}
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
if (mod_order == 4) {
QAM_amp128 = vmovq_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = vmovq_n_s16(0);
......@@ -2643,7 +2643,7 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
if (frame_parms->nb_antennas_rx>1) {
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[(aatx<<1)][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[(aatx<<1)+1][symbol*frame_parms->N_RB_DL*12];
......@@ -2703,7 +2703,7 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
if (frame_parms->nb_antennas_rx>1) {
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
rxdataF_comp128_0 = (int16x8_t *)&rxdataF_comp[(aatx<<1)][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[(aatx<<1)+1][symbol*frame_parms->N_RB_DL*12];
......@@ -2785,7 +2785,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
......@@ -2829,7 +2829,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++)
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128D = _mm_setzero_si128();
......@@ -2886,7 +2886,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++)
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128D = vdupq_n_s32(0);
......@@ -3119,7 +3119,7 @@ void dlsch_channel_level_TM7(int **dl_bf_ch_estimates_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++)
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128D = _mm_setzero_si128();
......@@ -4931,7 +4931,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
}
if (phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB == 2) {
if (phy_vars_ue->lte_frame_parms.nb_antenna_ports_eNB == 2) {
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
......@@ -4959,7 +4959,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
if (phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB == 2) {
if (phy_vars_ue->lte_frame_parms.nb_antenna_ports_eNB == 2) {
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
......
......@@ -163,7 +163,7 @@ char phich_resource[6];
if (pbch_decoded) {
frame_parms->nb_antennas_tx_eNB = pbch_tx_ant;
frame_parms->nb_antenna_ports_eNB = pbch_tx_ant;
// set initial transmission mode to 1 or 2 depending on number of detected TX antennas
frame_parms->mode1_flag = (pbch_tx_ant==1);
......@@ -566,7 +566,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
phy_vars_ue->lte_frame_parms.N_RB_DL,
phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration,
phich_string[phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource],
phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB);
phy_vars_ue->lte_frame_parms.nb_antenna_ports_eNB);
#if defined(OAI_USRP) || defined(EXMIMO)
LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
phy_vars_ue->Mod_id,
......
......@@ -200,7 +200,7 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
/*
// scramble crc with PBCH CRC mask (Table 5.3.1.1-1 of 3GPP 36.212-860)
switch (frame_parms->nb_antennas_tx_eNB) {
switch (frame_parms->nb_antenna_ports_eNB) {
case 1:
crc = crc ^ (uint16_t) 0;
break;
......@@ -232,7 +232,7 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
if (frame_parms->mode1_flag == 1)
amask = 0x0000;
else {
switch (frame_parms->nb_antennas_tx_eNB) {
switch (frame_parms->nb_antenna_ports_eNB) {
case 1:
amask = 0x0000;
break;
......@@ -492,7 +492,7 @@ uint16_t pbch_extract(int **rxdataF,
}
}
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antennas_tx_eNB;aatx++) {
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antenna_ports_eNB;aatx++) {
if (high_speed_flag == 1)
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
else
......@@ -554,7 +554,7 @@ int pbch_channel_level(int **dl_ch_estimates_ext,
uint32_t nsymb = (frame_parms->Ncp==0) ? 7:6;
uint32_t symbol_mod = symbol % nsymb;
for (aatx=0; aatx<4; aatx++) //frame_parms->nb_antennas_tx_eNB;aatx++)
for (aatx=0; aatx<4; aatx++) //frame_parms->nb_antenna_ports_eNB;aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level
......@@ -624,7 +624,7 @@ void pbch_channel_compensation(int **rxdataF_ext,
#endif
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
for (aatx=0; aatx<4; aatx++) //frame_parms->nb_antennas_tx_eNB;aatx++)
for (aatx=0; aatx<4; aatx++) //frame_parms->nb_antenna_ports_eNB;aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
#if defined(__x86_64__) || defined(__i386__)
......@@ -731,7 +731,7 @@ void pbch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if (frame_parms->nb_antennas_rx>1) {
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antennas_tx_eNB;aatx++) {
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antenna_ports_eNB;aatx++) {
#if defined(__x86_64__) || defined(__i386__)
rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[(aatx<<1)][symbol_mod*6*12];
rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[(aatx<<1)+1][symbol_mod*6*12];
......@@ -1077,7 +1077,7 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
if (pbch_phase == (phy_vars_ue->frame_rx % 4)) {
if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx_eNB);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antenna_ports_eNB);
} else
return(-1);
} else
......
......@@ -217,7 +217,7 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
if ((i!=nushiftmod3)&&(i!=(nushiftmod3+3))) {
txdataF[0][symbol_offset+reg_offset+i] = pcfich_d[0][m];
if (frame_parms->nb_antennas_tx_eNB>1)
if (frame_parms->nb_antenna_ports_eNB>1)
txdataF[1][symbol_offset+reg_offset+i] = pcfich_d[1][m];
m++;
......
......@@ -70,7 +70,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
// printf("tti %d : offset %d (slot %d)\n",tti,tti_offset,slot_offset);
//Generate Pilots
//antenna 0 symbol 0 slot 0
//antenna port 0 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[0][tti_offset],
amp,
slot_offset,
......@@ -79,7 +79,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
// printf("tti %d : second_pilot offset %d \n",tti,tti_offset+(second_pilot*samples_per_symbol));
//antenna 0 symbol 3/4 slot 0
//antenna port 0 symbol 3/4 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[0][tti_offset+(second_pilot*samples_per_symbol)],
amp,
slot_offset,
......@@ -87,7 +87,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
0);
// printf("tti %d : third_pilot offset %d \n",tti,tti_offset+((Nsymb>>1)*samples_per_symbol));
//antenna 0 symbol 0 slot 1
//antenna port 0 symbol 0 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[0][tti_offset+((Nsymb>>1)*samples_per_symbol)],
amp,
1+slot_offset,
......@@ -95,7 +95,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
0);
// printf("tti %d : third_pilot offset %d \n",tti,tti_offset+(((Nsymb>>1)+second_pilot)*samples_per_symbol));
//antenna 0 symbol 3/4 slot 1
//antenna port 0 symbol 3/4 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[0][tti_offset+(((Nsymb>>1)+second_pilot)*samples_per_symbol)],
amp,
1+slot_offset,
......@@ -103,66 +103,35 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
0);
if (frame_parms->nb_antennas_tx > 1) {
if (frame_parms->mode1_flag) {
// antenna 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset],
amp,
slot_offset,
0,
0);
// antenna 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(second_pilot*samples_per_symbol)],
amp,
slot_offset,
1,
0);
if (frame_parms->nb_antenna_ports_eNB > 1) {
//antenna 1 symbol 0 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(Nsymb>>1)*samples_per_symbol],
amp,
1+slot_offset,
0,
0);
// antenna 1 symbol 3 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(((Nsymb>>1)+second_pilot)*samples_per_symbol)],
amp,
1+slot_offset,
1,
0);
} else {
// antenna 1 symbol 0 slot 0
// antenna port 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset],
amp,
slot_offset,
0,
1);
// antenna 1 symbol 3 slot 0
// antenna port 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(second_pilot*samples_per_symbol)],
amp,
slot_offset,
1,
1);
//antenna 1 symbol 0 slot 1
//antenna port 1 symbol 0 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(Nsymb>>1)*samples_per_symbol],
amp,
1+slot_offset,
0,
1);
// antenna 1 symbol 3 slot 1
// antenna port 1 symbol 3 slot 1
lte_dl_cell_spec(phy_vars_eNB,&txdataF[1][tti_offset+(((Nsymb>>1)+second_pilot)*samples_per_symbol)],
amp,
1+slot_offset,
1,
1);
}
}
}
}
......@@ -193,7 +162,7 @@ int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
// printf("tti %d : offset %d (slot %d)\n",tti,tti_offset,slot_offset);
//Generate Pilots
//antenna 0 symbol 0 slot 0
//antenna port 0 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[0][slot_offset],
amp,
......@@ -212,44 +181,24 @@ int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
0);
}
if (frame_parms->nb_antennas_tx > 1) {
if (frame_parms->mode1_flag) {
// antenna 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset],
amp,
slot,
0,
0);
if (frame_parms->nb_antenna_ports_eNB > 1) {
if (first_pilot_only==0) {
// antenna 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
1,
0);
}
} else {
// antenna port 1 symbol 0 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset],
amp,
slot,
0,
1);
// antenna 1 symbol 0 slot 0
if (first_pilot_only == 0) {
// antenna port 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset],
&txdataF[1][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
0,
1,
1);
if (first_pilot_only == 0) {
// antenna 1 symbol 3 slot 0
lte_dl_cell_spec(phy_vars_eNB,
&txdataF[1][slot_offset+(second_pilot*samples_per_symbol)],
amp,
slot,
1,
1);
}
}
}
......
......@@ -63,8 +63,10 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
@params N_RB_DL total number of resource blocks (determine the operating BW)
@param abstraction_flag Flag to indicate abstracted interface
@param nb_antenna_tx number of physical transmit antennas at eNB
*/
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, uint8_t abstraction_flag);
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t
N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms);
/** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
\brief This function frees memory allocated for a particular DLSCH at UE
......@@ -157,7 +159,6 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
\param skip_half indicate that first or second half of RB must be skipped for PBCH/PSS/SSS
\param ue_spec_rs UE specific RS indicator
\param nb_antennas_tx_phy Physical antenna elements which can be different with antenna port number, especially in beamforming case
\param beamforming_weights_rb Beamforming weights applied on each antenna element and each carrier in case of TM7-10
\param use2ndpilots Set to use the pilots from antenna port 1 for PDSCH
\param frame_parms Frame parameter descriptor
*/
......@@ -168,8 +169,8 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
uint32_t *jj2,
uint16_t re_offset,
uint32_t symbol_offset,
LTE_DL_eNB_HARQ_t *dlsch0_harq,
LTE_DL_eNB_HARQ_t *dlsch1_harq,
LTE_eNB_DLSCH_t *dlsch0,
LTE_eNB_DLSCH_t *dlsch1,
uint8_t pilots,
int16_t amp,
uint8_t precoder_index,
......@@ -178,10 +179,9 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
uint32_t *re_allocated,
uint8_t skip_dc,
uint8_t skip_half,
uint8_t lprime,
uint8_t mprime,
uint8_t Ns,
int32_t **beamforming_weights);
uint8_t lprime,
uint8_t mprime,
uint8_t Ns);
/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF,
int16_t amp,
......@@ -198,8 +198,6 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
@param dlsch0 Pointer to Transport Block 0 DLSCH descriptor for this allocation
@param dlsch1 Pointer to Transport Block 0 DLSCH descriptor for this allocation
@param nb_antennas_tx_phy Physical antenna elements which can be different with antenna port number, especially in beamforming case
@param beamforming_weights Beamforming weights applied on each antenna element and each carrier in case of TM7-10
*/
int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
mod_sym_t **txdataF,
......@@ -207,8 +205,7 @@ int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
uint32_t sub_frame_offset,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch0,
LTE_eNB_DLSCH_t *dlsch1,
int32_t **beamforming_weights);
LTE_eNB_DLSCH_t *dlsch1);
/*
\brief This function is the top-level routine for generation of the sub-frame signal (frequency-domain) for MCH.
@param txdataF Table of pointers for frequency-domain TX signals
......@@ -331,6 +328,41 @@ int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch,
int32_t generate_pbch_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t *pbch_pdu);
/** \brief This function performs UE specific beamforming especially for
* transmission mode TM7-10
@param txdataF Table of pointers for frequency-domain TX signals
@param txdataF_BF Table of pointers for frequency-domain TX signals
after beamforming
@param frame_parms Frame descriptor structure
@param ue_spec_bf_weights UE specific beamforming weights applied on
each antenna element and each carrier
@param slot Slot number
@param symbol Symbol index on which to act*/
int ue_spec_beamforming(int32_t **txdataF,
int32_t **txdataF_BF,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t ***ue_spec_bf_weights,
int slot,