void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config) { unsigned int ind; LTE_DL_FRAME_PARMS *lte_frame_parms; printf("Start lte_param_init (Nid_cell %d, extended_prefix %d, transmission_mode %d, N_tx %d, N_rx %d)\n", Nid_cell, extended_prefix_flag,transmission_mode,N_tx,N_rx); PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); mac_xface = malloc(sizeof(MAC_xface)); randominit(0); set_taus_seed(0); lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); lte_frame_parms->N_RB_DL = 25; //50 for 10MHz and 25 for 5 MHz lte_frame_parms->N_RB_UL = 25; lte_frame_parms->Ncp = extended_prefix_flag; lte_frame_parms->Nid_cell = Nid_cell; lte_frame_parms->nushift = 0; lte_frame_parms->nb_antennas_tx = N_tx; lte_frame_parms->nb_antennas_rx = N_rx; lte_frame_parms->tdd_config = tdd_config; // lte_frame_parms->Csrs = 2; // lte_frame_parms->Bsrs = 0; // lte_frame_parms->kTC = 0; // lte_frame_parms->n_RRC = 0; lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; init_frame_parms(lte_frame_parms,1); //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); phy_init_top(lte_frame_parms); //allocation lte_frame_parms->twiddle_fft = twiddle_fft; lte_frame_parms->twiddle_ifft = twiddle_ifft; lte_frame_parms->rev = rev; memcpy(&PHY_vars_UE->lte_frame_parms,lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); phy_init_lte_top(lte_frame_parms); phy_init_lte_ue(PHY_vars_UE,1,0); phy_init_lte_eNB(PHY_vars_eNB,0,0,0); printf("Done lte_param_init\n"); }
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,u16 Nid_cell,u8 N_RB_DL,u8 osf) { LTE_DL_FRAME_PARMS *lte_frame_parms; printf("Start lte_param_init\n"); PHY_vars_eNB = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); PHY_vars_UE = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE)); //PHY_config = malloc(sizeof(PHY_CONFIG)); // mac_xface = malloc(sizeof(MAC_xface)); randominit(0); set_taus_seed(0); lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz lte_frame_parms->N_RB_UL = N_RB_DL; lte_frame_parms->Ncp = extended_prefix_flag; lte_frame_parms->Nid_cell = Nid_cell; lte_frame_parms->nushift = 0; lte_frame_parms->nb_antennas_tx = N_tx; lte_frame_parms->nb_antennas_rx = N_rx; // lte_frame_parms->Csrs = 2; // lte_frame_parms->Bsrs = 0; // lte_frame_parms->kTC = 0; // lte_frame_parms->n_RRC = 0; lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; lte_frame_parms->tdd_config = 1; lte_frame_parms->frame_type = 1; init_frame_parms(lte_frame_parms,osf); //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); phy_init_top(lte_frame_parms); //allocation lte_frame_parms->twiddle_fft = twiddle_fft; lte_frame_parms->twiddle_ifft = twiddle_ifft; lte_frame_parms->rev = rev; PHY_vars_UE->lte_frame_parms = *lte_frame_parms; phy_init_lte_top(lte_frame_parms); phy_init_lte_ue(PHY_vars_UE,0); phy_init_lte_eNB(PHY_vars_eNB,0,0,0); printf("Done lte_param_init\n"); }
void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs], uint8_t frame_type, uint8_t tdd_config, uint8_t tdd_config_S, uint8_t extended_prefix_flag, uint8_t N_RB_DL, uint16_t Nid_cell, uint8_t cooperation_flag,uint8_t transmission_mode,uint8_t abstraction_flag, int nb_antennas_rx, uint8_t eMBMS_active_state) { uint8_t eNB_id,UE_id,RN_id,CC_id; mac_xface = malloc(sizeof(MAC_xface)); memset(mac_xface, 0, sizeof(MAC_xface)); LOG_I(PHY,"init lte parms: Nid_cell %d, Frame type %d, N_RB_DL %d\n",Nid_cell,frame_type,N_RB_DL); for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { frame_parms[CC_id] = calloc(1, sizeof(LTE_DL_FRAME_PARMS)); (frame_parms[CC_id])->frame_type = frame_type; (frame_parms[CC_id])->tdd_config = tdd_config; (frame_parms[CC_id])->tdd_config_S = tdd_config_S; (frame_parms[CC_id])->N_RB_DL = N_RB_DL; (frame_parms[CC_id])->N_RB_UL = (frame_parms[CC_id])->N_RB_DL; (frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth; (frame_parms[CC_id])->phich_config_common.phich_duration = normal; (frame_parms[CC_id])->Ncp = extended_prefix_flag; (frame_parms[CC_id])->Nid_cell = Nid_cell; (frame_parms[CC_id])->nushift = (Nid_cell%6); (frame_parms[CC_id])->nb_antennas_tx = (transmission_mode == 1) ? 1 : 2; (frame_parms[CC_id])->nb_antennas_tx_eNB = (transmission_mode == 1) ? 1 : 2; (frame_parms[CC_id])->nb_antennas_rx = (transmission_mode == 1) ? 1 : 2; (frame_parms[CC_id])->mode1_flag = (transmission_mode == 1) ? 1 : 0; init_frame_parms(frame_parms[CC_id],1); (frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0 (frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1; (frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0; (frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; init_ul_hopping(frame_parms[CC_id]); } phy_init_top(frame_parms[0]); phy_init_lte_top(frame_parms[0]); PHY_vars_eNB_g = (PHY_VARS_eNB***)malloc(NB_eNB_INST*sizeof(PHY_VARS_eNB**)); for (eNB_id=0; eNB_id<NB_eNB_INST;eNB_id++){ PHY_vars_eNB_g[eNB_id] = (PHY_VARS_eNB**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_eNB*)); for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(frame_parms[CC_id],eNB_id,Nid_cell,cooperation_flag,transmission_mode,abstraction_flag); PHY_vars_eNB_g[eNB_id][CC_id]->Mod_id=eNB_id; PHY_vars_eNB_g[eNB_id][CC_id]->CC_id=CC_id; } } PHY_vars_UE_g = (PHY_VARS_UE***)malloc(NB_UE_INST*sizeof(PHY_VARS_UE**)); for (UE_id=0; UE_id<NB_UE_INST;UE_id++){ PHY_vars_UE_g[UE_id] = (PHY_VARS_UE**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_UE*)); for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { (frame_parms[CC_id])->nb_antennas_tx = 1; (frame_parms[CC_id])->nb_antennas_rx = nb_antennas_rx; PHY_vars_UE_g[UE_id][CC_id] = init_lte_UE(frame_parms[CC_id], UE_id,abstraction_flag,transmission_mode); PHY_vars_UE_g[UE_id][CC_id]->Mod_id=UE_id; PHY_vars_UE_g[UE_id][CC_id]->CC_id=CC_id; } } if (NB_RN_INST > 0) { PHY_vars_RN_g = malloc(NB_RN_INST*sizeof(PHY_VARS_RN*)); for (RN_id=0; RN_id<NB_RN_INST;RN_id++){ PHY_vars_RN_g[RN_id] = init_lte_RN(*frame_parms,RN_id,eMBMS_active_state); } } }
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode) { unsigned int ind; printf("Start lte_param_init\n"); PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB)); PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); PHY_config = malloc(sizeof(PHY_CONFIG)); mac_xface = malloc(sizeof(MAC_xface)); randominit(0); set_taus_seed(0); lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms); lte_frame_parms->N_RB_DL = 25; //50 for 10MHz and 25 for 5 MHz lte_frame_parms->N_RB_UL = 25; lte_frame_parms->Ncp = 1; lte_frame_parms->Nid_cell = 0; lte_frame_parms->nushift = 0; lte_frame_parms->nb_antennas_tx = N_tx; lte_frame_parms->nb_antennas_rx = N_rx; lte_frame_parms->first_dlsch_symbol = 4; lte_frame_parms->num_dlsch_symbols = 6; lte_frame_parms->Csrs = 2; lte_frame_parms->Bsrs = 0; lte_frame_parms->kTC = 0; lte_frame_parms->n_RRC = 0; lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; init_frame_parms(lte_frame_parms); copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); phy_init_top(N_tx); //allocation lte_frame_parms->twiddle_fft = twiddle_fft; lte_frame_parms->twiddle_ifft = twiddle_ifft; lte_frame_parms->rev = rev; PHY_vars_UE->lte_frame_parms = *lte_frame_parms; lte_gold(lte_frame_parms); generate_ul_ref_sigs(); generate_ul_ref_sigs_rx(); generate_64qam_table(); generate_16qam_table(); generate_RIV_tables(); generate_pcfich_reg_mapping(lte_frame_parms); generate_phich_reg_mapping_ext(lte_frame_parms); phy_init_lte_ue(&PHY_vars_UE->lte_frame_parms, &PHY_vars_UE->lte_ue_common_vars, PHY_vars_UE->lte_ue_dlsch_vars, PHY_vars_UE->lte_ue_dlsch_vars_cntl, PHY_vars_UE->lte_ue_dlsch_vars_ra, PHY_vars_UE->lte_ue_dlsch_vars_1A, PHY_vars_UE->lte_ue_pbch_vars, PHY_vars_UE->lte_ue_pdcch_vars, PHY_vars_UE); phy_init_lte_eNB(&PHY_vars_eNb->lte_frame_parms, &PHY_vars_eNb->lte_eNB_common_vars, PHY_vars_eNb->lte_eNB_ulsch_vars, 0, PHY_vars_eNb); printf("Done lte_param_init\n"); }