Commit f79dd53e authored by Gabriel's avatar Gabriel

Merge remote-tracking branch 'origin/feature-21-TM7-tmp' into develop_integration_w50

parents 089eb06a e470e2d3
...@@ -119,6 +119,7 @@ endmacro(add_list_string_option) ...@@ -119,6 +119,7 @@ endmacro(add_list_string_option)
#################################################### ####################################################
# compilation flags # compilation flags
############################################# #############################################
#set(CMAKE_BUILD_TYPE "Debug")
if (CMAKE_BUILD_TYPE STREQUAL "") if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo") set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif() endif()
...@@ -476,7 +477,7 @@ include_directories ("${X2AP_DIR}") ...@@ -476,7 +477,7 @@ include_directories ("${X2AP_DIR}")
# Hardware dependant options # Hardware dependant options
################################### ###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4") 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_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR") add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
...@@ -1070,11 +1071,14 @@ set(PHY_SRC ...@@ -1070,11 +1071,14 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c ${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c
${OPENAIR1_DIR}/PHY/MODULATION/beamforming.c
${OPENAIR1_DIR}/PHY/MODULATION/compute_bf_weights.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_est_freq_offset.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
...@@ -1967,7 +1971,7 @@ target_link_libraries (oaisim_nos1 ${T_LIB}) ...@@ -1967,7 +1971,7 @@ target_link_libraries (oaisim_nos1 ${T_LIB})
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
##################################### #####################################
foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim) foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
add_executable(${myExe} add_executable(${myExe}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
...@@ -2049,6 +2053,7 @@ if (${T_TRACER}) ...@@ -2049,6 +2053,7 @@ if (${T_TRACER})
add_dependencies(oaisim generate_T) add_dependencies(oaisim generate_T)
add_dependencies(oaisim_nos1 generate_T) add_dependencies(oaisim_nos1 generate_T)
add_dependencies(dlsim generate_T) add_dependencies(dlsim generate_T)
add_dependencies(dlsim_tm7 generate_T)
add_dependencies(ulsim generate_T) add_dependencies(ulsim generate_T)
add_dependencies(pbchsim generate_T) add_dependencies(pbchsim generate_T)
add_dependencies(scansim generate_T) add_dependencies(scansim generate_T)
......
...@@ -335,7 +335,7 @@ function main() { ...@@ -335,7 +335,7 @@ function main() {
#By default: EXMIMO: enable #By default: EXMIMO: enable
if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
if [ "$HW" = "EXMIMO" ] ; then if [ "$HW" = "EXMIMO" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="False" DEADLINE_SCHEDULER_FLAG_USER="True"
elif [ "$HW" = "ETHERNET" ] ; then elif [ "$HW" = "ETHERNET" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="False" DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_USRP" ] ; then elif [ "$HW" = "OAI_USRP" ] ; then
......
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False ) set ( ADDR_CONF False )
set ( DEBUG_OMG False ) set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False ) set ( DISABLE_XER_PRINT False )
......
...@@ -5,14 +5,14 @@ linux := $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi) ...@@ -5,14 +5,14 @@ linux := $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
CFLAGS += -std=gnu99 CFLAGS += -std=gnu99
#CFLAGS += -Wall -g -ggdb -Wstrict-prototypes -fno-strict-aliasing CFLAGS += -Wall -g -ggdb -Wstrict-prototypes -fno-strict-aliasing
# Need to force this option because default kernel module builder is wrong # Need to force this option because default kernel module builder is wrong
CFLAGS += $(call cc-option,-mpreferred-stack-boundary=4) 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) #For performance, if some option doesn't exist in all gcc versions, use $(call cc-option,MY_OPTION)
CFLAGS += -O2 #CFLAGS += -O2
CFLAGS += -funroll-loops #CFLAGS += -funroll-loops
CFLAGS += -Wno-packed-bitfield-compat CFLAGS += -Wno-packed-bitfield-compat
# This is the minimum CPU faetures for OAI # This is the minimum CPU faetures for OAI
......
...@@ -304,7 +304,8 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms); ...@@ -304,7 +304,8 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing); //void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);
void lte_param_init(unsigned char N_tx, void lte_param_init(unsigned char N_tx_port_eNB,
unsigned char N_tx,
unsigned char N_rx, unsigned char N_rx,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
...@@ -339,7 +340,8 @@ void phy_cleanup(void); ...@@ -339,7 +340,8 @@ void phy_cleanup(void);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
void lte_param_init(unsigned char N_tx, void lte_param_init(unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
unsigned char N_rx, unsigned char N_rx,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
...@@ -350,7 +352,6 @@ void lte_param_init(unsigned char N_tx, ...@@ -350,7 +352,6 @@ void lte_param_init(unsigned char N_tx,
uint8_t threequarter_fs, uint8_t threequarter_fs,
uint8_t osf, uint8_t osf,
uint32_t perfect_ce); uint32_t perfect_ce);
/** @} */ /** @} */
#endif #endif
...@@ -46,13 +46,12 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *fp, ...@@ -46,13 +46,12 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *fp,
uint8_t p_eNB, uint8_t p_eNB,
PHICH_CONFIG_COMMON *phich_config) PHICH_CONFIG_COMMON *phich_config)
{ {
fp->N_RB_DL = N_RB_DL; fp->N_RB_DL = N_RB_DL;
fp->Nid_cell = Nid_cell; fp->Nid_cell = Nid_cell;
fp->nushift = Nid_cell%6; fp->nushift = Nid_cell%6;
fp->Ncp = Ncp; fp->Ncp = Ncp;
fp->frame_type = frame_type; fp->frame_type = frame_type;
fp->nb_antennas_tx_eNB = p_eNB; fp->nb_antenna_ports_eNB = p_eNB;
fp->phich_config_common.phich_resource = phich_config->phich_resource; fp->phich_config_common.phich_resource = phich_config->phich_resource;
fp->phich_config_common.phich_duration = phich_config->phich_duration; fp->phich_config_common.phich_duration = phich_config->phich_duration;
} }
...@@ -684,6 +683,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, ...@@ -684,6 +683,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
eNB->transmission_mode[UE_id] = 6; eNB->transmission_mode[UE_id] = 6;
break; break;
case AntennaInfoDedicated__transmissionMode_tm7: case AntennaInfoDedicated__transmissionMode_tm7:
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
eNB->transmission_mode[UE_id] = 7; eNB->transmission_mode[UE_id] = 7;
break; break;
default: default:
...@@ -835,7 +835,6 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -835,7 +835,6 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
if (physicalConfigDedicated->antennaInfo) { if (physicalConfigDedicated->antennaInfo) {
phy_vars_ue->transmission_mode[eNB_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode); phy_vars_ue->transmission_mode[eNB_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
LOG_D(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]); LOG_D(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]);
LOG_D(PHY,"\n");
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) { switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
case AntennaInfoDedicated__transmissionMode_tm1: case AntennaInfoDedicated__transmissionMode_tm1:
phy_vars_ue->transmission_mode[eNB_id] = 1; phy_vars_ue->transmission_mode[eNB_id] = 1;
...@@ -856,6 +855,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -856,6 +855,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->transmission_mode[eNB_id] = 6; phy_vars_ue->transmission_mode[eNB_id] = 6;
break; break;
case AntennaInfoDedicated__transmissionMode_tm7: case AntennaInfoDedicated__transmissionMode_tm7:
lte_gold_ue_spec_port5(phy_vars_ue->lte_gold_uespec_port5_table, phy_vars_ue->frame_parms.Nid_cell, phy_vars_ue->pdcch_vars[eNB_id]->crnti);
phy_vars_ue->transmission_mode[eNB_id] = 7; phy_vars_ue->transmission_mode[eNB_id] = 7;
break; break;
default: default:
...@@ -1018,14 +1018,17 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS ...@@ -1018,14 +1018,17 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) ); pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV // FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->rxdataF_uespec_pilots = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) ); pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_bf_ch_estimates = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_bf_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// the allocated memory size is fixed: // the allocated memory size is fixed:
AssertFatal( fp->nb_antennas_rx <= 2, "nb_antennas_rx > 2" ); AssertFatal( fp->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
...@@ -1036,13 +1039,16 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS ...@@ -1036,13 +1039,16 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
for (int j=0; j<4; j++) { //fp->nb_antennas_tx; j++) for (int j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
const int idx = (j<<1)+i; const int idx = (j<<1)+i;
const size_t num = 7*2*fp->N_RB_DL*12; const size_t num = 7*2*fp->N_RB_DL*12;
pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_uespec_pilots[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * fp->N_RB_DL*12);
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_bf_ch_estimates[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2);
pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
} }
} }
} }
...@@ -1257,6 +1263,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1257,6 +1263,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LTE_eNB_SRS* const srs_vars = eNB->srs_vars; LTE_eNB_SRS* const srs_vars = eNB->srs_vars;
LTE_eNB_PRACH* const prach_vars = &eNB->prach_vars; LTE_eNB_PRACH* const prach_vars = &eNB->prach_vars;
int i, j, eNB_id, UE_id; int i, j, eNB_id, UE_id;
int re;
eNB->total_dlsch_bitrate = 0; eNB->total_dlsch_bitrate = 0;
eNB->total_transmitted_bits = 0; eNB->total_transmitted_bits = 0;
...@@ -1283,9 +1290,9 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1283,9 +1290,9 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB->physicalConfigDedicated[UE_id] = NULL; eNB->physicalConfigDedicated[UE_id] = NULL;
} }
eNB->first_run_I0_measurements = 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.
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.
} }
// for (eNB_id=0; eNB_id<3; eNB_id++) { // for (eNB_id=0; eNB_id<3; eNB_id++) {
{ {
eNB_id=0; eNB_id=0;
...@@ -1293,39 +1300,72 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1293,39 +1300,72 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// TX vars // TX vars
if (eNB->node_function != NGFI_RCC_IF4p5) if (eNB->node_function != NGFI_RCC_IF4p5)
common_vars->txdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) ); common_vars->txdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
common_vars->txdataF[eNB_id] = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) ); common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
for (i=0; i<14; i++) {
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
eNB_id,i,common_vars->txdataF[eNB_id][i],
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
#endif
}
for (i=0; i<fp->nb_antennas_tx; i++) { for (i=0; i<fp->nb_antennas_tx; i++) {
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
if (eNB->node_function != NGFI_RCC_IF4p5) if (eNB->node_function != NGFI_RCC_IF4p5)
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) ); common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear(fp->samples_per_tti*10*sizeof(int32_t) );
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]); msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF_BF[%d][%d] = %p (%d bytes)\n",
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%d bytes)\n", eNB_id,i,common_vars->txdataF_BF[eNB_id][i],
eNB_id,i,common_vars->txdataF[eNB_id][i], fp->ofdm_symbol_size*sizeof(int32_t));
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t)); msg("[openair][LTE_PHY][INIT] lte_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]);
#endif #endif
} }
for (i=0; i<14; i++) { // 14 is the total number of antenna ports
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<fp->nb_antennas_tx; j++) {
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
// antenna ports 0-3 are mapped on antennas 0-3
// antenna port 4 is mapped on antenna 0
// antenna ports 5-14 are mapped on all antennas
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
for (re=0; re<fp->ofdm_symbol_size; re++)
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
}
else if (i>4) {
for (re=0; re<fp->ofdm_symbol_size; re++)
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
}
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
fp->ofdm_symbol_size*sizeof(int32_t));
#endif
}
}
// RX vars // RX vars
if (eNB->node_function != NGFI_RCC_IF4p5) { if (eNB->node_function != NGFI_RCC_IF4p5) {
common_vars->rxdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); common_vars->rxdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
} }
common_vars->rxdataF[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); common_vars->rxdataF[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<fp->nb_antennas_rx; i++) { for (i=0; i<fp->nb_antennas_rx; i++) {
if (eNB->node_function != NGFI_RCC_IF4p5) { if (eNB->node_function != NGFI_RCC_IF4p5) {
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) ); common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) ); common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) );
}
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]); printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]);
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]); printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]);
#endif #endif
}
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
} }
if (eNB->node_function != NGFI_RRU_IF4p5) { if (eNB->node_function != NGFI_RRU_IF4p5) {
...@@ -1465,5 +1505,5 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1465,5 +1505,5 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
} // node_function != NGFI_RRU_IF4p5 } // node_function != NGFI_RRU_IF4p5
return (0); return (0);
}
}
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx, void lte_param_init(unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
unsigned char N_rx, unsigned char N_rx,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
...@@ -70,9 +71,9 @@ void lte_param_init(unsigned char N_tx, ...@@ -70,9 +71,9 @@ void lte_param_init(unsigned char N_tx,
frame_parms->Ncp_UL = extended_prefix_flag; frame_parms->Ncp_UL = extended_prefix_flag;
frame_parms->Nid_cell = Nid_cell; frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6; frame_parms->nushift = Nid_cell%6;
frame_parms->nb_antennas_tx = N_tx; frame_parms->nb_antennas_tx = N_tx_phy;
frame_parms->nb_antennas_rx = N_rx; frame_parms->nb_antennas_rx = N_rx;
frame_parms->nb_antennas_tx_eNB = N_tx; frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
frame_parms->phich_config_common.phich_resource = oneSixth; frame_parms->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal; frame_parms->phich_config_common.phich_duration = normal;
frame_parms->tdd_config = tdd_config; frame_parms->tdd_config = tdd_config;
...@@ -81,7 +82,7 @@ void lte_param_init(unsigned char N_tx, ...@@ -81,7 +82,7 @@ void lte_param_init(unsigned char N_tx,
// frame_parms->Bsrs = 0; // frame_parms->Bsrs = 0;
// frame_parms->kTC = 0;44 // frame_parms->kTC = 0;44
// frame_parms->n_RRC = 0; // frame_parms->n_RRC = 0;
frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; frame_parms->mode1_flag = (transmission_mode == 1 || transmission_mode ==7)? 1 : 0;
init_frame_parms(frame_parms,osf); init_frame_parms(frame_parms,osf);
...@@ -93,6 +94,9 @@ void lte_param_init(unsigned char N_tx, ...@@ -93,6 +94,9 @@ void lte_param_init(unsigned char N_tx,
UE->frame_parms = *frame_parms; UE->frame_parms = *frame_parms;
eNB->frame_parms = *frame_parms; eNB->frame_parms = *frame_parms;
eNB->transmission_mode[0] = transmission_mode;
UE->transmission_mode[0] = transmission_mode;
phy_init_lte_top(frame_parms); phy_init_lte_top(frame_parms);
dump_frame_parms(frame_parms); dump_frame_parms(frame_parms);
...@@ -110,7 +114,8 @@ void lte_param_init(unsigned char N_tx, ...@@ -110,7 +114,8 @@ void lte_param_init(unsigned char N_tx,
generate_phich_reg_mapping(&UE->frame_parms); generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init // DL power control init
if (transmission_mode == 1) { //if (transmission_mode == 1) {
if (transmission_mode == 1 || transmission_mode ==7) {
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 0; ((eNB->frame_parms).pdsch_config_common).p_b = 0;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
......
...@@ -184,7 +184,7 @@ void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) ...@@ -184,7 +184,7 @@ void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms)
printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config); printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S); printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag); printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
printf("frame_parms->nb_antennas_tx_eNB(nb_antenna_ports)=%d\n",frame_parms->nb_antennas_tx_eNB); printf("frame_parms->nb_antenna_ports_eNB=%d\n",frame_parms->nb_antenna_ports_eNB);
printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx); printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx); printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
printf("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size); printf("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size);
......
filt_len = 16;
F = -3/4:1/4:7/4;
F_l = zeros(8,filt_len);
F_r = zeros(8,filt_len);
F_m = zeros(8,filt_len);
F2 =-3/5:1/5:8/5;
for i=0:3
F_l(i+1,:) = floor(16384*[F(8+i:-1:4) zeros(1,7-i) zeros(1,4)]);
F_r(i+1,:) = floor(16384*[zeros(1,4+i) F(4:end-i) zeros(1,4)]);
F_m(i+1,:) = floor(16384*[F(4-i:8) F(7:-1:1+i) zeros(1,4)]);
end
for i=0:1
F_l(i+5,:) = floor(16384*[F(8:-1:4-i) zeros(1,7-i) zeros(1,4)]);
F_r(i+5,:) = floor(16384*[zeros(1,5+i) F2(5+i) F2(7:end-i) zeros(1,4)]);
F_m(i+5,:) = floor(16384*[F(4-i:8) F2(8-i) F2(6:-1:1+i) zeros(1,4)]);
end
for i=2:3
F_l(i+5,:) = floor(16384*[F2(end:-1:7) F2(8-i) zeros(1,5) zeros(1,4)]);
F_r(i+5,:) = floor(16384*[zeros(1,4+i) F(4:end-i) zeros(1,4)]);
F_m(i+5,:) = floor(16384*[F2(4-i:6) F2(4+i) F(8:-1:1+i) zeros(1,4)]);
end
fd = fopen("filt16_32.h","w");
for i=0:3
fprintf(fd,"short filt%d_l%d[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_l(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_l(i+1,end));
fprintf(fd,"short filt%d_r%d[%d] = {\n",filt_len,i,filt_len);