Commit 0a989c2a authored by Wang He's avatar Wang He

Change NUMBER_OF_UE_MAX to variable.

Add new configuration in config file.
global_params = (
  {
    number_of_ue_max = xxxxxx';
  }
)
parent 7e82c62c
...@@ -58,7 +58,8 @@ int current_dlsch_cqi; ...@@ -58,7 +58,8 @@ int current_dlsch_cqi;
PHY_VARS_eNB *PHY_vars_eNB; PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE; PHY_VARS_UE *PHY_vars_UE;
DCI1_5MHz_TDD_t DLSCH_alloc_pdu; DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX]; //channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
channel_desc_t ***UE2eNB;
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) 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)
{ {
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn); extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
extern int32_t get_uldl_offset(int eutra_bandP); extern int32_t get_uldl_offset(int eutra_bandP);
void phy_vars_eNB_free(PHY_VARS_eNB *eNB);
void phy_measurements_eNB_free(PHY_MEASUREMENTS_eNB *meas);
extern uint16_t prach_root_sequence_map0_3[838]; extern uint16_t prach_root_sequence_map0_3[838];
extern uint16_t prach_root_sequence_map4[138]; extern uint16_t prach_root_sequence_map4[138];
...@@ -533,6 +535,7 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) ...@@ -533,6 +535,7 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB)
LTE_eNB_PRACH* const prach_vars_br = &eNB->prach_vars_br; LTE_eNB_PRACH* const prach_vars_br = &eNB->prach_vars_br;
#endif #endif
int i, UE_id; int i, UE_id;
PHY_MEASUREMENTS_eNB* const meas = &eNB->measurements;
for (i = 0; i < NB_ANTENNA_PORTS_ENB; i++) { for (i = 0; i < NB_ANTENNA_PORTS_ENB; i++) {
if (i < fp->nb_antenna_ports_eNB || i == 5) { if (i < fp->nb_antenna_ports_eNB || i == 5) {
...@@ -594,6 +597,103 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) ...@@ -594,6 +597,103 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB)
} //UE_id } //UE_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) eNB->UE_stats_ptr[UE_id] = NULL; for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) eNB->UE_stats_ptr[UE_id] = NULL;
phy_measurements_eNB_free(meas);
phy_vars_eNB_free(eNB);
}
void phy_vars_eNB_free(PHY_VARS_eNB *eNB)
{
int i, j;
free_and_zero(eNB->srs_vars);
free_and_zero(eNB->pusch_vars);
free_and_zero(eNB->ulsch);
free_and_zero(eNB->UE_stats_ptr);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
free_and_zero(eNB->dlsch[i]);
}
free_and_zero(eNB->dlsch);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
for (j = 0; j < 20; j++) {
free_and_zero(eNB->lte_gold_uespec_port5_table[i][j]);
}
free_and_zero(eNB->lte_gold_uespec_port5_table[i]);
}
free_and_zero(eNB->lte_gold_uespec_port5_table);
free_and_zero(eNB->first_sr);
free_and_zero(eNB->first_run_timing_advance);
free_and_zero(eNB->pdsch_config_dedicated);
free_and_zero(eNB->pusch_config_dedicated);
free_and_zero(eNB->pucch_config_dedicated);
free_and_zero(eNB->ul_power_control_dedicated);
free_and_zero(eNB->tpc_pdcch_config_pucch);
free_and_zero(eNB->tpc_pdcch_config_pusch);
free_and_zero(eNB->cqi_report_config);
free_and_zero(eNB->soundingrs_ul_config_dedicated);
free_and_zero(eNB->scheduling_request_config);
free_and_zero(eNB->transmission_mode);
free_and_zero(eNB->physicalConfigDedicated);
free_and_zero(eNB->mu_mimo_mode);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
free_and_zero(eNB->pucch1_stats_cnt[i]);
free_and_zero(eNB->pucch1_stats[i]);
free_and_zero(eNB->pucch1_stats_thres[i]);
free_and_zero(eNB->pucch1ab_stats_cnt[i]);
free_and_zero(eNB->pucch1ab_stats[i]);
free_and_zero(eNB->pusch_stats_rb[i]);
free_and_zero(eNB->pusch_stats_round[i]);
free_and_zero(eNB->pusch_stats_mcs[i]);
free_and_zero(eNB->pusch_stats_bsr[i]);
free_and_zero(eNB->pusch_stats_BO[i]);
}
free_and_zero(eNB->pucch1_stats_cnt);
free_and_zero(eNB->pucch1_stats);
free_and_zero(eNB->pucch1_stats_thres);
free_and_zero(eNB->pucch1ab_stats_cnt);
free_and_zero(eNB->pucch1ab_stats);
free_and_zero(eNB->pusch_stats_rb);
free_and_zero(eNB->pusch_stats_round);
free_and_zero(eNB->pusch_stats_mcs);
free_and_zero(eNB->pusch_stats_bsr);
free_and_zero(eNB->pusch_stats_BO);
}
void phy_measurements_eNB_free(PHY_MEASUREMENTS_eNB *meas)
{
int i, j;
free_and_zero(meas->rx_rssi_dBm);
free_and_zero(meas->wideband_cqi_tot);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
free_and_zero(meas->rx_correlation[i]);
free_and_zero(meas->rx_correlation_dB[i]);
free_and_zero(meas->wideband_cqi[i]);
free_and_zero(meas->wideband_cqi_dB[i]);
free_and_zero(meas->subband_cqi_tot[i]);
free_and_zero(meas->subband_cqi_tot_dB[i]);
for (j = 0; j < 2; j++){
free_and_zero(meas->rx_spatial_power[i][j]);
free_and_zero(meas->rx_spatial_power_dB[i][j]);
}
for (j = 0; j < MAX_NUM_RU_PER_eNB; j++) {
free_and_zero(meas->subband_cqi[i][j]);
free_and_zero(meas->subband_cqi_dB[i][j]);
}
free_and_zero(meas->rx_spatial_power[i]);
free_and_zero(meas->rx_spatial_power_dB[i]);
free_and_zero(meas->subband_cqi[i]);
free_and_zero(meas->subband_cqi_dB[i]);
}
free_and_zero(meas->rx_correlation);
free_and_zero(meas->rx_correlation_dB);
free_and_zero(meas->wideband_cqi);
free_and_zero(meas->wideband_cqi_dB);
free_and_zero(meas->subband_cqi_tot);
free_and_zero(meas->subband_cqi_tot_dB);
free_and_zero(meas->rx_spatial_power);
free_and_zero(meas->rx_spatial_power_dB);
free_and_zero(meas->subband_cqi);
free_and_zero(meas->subband_cqi_dB);
} }
void install_schedule_handlers(IF_Module_t *if_inst) void install_schedule_handlers(IF_Module_t *if_inst)
......
...@@ -39,6 +39,99 @@ extern PHY_VARS_UE *UE; ...@@ -39,6 +39,99 @@ extern PHY_VARS_UE *UE;
extern RU_t *ru; extern RU_t *ru;
extern void phy_init_RU(RU_t *); extern void phy_init_RU(RU_t *);
void phy_measurements_eNB_malloc(PHY_MEASUREMENTS_eNB *meas)
{
int i, j;
meas->rx_spatial_power = (unsigned int ***)malloc(sizeof(unsigned int **)*NUMBER_OF_UE_MAX);
meas->rx_spatial_power_dB = (unsigned short ***)malloc(sizeof(unsigned short **)*NUMBER_OF_UE_MAX);
meas->rx_rssi_dBm = (short *)malloc(sizeof(short)*NUMBER_OF_UE_MAX);
meas->rx_correlation = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->rx_correlation_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi_tot = (char *)malloc(sizeof(char)*NUMBER_OF_UE_MAX);
meas->subband_cqi = (int ***)malloc(sizeof(int **)*NUMBER_OF_UE_MAX);
meas->subband_cqi_tot = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->subband_cqi_dB = (int ***)malloc(sizeof(int **)*NUMBER_OF_UE_MAX);
meas->subband_cqi_tot_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
meas->rx_spatial_power[i] = (unsigned int **)malloc(sizeof(unsigned int *)*2);
meas->rx_spatial_power_dB[i] = (unsigned short **)malloc(sizeof(unsigned short *)*2);
for (j = 0; j < 2; j++) {
meas->rx_spatial_power[i][j] = (unsigned int *)malloc(sizeof(unsigned int)*2);
meas->rx_spatial_power_dB[i][j] = (unsigned short *)malloc(sizeof(unsigned short)*2);
}
meas->rx_correlation[i] = (int *)malloc(sizeof(int)*2);
meas->rx_correlation_dB[i] = (int *)malloc(sizeof(int)*2);
meas->wideband_cqi[i] = (int *)malloc(sizeof(int)*MAX_NUM_RU_PER_eNB);
meas->wideband_cqi_dB[i] = (int *)malloc(sizeof(int)*MAX_NUM_RU_PER_eNB);
meas->subband_cqi[i] = (int **)malloc(sizeof(int *)*MAX_NUM_RU_PER_eNB);
meas->subband_cqi_dB[i] = (int **)malloc(sizeof(int *)*MAX_NUM_RU_PER_eNB);
for (j = 0; j < MAX_NUM_RU_PER_eNB; j++) {
meas->subband_cqi[i][j] = (int *)malloc(sizeof(int)*100);
meas->subband_cqi_dB[i][j] = (int *)malloc(sizeof(int)*100);
}
meas->subband_cqi_tot[i] = (int *)malloc(sizeof(int)*100);
meas->subband_cqi_tot_dB[i] = (int *)malloc(sizeof(int)*100);
}
}
void phy_vars_eNB_malloc(PHY_VARS_eNB *eNB)
{
int i, j;
eNB->srs_vars = (LTE_eNB_SRS *)malloc(sizeof(LTE_eNB_SRS)*NUMBER_OF_UE_MAX);
eNB->pusch_vars = (LTE_eNB_PUSCH **)malloc(sizeof(LTE_eNB_PUSCH *)*NUMBER_OF_UE_MAX);
eNB->dlsch = (LTE_eNB_DLSCH_t ***)malloc(sizeof(LTE_eNB_DLSCH_t **)*NUMBER_OF_UE_MAX);
eNB->ulsch = (LTE_eNB_ULSCH_t **)malloc(sizeof(LTE_eNB_ULSCH_t *)*(NUMBER_OF_UE_MAX+1));
eNB->UE_stats = (LTE_eNB_UE_stats *)malloc(sizeof(LTE_eNB_UE_stats)*NUMBER_OF_UE_MAX);
eNB->UE_stats_ptr = (LTE_eNB_UE_stats **)malloc(sizeof(LTE_eNB_UE_stats *)*(NUMBER_OF_UE_MAX+1));
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->dlsch[i] = (LTE_eNB_DLSCH_t **)malloc(sizeof(LTE_eNB_DLSCH_t *)*2);
}
eNB->lte_gold_uespec_port5_table = (uint32_t ***)malloc(sizeof(uint32_t **)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->lte_gold_uespec_port5_table[i] = (uint32_t **)malloc(sizeof(uint32_t *)*20);
for (j = 0; j < 20 ; j++) {
eNB->lte_gold_uespec_port5_table[i][j] = (uint32_t *)malloc(sizeof(uint32_t)*38);
}
}
eNB->first_sr = (uint8_t *)malloc(sizeof(uint8_t)*NUMBER_OF_UE_MAX);
eNB->first_run_timing_advance = (unsigned char *)malloc(sizeof(unsigned char)*NUMBER_OF_UE_MAX);
eNB->pdsch_config_dedicated = (PDSCH_CONFIG_DEDICATED *)malloc(sizeof(PDSCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->pusch_config_dedicated = (PUSCH_CONFIG_DEDICATED *)malloc(sizeof(PUSCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->pucch_config_dedicated = (PUCCH_CONFIG_DEDICATED *)malloc(sizeof(PUCCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->ul_power_control_dedicated = (UL_POWER_CONTROL_DEDICATED *)malloc(sizeof(UL_POWER_CONTROL_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->tpc_pdcch_config_pucch = (TPC_PDCCH_CONFIG *)malloc(sizeof(TPC_PDCCH_CONFIG)*NUMBER_OF_UE_MAX);
eNB->tpc_pdcch_config_pusch = (TPC_PDCCH_CONFIG *)malloc(sizeof(TPC_PDCCH_CONFIG)*NUMBER_OF_UE_MAX);
eNB->cqi_report_config = (CQI_REPORT_CONFIG *)malloc(sizeof(CQI_REPORT_CONFIG)*NUMBER_OF_UE_MAX);
eNB->soundingrs_ul_config_dedicated = (SOUNDINGRS_UL_CONFIG_DEDICATED *)malloc(sizeof(SOUNDINGRS_UL_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->scheduling_request_config = (SCHEDULING_REQUEST_CONFIG *)malloc(sizeof(SCHEDULING_REQUEST_CONFIG)*NUMBER_OF_UE_MAX);
eNB->transmission_mode = (uint8_t *)malloc(sizeof(uint8_t)*NUMBER_OF_UE_MAX);
eNB->physicalConfigDedicated = (struct LTE_PhysicalConfigDedicated **)malloc(sizeof(struct LTE_PhysicalConfigDedicated *)*NUMBER_OF_UE_MAX);
eNB->mu_mimo_mode = (MU_MIMO_mode *)malloc(sizeof(MU_MIMO_mode)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats_cnt = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats_thres = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1ab_stats_cnt = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1ab_stats = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_rb = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_round = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_mcs = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_bsr = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_BO = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->pucch1_stats_cnt[i] = (int32_t *)malloc(sizeof(uint32_t)*10);
eNB->pucch1_stats[i] = (int32_t *)malloc(sizeof(uint32_t)*10*1024);
eNB->pucch1_stats_thres[i] = (int32_t *)malloc(sizeof(uint32_t)*10*1024);
eNB->pucch1ab_stats_cnt[i] = (int32_t *)malloc(sizeof(uint32_t)*10);
eNB->pucch1ab_stats[i] = (int32_t *)malloc(sizeof(uint32_t)*2*10*1024);
eNB->pusch_stats_rb[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_round[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_mcs[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_bsr[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_BO[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
}
phy_measurements_eNB_malloc(&(eNB->measurements));
}
void lte_param_init(PHY_VARS_eNB **eNBp, void lte_param_init(PHY_VARS_eNB **eNBp,
PHY_VARS_UE **UEp, PHY_VARS_UE **UEp,
RU_t **rup, RU_t **rup,
...@@ -62,6 +155,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -62,6 +155,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
PHY_VARS_UE *UE; PHY_VARS_UE *UE;
RU_t *ru; RU_t *ru;
printf("Start lte_param_init\n"); printf("Start lte_param_init\n");
// dlsim does not read the config file to get number_of_ue_max, so we set NUMBER_OF_UE_MAX to 16
NUMBER_OF_UE_MAX = 16;
*eNBp = malloc(sizeof(PHY_VARS_eNB)); *eNBp = malloc(sizeof(PHY_VARS_eNB));
*UEp = malloc(sizeof(PHY_VARS_UE)); *UEp = malloc(sizeof(PHY_VARS_UE));
*rup = malloc(sizeof(RU_t)); *rup = malloc(sizeof(RU_t));
...@@ -72,6 +167,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -72,6 +167,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
memset((void *)eNB,0,sizeof(PHY_VARS_eNB)); memset((void *)eNB,0,sizeof(PHY_VARS_eNB));
memset((void *)UE,0,sizeof(PHY_VARS_UE)); memset((void *)UE,0,sizeof(PHY_VARS_UE));
memset((void *)ru,0,sizeof(RU_t)); memset((void *)ru,0,sizeof(RU_t));
phy_vars_eNB_malloc(eNB);
ru->eNB_list[0] = eNB; ru->eNB_list[0] = eNB;
eNB->RU_list[0] = ru; eNB->RU_list[0] = ru;
ru->num_eNB=1; ru->num_eNB=1;
......
...@@ -188,7 +188,8 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX ...@@ -188,7 +188,8 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
uint8_t shortened_format, uint8_t shortened_format,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint16_t n3_pucch, uint16_t n3_pucch,
uint16_t n3_pucch_array[NUMBER_OF_UE_MAX], //uint16_t n3_pucch_array[NUMBER_OF_UE_MAX],
uint16_t *n3_pucch_array,
uint8_t ncs_cell[20][7] ) uint8_t ncs_cell[20][7] )
{ {
uint32_t aa, symNo, k, slotNo, sym, i, j; uint32_t aa, symNo, k, slotNo, sym, i, j;
...@@ -203,11 +204,16 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX ...@@ -203,11 +204,16 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2]; int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
int32_t IP_allavg[D_NPUCCH_SF5]; int32_t IP_allavg[D_NPUCCH_SF5];
//int16_t temp_ch[2]; //int16_t temp_ch[2];
int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number; int16_t m_self=0, same_m_number;
uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX]; /* uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX];
int16_t n_oc0[NUMBER_OF_UE_MAX]; int16_t n_oc0[NUMBER_OF_UE_MAX];
int16_t n_oc1[NUMBER_OF_UE_MAX]; int16_t n_oc1[NUMBER_OF_UE_MAX];
int16_t np_n_array[2][NUMBER_OF_UE_MAX]; //Cyclic shift int16_t np_n_array[2][NUMBER_OF_UE_MAX]; */ //Cyclic shift
int16_t *m;
uint16_t *n3_pucch_sameRB;
int16_t *n_oc0;
int16_t *n_oc1;
int16_t *np_n_array[2];
uint8_t N_PUCCH_SF0 = 5; uint8_t N_PUCCH_SF0 = 5;
uint8_t N_PUCCH_SF1 = (shortened_format==0)? 5:4; uint8_t N_PUCCH_SF1 = (shortened_format==0)? 5:4;
...@@ -221,7 +227,14 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX ...@@ -221,7 +227,14 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
//double d_theta[32]={0.0}; //double d_theta[32]={0.0};
//int32_t temp_theta[32][2]={0}; //int32_t temp_theta[32][2]={0};
m = (int16_t *)malloc(sizeof(int16_t)*NUMBER_OF_UE_MAX);
n3_pucch_sameRB = (uint16_t *)malloc(sizeof(uint16_t)*NUMBER_OF_UE_MAX);
n_oc0 = (int16_t *)malloc(sizeof(int16_t)*NUMBER_OF_UE_MAX);
n_oc1 = (int16_t *)malloc(sizeof(int16_t)*NUMBER_OF_UE_MAX);
for (aa = 0; aa < 2; aa++) {
np_n_array[aa] = (int16_t *)malloc(sizeof(int16_t)*NUMBER_OF_UE_MAX);
}
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
for (symNo=0; symNo<D_NSYM1SF; symNo++){ for (symNo=0; symNo<D_NSYM1SF; symNo++){
for(ip_ind=0; ip_ind<D_NPUCCH_SF5-1; ip_ind++) { for(ip_ind=0; ip_ind<D_NPUCCH_SF5-1; ip_ind++) {
...@@ -782,13 +795,22 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -782,13 +795,22 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// TODO // TODO
// When using PUCCH format3, it must be an argument of rx_pucch function // When using PUCCH format3, it must be an argument of rx_pucch function
uint16_t n3_pucch = 20; uint16_t n3_pucch = 20;
uint16_t n3_pucch_array[NUMBER_OF_UE_MAX]={1}; //uint16_t n3_pucch_array[NUMBER_OF_UE_MAX]={1};
n3_pucch_array[0]=n3_pucch; //n3_pucch_array[0]=n3_pucch;
uint16_t *n3_pucch_array;
uint8_t do_sr = 1; uint8_t do_sr = 1;
uint16_t crnti=0x1234; uint16_t crnti=0x1234;
int16_t DTXthreshold = 10; int16_t DTXthreshold = 10;
/* PUCCH format3 << */ /* PUCCH format3 << */
n3_pucch_array = (uint16_t *)malloc(sizeof(uint16_t)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (i == 0) {
n3_pucch_array[i] = 0;
} else {
n3_pucch_array[i] = 1;
}
}
if (first_call == 1) { if (first_call == 1) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
for (j=0;j<NUMBER_OF_UE_MAX;j++) { for (j=0;j<NUMBER_OF_UE_MAX;j++) {
......
...@@ -30,12 +30,18 @@ ...@@ -30,12 +30,18 @@
int otg_enabled; int otg_enabled;
FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW}; FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
/*
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
*/
float **tput_time_enb = NULL;
float **tput_enb = NULL;
float **tput_time_ue = NULL;
float **tput_ue = NULL;
float *tput_ue_max = NULL;
static void ia_receiver_on_off( FL_OBJECT *button, long arg) static void ia_receiver_on_off( FL_OBJECT *button, long arg)
{ {
......
...@@ -26,11 +26,16 @@ ...@@ -26,11 +26,16 @@
int otg_enabled; int otg_enabled;
int use_sic_receiver=0; int use_sic_receiver=0;
FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW}; FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; /*float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; */
float **tput_time_enb;
float **tput_enb;
float **tput_time_ue;
float **tput_ue;
float *tput_ue_max;
static void ia_receiver_on_off( FL_OBJECT *button, long arg) static void ia_receiver_on_off( FL_OBJECT *button, long arg)
{ {
if (fl_get_button(button)) { if (fl_get_button(button)) {
......
...@@ -209,7 +209,8 @@ typedef struct { ...@@ -209,7 +209,8 @@ typedef struct {
// This used in UE_phy_stub_single_thread_rxn_txnp4 // This used in UE_phy_stub_single_thread_rxn_txnp4
pthread_mutex_t mutex_single_thread; pthread_mutex_t mutex_single_thread;
pthread_cond_t cond_single_thread; pthread_cond_t cond_single_thread;
int num_single_thread[NUMBER_OF_UE_MAX]; //int num_single_thread[NUMBER_OF_UE_MAX];
int *num_single_thread;
} SF_ticking; } SF_ticking;
typedef struct { typedef struct {
......
...@@ -436,7 +436,7 @@ typedef struct { ...@@ -436,7 +436,7 @@ typedef struct {
typedef struct { typedef struct {
/// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only. /// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only.
int8_t p0_UE_PUSCH; int8_t p0_UE_PUSCH;
/// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state “disabled”. en1 corresponds to value 1.25 corresponding to “enabled”. \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25). /// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state 窶彭isabled窶� en1 corresponds to value 1.25 corresponding to 窶彳nabled窶� \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25).
uint8_t deltaMCS_Enabled; uint8_t deltaMCS_Enabled;
/// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled". /// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled".
uint8_t accumulationEnabled; uint8_t accumulationEnabled;
......
...@@ -972,30 +972,42 @@ typedef struct { ...@@ -972,30 +972,42 @@ typedef struct {
short n0_subband_power_tot_dBm[100]; short n0_subband_power_tot_dBm[100];
// eNB measurements (per user) // eNB measurements (per user)
//! estimated received spatial signal power (linear) //! estimated received spatial signal power (linear)
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2]; // unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
unsigned int ***rx_spatial_power;
//! estimated received spatial signal power (dB) //! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2]; // unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2];
unsigned short ***rx_spatial_power_dB;
//! estimated rssi (dBm) //! estimated rssi (dBm)
short rx_rssi_dBm[NUMBER_OF_UE_MAX]; // short rx_rssi_dBm[NUMBER_OF_UE_MAX];
short *rx_rssi_dBm;
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int rx_correlation[NUMBER_OF_UE_MAX][2]; // int rx_correlation[NUMBER_OF_UE_MAX][2];
int **rx_correlation;
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation) //! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int rx_correlation_dB[NUMBER_OF_UE_MAX][2]; // int rx_correlation_dB[NUMBER_OF_UE_MAX][2];
int **rx_correlation_dB;
/// Wideband CQI (= SINR) /// Wideband CQI (= SINR)
int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB]; // int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
int **wideband_cqi;
/// Wideband CQI in dB (= SINR dB) /// Wideband CQI in dB (= SINR dB)
int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB]; // int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
int **wideband_cqi_dB;
/// Wideband CQI (sum of all RX antennas, in dB) /// Wideband CQI (sum of all RX antennas, in dB)
char wideband_cqi_tot[NUMBER_OF_UE_MAX]; // char wideband_cqi_tot[NUMBER_OF_UE_MAX];
char *wideband_cqi_tot;
/// Subband CQI per RX antenna and RB (= SINR) /// Subband CQI per RX antenna and RB (= SINR)
int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100]; // int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
int ***subband_cqi;
/// Total Subband CQI and RB (= SINR) /// Total Subband CQI and RB (= SINR)
int subband_cqi_tot[NUMBER_OF_UE_MAX][100]; // int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
int **subband_cqi_tot;
/// Subband CQI in dB and RB (= SINR dB) /// Subband CQI in dB and RB (= SINR dB)
int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100]; // int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
int ***subband_cqi_dB;
/// Total Subband CQI and RB /// Total Subband CQI and RB
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100]; // int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
int **subband_cqi_tot_dB;
/// PRACH background noise level /// PRACH background noise level
int prach_I0; int prach_I0;
} PHY_MEASUREMENTS_eNB; } PHY_MEASUREMENTS_eNB;
...@@ -1052,23 +1064,30 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1052,23 +1064,30 @@ typedef struct PHY_VARS_eNB_s {
#endif #endif
LTE_eNB_COMMON common_vars; LTE_eNB_COMMON common_vars;
LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX]; LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX];
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX]; // LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
LTE_eNB_SRS *srs_vars;
LTE_eNB_PBCH pbch; LTE_eNB_PBCH pbch;
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX]; // LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PUSCH **pusch_vars;
LTE_eNB_PRACH prach_vars; LTE_eNB_PRACH prach_vars;
LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams // LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA // LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
LTE_eNB_DLSCH_t ***dlsch;
LTE_eNB_ULSCH_t **ulsch;
LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p; LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p;
LTE_eNB_DLSCH_t *dlsch_MCH; LTE_eNB_DLSCH_t *dlsch_MCH;
LTE_eNB_DLSCH_t *dlsch_PCH; LTE_eNB_DLSCH_t *dlsch_PCH;
LTE_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX]; // LTE_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX];
LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX]; // LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX];
LTE_eNB_UE_stats *UE_stats;
LTE_eNB_UE_stats **UE_stats_ptr;
/// cell-specific reference symbols /// cell-specific reference symbols
uint32_t lte_gold_table[20][2][14]; uint32_t lte_gold_table[20][2][14];
/// UE-specific reference symbols (p=5), TM 7 /// UE-specific reference symbols (p=5), TM 7
uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38]; // uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38];
uint32_t ***lte_gold_uespec_port5_table;
/// UE-specific reference symbols (p=7...14), TM 8/9/10 /// UE-specific reference symbols (p=7...14), TM 8/9/10
uint32_t lte_gold_uespec_table[2][20][2][21]; uint32_t lte_gold_uespec_table[2][20][2][21];
...@@ -1105,7 +1124,8 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1105,7 +1124,8 @@ typedef struct PHY_VARS_eNB_s {
char eNB_generate_rar; char eNB_generate_rar;
/// Indicator set to 0 after first SR /// Indicator set to 0 after first SR
uint8_t first_sr[NUMBER_OF_UE_MAX]; // uint8_t first_sr[NUMBER_OF_UE_MAX];
uint8_t *first_sr;
uint32_t max_peak_val; uint32_t max_peak_val;
int max_eNB_id, max_sync_pos; int max_eNB_id, max_sync_pos;
...@@ -1117,7 +1137,8 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1117,7 +1137,8 @@ typedef struct PHY_VARS_eNB_s {
/// N0 (used for abstraction) /// N0 (used for abstraction)
double N0; double N0;
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX]; // unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX];
unsigned char *first_run_timing_advance;
unsigned char first_run_I0_measurements; unsigned char first_run_I0_measurements;
...@@ -1135,45 +1156,52 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1135,45 +1156,52 @@ typedef struct PHY_VARS_eNB_s {
// PDSCH Varaibles // PDSCH Varaibles
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX]; // PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX];
PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated;
// PUSCH Varaibles // PUSCH Varaibles
PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_UE_MAX]; // PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_UE_MAX];
PUSCH_CONFIG_DEDICATED *pusch_config_dedicated;
// PUCCH variables // PUCCH variables
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_UE_MAX]; // PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_UE_MAX];
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated;
// UL-POWER-Control // UL-POWER-Control
UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_UE_MAX]; // UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_UE_MAX];
UL_POWER_CONTROL_DEDICATED *ul_power_control_dedicated;
// TPC // TPC
TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX]; // TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX];
TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX]; // TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX];
TPC_PDCCH_CONFIG *tpc_pdcch_config_pucch;
TPC_PDCCH_CONFIG *tpc_pdcch_config_pusch;
// CQI reporting // CQI reporting
CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_UE_MAX]; // CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_UE_MAX];
CQI_REPORT_CONFIG *cqi_report_config;
// SRS Variables // SRS Variables
SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX]; // SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX];
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated;
uint8_t ncs_cell[20][7]; uint8_t ncs_cell[20][7];
// Scheduling Request Config // Scheduling Request Config
SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_UE_MAX]; // SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_UE_MAX];
SCHEDULING_REQUEST_CONFIG *scheduling_request_config;
// Transmission mode per UE // Transmission mode per UE
uint8_t transmission_mode[NUMBER_OF_UE_MAX]; // uint8_t transmission_mode[NUMBER_OF_UE_MAX];
uint8_t *transmission_mode;
/// cba_last successful reception for each group, used for collision detection /// cba_last successful reception for each group, used for collision detection
uint8_t cba_last_reception[4]; uint8_t cba_last_reception[4];
// Pointers for active physicalConfigDedicated to be applied in current subframe // Pointers for active physicalConfigDedicated to be applied in current subframe
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX]; // struct LTE_PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
struct LTE_PhysicalConfigDedicated **physicalConfigDedicated;
uint32_t rb_mask_ul[4]; uint32_t rb_mask_ul[4];
/// Information regarding TM5 /// Information regarding TM5
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX]; // MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
MU_MIMO_mode *mu_mimo_mode;
/// target_ue_dl_mcs : only for debug purposes /// target_ue_dl_mcs : only for debug purposes
...@@ -1243,7 +1271,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1243,7 +1271,7 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t ulsch_tc_intl1_stats; time_stats_t ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats; time_stats_t ulsch_tc_intl2_stats;
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10]; /* int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024]; int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024]; int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10]; int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
...@@ -1252,7 +1280,17 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1252,7 +1280,17 @@ typedef struct PHY_VARS_eNB_s {
int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240]; int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240];
int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240]; int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240];
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240]; int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240]; int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240]; */
int32_t **pucch1_stats_cnt;
int32_t **pucch1_stats;
int32_t **pucch1_stats_thres;
int32_t **pucch1ab_stats_cnt;
int32_t **pucch1ab_stats;
int32_t **pusch_stats_rb;
int32_t **pusch_stats_round;
int32_t **pusch_stats_mcs;
int32_t **pusch_stats_bsr;
int32_t **pusch_stats_BO;
} PHY_VARS_eNB; } PHY_VARS_eNB;
......
...@@ -244,6 +244,15 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -244,6 +244,15 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
clear_UE_transport_info(oai_emulation.info.nb_ue_local+ clear_UE_transport_info(oai_emulation.info.nb_ue_local+
oai_emulation.info.nb_ue_remote); oai_emulation.info.nb_ue_remote);
UE_transport_info = (UE_transport_info_t **)malloc(sizeof(UE_transport_info_t *)*NUMBER_OF_UE_MAX);
ue_cntl_delay = (UE_cntl ***)malloc(sizeof(UE_cntl **)*NUMBER_OF_UE_MAX);
for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
UE_transport_info[i] = (UE_transport_info_t *)malloc(sizeof(UE_transport_info_t)*MAX_NUM_CCs);
ue_cntl_delay[i] = (UE_cntl **)malloc(sizeof(UE_cntl *)*MAX_NUM_CCs);
for (int j = 0; j < 2; j++) {
ue_cntl_delay[i][j] = (UE_cntl *)malloc(sizeof(UE_cntl)*2);
}
}
if (oai_emulation.info.master[messg->master_id].nb_ue > 0 ) { if (oai_emulation.info.master[messg->master_id].nb_ue > 0 ) {
total_header += sizeof(UE_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE; total_header += sizeof(UE_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE;
......
...@@ -231,7 +231,7 @@ void clear_UE_transport_info(uint8_t nb_UE) ...@@ -231,7 +231,7 @@ void clear_UE_transport_info(uint8_t nb_UE)
for (UE_id=0; UE_id<nb_UE; UE_id++) for (UE_id=0; UE_id<nb_UE; UE_id++)
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
UE_transport_info_TB_index[UE_id][CC_id]=0; // UE_transport_info_TB_index[UE_id][CC_id]=0;
memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl)); memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl));
} }
......
...@@ -55,9 +55,12 @@ extern tx_handler_t tx_handler; ...@@ -55,9 +55,12 @@ extern tx_handler_t tx_handler;
extern eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; extern eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
extern uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; extern uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
extern UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; //extern UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
extern uint16_t UE_transport_info_TB_index[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; //extern uint16_t UE_transport_info_TB_index[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
extern UE_transport_info_t **UE_transport_info;
extern uint16_t **UE_transport_info_TB_index;
extern UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2]; //extern UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2];
extern UE_cntl ***ue_cntl_delay;
#endif #endif
...@@ -57,9 +57,12 @@ tx_handler_t tx_handler; ...@@ -57,9 +57,12 @@ tx_handler_t tx_handler;
eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; //UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
uint16_t UE_transport_info_TB_index[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; //uint16_t UE_transport_info_TB_index[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
UE_transport_info_t **UE_transport_info;
uint16_t **UE_transport_info_TB_index;
UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2]; //UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2];
UE_cntl ***ue_cntl_delay;
#endif #endif
...@@ -87,6 +87,13 @@ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */ ...@@ -87,6 +87,13 @@ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
#define TPUT_WINDOW_LENGTH 100
extern float **tput_time_enb;
extern float **tput_enb;
extern float **tput_time_ue;
extern float **tput_ue;
extern float *tput_ue_max;
int emulate_rf = 0; int emulate_rf = 0;
void handler(int sig) { void handler(int sig) {
...@@ -339,7 +346,8 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -339,7 +346,8 @@ void fill_DCI(PHY_VARS_eNB *eNB,
int frame, int frame,
int subframe, int subframe,
Sched_Rsp_t *sched_resp, Sched_Rsp_t *sched_resp,
uint8_t input_buffer[NUMBER_OF_UE_MAX][20000], //uint8_t input_buffer[NUMBER_OF_UE_MAX][20000],
uint8_t **input_buffer,
int n_rnti, int n_rnti,
int n_users, int n_users,
int transmission_mode, int transmission_mode,
...@@ -907,6 +915,23 @@ int main(int argc, char **argv) { ...@@ -907,6 +915,23 @@ int main(int argc, char **argv) {
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
//itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); //itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
tput_time_enb = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_enb = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_time_ue = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_ue = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_ue_max = (float *)malloc(sizeof(float)*NUMBER_OF_UE_MAX);
memset(tput_ue_max,0,sizeof(float)*NUMBER_OF_UE_MAX);
for (int ii = 0; ii < NUMBER_OF_UE_MAX; ii++) {
tput_time_enb[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_enb[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_time_ue[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_ue[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_time_enb[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_enb[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_time_ue[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_ue[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
}
if (common_flag == 0) { if (common_flag == 0) {
switch (N_RB_DL) { switch (N_RB_DL) {
case 6: case 6:
...@@ -1016,7 +1041,11 @@ int main(int argc, char **argv) { ...@@ -1016,7 +1041,11 @@ int main(int argc, char **argv) {
printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx_phy,n_rx,extended_prefix_flag); printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx_phy,n_rx,extended_prefix_flag);
snr1 = snr0+snr_int; snr1 = snr0+snr_int;
printf("SNR0 %f, SNR1 %f\n",snr0,snr1); printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
uint8_t input_buffer[NUMBER_OF_UE_MAX][20000]; //uint8_t input_buffer[NUMBER_OF_UE_MAX][20000];
uint8_t **input_buffer = (uint8_t **)malloc(sizeof(uint8_t *)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
input_buffer[i] = (uint8_t *)malloc(sizeof(uint8_t)*20000);
}
for (i=0; i<n_users; i++) for (i=0; i<n_users; i++)
for (j=0; j<20000; j++) input_buffer[i][j] = (uint8_t)((taus())&255); for (j=0; j<20000; j++) input_buffer[i][j] = (uint8_t)((taus())&255);
......
...@@ -61,12 +61,15 @@ double cpuf; ...@@ -61,12 +61,15 @@ double cpuf;
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0)) #define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
//#define MCS_COUNT 23//added for PHY abstraction //#define MCS_COUNT 23//added for PHY abstraction
#include <openair1/SIMULATION/LTE_PHY/common_sim.h> #include <openair1/SIMULATION/LTE_PHY/common_sim.h>
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; //channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX]; //channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
//Added for PHY abstractionopenair1/PHY/TOOLS/lte_phy_scope.h //Added for PHY abstractionopenair1/PHY/TOOLS/lte_phy_scope.h
node_desc_t *enb_data[NUMBER_OF_eNB_MAX]; node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
node_desc_t *ue_data[NUMBER_OF_UE_MAX]; //node_desc_t *ue_data[NUMBER_OF_UE_MAX];
//double sinr_bler_map[MCS_COUNT][2][16]; //double sinr_bler_map[MCS_COUNT][2][16];
channel_desc_t ***eNB2UE;
channel_desc_t ***UE2eNB;
node_desc_t **ue_data;
extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16]; extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
//extern char* namepointer_chMag ; //extern char* namepointer_chMag ;
...@@ -98,6 +101,13 @@ Sched_Rsp_t sched_resp; ...@@ -98,6 +101,13 @@ Sched_Rsp_t sched_resp;
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
#define TPUT_WINDOW_LENGTH 100
extern float **tput_time_enb;
extern float **tput_enb;
extern float **tput_time_ue;
extern float **tput_ue;
extern float *tput_ue_max;
void void
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu, fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
uint8_t cqi_req, uint8_t cqi_req,
...@@ -587,6 +597,22 @@ int main(int argc, char **argv) { ...@@ -587,6 +597,22 @@ int main(int argc, char **argv) {
if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD) if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD)
set_worker_conf("WORKER_ENABLE"); set_worker_conf("WORKER_ENABLE");
tput_time_enb = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_enb = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_time_ue = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_ue = (float **)malloc(sizeof(float *)*NUMBER_OF_UE_MAX);
tput_ue_max = (float *)malloc(sizeof(float)*NUMBER_OF_UE_MAX);
memset(tput_ue_max,0,sizeof(float)*NUMBER_OF_UE_MAX);
for (int ii = 0; ii < NUMBER_OF_UE_MAX; ii++) {
tput_time_enb[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_enb[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_time_ue[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
tput_ue[ii] = (float *)malloc(sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_time_enb[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_enb[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_time_ue[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
memset(tput_ue[ii],0,sizeof(float)*TPUT_WINDOW_LENGTH);
}
RC.nb_L1_inst = 1; RC.nb_L1_inst = 1;
RC.nb_RU = 1; RC.nb_RU = 1;
lte_param_init(&eNB,&UE,&ru, lte_param_init(&eNB,&UE,&ru,
......
...@@ -184,15 +184,21 @@ typedef enum { ...@@ -184,15 +184,21 @@ typedef enum {
#include "platform_constants.h" #include "platform_constants.h"
typedef struct { typedef struct {
channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs]; /* channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs]; channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
double r_re_DL[NUMBER_OF_UE_MAX][2][30720]; double r_re_DL[NUMBER_OF_UE_MAX][2][30720];
double r_im_DL[NUMBER_OF_UE_MAX][2][30720]; double r_im_DL[NUMBER_OF_UE_MAX][2][30720]; */
channel_desc_t ****RU2UE;
channel_desc_t ****UE2RU;
double ***r_re_DL;
double ***r_im_DL;
double r_re_UL[NUMBER_OF_eNB_MAX][2][30720]; double r_re_UL[NUMBER_OF_eNB_MAX][2][30720];
double r_im_UL[NUMBER_OF_eNB_MAX][2][30720]; double r_im_UL[NUMBER_OF_eNB_MAX][2][30720];
int RU_output_mask[NUMBER_OF_UE_MAX]; /* int RU_output_mask[NUMBER_OF_UE_MAX]; */
int *RU_output_mask;
int UE_output_mask[NUMBER_OF_RU_MAX]; int UE_output_mask[NUMBER_OF_RU_MAX];
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX]; /* pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX]; */
pthread_mutex_t *RU_output_mutex;
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX]; pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
pthread_mutex_t subframe_mutex; pthread_mutex_t subframe_mutex;
int subframe_ru_mask; int subframe_ru_mask;
......
...@@ -2634,6 +2634,28 @@ int RCconfig_parallel(void) { ...@@ -2634,6 +2634,28 @@ int RCconfig_parallel(void) {
return 0; return 0;
} }
int RCconfig_set_global_params(void)
{
int number_of_ue_max;
paramlist_def_t Global_params_list = {CONFIG_STRING_GLOBAL_PARAMS_LIST,NULL,0};
paramdef_t GlobalParams[] = GLOBAL_PARAMS_DESC;
config_getlist(&Global_params_list,NULL,0,NULL);
if (Global_params_list.numelt > 0) {
config_getlist(&Global_params_list,GlobalParams,sizeof(GlobalParams)/sizeof(paramdef_t),NULL);
number_of_ue_max = *(Global_params_list.paramarray[0][0].iptr);
if (number_of_ue_max <= 0 || number_of_ue_max > 256) {
printf("number_of_ue_max is not properly configured, shoule be 1-256, set to default.\n");
NUMBER_OF_UE_MAX = 16;
} else {
NUMBER_OF_UE_MAX = number_of_ue_max;
}
} else {
printf("No params found, set to default\n");
NUMBER_OF_UE_MAX = 16;
}
return 0;
}
void RCConfig(void) { void RCConfig(void) {
paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0};
paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0};
...@@ -2668,6 +2690,7 @@ void RCConfig(void) { ...@@ -2668,6 +2690,7 @@ void RCConfig(void) {
config_getlist( &RUParamList,NULL,0, NULL); config_getlist( &RUParamList,NULL,0, NULL);
RC.nb_RU = RUParamList.numelt; RC.nb_RU = RUParamList.numelt;
RCconfig_parallel(); RCconfig_parallel();
RCconfig_set_global_params();
} }
int check_plmn_identity(rrc_eNB_carrier_data_t *carrier,uint16_t mcc,uint16_t mnc,uint8_t mnc_digit_length) { int check_plmn_identity(rrc_eNB_carrier_data_t *carrier,uint16_t mcc,uint16_t mnc,uint8_t mnc_digit_length) {
......
...@@ -1154,6 +1154,22 @@ typedef struct srb1_params_s { ...@@ -1154,6 +1154,22 @@ typedef struct srb1_params_s {
#define CONFIG_HLP_PARALLEL "PARALLEL_SINGLE_THREAD, PARALLEL_RU_L1_SPLIT, or PARALLEL_RU_L1_TRX_SPLIT(RU_L1_TRX_SPLIT by defult)\n" #define CONFIG_HLP_PARALLEL "PARALLEL_SINGLE_THREAD, PARALLEL_RU_L1_SPLIT, or PARALLEL_RU_L1_TRX_SPLIT(RU_L1_TRX_SPLIT by defult)\n"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* global params section name */
#define CONFIG_STRING_GLOBAL_PARAMS_LIST "global_params"
/* global params names */
#define CONFIG_STRING_NUMBER_OF_UE_MAX "number_of_ue_max"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* thread configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GLOBAL_PARAMS_DESC { \
{CONFIG_STRING_NUMBER_OF_UE_MAX, CONFIG_HLP_NUMBER_OF_UE_MAX, 0, iptr:NULL, defintval:16, TYPE_INT, 0} \
}
#define CONFIG_HLP_NUMBER_OF_UE_MAX "number_of_ue_max\n"
#include "enb_paramdef_emtc.h" #include "enb_paramdef_emtc.h"
#include "enb_paramdef_sidelink.h" #include "enb_paramdef_sidelink.h"
#endif #endif
...@@ -949,34 +949,48 @@ typedef struct { ...@@ -949,34 +949,48 @@ typedef struct {
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/ /*! \brief UE list used by eNB to order UEs/CC for scheduling*/
typedef struct { typedef struct {
/// Dedicated information for UEs /// Dedicated information for UEs
struct PhysicalConfigDedicated *physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // struct PhysicalConfigDedicated *physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
struct PhysicalConfigDedicated **physicalConfigDedicated[MAX_NUM_CCs];
/// DLSCH pdu /// DLSCH pdu
DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX]; // DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX];
DLSCH_PDU *DLSCH_pdu[MAX_NUM_CCs][2];
/// DCI template and MAC connection parameters for UEs /// DCI template and MAC connection parameters for UEs
UE_TEMPLATE UE_template[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // UE_TEMPLATE UE_template[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
UE_TEMPLATE *UE_template[MAX_NUM_CCs];
/// DCI template and MAC connection for RA processes /// DCI template and MAC connection for RA processes
int pCC_id[NUMBER_OF_UE_MAX]; // int pCC_id[NUMBER_OF_UE_MAX];
int *pCC_id;
/// sorted downlink component carrier for the scheduler /// sorted downlink component carrier for the scheduler
int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int *ordered_CCids[MAX_NUM_CCs];
/// number of downlink active component carrier /// number of downlink active component carrier
int numactiveCCs[NUMBER_OF_UE_MAX]; // int numactiveCCs[NUMBER_OF_UE_MAX];
int *numactiveCCs;
/// sorted uplink component carrier for the scheduler /// sorted uplink component carrier for the scheduler
int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int *ordered_ULCCids[MAX_NUM_CCs];
/// number of uplink active component carrier /// number of uplink active component carrier
int numactiveULCCs[NUMBER_OF_UE_MAX]; // int numactiveULCCs[NUMBER_OF_UE_MAX];
int *numactiveULCCs;
/// number of downlink active component carrier /// number of downlink active component carrier
uint8_t dl_CC_bitmap[NUMBER_OF_UE_MAX]; // uint8_t dl_CC_bitmap[NUMBER_OF_UE_MAX];
uint8_t *dl_CC_bitmap;
/// eNB to UE statistics /// eNB to UE statistics
eNB_UE_STATS eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNB_UE_STATS eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
eNB_UE_STATS *eNB_UE_stats[MAX_NUM_CCs];
/// scheduling control info /// scheduling control info
UE_sched_ctrl UE_sched_ctrl[NUMBER_OF_UE_MAX]; // UE_sched_ctrl UE_sched_ctrl[NUMBER_OF_UE_MAX];
int next[NUMBER_OF_UE_MAX]; UE_sched_ctrl *UE_sched_ctrl;
// int next[NUMBER_OF_UE_MAX];
int *next;
int head; int head;
int next_ul[NUMBER_OF_UE_MAX]; // int next_ul[NUMBER_OF_UE_MAX];
int *next_ul;
int head_ul; int head_ul;
int avail; int avail;
int num_UEs; int num_UEs;
boolean_t active[NUMBER_OF_UE_MAX]; // boolean_t active[NUMBER_OF_UE_MAX];
boolean_t *active;
} UE_list_t; } UE_list_t;
/*! \brief eNB common channels */ /*! \brief eNB common channels */
...@@ -1248,7 +1262,8 @@ typedef struct { ...@@ -1248,7 +1262,8 @@ typedef struct {
/// Outgoing RAR pdu for PHY /// Outgoing RAR pdu for PHY
RAR_PDU RAR_pdu; RAR_PDU RAR_pdu;
/// Incoming DLSCH pdu for PHY /// Incoming DLSCH pdu for PHY
DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2]; // DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2];
DLSCH_PDU **DLSCH_pdu;
/// number of attempt for rach /// number of attempt for rach
uint8_t RA_attempt_number; uint8_t RA_attempt_number;
/// Random-access procedure flag /// Random-access procedure flag
......
...@@ -64,11 +64,11 @@ int last_dlsch_ue_id[MAX_NUM_CCs] = {-1}; ...@@ -64,11 +64,11 @@ int last_dlsch_ue_id[MAX_NUM_CCs] = {-1};
int last_ulsch_ue_id[MAX_NUM_CCs] = {-1}; int last_ulsch_ue_id[MAX_NUM_CCs] = {-1};
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; uint16_t *pre_nb_rbs_required[2][MAX_NUM_CCs];
uint8_t dlsch_ue_select_tbl_in_use; uint8_t dlsch_ue_select_tbl_in_use;
uint8_t new_dlsch_ue_select_tbl_in_use; uint8_t new_dlsch_ue_select_tbl_in_use;
boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; boolean_t *pre_scd_activeUE;
eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; eNB_UE_STATS *pre_scd_eNB_UE_stats[MAX_NUM_CCs];
#endif #endif
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
...@@ -106,7 +106,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, ...@@ -106,7 +106,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int min_rb_unit[MAX_NUM_CCs], int min_rb_unit[MAX_NUM_CCs],
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]) { uint16_t *nb_rbs_required[MAX_NUM_CCs]) {
int CC_id=0,UE_id, lc_id, N_RB_DL; int CC_id=0,UE_id, lc_id, N_RB_DL;
UE_TEMPLATE UE_template; UE_TEMPLATE UE_template;
eNB_UE_STATS *eNB_UE_stats; eNB_UE_STATS *eNB_UE_stats;
...@@ -119,7 +119,10 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, ...@@ -119,7 +119,10 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
if(N_RB_DL==100) step_size=4; if(N_RB_DL==100) step_size=4;
memset(nb_rbs_required, 0, sizeof(uint16_t)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); for (int i = 0; i < MAX_NUM_CCs; i++) {
memset(nb_rbs_required[i],0,sizeof(uint16_t)*NUMBER_OF_UE_MAX);
}
// memset(nb_rbs_required, 0, sizeof(uint16_t)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
for (UE_id = 0; UE_id <NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id <NUMBER_OF_UE_MAX; UE_id++) {
...@@ -174,7 +177,7 @@ void dlsch_scheduler_pre_ue_select_fairRR( ...@@ -174,7 +177,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int *mbsfn_flag, int *mbsfn_flag,
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], uint16_t **nb_rbs_required,
DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs]) { DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs]) {
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = eNB->common_channels; COMMON_channels_t *cc = eNB->common_channels;
...@@ -576,9 +579,11 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -576,9 +579,11 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
uint8_t slice_allocation[MAX_NUM_CCs][N_RBG_MAX]; uint8_t slice_allocation[MAX_NUM_CCs][N_RBG_MAX];
int UE_id, i; int UE_id, i;
uint16_t j,c; uint16_t j,c;
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
// uint16_t nb_rbs_required_remaining_1[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // uint16_t nb_rbs_required_remaining_1[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
uint16_t **nb_rbs_required;
uint16_t **nb_rbs_required_remaining;
uint16_t average_rbs_per_user[MAX_NUM_CCs] = {0}; uint16_t average_rbs_per_user[MAX_NUM_CCs] = {0};
rnti_t rnti; rnti_t rnti;
int min_rb_unit[MAX_NUM_CCs]; int min_rb_unit[MAX_NUM_CCs];
...@@ -601,6 +606,12 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -601,6 +606,12 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
#endif #endif
memset(rballoc_sub[0],0,(MAX_NUM_CCs)*(N_RBG_MAX)*sizeof(unsigned char)); memset(rballoc_sub[0],0,(MAX_NUM_CCs)*(N_RBG_MAX)*sizeof(unsigned char));
memset(min_rb_unit,0,sizeof(min_rb_unit)); memset(min_rb_unit,0,sizeof(min_rb_unit));
nb_rbs_required = (uint16_t **)malloc(sizeof(uint16_t *)*MAX_NUM_CCs);
nb_rbs_required_remaining = (uint16_t **)malloc(sizeof(uint16_t *)*MAX_NUM_CCs);
for (i = 0; i < MAX_NUM_CCs; i++) {
nb_rbs_required[i] = (uint16_t *)malloc(sizeof(uint16_t)*NUMBER_OF_UE_MAX);
nb_rbs_required_remaining[i] = (uint16_t *)malloc(sizeof(uint16_t)*NUMBER_OF_UE_MAX);
}
memset(MIMO_mode_indicator[0], 0, MAX_NUM_CCs*N_RBG_MAX*sizeof(unsigned char)); memset(MIMO_mode_indicator[0], 0, MAX_NUM_CCs*N_RBG_MAX*sizeof(unsigned char));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -615,15 +626,15 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -615,15 +626,15 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
UE_id = i; UE_id = i;
// Initialize scheduling information for all active UEs // Initialize scheduling information for all active UEs
dlsch_scheduler_pre_processor_reset(Mod_id, dlsch_scheduler_pre_processor_reset_fairRR(Mod_id,
0, 0,
frameP, frameP,
subframeP, subframeP,
min_rb_unit, min_rb_unit,
(uint16_t (*)[NUMBER_OF_UE_MAX])nb_rbs_required, nb_rbs_required,
rballoc_sub, rballoc_sub,
MIMO_mode_indicator, MIMO_mode_indicator,
mbsfn_flag); mbsfn_flag);
} }
} }
...@@ -631,10 +642,13 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -631,10 +642,13 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
// Store the DLSCH buffer for each logical channel // Store the DLSCH buffer for each logical channel
store_dlsch_buffer(Mod_id,0, frameP, subframeP); store_dlsch_buffer(Mod_id,0, frameP, subframeP);
// Calculate the number of RBs required by each UE on the basis of logical channel's buffer // Calculate the number of RBs required by each UE on the basis of logical channel's buffer
assign_rbs_required(Mod_id, 0, frameP, subframeP, nb_rbs_required, assign_rbs_required_fairRR(Mod_id, 0, frameP, subframeP, nb_rbs_required,
min_rb_unit); min_rb_unit);
#else #else
memcpy(nb_rbs_required, pre_nb_rbs_required[dlsch_ue_select_tbl_in_use], sizeof(uint16_t)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); // memcpy(nb_rbs_required, pre_nb_rbs_required[dlsch_ue_select_tbl_in_use], sizeof(uint16_t)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
for (i = 0; i < MAX_NUM_CCs; i++) {
memcpy(nb_rbs_required[i],pre_nb_rbs_required[dlsch_ue_select_tbl_in_use][i],sizeof(uint16_t)*NUMBER_OF_UE_MAX);
}
#endif #endif
dlsch_scheduler_pre_ue_select_fairRR(Mod_id,frameP,subframeP, mbsfn_flag,nb_rbs_required,dlsch_ue_select); dlsch_scheduler_pre_ue_select_fairRR(Mod_id,frameP,subframeP, mbsfn_flag,nb_rbs_required,dlsch_ue_select);
...@@ -696,17 +710,17 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -696,17 +710,17 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
for (j = 0; j < N_RBG_MAX; ++j) for (j = 0; j < N_RBG_MAX; ++j)
slice_allocation[c][j] = 1; slice_allocation[c][j] = 1;
LOG_T(MAC,"calling dlsch_scheduler_pre_processor_allocate .. \n "); LOG_T(MAC,"calling dlsch_scheduler_pre_processor_allocate_fairRR .. \n ");
dlsch_scheduler_pre_processor_allocate (Mod_id, dlsch_scheduler_pre_processor_allocate_fairRR (Mod_id,
UE_id, UE_id,
CC_id, CC_id,
N_RBG[CC_id], N_RBG[CC_id],
min_rb_unit[CC_id], min_rb_unit[CC_id],
(uint16_t (*)[NUMBER_OF_UE_MAX])nb_rbs_required, nb_rbs_required,
(uint16_t (*)[NUMBER_OF_UE_MAX])nb_rbs_required_remaining, nb_rbs_required_remaining,
rballoc_sub, rballoc_sub,
slice_allocation, slice_allocation,
MIMO_mode_indicator); MIMO_mode_indicator);
temp_total_rbs_count -= ue_sched_ctl->pre_nb_available_rbs[CC_id]; temp_total_rbs_count -= ue_sched_ctl->pre_nb_available_rbs[CC_id];
temp_total_ue_count--; temp_total_ue_count--;
...@@ -809,6 +823,12 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -809,6 +823,12 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
} }
} }
} }
for (i = 0; i < MAX_NUM_CCs; i++) {
free_and_zero(nb_rbs_required[i]);
free_and_zero(nb_rbs_required_remaining[i]);
}
free_and_zero(nb_rbs_required);
free_and_zero(nb_rbs_required_remaining);
} }
......
...@@ -82,7 +82,8 @@ void dlsch_scheduler_pre_ue_select_fairRR( ...@@ -82,7 +82,8 @@ void dlsch_scheduler_pre_ue_select_fairRR(
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int* mbsfn_flag, int* mbsfn_flag,
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], // uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t **nb_rbs_required,
DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs]); DLSCH_UE_SELECT dlsch_ue_select[MAX_NUM_CCs]);
void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
......
...@@ -1195,7 +1195,8 @@ typedef struct { ...@@ -1195,7 +1195,8 @@ typedef struct {
/*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/ /*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/
typedef struct { typedef struct {
/// deleting control info /// deleting control info
UE_free_ctrl_t UE_free_ctrl[NUMBER_OF_UE_MAX+1]; // UE_free_ctrl_t UE_free_ctrl[NUMBER_OF_UE_MAX+1];
UE_free_ctrl_t *UE_free_ctrl;
int num_UEs; int num_UEs;
int head_freelist; ///the head position of the delete list int head_freelist; ///the head position of the delete list
int tail_freelist; ///the tail position of the delete list int tail_freelist; ///the tail position of the delete list
...@@ -1778,7 +1779,8 @@ typedef struct { ...@@ -1778,7 +1779,8 @@ typedef struct {
typedef struct { typedef struct {
uint16_t num_UEs; uint16_t num_UEs;
RRC_release_ctrl_t RRC_release_ctrl[NUMBER_OF_UE_MAX]; // RRC_release_ctrl_t RRC_release_ctrl[NUMBER_OF_UE_MAX];
RRC_release_ctrl_t *RRC_release_ctrl;
} RRC_release_list_t; } RRC_release_list_t;
typedef struct { typedef struct {
......
...@@ -78,11 +78,11 @@ extern uint8_t rb_table[34]; ...@@ -78,11 +78,11 @@ extern uint8_t rb_table[34];
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern uint16_t *pre_nb_rbs_required[2][MAX_NUM_CCs];
extern uint8_t dlsch_ue_select_tbl_in_use; extern uint8_t dlsch_ue_select_tbl_in_use;
extern uint8_t new_dlsch_ue_select_tbl_in_use; extern uint8_t new_dlsch_ue_select_tbl_in_use;
extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX]; extern boolean_t *pre_scd_activeUE;
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; extern eNB_UE_STATS *pre_scd_eNB_UE_stats[MAX_NUM_CCs];
#endif #endif
extern mac_rlc_am_muilist_t rlc_am_mui; extern mac_rlc_am_muilist_t rlc_am_mui;
......
...@@ -239,6 +239,16 @@ void dlsch_scheduler_pre_processor_reset(module_id_t module_idP, ...@@ -239,6 +239,16 @@ void dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX], uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX],
int *mbsfn_flag); int *mbsfn_flag);
void dlsch_scheduler_pre_processor_reset_fairRR(module_id_t module_idP,
int slice_idx,
frame_t frameP,
sub_frame_t subframeP,
int min_rb_unit[NFAPI_CC_MAX],
uint16_t **nb_rbs_required_p,
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX],
int *mbsfn_flag);
void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id, void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id,
int slice_idx, int slice_idx,
const uint8_t rbs_retx[NFAPI_CC_MAX]); const uint8_t rbs_retx[NFAPI_CC_MAX]);
...@@ -291,6 +301,17 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, ...@@ -291,6 +301,17 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX], uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX],
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]); uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
void dlsch_scheduler_pre_processor_allocate_fairRR(module_id_t Mod_id,
int UE_id,
uint8_t CC_id,
int N_RBG,
int min_rb_unit,
uint16_t **nb_rbs_required_p,
uint16_t **nb_rbs_remaining_p,
uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX],
uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX],
uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]);
/* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f /* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f
and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f. and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f.
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
...@@ -726,6 +747,7 @@ int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); ...@@ -726,6 +747,7 @@ int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP); void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP);
void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]); void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]);
void assign_rbs_required_fairRR(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t **nb_rbs_required, int min_rb_unit[NFAPI_CC_MAX]);
void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag); void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag);
int prev(UE_list_t * listP, int nodeP, int ul_flag); int prev(UE_list_t * listP, int nodeP, int ul_flag);
...@@ -1308,7 +1330,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, ...@@ -1308,7 +1330,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
int min_rb_unit[MAX_NUM_CCs], int min_rb_unit[MAX_NUM_CCs],
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]); uint16_t *nb_rbs_required[MAX_NUM_CCs]);
#endif #endif
/* Slice related functions */ /* Slice related functions */
...@@ -1322,5 +1344,8 @@ void eNB_Config_Local_DRX(module_id_t Mod_id, rnti_t rnti, LTE_DRX_Config_t *drx ...@@ -1322,5 +1344,8 @@ void eNB_Config_Local_DRX(module_id_t Mod_id, rnti_t rnti, LTE_DRX_Config_t *drx
/* from here: prototypes to get rid of compilation warnings: doc to be written by function author */ /* from here: prototypes to get rid of compilation warnings: doc to be written by function author */
uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe); uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe);
void ue_free_list_malloc(UE_free_list_t *ue_free_list);
void ue_free_list_free(UE_free_list_t *ue_free_list);
#endif #endif
/** @}*/ /** @}*/
...@@ -122,6 +122,7 @@ void mac_top_init_eNB(void) ...@@ -122,6 +122,7 @@ void mac_top_init_eNB(void)
"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n", "[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",
sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, mac); sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, mac);
bzero(mac[i], sizeof(eNB_MAC_INST)); bzero(mac[i], sizeof(eNB_MAC_INST));
ue_free_list_malloc(&(mac[i]->UE_free_list));
mac[i]->Mod_id = i; mac[i]->Mod_id = i;
for (j = 0; j < MAX_NUM_CCs; j++) { for (j = 0; j < MAX_NUM_CCs; j++) {
mac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = mac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list =
...@@ -223,3 +224,13 @@ int l2_init_eNB(void) ...@@ -223,3 +224,13 @@ int l2_init_eNB(void)
return (1); return (1);
} }
void ue_free_list_malloc(UE_free_list_t *ue_free_list)
{
ue_free_list->UE_free_ctrl = (UE_free_ctrl_t *)malloc(sizeof(UE_free_ctrl_t)*(NUMBER_OF_UE_MAX+1));
}
void ue_free_list_free(UE_free_list_t *ue_free_list)
{
free_and_zero(ue_free_list->UE_free_ctrl);
}
This diff is collapsed.
...@@ -83,7 +83,7 @@ extern struct msghdr nas_msg_rx; ...@@ -83,7 +83,7 @@ extern struct msghdr nas_msg_rx;
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX]; extern uint16_t *inst_pdcp_list;
#endif #endif
extern Packet_OTG_List_t *otg_pdcp_buffer; extern Packet_OTG_List_t *otg_pdcp_buffer;
......
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
#define UE_IP_NB_INSTANCES_MAX NUMBER_OF_UE_MAX /*MAX_MOBILES_PER_ENB*/ //#define UE_IP_NB_INSTANCES_MAX NUMBER_OF_UE_MAX /*MAX_MOBILES_PER_ENB*/
signed int UE_IP_NB_INSTANCES_MAX;
#endif #endif
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
struct net_device *ue_ip_dev[UE_IP_NB_INSTANCES_MAX]; //struct net_device *ue_ip_dev[UE_IP_NB_INSTANCES_MAX];
struct net_device **ue_ip_dev;
#ifdef OAI_NW_DRIVER_USE_NETLINK #ifdef OAI_NW_DRIVER_USE_NETLINK
extern void ue_ip_netlink_release(void); extern void ue_ip_netlink_release(void);
...@@ -366,6 +367,8 @@ int init_module (void) { ...@@ -366,6 +367,8 @@ int init_module (void) {
// Initialize parameters shared with RRC // Initialize parameters shared with RRC
printk("[UE_IP_DRV][%s] Starting OAI IP driver", __FUNCTION__); printk("[UE_IP_DRV][%s] Starting OAI IP driver", __FUNCTION__);
UE_IP_NB_INSTANCES_MAX = NUMBER_OF_UE_MAX;
ue_ip_dev = (struct net_device **)malloc(sizeof(struct net_device*)*UE_IP_NB_INSTANCES_MAX);
for (inst=0; inst<UE_IP_NB_INSTANCES_MAX; inst++) { for (inst=0; inst<UE_IP_NB_INSTANCES_MAX; inst++) {
printk("[UE_IP_DRV][%s] begin init instance %d\n", __FUNCTION__,inst); printk("[UE_IP_DRV][%s] begin init instance %d\n", __FUNCTION__,inst);
sprintf(devicename,"oip%d",inst+1); sprintf(devicename,"oip%d",inst+1);
......
...@@ -109,7 +109,7 @@ typedef struct pdcp_data_ind_header_s { ...@@ -109,7 +109,7 @@ typedef struct pdcp_data_ind_header_s {
extern struct net_device *ue_ip_dev[UE_IP_NB_INSTANCES_MAX]; //extern struct net_device *ue_ip_dev[UE_IP_NB_INSTANCES_MAX];
extern struct net_device **ue_ip_dev;
#endif #endif
...@@ -8537,6 +8537,8 @@ void rrc_enb_init(void) { ...@@ -8537,6 +8537,8 @@ void rrc_enb_init(void) {
pthread_mutex_init(&lock_ue_freelist, NULL); pthread_mutex_init(&lock_ue_freelist, NULL);
pthread_mutex_init(&rrc_release_freelist, NULL); pthread_mutex_init(&rrc_release_freelist, NULL);
memset(&rrc_release_info,0,sizeof(RRC_release_list_t)); memset(&rrc_release_info,0,sizeof(RRC_release_list_t));
rrc_release_info.RRC_release_ctrl = (RRC_release_ctrl_t *)malloc(sizeof(RRC_release_ctrl_t)*NUMBER_OF_UE_MAX);
memset(rrc_release_info.RRC_release_ctrl,0,sizeof(RRC_release_ctrl_t)*NUMBER_OF_UE_MAX);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -260,4 +260,3 @@ int OCG_main(char is_local_server[FILENAME_LENGTH_MAX]) ...@@ -260,4 +260,3 @@ int OCG_main(char is_local_server[FILENAME_LENGTH_MAX])
return 1; return 1;
#endif #endif
} }
...@@ -454,13 +454,20 @@ typedef struct { ...@@ -454,13 +454,20 @@ typedef struct {
* @brief Including Application type, Source, destination, background, etc * @brief Including Application type, Source, destination, background, etc
* @{*/ * @{*/
typedef struct { typedef struct {
char *application_type[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; /* char *application_type[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *source_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *source_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *destination_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *destination_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *background[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *background[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
unsigned int aggregation_level[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; unsigned int aggregation_level[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
int flow_start[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; int flow_start[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
int flow_duration[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; int flow_duration[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; */
char **application_type;
char **source_id;
char **destination_id;
char **background;
unsigned int *aggregation_level;
int *flow_start;
int *flow_duration;
} Predefined_Traffic; } Predefined_Traffic;
/* @}*/ /* @}*/
...@@ -489,7 +496,7 @@ typedef struct { ...@@ -489,7 +496,7 @@ typedef struct {
//int ed; //int ed;
//double holding_time_off_pe; //double holding_time_off_pe;
char *application_type[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; /* char *application_type[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *source_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *source_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *destination_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *destination_id[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
char *traffic[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; char *traffic[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
...@@ -530,7 +537,50 @@ typedef struct { ...@@ -530,7 +537,50 @@ typedef struct {
unsigned int holding_time_off_pe[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; unsigned int holding_time_off_pe[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
unsigned int holding_time_pe_off[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; unsigned int holding_time_pe_off[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
unsigned int pu_size_pkts[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; unsigned int pu_size_pkts[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
unsigned int ed_size_pkts[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; unsigned int ed_size_pkts[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; */
char **application_type;
char **source_id;
char **destination_id;
char **traffic;
char **transport_protocol;
char **ip_version;
char **background;
char **idt_dist;
int *idt_min_ms;
int *idt_max_ms;
double *idt_standard_deviation;
double *idt_lambda;
double *idt_scale;
double *idt_shape;
char **size_dist;
int *size_min_byte;
int *size_max_byte;
double *size_standard_deviation;
double *size_lambda;
double *size_scale;
double *size_shape;
int *stream;
int *destination_port;
unsigned int *aggregation_level;
int *flow_start;
int *flow_duration;
char **m2m;
//M2M_Traffic m2m_traffic;
double *prob_off_pu;
double *prob_off_ed;
double *prob_off_pe;
double *prob_pu_ed;
double *prob_pu_pe;
double *prob_ed_pe;
double *prob_ed_pu;
unsigned int *holding_time_off_ed;
unsigned int *holding_time_off_pu;
unsigned int *holding_time_off_pe;
unsigned int *holding_time_pe_off;
unsigned int *pu_size_pkts;
unsigned int *ed_size_pkts;
} Customized_Traffic; } Customized_Traffic;
/* @}*/ /* @}*/
...@@ -686,8 +736,10 @@ typedef struct { ...@@ -686,8 +736,10 @@ typedef struct {
unsigned char cli_num_enb; unsigned char cli_num_enb;
unsigned char cli_start_enb[NUMBER_OF_eNB_MAX]; unsigned char cli_start_enb[NUMBER_OF_eNB_MAX];
unsigned char cli_num_ue; unsigned char cli_num_ue;
unsigned char cli_start_ue[NUMBER_OF_UE_MAX]; // unsigned char cli_start_ue[NUMBER_OF_UE_MAX];
unsigned char oai_ifup[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; // unsigned char oai_ifup[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX];
unsigned char *cli_start_ue;
unsigned char *oai_ifup;
// emu related // emu related
unsigned int seed; unsigned int seed;
unsigned int frame; unsigned int frame;
...@@ -717,10 +769,12 @@ typedef struct { ...@@ -717,10 +769,12 @@ typedef struct {
*/ */
unsigned char slot_isr; unsigned char slot_isr;
int slot_sfd; int slot_sfd;
rnti_t eNB_ue_module_id_to_rnti[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];/*!< \brief used by eNB, this array can be filled: rnti_t *eNB_ue_module_id_to_rnti[NUMBER_OF_eNB_MAX];
module_id_t *eNB_ue_local_uid_to_ue_module_id[NUMBER_OF_eNB_MAX];
/* rnti_t eNB_ue_module_id_to_rnti[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];*//*!< \brief used by eNB, this array can be filled:
by local virtualization: set directly by UE, or by remote UEs: TODO add signalisation on ethernet emulation link from UE to eNB*/ by local virtualization: set directly by UE, or by remote UEs: TODO add signalisation on ethernet emulation link from UE to eNB*/
module_id_t eNB_ue_local_uid_to_ue_module_id[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];/*!< \brief used by eNB, this array can be filled: /* module_id_t eNB_ue_local_uid_to_ue_module_id[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];*//*!< \brief used by eNB, this array can be filled:
by local virtualization: set directly by UE, or by remote UEs: TODO add signalisation on ethernet emulation link from UE to eNB*/ by local virtualization: set directly by UE, or by remote UEs: TODO add signalisation on ethernet emulation link from UE to eNB*/
} Info; } Info;
...@@ -731,7 +785,8 @@ typedef struct { ...@@ -731,7 +785,8 @@ typedef struct {
* @brief OAI Emulation struct for OSD_basic * @brief OAI Emulation struct for OSD_basic
* @{*/ * @{*/
typedef struct { typedef struct {
Mac_config mac_config[NUMBER_OF_UE_MAX]; // Mac_config mac_config[NUMBER_OF_UE_MAX];
Mac_config *mac_config;
Environment_System_Config environment_system_config; /*!< \brief Evironment configuration */ Environment_System_Config environment_system_config; /*!< \brief Evironment configuration */
Topology_Config topology_config; /*!< \brief Topology configuration */ Topology_Config topology_config; /*!< \brief Topology configuration */
Application_Config application_config; /*!< \brief Applications configuration */ Application_Config application_config; /*!< \brief Applications configuration */
...@@ -766,6 +821,21 @@ typedef struct { ...@@ -766,6 +821,21 @@ typedef struct {
int OCG_main (char is_local_server[FILENAME_LENGTH_MAX]); int OCG_main (char is_local_server[FILENAME_LENGTH_MAX]);
void predefined_traffic_malloc(Predefined_Traffic *predefined_traffic);
void predefined_traffic_free(Predefined_Traffic *predefined_traffic);
void customized_traffic_malloc(Customized_Traffic *customized_traffic);
void customized_traffic_free(Customized_Traffic *customized_traffic);
void application_config_malloc(Application_Config *application_config);
void application_config_free(Application_Config *application_config);
void info_malloc(Info *info);
void info_free(Info *info);
void oai_emulation_malloc(OAI_Emulation *oai_emulation);
void oai_emulation_free(OAI_Emulation *oai_emulation);
// void init_oai_emulation (void); // void init_oai_emulation (void);
//#include "UTIL/LOG/log.h" //#include "UTIL/LOG/log.h"
......
...@@ -69,7 +69,7 @@ char *map_int_to_str(mapping *map, int val) { ...@@ -69,7 +69,7 @@ char *map_int_to_str(mapping *map, int val) {
// mobtype = map_int_to_str(omg_model_names,omv_data.geo[i].mobility_type) // mobtype = map_int_to_str(omg_model_names,omv_data.geo[i].mobility_type)
extern int pfd[2]; extern int pfd[2];
extern struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; extern struct Geo *geo;
extern int nb_frames; extern int nb_frames;
extern int node_number; extern int node_number;
extern int nb_enb; extern int nb_enb;
...@@ -90,6 +90,11 @@ void CommunicationThread::run() ...@@ -90,6 +90,11 @@ void CommunicationThread::run()
int counter = nb_frames; int counter = nb_frames;
Data_Flow_Unit data; Data_Flow_Unit data;
data_flow_unit_malloc(&data);
geo = (struct Geo *)malloc(sizeof(struct Geo)*(NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX));
for (int i = 0; i < (NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX); i++) {
struct_geo_malloc(&(geo[i]));
}
while (counter > 0 && !end){ while (counter > 0 && !end){
switch( nread = read(pfd[0], &data, sizeof(Data_Flow_Unit))) { switch( nread = read(pfd[0], &data, sizeof(Data_Flow_Unit))) {
case -1 : case -1 :
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
//extern pid_t simulator_pid; //extern pid_t simulator_pid;
extern int pfd[2]; extern int pfd[2];
extern struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; //extern struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX];
extern struct Geo *geo;
extern CommunicationThread* communication_thread; extern CommunicationThread* communication_thread;
extern int x_area, y_area; extern int x_area, y_area;
extern int nb_frames; extern int nb_frames;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
//pid_t simulator_pid; //pid_t simulator_pid;
int pfd[2]; int pfd[2];
struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; struct Geo *geo;
int x_area, y_area, z_area; int x_area, y_area, z_area;
int nb_frames; int nb_frames;
int nb_enb; int nb_enb;
...@@ -79,3 +79,30 @@ int main(int argc, char *argv[]) { ...@@ -79,3 +79,30 @@ int main(int argc, char *argv[]) {
return end_value; return end_value;
} }
void struct_geo_malloc(struct Geo *geo)
{
geo->Neighbor = (int *)malloc(sizeof(int)*NUMBER_OF_UE_MAX);
}
void struct_geo_free(struct Geo *geo)
{
free(geo->Neighbor);
}
void data_flow_unit_malloc(Data_Flow_Unit *data_flow_unit)
{
int i;
data_flow_unit->geo = (struct Geo *)malloc(sizeof(struct Geo)*(NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX));
for (i = 0; i < (NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX); i++) {
struct_geo_malloc(&(data_flow_unit->geo[i]));
}
}
void data_flow_unit_free(Data_Flow_Unit *data_flow_unit)
{
int i;
for (i = 0; i < (NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX); i++) {
struct_geo_free(&(data_flow_unit->geo[i]));
}
free(data_flow_unit->geo);
}
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include <GL/glu.h> #include <GL/glu.h>
#include <stdio.h> #include <stdio.h>
extern struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; //extern struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX];
extern struct Geo *geo;
extern int x_area; extern int x_area;
extern int y_area; extern int y_area;
extern int z_area; extern int z_area;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "openairinterface5g_limits.h" #include "openairinterface5g_limits.h"
#ifndef __PHY_IMPLEMENTATION_DEFS_H__ #ifndef __PHY_IMPLEMENTATION_DEFS_H__
#define Maxneighbor NUMBER_OF_UE_MAX // #define Maxneighbor NUMBER_OF_UE_MAX
#ifndef NB_ANTENNAS_RX #ifndef NB_ANTENNAS_RX
#define NB_ANTENNAS_RX 4 #define NB_ANTENNAS_RX 4
#endif #endif
...@@ -48,7 +48,8 @@ typedef struct Geo { ...@@ -48,7 +48,8 @@ typedef struct Geo {
int mobility_type; // model of mobility int mobility_type; // model of mobility
int node_type; int node_type;
int Neighbors; // number of neighboring nodes (distance between the node and its neighbors < 100) int Neighbors; // number of neighboring nodes (distance between the node and its neighbors < 100)
int Neighbor[NUMBER_OF_UE_MAX]; // array of its neighbors // int Neighbor[NUMBER_OF_UE_MAX]; // array of its neighbors
int *Neighbor;
//relavent to UE only //relavent to UE only
unsigned short state; unsigned short state;
unsigned short rnti; unsigned short rnti;
...@@ -62,9 +63,13 @@ typedef struct Geo { ...@@ -62,9 +63,13 @@ typedef struct Geo {
typedef struct Data_Flow_Unit { typedef struct Data_Flow_Unit {
// int total_num_nodes; // int total_num_nodes;
struct Geo geo[NUMBER_OF_eNB_MAX+NUMBER_OF_UE_MAX]; struct Geo *geo;
int end; int end;
} Data_Flow_Unit; } Data_Flow_Unit;
void data_flow_unit_malloc(Data_Flow_Unit *data_flow_unit);
void data_flow_unit_free(Data_Flow_Unit *data_flow_unit);
void struct_geo_malloc(struct Geo *geo);
void struct_geo_free(struct Geo *geo);
#endif // STRUCTURES_H #endif // STRUCTURES_H
...@@ -57,7 +57,7 @@ Description Defines functions used to handle EPS bearer contexts. ...@@ -57,7 +57,7 @@ Description Defines functions used to handle EPS bearer contexts.
#include <arpa/inet.h> #include <arpa/inet.h>
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
#include "openairinterface5g_limits.h" #include "openairinterface5g_limits.h"
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX]; extern uint16_t *inst_pdcp_list;
#endif #endif
/****************************************************************************/ /****************************************************************************/
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
// XXX simple array container for multiple users // XXX simple array container for multiple users
typedef struct { typedef struct {
size_t count; size_t count;
nas_user_t item[NUMBER_OF_UE_MAX]; // nas_user_t item[NUMBER_OF_UE_MAX];
nas_user_t *item;
} nas_user_container_t; } nas_user_container_t;
nas_user_t *find_user_from_fd(nas_user_container_t *users, int fd); nas_user_t *find_user_from_fd(nas_user_container_t *users, int fd);
......
...@@ -46,6 +46,7 @@ int create_tasks_ue(uint32_t ue_nb) { ...@@ -46,6 +46,7 @@ int create_tasks_ue(uint32_t ue_nb) {
if (ue_nb > 0) { if (ue_nb > 0) {
nas_user_container_t *users = calloc(1, sizeof(*users)); nas_user_container_t *users = calloc(1, sizeof(*users));
users->item = (nas_user_t *)calloc(NUMBER_OF_UE_MAX,sizeof(nas_user_t));
if (users == NULL) abort(); if (users == NULL) abort();
......
#ifndef OPENAIRINTERFACE5G_LIMITS_H_ #ifndef OPENAIRINTERFACE5G_LIMITS_H_
#define OPENAIRINTERFACE5G_LIMITS_H_ #define OPENAIRINTERFACE5G_LIMITS_H_
signed int NUMBER_OF_UE_MAX;
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) #if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR)
# define NUMBER_OF_eNB_MAX 1 # define NUMBER_OF_eNB_MAX 1
# define NUMBER_OF_RU_MAX 2 # define NUMBER_OF_RU_MAX 2
...@@ -11,16 +13,16 @@ ...@@ -11,16 +13,16 @@
// now , if we use --mu option in UE, compiling error will occur. // now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future. // This problem will be fixed in the future.
# ifndef UESIM_EXPANSION # ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 16 //# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_UCI_VARS_MAX 56 # define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 3 # define NUMBER_OF_CONNECTED_eNB_MAX 3
# else # else
# define NUMBER_OF_UE_MAX 256 //# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256 # define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1 # define NUMBER_OF_CONNECTED_eNB_MAX 1
# endif # endif
# else # else
# define NUMBER_OF_UE_MAX 256 //# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256 # define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1 # define NUMBER_OF_CONNECTED_eNB_MAX 1
# endif # endif
...@@ -34,34 +36,34 @@ Now some parts are using NUMBER_OF_UE_MAX ...@@ -34,34 +36,34 @@ Now some parts are using NUMBER_OF_UE_MAX
and the other are using MAX_MOBILES_PER_ENB in for-loop. and the other are using MAX_MOBILES_PER_ENB in for-loop.
*/ */
# ifndef UESIM_EXPANSION # ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 16 //# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_UCI_VARS_MAX 56 # define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 3 # define NUMBER_OF_CONNECTED_eNB_MAX 3
# else # else
# define NUMBER_OF_UE_MAX 256 //# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256 # define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1 # define NUMBER_OF_CONNECTED_eNB_MAX 1
# endif # endif
# else # else
# define NUMBER_OF_UE_MAX 256 //# define NUMBER_OF_UE_MAX 256
# define NUMBER_OF_UCI_VARS_MAX 256 # define NUMBER_OF_UCI_VARS_MAX 256
# define NUMBER_OF_CONNECTED_eNB_MAX 1 # define NUMBER_OF_CONNECTED_eNB_MAX 1
# endif # endif
# if defined(STANDALONE) && STANDALONE==1 # if defined(STANDALONE) && STANDALONE==1
# undef NUMBER_OF_eNB_MAX # undef NUMBER_OF_eNB_MAX
# undef NUMBER_OF_UE_MAX //# undef NUMBER_OF_UE_MAX
# undef NUMBER_OF_RU_MAX # undef NUMBER_OF_RU_MAX
# define NUMBER_OF_eNB_MAX 3 # define NUMBER_OF_eNB_MAX 3
# define NUMBER_OF_UE_MAX 3 //# define NUMBER_OF_UE_MAX 3
# define NUMBER_OF_RU_MAX 3 # define NUMBER_OF_RU_MAX 3
# endif # endif
# if defined(LARGE_SCALE) && LARGE_SCALE # if defined(LARGE_SCALE) && LARGE_SCALE
# undef NUMBER_OF_eNB_MAX # undef NUMBER_OF_eNB_MAX
# undef NUMBER_OF_UE_MAX //# undef NUMBER_OF_UE_MAX
# undef NUMBER_OF_CONNECTED_eNB_MAX # undef NUMBER_OF_CONNECTED_eNB_MAX
# undef NUMBER_OF_RU_MAX # undef NUMBER_OF_RU_MAX
# define NUMBER_OF_eNB_MAX 2 # define NUMBER_OF_eNB_MAX 2
# define NUMBER_OF_UE_MAX 120 //# define NUMBER_OF_UE_MAX 120
# define NUMBER_OF_RU_MAX 16 # define NUMBER_OF_RU_MAX 16
# define NUMBER_OF_CONNECTED_eNB_MAX 1 // to save some memory # define NUMBER_OF_CONNECTED_eNB_MAX 1 // to save some memory
# endif # endif
......
...@@ -143,6 +143,8 @@ extern double cpuf; ...@@ -143,6 +143,8 @@ extern double cpuf;
void init_eNB(int,int); void init_eNB(int,int);
void stop_eNB(int nb_inst); void stop_eNB(int nb_inst);
void phy_vars_eNB_malloc(PHY_VARS_eNB *eNB);
void phy_measurements_eNB_malloc(PHY_MEASUREMENTS_eNB *meas);
int wakeup_tx(PHY_VARS_eNB *eNB ,int frame_rx,int subframe_rx,int frame_tx,int subframe_tx,uint64_t timestamp_tx); int wakeup_tx(PHY_VARS_eNB *eNB ,int frame_rx,int subframe_rx,int frame_tx,int subframe_tx,uint64_t timestamp_tx);
int wakeup_txfh(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,int frame_tx,int subframe_tx,uint64_t timestamp_tx); int wakeup_txfh(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,int frame_tx,int subframe_tx,uint64_t timestamp_tx);
...@@ -237,8 +239,11 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name ...@@ -237,8 +239,11 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
// L2-emulator can work only one eNB. // L2-emulator can work only one eNB.
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); // memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX); // memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); // memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX); for (int i = 0; i < MAX_NUM_CCs; i++) {
memcpy(pre_scd_eNB_UE_stats[i],&(RC.mac[0]->UE_list.eNB_UE_stats[i][0]),(sizeof(eNB_UE_STATS)*NUMBER_OF_UE_MAX));
}
memcpy(pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
AssertFatal((ret= pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd, return %d\n",ret); AssertFatal((ret= pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd, return %d\n",ret);
...@@ -1290,6 +1295,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -1290,6 +1295,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list; eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list; eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
eNB->prach_energy_counter = 0; eNB->prach_energy_counter = 0;
phy_vars_eNB_malloc(eNB);
} }
} }
...@@ -1300,6 +1306,100 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -1300,6 +1306,100 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
} }
void phy_vars_eNB_malloc(PHY_VARS_eNB *eNB)
{
int i, j;
eNB->srs_vars = (LTE_eNB_SRS *)malloc(sizeof(LTE_eNB_SRS)*NUMBER_OF_UE_MAX);
eNB->pusch_vars = (LTE_eNB_PUSCH **)malloc(sizeof(LTE_eNB_PUSCH *)*NUMBER_OF_UE_MAX);
eNB->dlsch = (LTE_eNB_DLSCH_t ***)malloc(sizeof(LTE_eNB_DLSCH_t **)*NUMBER_OF_UE_MAX);
eNB->ulsch = (LTE_eNB_ULSCH_t **)malloc(sizeof(LTE_eNB_ULSCH_t *)*(NUMBER_OF_UE_MAX+1));
eNB->UE_stats = (LTE_eNB_UE_stats *)malloc(sizeof(LTE_eNB_UE_stats)*NUMBER_OF_UE_MAX);
eNB->UE_stats_ptr = (LTE_eNB_UE_stats **)malloc(sizeof(LTE_eNB_UE_stats *)*(NUMBER_OF_UE_MAX+1));
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->dlsch[i] = (LTE_eNB_DLSCH_t **)malloc(sizeof(LTE_eNB_DLSCH_t *)*2);
}
eNB->lte_gold_uespec_port5_table = (uint32_t ***)malloc(sizeof(uint32_t **)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->lte_gold_uespec_port5_table[i] = (uint32_t **)malloc(sizeof(uint32_t *)*20);
for (j = 0; j < 20 ; j++) {
eNB->lte_gold_uespec_port5_table[i][j] = (uint32_t *)malloc(sizeof(uint32_t)*38);
}
}
eNB->first_sr = (uint8_t *)malloc(sizeof(uint8_t)*NUMBER_OF_UE_MAX);
eNB->first_run_timing_advance = (unsigned char *)malloc(sizeof(unsigned char)*NUMBER_OF_UE_MAX);
eNB->pdsch_config_dedicated = (PDSCH_CONFIG_DEDICATED *)malloc(sizeof(PDSCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->pusch_config_dedicated = (PUSCH_CONFIG_DEDICATED *)malloc(sizeof(PUSCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->pucch_config_dedicated = (PUCCH_CONFIG_DEDICATED *)malloc(sizeof(PUCCH_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->ul_power_control_dedicated = (UL_POWER_CONTROL_DEDICATED *)malloc(sizeof(UL_POWER_CONTROL_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->tpc_pdcch_config_pucch = (TPC_PDCCH_CONFIG *)malloc(sizeof(TPC_PDCCH_CONFIG)*NUMBER_OF_UE_MAX);
eNB->tpc_pdcch_config_pusch = (TPC_PDCCH_CONFIG *)malloc(sizeof(TPC_PDCCH_CONFIG)*NUMBER_OF_UE_MAX);
eNB->cqi_report_config = (CQI_REPORT_CONFIG *)malloc(sizeof(CQI_REPORT_CONFIG)*NUMBER_OF_UE_MAX);
eNB->soundingrs_ul_config_dedicated = (SOUNDINGRS_UL_CONFIG_DEDICATED *)malloc(sizeof(SOUNDINGRS_UL_CONFIG_DEDICATED)*NUMBER_OF_UE_MAX);
eNB->scheduling_request_config = (SCHEDULING_REQUEST_CONFIG *)malloc(sizeof(SCHEDULING_REQUEST_CONFIG)*NUMBER_OF_UE_MAX);
eNB->transmission_mode = (uint8_t *)malloc(sizeof(uint8_t)*NUMBER_OF_UE_MAX);
eNB->physicalConfigDedicated = (struct LTE_PhysicalConfigDedicated **)malloc(sizeof(struct LTE_PhysicalConfigDedicated *)*NUMBER_OF_UE_MAX);
eNB->mu_mimo_mode = (MU_MIMO_mode *)malloc(sizeof(MU_MIMO_mode)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats_cnt = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1_stats_thres = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1ab_stats_cnt = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pucch1ab_stats = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_rb = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_round = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_mcs = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_bsr = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
eNB->pusch_stats_BO = (int32_t **)malloc(sizeof(int32_t *)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
eNB->pucch1_stats_cnt[i] = (int32_t *)malloc(sizeof(uint32_t)*10);
eNB->pucch1_stats[i] = (int32_t *)malloc(sizeof(uint32_t)*10*1024);
eNB->pucch1_stats_thres[i] = (int32_t *)malloc(sizeof(uint32_t)*10*1024);
eNB->pucch1ab_stats_cnt[i] = (int32_t *)malloc(sizeof(uint32_t)*10);
eNB->pucch1ab_stats[i] = (int32_t *)malloc(sizeof(uint32_t)*2*10*1024);
eNB->pusch_stats_rb[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_round[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_mcs[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_bsr[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
eNB->pusch_stats_BO[i] = (int32_t *)malloc(sizeof(uint32_t)*10240);
}
phy_measurements_eNB_malloc(&(eNB->measurements));
}
void phy_measurements_eNB_malloc(PHY_MEASUREMENTS_eNB *meas)
{
int i, j;
meas->rx_spatial_power = (unsigned int ***)malloc(sizeof(unsigned int **)*NUMBER_OF_UE_MAX);
meas->rx_spatial_power_dB = (unsigned short ***)malloc(sizeof(unsigned short **)*NUMBER_OF_UE_MAX);
meas->rx_rssi_dBm = (short *)malloc(sizeof(short)*NUMBER_OF_UE_MAX);
meas->rx_correlation = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->rx_correlation_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->wideband_cqi_tot = (char *)malloc(sizeof(char)*NUMBER_OF_UE_MAX);
meas->subband_cqi = (int ***)malloc(sizeof(int **)*NUMBER_OF_UE_MAX);
meas->subband_cqi_tot = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
meas->subband_cqi_dB = (int ***)malloc(sizeof(int **)*NUMBER_OF_UE_MAX);
meas->subband_cqi_tot_dB = (int **)malloc(sizeof(int *)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
meas->rx_spatial_power[i] = (unsigned int **)malloc(sizeof(unsigned int *)*2);
meas->rx_spatial_power_dB[i] = (unsigned short **)malloc(sizeof(unsigned short *)*2);
for (j = 0; j < 2; j++) {
meas->rx_spatial_power[i][j] = (unsigned int *)malloc(sizeof(unsigned int)*2);
meas->rx_spatial_power_dB[i][j] = (unsigned short *)malloc(sizeof(unsigned short)*2);
}
meas->rx_correlation[i] = (int *)malloc(sizeof(int)*2);
meas->rx_correlation_dB[i] = (int *)malloc(sizeof(int)*2);
meas->wideband_cqi[i] = (int *)malloc(sizeof(int)*MAX_NUM_RU_PER_eNB);
meas->wideband_cqi_dB[i] = (int *)malloc(sizeof(int)*MAX_NUM_RU_PER_eNB);
meas->subband_cqi[i] = (int **)malloc(sizeof(int *)*MAX_NUM_RU_PER_eNB);
meas->subband_cqi_dB[i] = (int **)malloc(sizeof(int *)*MAX_NUM_RU_PER_eNB);
for (j = 0; j < MAX_NUM_RU_PER_eNB; j++) {
meas->subband_cqi[i][j] = (int *)malloc(sizeof(int)*100);
meas->subband_cqi_dB[i][j] = (int *)malloc(sizeof(int)*100);
}
meas->subband_cqi_tot[i] = (int *)malloc(sizeof(int)*100);
meas->subband_cqi_tot_dB[i] = (int *)malloc(sizeof(int)*100);
}
}
void stop_eNB(int nb_inst) { void stop_eNB(int nb_inst) {
for (int inst=0; inst<nb_inst; inst++) { for (int inst=0; inst<nb_inst; inst++) {
......
...@@ -1779,8 +1779,11 @@ void *ru_thread( void *param ) { ...@@ -1779,8 +1779,11 @@ void *ru_thread( void *param ) {
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use; new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use; dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); // memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX); for (int ii = 0; ii < MAX_NUM_CCs; ii++) {
memcpy(pre_scd_eNB_UE_stats[ii],&(RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats[ii][0]),sizeof(eNB_UE_STATS)*NUMBER_OF_UE_MAX);
}
memcpy(pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd\n"); AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd\n");
ru->proc.instance_pre_scd++; ru->proc.instance_pre_scd++;
......
This diff is collapsed.
...@@ -2172,6 +2172,7 @@ int init_timer_thread(void) { ...@@ -2172,6 +2172,7 @@ int init_timer_thread(void) {
//PHY_VARS_UE *UE=PHY_vars_UE_g[0]; //PHY_VARS_UE *UE=PHY_vars_UE_g[0];
PHY_VARS_UE *UE=PHY_vars_UE_g[0][0]; PHY_VARS_UE *UE=PHY_vars_UE_g[0][0];
phy_stub_ticking = (SF_ticking *)malloc(sizeof(SF_ticking)); phy_stub_ticking = (SF_ticking *)malloc(sizeof(SF_ticking));
phy_stub_ticking->num_single_thread = (int *)malloc(sizeof(int)*NUMBER_OF_UE_MAX);
pthread_mutex_init(&UE->timer_mutex,NULL); pthread_mutex_init(&UE->timer_mutex,NULL);
pthread_cond_init(&UE->timer_cond,NULL); pthread_cond_init(&UE->timer_cond,NULL);
UE->instance_cnt_timer = -1; UE->instance_cnt_timer = -1;
......
...@@ -100,7 +100,7 @@ int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex ...@@ -100,7 +100,7 @@ int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX]; uint16_t *inst_pdcp_list;
#endif #endif
uint16_t sf_ahead=2; uint16_t sf_ahead=2;
int tddflag; int tddflag;
...@@ -602,9 +602,9 @@ void init_pdcp(void) { ...@@ -602,9 +602,9 @@ void init_pdcp(void) {
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
int CC_id; int CC_id;
uint8_t abstraction_flag=0; uint8_t abstraction_flag=0;
#ifdef UESIM_EXPANSION /*#ifdef UESIM_EXPANSION
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list)); memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
#endif #endif */
// Default value for the number of UEs. It will hold, // Default value for the number of UEs. It will hold,
// if not changed from the command line option --num-ues // if not changed from the command line option --num-ues
NB_UE_INST=1; NB_UE_INST=1;
...@@ -714,6 +714,11 @@ int main( int argc, char **argv ) { ...@@ -714,6 +714,11 @@ int main( int argc, char **argv ) {
RCConfig_sim(); RCConfig_sim();
} }
#ifdef UESIM_EXPANSION
uint16_t *inst_pdcp_list = (uint16_t *)malloc(sizeof(uint16_t)*NUMBER_OF_UE_MAX);
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
#endif
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
#ifndef DEADLINE_SCHEDULER #ifndef DEADLINE_SCHEDULER
printf("NO deadline scheduler\n"); printf("NO deadline scheduler\n");
...@@ -863,6 +868,9 @@ int main( int argc, char **argv ) { ...@@ -863,6 +868,9 @@ int main( int argc, char **argv ) {
terminate_opt(); terminate_opt();
logClean(); logClean();
#ifdef UESIM_EXPANSION
free_and_zero(inst_pdcp_list);
#endif
printf("Bye.\n"); printf("Bye.\n");
return 0; return 0;
} }
...@@ -99,6 +99,7 @@ void wait_eNBs(void) ...@@ -99,6 +99,7 @@ void wait_eNBs(void)
void RCConfig_sim(void) { void RCConfig_sim(void) {
int i,j;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
// Get num RU instances // Get num RU instances
...@@ -107,6 +108,31 @@ void RCConfig_sim(void) { ...@@ -107,6 +108,31 @@ void RCConfig_sim(void) {
AssertFatal(RC.nb_RU>0,"we need at least 1 RU for simulation\n"); AssertFatal(RC.nb_RU>0,"we need at least 1 RU for simulation\n");
printf("returned with %d rus\n",RC.nb_RU); printf("returned with %d rus\n",RC.nb_RU);
sim.RU2UE = (channel_desc_t ****)malloc(sizeof(channel_desc_t ***)*NUMBER_OF_RU_MAX);
sim.UE2RU = (channel_desc_t ****)malloc(sizeof(channel_desc_t ***)*NUMBER_OF_UE_MAX);
sim.r_re_DL = (double ***)malloc(sizeof(double **)*NUMBER_OF_UE_MAX);
sim.r_im_DL = (double ***)malloc(sizeof(double **)*NUMBER_OF_UE_MAX);
sim.RU_output_mask = (int *)malloc(sizeof(int)*NUMBER_OF_UE_MAX);
sim.RU_output_mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)*NUMBER_OF_UE_MAX);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
sim.UE2RU[i] = (channel_desc_t ***)malloc(sizeof(channel_desc_t **)*NUMBER_OF_RU_MAX);
for (j = 0; j < NUMBER_OF_RU_MAX; j++) {
sim.UE2RU[i][j] = (channel_desc_t **)malloc(sizeof(channel_desc_t *)*MAX_NUM_CCs);
}
sim.r_re_DL[i] = (double **)malloc(sizeof(double *)*2);
sim.r_im_DL[i] = (double **)malloc(sizeof(double *)*2);
for (j = 0; j < 2; j++) {
sim.r_re_DL[i][j] = (double *)malloc(sizeof(double)*30720);
sim.r_im_DL[i][j] = (double *)malloc(sizeof(double)*30720);
}
}
for (i = 0; i < NUMBER_OF_RU_MAX; i++) {
sim.RU2UE[i] = (channel_desc_t ***)malloc(sizeof(channel_desc_t **)*NUMBER_OF_UE_MAX);
for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
sim.RU2UE[i][j] = (channel_desc_t **)malloc(sizeof(channel_desc_t *)*MAX_NUM_CCs);
}
}
init_RU(NULL,internal,internal,0); init_RU(NULL,internal,internal,0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment