Commit 8073aefe authored by knopp's avatar knopp
Browse files

applied patches from S. Held, addition of scansim.c and PHY files for UE band scanning

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6475 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2ff16039
......@@ -350,7 +350,7 @@ int itti_send_broadcast_message(MessageDef *message_p) {
return ret;
}
inline MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds message_id, MessageHeaderSize size)
MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds message_id, MessageHeaderSize size)
{
MessageDef *temp = NULL;
......@@ -379,7 +379,7 @@ inline MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, Messag
return temp;
}
inline MessageDef *itti_alloc_new_message(task_id_t origin_task_id, MessagesIds message_id)
MessageDef *itti_alloc_new_message(task_id_t origin_task_id, MessagesIds message_id)
{
return itti_alloc_new_message_sized(origin_task_id, message_id, itti_desc.messages_info[message_id].size);
}
......
......@@ -204,7 +204,7 @@ const char *itti_get_task_name(task_id_t task_id);
* \param message_id Message ID
* @returns NULL in case of failure or newly allocated mesage ref
**/
inline MessageDef *itti_alloc_new_message(
MessageDef *itti_alloc_new_message(
task_id_t origin_task_id,
MessagesIds message_id);
......@@ -214,7 +214,7 @@ inline MessageDef *itti_alloc_new_message(
* \param size size of the payload to send
* @returns NULL in case of failure or newly allocated mesage ref
**/
inline MessageDef *itti_alloc_new_message_sized(
MessageDef *itti_alloc_new_message_sized(
task_id_t origin_task_id,
MessagesIds message_id,
MessageHeaderSize size);
......
......@@ -179,7 +179,7 @@ TAB_SIZE = 8
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
ALIASES += vr{1}="\details Value range: \1\n"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
......
......@@ -62,14 +62,14 @@ struct treillis {
struct treillis all_treillis[8][256];
int all_treillis_initialized=0;
inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) {
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) {
unsigned char output;
output = (input ^ (*state>>2) ^ (*state>>1))&1;
*state = (((input<<2)^(*state>>1))^((*state>>1)<<2)^((*state)<<2))&7;
return(output);
}
inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state) {
static inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state) {
*z = ((*state>>2) ^ (*state)) &1;
*x = ((*state) ^ (*state>>1)) &1;
*state = (*state)>>1;
......
......@@ -29,12 +29,12 @@
extern unsigned int threegpplte_interleaver_output;
extern unsigned int threegpplte_interleaver_tmp;
extern inline void threegpplte_interleaver_reset(void) {
static inline void threegpplte_interleaver_reset(void) {
threegpplte_interleaver_output = 0;
threegpplte_interleaver_tmp = 0;
}
extern inline unsigned short threegpplte_interleaver(unsigned short f1,
static inline unsigned short threegpplte_interleaver(unsigned short f1,
unsigned short f2,
unsigned short K) {
......@@ -49,7 +49,7 @@ extern inline unsigned short threegpplte_interleaver(unsigned short f1,
}
extern inline short threegpp_interleaver_parameters(unsigned short bytes_per_codeword) {
static inline short threegpp_interleaver_parameters(unsigned short bytes_per_codeword) {
if (bytes_per_codeword<=64)
return (bytes_per_codeword-5);
else if (bytes_per_codeword <=128)
......
......@@ -46,7 +46,7 @@ unsigned int ps0, ps1, ps2, pb;
*/
//
inline void pset_taus_seed(unsigned int off) {
static inline void pset_taus_seed(unsigned int off) {
ps0 = (unsigned int)0x1e23d852 + (off<<4);
......@@ -55,7 +55,7 @@ inline void pset_taus_seed(unsigned int off) {
}
inline unsigned int ptaus(void) {
static inline unsigned int ptaus(void) {
pb = (((ps0 << 13) ^ ps0) >> 19);
ps0 = (((ps0 & 0xFFFFFFFE) << 12)^ pb);
......
......@@ -67,30 +67,37 @@ int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);
/*!
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation
@param phy_vars_ue Pointer to UE Variables
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation.
\details Only a subset of phy_vars_ue is initialized.
@param[out] phy_vars_ue Pointer to UE Variables
@param nb_connected_eNB Number of eNB that UE can process in one PDSCH demodulation subframe
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
*/
int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
int nb_connected_eNB,
uint8_t abstraction_flag);
/*!
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation (eNB)
@param phy_vars_eNb Pointer to eNB Variables
\brief Allocate and initialize the PHY variables relevant to the LTE implementation (eNB).
\details Only a subset of phy_vars_eNb is initialized.
@param[out] phy_vars_eNb Pointer to eNB Variables
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
@param cooperation_flag
@param cooperation_flag 0 for no cooperation, 1 for Delay Diversity and 2 for Distributed Alamouti
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
*/
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
unsigned char is_secondary_eNb,
unsigned char cooperation_flag,
unsigned char abstraction_flag);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch). The basically allows configuration of \f$N_{\mathrm{RB}}^{\mathrm{DL}}\f$, the cell id \f$N_{\mathrm{ID}}^{\mathrm{cell}}\f$, the normal/extended prefix mode, the frame type (FDD/TDD), \f$N_{\mathrm{cp}}\f$, the number of TX antennas at eNB (\f$p\f$) and the number of PHICH groups, \f$N_{\mathrm{group}}^{\mathrm{PHICH}}\f$
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch).
\details The basically allows configuration of \f$N_{\mathrm{RB}}^{\mathrm{DL}}\f$, the cell id \f$N_{\mathrm{ID}}^{\mathrm{cell}}\f$, the normal/extended prefix mode, the frame type (FDD/TDD), \f$N_{\mathrm{cp}}\f$, the number of TX antennas at eNB (\f$p\f$) and the number of PHICH groups, \f$N_{\mathrm{group}}^{\mathrm{PHICH}}\f$
@param lte_frame_parms pointer to LTE parameter structure
@param N_RB_DL Number of DL resource blocks
@param Nid_cell Cell ID
......@@ -108,7 +115,8 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
PHICH_CONFIG_COMMON *phich_config);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1. From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.
\details From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of eNB
@param CC_id Component Carrier index
@param tdd_Config TDD UL/DL and S-subframe configurations
......@@ -120,7 +128,8 @@ void phy_config_sib1_eNB(module_id_t Mod_id,
uint8_t SIwindowsize,
uint16_t SIperiod);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1. From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.
\details From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of UE
@param CC_id Component Carrier index
@param CH_index Index of eNB for this configuration
......@@ -205,7 +214,8 @@ void phy_config_sib2_eNB(module_id_t Mod_id,
/*!
\fn void phy_config_dedicated_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Configure UE dedicated parameters. Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
\brief Configure UE dedicated parameters.
\details Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param CH_index Index of eNB for this configuration
......@@ -219,7 +229,8 @@ void phy_config_dedicated_ue(module_id_t Mod_id,
/**
\brief Configure UE MBSFN common parameters. Invoked upon reception of SIB13 from eNB.
\brief Configure UE MBSFN common parameters.
\details Invoked upon reception of SIB13 from eNB.
@param Mod_id Instance ID for UE
@param CC_id Component Carrier Index
@param CH_index eNB id (for multiple eNB reception)
......@@ -232,7 +243,8 @@ void phy_config_sib13_ue(module_id_t Mod_id,
long mbsfn_AreaId_r9);
/**
\brief Configure eNB MBSFN common parameters. Invoked upon transmission of SIB13 from eNB.
\brief Configure eNB MBSFN common parameters.
\details Invoked upon transmission of SIB13 from eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
......@@ -270,7 +282,8 @@ void phy_config_meas_ue(module_id_t Mod_id,
/*!
\fn void phy_config_dedicated_eNB(module_id_t Mod_id,uint16_t rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Prepare for configuration of PHY with dedicated parameters. Invoked just prior to transmission of RRCConnectionSetup or RRCConnectionReconfiguration at eNB.
\brief Prepare for configuration of PHY with dedicated parameters.
\details Invoked just prior to transmission of RRCConnectionSetup or RRCConnectionReconfiguration at eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param rnti rnti for UE context
......
......@@ -51,6 +51,7 @@
#include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_PHY
#include "assertions.h"
#ifdef EXMIMO
extern openair0_rf_map rf_map[MAX_NUM_CCs];
......@@ -60,6 +61,7 @@ extern uint16_t prach_root_sequence_map0_3[838];
extern uint16_t prach_root_sequence_map4[138];
uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
// FIXME not used anywhere
void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
uint8_t N_RB_DL,
uint8_t Nid_cell,
......@@ -865,27 +867,119 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms) {
}
/*! \brief Helper function to allocate memory for DLSCH data structures.
* \param[out] pdsch Pointer to the LTE_UE_PDSCH structure to initialize.
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
* \note This function is optimistic in that it expects malloc() to succeed.
*/
void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const frame_parms )
{
AssertFatal( pdsch, "pdsch==0" );
pdsch->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL );
pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho_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:
AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
for (int i=0; i<frame_parms->nb_antennas_rx; i++) {
pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12;
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->dl_ch_estimates_ext[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_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
}
}
/*! \brief Helper function to allocate memory for DLSCH_FLP data structures.
* \param[out] pdsch_flp Pointer to the LTE_UE_PDSCH_FLP structure to initialize.
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
* \note This function is optimistic in that it expects malloc() to succeed.
*/
void phy_init_lte_ue__PDSCH_FLP( LTE_UE_PDSCH_FLP* const pdsch_flp, const LTE_DL_FRAME_PARMS* const frame_parms )
{
AssertFatal( pdsch_flp, "pdsch==0" );
pdsch_flp->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch_flp->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch_flp->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
// FIXME! no further allocation for (int16_t*)pdsch_flp->llr128 !!! expect SIGSEGV
pdsch_flp->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL );
pdsch_flp->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch_flp->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch_flp->rxdataF_comp = (double**)malloc16_clear( 8*sizeof(double*) );
pdsch_flp->dl_ch_rho_ext = (double**)malloc16_clear( 8*sizeof(double*) );
pdsch_flp->dl_ch_mag = (double**)malloc16_clear( 8*sizeof(double*) );
pdsch_flp->dl_ch_magb = (double**)malloc16_clear( 8*sizeof(double*) );
pdsch_flp->rho = (double**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(double*) );
// the allocated memory size is fixed:
AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
for (int i=0; i<frame_parms->nb_antennas_rx; i++) {
pdsch_flp->rho[i] = (double*)malloc16_clear( sizeof(double)*(frame_parms->N_RB_DL*12*7*2) );
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12;
pdsch_flp->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch_flp->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch_flp->rxdataF_comp[idx] = (double*)malloc16_clear( sizeof(double) * num );
pdsch_flp->dl_ch_rho_ext[idx] = (double*)malloc16_clear( sizeof(double) * num );
pdsch_flp->dl_ch_mag[idx] = (double*)malloc16_clear( sizeof(double) * num );
pdsch_flp->dl_ch_magb[idx] = (double*)malloc16_clear( sizeof(double) * num );
}
}
}
int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
int nb_connected_eNB,
uint8_t abstraction_flag) {
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
LTE_UE_COMMON *ue_common_vars = &phy_vars_ue->lte_ue_common_vars;
LTE_UE_PDSCH **ue_pdsch_vars = phy_vars_ue->lte_ue_pdsch_vars;
LTE_UE_PDSCH_FLP **ue_pdsch_vars_flp= phy_vars_ue->lte_ue_pdsch_vars_flp;
LTE_UE_PDSCH **ue_pdsch_vars_SI = phy_vars_ue->lte_ue_pdsch_vars_SI;
LTE_UE_PDSCH **ue_pdsch_vars_ra = phy_vars_ue->lte_ue_pdsch_vars_ra;
LTE_UE_PDSCH **ue_pdsch_vars_mch = phy_vars_ue->lte_ue_pdsch_vars_MCH;
LTE_UE_PBCH **ue_pbch_vars = phy_vars_ue->lte_ue_pbch_vars;
LTE_UE_PDCCH **ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars;
LTE_UE_PRACH **ue_prach_vars = phy_vars_ue->lte_ue_prach_vars;
// create shortcuts
LTE_DL_FRAME_PARMS* const frame_parms = &phy_vars_ue->lte_frame_parms;
LTE_UE_COMMON* const ue_common_vars = &phy_vars_ue->lte_ue_common_vars;
LTE_UE_PDSCH** const ue_pdsch_vars = phy_vars_ue->lte_ue_pdsch_vars;
LTE_UE_PDSCH_FLP** const ue_pdsch_vars_flp = phy_vars_ue->lte_ue_pdsch_vars_flp;
LTE_UE_PDSCH** const ue_pdsch_vars_SI = phy_vars_ue->lte_ue_pdsch_vars_SI;
LTE_UE_PDSCH** const ue_pdsch_vars_ra = phy_vars_ue->lte_ue_pdsch_vars_ra;
LTE_UE_PDSCH** const ue_pdsch_vars_mch = phy_vars_ue->lte_ue_pdsch_vars_MCH;
LTE_UE_PBCH** const ue_pbch_vars = phy_vars_ue->lte_ue_pbch_vars;
LTE_UE_PDCCH** const ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars;
LTE_UE_PRACH** const ue_prach_vars = phy_vars_ue->lte_ue_prach_vars;
int i,j,k;
unsigned char eNB_id;
int eNB_id;
msg("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", phy_vars_ue->Mod_id+NB_eNB_INST);
// many memory allocation sizes are hard coded
AssertFatal( frame_parms->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
AssertFatal( phy_vars_ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
#ifndef USER_MODE
AssertFatal( frame_parms->nb_antennas_tx <= NB_ANTENNAS_TX, "nb_antennas_tx too large" );
AssertFatal( frame_parms->nb_antennas_rx <= NB_ANTENNAS_RX, "nb_antennas_rx too large" );
#endif
// init phy_vars_ue
msg("Initializing UE vars (abstraction %d) for eNB TXant %d, UE RXant %d\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02d][]\n", phy_vars_ue->Mod_id+NB_eNB_INST);
for (i=0;i<4;i++) {
for (i=0; i<4; i++) {
phy_vars_ue->rx_gain_max[i] = 135;
phy_vars_ue->rx_gain_med[i] = 128;
phy_vars_ue->rx_gain_byp[i] = 120;
......@@ -897,628 +991,165 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->total_TBS_last[eNB_id] = 0;
phy_vars_ue->bitrate[eNB_id] = 0;
phy_vars_ue->total_received_bits[eNB_id] = 0;
phy_vars_ue->tx_power_dBm=-127;
}
phy_vars_ue->tx_power_dBm=-127;
if (abstraction_flag == 0) {
ue_common_vars->txdata = (int **)malloc16(frame_parms->nb_antennas_tx*sizeof(int*));
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
#ifdef USER_MODE
ue_common_vars->txdata[i] = (int *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
bzero(ue_common_vars->txdata[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
#else //USER_MODE
ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i];
#endif //USER_MODE
}
// init TX buffers
ue_common_vars->txdataF = (mod_sym_t **)malloc16(frame_parms->nb_antennas_tx*sizeof(mod_sym_t*));
ue_common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
ue_common_vars->txdataF = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
#ifdef USER_MODE
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(ue_common_vars->txdataF[i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
ue_common_vars->txdata[i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
#else //USER_MODE
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(ue_common_vars->txdataF[i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i];
#endif //USER_MODE
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
}
// RX buffers
ue_common_vars->rxdata = (int **)malloc16(frame_parms->nb_antennas_rx*sizeof(int*));
if (ue_common_vars->rxdata) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdata allocated at %p\n", ue_common_vars->rxdata);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdata not allocated\n");
return(-1);
}
// init RX buffers
ue_common_vars->rxdata = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
ue_common_vars->rxdataF = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
ue_common_vars->rxdataF2 = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
#ifndef USER_MODE
ue_common_vars->rxdata[i] = (int*) RX_DMA_BUFFER[0][i];
ue_common_vars->rxdata[i] = (int32_t*) RX_DMA_BUFFER[0][i];
#else //USER_MODE
ue_common_vars->rxdata[i] = (int*) malloc16((FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int));
ue_common_vars->rxdata[i] = (int32_t*) malloc16_clear( (FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int32_t) );
#endif //USER_MODE
if (ue_common_vars->rxdata[i]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdata[%d] allocated at %p\n",i,ue_common_vars->rxdata[i]);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdata[%d] not allocated\n",i);
return(-1);
}
}
ue_common_vars->rxdataF = (int **)malloc16(frame_parms->nb_antennas_rx*sizeof(int*));
if (ue_common_vars->rxdataF) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF allocated at %p\n", ue_common_vars->rxdataF);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF not allocated\n");
return(-1);
}
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
//RK 2 times because of output format of FFT! We should get rid of this
ue_common_vars->rxdataF[i] = (int *)malloc16(2*sizeof(int)*(frame_parms->ofdm_symbol_size*14));
if (ue_common_vars->rxdataF[i]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF[%d] allocated at %p\n",i,ue_common_vars->rxdataF[i]);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF[%d] not allocated\n",i);
return(-1);
}
}
ue_common_vars->rxdataF2 = (int **)malloc16(frame_parms->nb_antennas_rx*sizeof(int*));
if (ue_common_vars->rxdataF2) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF2 allocated at %p\n", ue_common_vars->rxdataF2);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF2 not allocated\n");
return(-1);
}
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
//RK 2 times because of output format of FFT! We should get rid of this
ue_common_vars->rxdataF2[i] = (int *)malloc16(2*sizeof(int)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*10));
if (ue_common_vars->rxdataF2[i]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF2[%d] allocated at %p\n",i,ue_common_vars->rxdataF2[i]);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->rxdataF2[%d] not allocated\n",i);
return(-1);
}
// RK 2 times because of output format of FFT!
// FIXME We should get rid of this
ue_common_vars->rxdataF[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*(frame_parms->ofdm_symbol_size*14) );
// RK 2 times because of output format of FFT! We should get rid of this
// FIXME We should get rid of this
ue_common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*10) );
}
}
// Channel estimates
for (eNB_id=0;eNB_id<7;eNB_id++) {
ue_common_vars->dl_ch_estimates[eNB_id] = (int **)malloc16(8*sizeof(int*));
if (ue_common_vars->dl_ch_estimates[eNB_id]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates (eNB %d) allocated at %p\n",
eNB_id,ue_common_vars->dl_ch_estimates[eNB_id]);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates not allocated\n");
return(-1);
}
for (eNB_id=0; eNB_id<7; eNB_id++) {
ue_common_vars->dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
ue_common_vars->dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates[eNB_id][(j<<1) + i] = (int *)malloc16(frame_parms->symbols_per_tti*sizeof(int)*(frame_parms->ofdm_symbol_size)+LTE_CE_FILTER_LENGTH);
if (ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates[%d][%d] allocated at %p\n",eNB_id,(j<<1)+i,
ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i]);
#endif
memset(ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i],0,frame_parms->symbols_per_tti*sizeof(int)*(frame_parms->ofdm_symbol_size)+LTE_CE_FILTER_LENGTH);
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates[%d] not allocated\n",i);
return(-1);
}
int idx = (j<<1) + i;
ue_common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->symbols_per_tti*(frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
ue_common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size*2 );
}
}
for (eNB_id=0;eNB_id<7;eNB_id++) {
ue_common_vars->dl_ch_estimates_time[eNB_id] = (int **)malloc16(8*sizeof(int*));
if (ue_common_vars->dl_ch_estimates_time[eNB_id]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates_time[%d] allocated at %p\n",eNB_id,
ue_common_vars->dl_ch_estimates_time[eNB_id]);
#endif
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates_time not allocated_time\n");
return(-1);
}
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->ofdm_symbol_size)*2);
if (ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates_time[%d] allocated at %p\n",i,
ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i]);
#endif
memset(ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i],0,sizeof(int)*(frame_parms->ofdm_symbol_size)*2);
}
else {
msg("[openair][LTE_PHY][INIT] ue_common_vars->dl_ch_estimates_time[%d] not allocated\n",i);
return(-1);
}
}
}
// lte_ue_pdsch_vars = (LTE_UE_PDSCH **)malloc16(3*sizeof(LTE_UE_PDSCH*));
// lte_ue_pbch_vars = (LTE_UE_PBCH **)malloc16(3*sizeof(LTE_UE_PBCH*));
// DLSCH
for (eNB_id=0;eNB_id<phy_vars_ue->n_connected_eNB;eNB_id++) {
ue_pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16(sizeof(LTE_UE_PDSCH));
for (eNB_id=0; eNB_id<phy_vars_ue->n_connected_eNB; eNB_id++) {
ue_pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
#ifdef ENABLE_FULL_FLP
ue_pdsch_vars_flp[eNB_id]= (LTE_UE_PDSCH_FLP *)malloc16(sizeof(LTE_UE_PDSCH_FLP));
#endif
ue_pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16(sizeof(LTE_UE_PDSCH));
ue_pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16(sizeof(LTE_UE_PDSCH));
ue_pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16(sizeof(LTE_UE_PDSCH));
ue_pdcch_vars[eNB_id] = (LTE_UE_PDCCH *)malloc16(sizeof(LTE_UE_PDCCH));
ue_prach_vars[eNB_id] = (LTE_UE_PRACH *)malloc16(sizeof(LTE_UE_PRACH));
#ifdef DEBUG_PHY
msg("[OPENAIR][LTE PHY][INIT] ue_pdsch_vars[%d] = %p\n",eNB_id,ue_pdsch_vars[eNB_id]);
msg("[OPENAIR][LTE PHY][INIT] ue_pdsch_vars_SI[%d] = %p\n",eNB_id,ue_pdsch_vars_SI[eNB_id]);
msg("[OPENAIR][LTE PHY][INIT] ue_pdsch_vars_ra[%d] = %p\n",eNB_id,ue_pdsch_vars_ra[eNB_id]);
msg("[OPENAIR][LTE PHY][INIT] ue_pdsch_vars_mch[%d] = %p\n",eNB_id,ue_pdsch_vars_mch[eNB_id]);
msg("[OPENAIR][LTE PHY][INIT] ue_pdcch_vars[%d] = %p\n",eNB_id,ue_pdcch_vars[eNB_id]);
msg("[OPENAIR][LTE PHY][INIT] ue_prach_vars[%d] = %p\n",eNB_id,ue_prach_vars[eNB_id]);
//msg("[OPENAIR][LTE PHY][INIT] prach_resources[%d] = %p\n",eNB_id,prach_resources[eNB_id]);