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 lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t N_RB_DL,uint8_t frame_type,uint8_t tdd_config,uint8_t osf, int num_bss) { LTE_DL_FRAME_PARMS *lte_frame_parms[num_bss]; PHY_vars_eNB = malloc(num_bss*sizeof(PHY_VARS_eNB*)); PHY_vars_UE = malloc(num_bss*sizeof(PHY_VARS_UE*)); var = malloc(num_bss*sizeof(uint8_t)); randominit(0); set_taus_seed(0); mac_xface = malloc(sizeof(MAC_xface)); int i = 0; for (i = 0; i < num_bss; i++){ PHY_vars_eNB[i] = malloc(sizeof(PHY_VARS_eNB)); PHY_vars_UE[i] = malloc(sizeof(PHY_VARS_UE)); lte_frame_parms[i] = &(PHY_vars_eNB[i]->lte_frame_parms); lte_frame_parms[i]->frame_type = frame_type; lte_frame_parms[i]->tdd_config = tdd_config; lte_frame_parms[i]->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz lte_frame_parms[i]->N_RB_UL = N_RB_DL; lte_frame_parms[i]->Ncp = extended_prefix_flag; lte_frame_parms[i]->Ncp_UL = extended_prefix_flag; lte_frame_parms[i]->Nid_cell = 10; lte_frame_parms[i]->nushift = 0; lte_frame_parms[i]->nb_antennas_tx = N_tx; lte_frame_parms[i]->nb_antennas_rx = N_rx; lte_frame_parms[i]->mode1_flag = (transmission_mode == 1)? 1 : 0; lte_frame_parms[i]->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0 init_frame_parms(lte_frame_parms[i],osf); PHY_vars_UE[i]->lte_frame_parms = *lte_frame_parms[i]; phy_init_lte_top(lte_frame_parms[i]); phy_init_lte_ue(PHY_vars_UE[i],1,0); phy_init_lte_eNB(PHY_vars_eNB[i],0,0,0); } }
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 char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) { // unsigned int ind; LTE_DL_FRAME_PARMS *lte_frame_parms; int i; printf("Start lte_param_init\n"); PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB)); PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB)); PHY_vars_eNb2 = 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 = 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 = Nid_cell%6; lte_frame_parms->nb_antennas_tx = N_tx; lte_frame_parms->nb_antennas_tx_eNB = 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 = 3; lte_frame_parms->frame_type = frame_type; init_frame_parms(lte_frame_parms,osf); //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); PHY_vars_UE->lte_frame_parms = *lte_frame_parms; phy_init_lte_top(lte_frame_parms); PHY_vars_UE->PHY_measurements.n_adj_cells=2; PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; for (i=0; i<3; i++) lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); phy_init_lte_ue(PHY_vars_UE,1,0); phy_init_lte_eNB(PHY_vars_eNb,0,0,0); for (i=0; i<10; i++) { PHY_vars_UE->scan_info[0].amp[0][i] = 0; PHY_vars_UE->scan_info[0].amp[1][i] = 0; PHY_vars_UE->scan_info[0].amp[2][i] = 0; } memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1; PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6; PHY_vars_eNb1->Mod_id=1; memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2; PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6; PHY_vars_eNb2->Mod_id=2; phy_init_lte_eNB(PHY_vars_eNb1,0,0,0); phy_init_lte_eNB(PHY_vars_eNb2,0,0,0); phy_init_lte_top(lte_frame_parms); printf("Done lte_param_init\n"); }