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"); }
PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag, uint8_t transmission_mode) { int i,j; PHY_VARS_UE* PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); memset(PHY_vars_UE,0,sizeof(PHY_VARS_UE)); PHY_vars_UE->Mod_id=UE_id; memcpy(&(PHY_vars_UE->lte_frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS)); phy_init_lte_ue(PHY_vars_UE,1,abstraction_flag); for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { for (j=0; j<2; j++) { PHY_vars_UE->dlsch_ue[i][j] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); if (!PHY_vars_UE->dlsch_ue[i][j]) { LOG_E(PHY,"Can't get ue dlsch structures\n"); exit(-1); } else LOG_D(PHY,"dlsch_ue[%d][%d] => %p\n",UE_id,i,PHY_vars_UE->dlsch_ue[i][j]); } PHY_vars_UE->ulsch_ue[i] = new_ue_ulsch(NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_UE->ulsch_ue[i]) { LOG_E(PHY,"Can't get ue ulsch structures\n"); exit(-1); } PHY_vars_UE->dlsch_ue_SI[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); PHY_vars_UE->dlsch_ue_ra[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); PHY_vars_UE->transmission_mode[i] = transmission_mode; } PHY_vars_UE->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1; PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL,0); return (PHY_vars_UE); }
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 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"); }
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"); }