initial testing version of L1L-L1H split (RRU-RAU)
This commit is contained in:
@@ -91,7 +91,6 @@ extern char smbv_ip[16];
|
||||
#define K 2 // averaging coefficient
|
||||
#define TARGET_SF_TIME_NS 1000000 // 1ms = 1000000 ns
|
||||
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
|
||||
int otg_times = 0;
|
||||
int if_times = 0;
|
||||
@@ -115,7 +114,7 @@ uint8_t beta_ACK = 0;
|
||||
uint8_t beta_RI = 0;
|
||||
uint8_t beta_CQI = 2;
|
||||
uint8_t target_ul_mcs = 16;
|
||||
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
//LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int map1,map2;
|
||||
double **ShaF = NULL;
|
||||
// pointers signal buffers (s = transmit, r,r0 = receive)
|
||||
@@ -155,10 +154,10 @@ char tdd_config[10];
|
||||
|
||||
Packet_OTG_List_t *otg_pdcp_buffer = NULL;
|
||||
|
||||
extern node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
|
||||
extern node_desc_t *enb_data[NUMBER_OF_RU_MAX];
|
||||
extern node_desc_t *ue_data[NUMBER_OF_UE_MAX];
|
||||
extern channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
|
||||
extern mapping small_scale_names[];
|
||||
#if defined(Rel10)
|
||||
@@ -175,19 +174,12 @@ extern int xforms;
|
||||
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
eth_params_t *eth_params;
|
||||
|
||||
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *,int,int);
|
||||
void stop_eNB(int nb_inst);
|
||||
|
||||
const Enb_properties_array_t *enb_properties;
|
||||
|
||||
int oaisim_flag=1;
|
||||
|
||||
|
||||
void get_simulation_options(int argc, char *argv[])
|
||||
{
|
||||
int option;
|
||||
char *conf_config_file_name = NULL;
|
||||
|
||||
enum long_option_e {
|
||||
LONG_OPTION_START = 0x100, /* Start after regular single char options */
|
||||
@@ -279,9 +271,9 @@ void get_simulation_options(int argc, char *argv[])
|
||||
|
||||
case LONG_OPTION_ENB_CONF:
|
||||
if (optarg) {
|
||||
free(conf_config_file_name); // prevent memory leak if option is used multiple times
|
||||
conf_config_file_name = strdup(optarg);
|
||||
printf("eNB configuration file is %s\n", conf_config_file_name);
|
||||
free(RC.config_file_name); // prevent memory leak if option is used multiple times
|
||||
RC.config_file_name = strdup(optarg);
|
||||
printf("eNB configuration file is %s\n", RC.config_file_name);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -609,8 +601,8 @@ void get_simulation_options(int argc, char *argv[])
|
||||
|
||||
case 'O':
|
||||
if (optarg) {
|
||||
free(conf_config_file_name); // prevent memory leak if option is used multiple times
|
||||
conf_config_file_name = strdup(optarg);
|
||||
free(RC.config_file_name); // prevent memory leak if option is used multiple times
|
||||
RC.config_file_name = strdup(optarg);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -789,55 +781,68 @@ void get_simulation_options(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if ((oai_emulation.info.nb_enb_local > 0) && (conf_config_file_name != NULL)) {
|
||||
|
||||
if (RC.config_file_name != NULL) {
|
||||
/* Read eNB configuration file */
|
||||
enb_properties = enb_config_init(conf_config_file_name);
|
||||
|
||||
AssertFatal (oai_emulation.info.nb_enb_local <= enb_properties->number,
|
||||
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!",
|
||||
conf_config_file_name, oai_emulation.info.nb_enb_local, enb_properties->number);
|
||||
|
||||
eth_params = (eth_params_t*)malloc(enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t));
|
||||
memset(eth_params, 0, enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t));
|
||||
|
||||
for (int j=0; j<enb_properties->properties[0]->nb_rrh_gw; j++) {
|
||||
RCConfig(RC.config_file_name);
|
||||
printf("returned with %d eNBs, %d rus\n",RC.nb_inst,RC.nb_RU);
|
||||
oai_emulation.info.nb_enb_local = RC.nb_inst;
|
||||
oai_emulation.info.nb_ru_local = RC.nb_RU;
|
||||
|
||||
/*
|
||||
for (int j=0; j<enb_properties->nb_ru; j++) {
|
||||
|
||||
if (enb_properties->properties[0]->rrh_gw_config[j].active == 1 ) {
|
||||
// local_remote_radio = BBU_REMOTE_RADIO_HEAD;
|
||||
(eth_params+j)->local_if_name = enb_properties->properties[0]->rrh_gw_config[j].rrh_gw_if_name;
|
||||
(eth_params+j)->my_addr = enb_properties->properties[0]->rrh_gw_config[j].local_address;
|
||||
(eth_params+j)->my_port = enb_properties->properties[0]->rrh_gw_config[j].local_port;
|
||||
(eth_params+j)->remote_addr = enb_properties->properties[0]->rrh_gw_config[j].remote_address;
|
||||
(eth_params+j)->remote_port = enb_properties->properties[0]->rrh_gw_config[j].remote_port;
|
||||
|
||||
if (enb_properties->properties[0]->rrh_gw_config[j].raw == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_MODE;
|
||||
} else if (enb_properties->properties[0]->rrh_gw_config[j].rawif4p5 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_IF4p5_MODE;
|
||||
} else if (enb_properties->properties[0]->rrh_gw_config[j].udpif4p5 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_IF4p5_MODE;
|
||||
} else if (enb_properties->properties[0]->rrh_gw_config[j].rawif5_mobipass == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_IF5_MOBIPASS;
|
||||
} else {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_MODE;
|
||||
}
|
||||
// local_remote_radio = BBU_REMOTE_RADIO_HEAD;
|
||||
(eth_params+j)->local_if_name = enb_properties->ru_config[j]->ru_if_name;
|
||||
(eth_params+j)->my_addr = enb_properties->ru_config[j]->local_address;
|
||||
(eth_params+j)->my_port = enb_properties->ru_config[j]->local_port;
|
||||
(eth_params+j)->remote_addr = enb_properties->ru_config[j]->remote_address;
|
||||
(eth_params+j)->remote_port = enb_properties->ru_config[j]->remote_port;
|
||||
|
||||
if (enb_properties->ru_config[j]->raw == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_MODE;
|
||||
ru_if_in[j] = REMOTE_IF5;
|
||||
node_function[j] = NGFI_RRU_IF5;
|
||||
} else if (enb_properties->ru_config[j]->rawif4p5 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_IF4p5_MODE;
|
||||
ru_if_in[j] = REMOTE_IF4p5;
|
||||
node_function[j] = NGFI_RRU_IF4p5;
|
||||
} else if (enb_properties->ru_config[j]->udpif4p5 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_IF4p5_MODE;
|
||||
ru_if_in[j] = REMOTE_IF4p5;
|
||||
node_function[j] = NGFI_RRU_IF4p5;
|
||||
} else if (enb_properties->ru_config[j]->rawif5_mobipass == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_IF5_MOBIPASS;
|
||||
ru_if_in[j] = REMOTE_IF5;
|
||||
LOG_E(EMU,"Don't use 8-bit IF5 format with oaisim, please change in configuration file\n");
|
||||
} else {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_MODE;
|
||||
ru_if_in[j] = REMOTE_IF5;
|
||||
node_function[j] = NGFI_RRU_IF5;
|
||||
}
|
||||
}
|
||||
/* Update some simulation parameters */
|
||||
oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0];
|
||||
oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0];
|
||||
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[0]->tdd_config_s[0];
|
||||
oai_emulation.info.extended_prefix_flag[0] = enb_properties->properties[0]->prefix_type[0];
|
||||
node_timing[j] = synch_to_ext_device;
|
||||
|
||||
oai_emulation.info.node_function[0] = enb_properties->properties[0]->cc_node_function[0];
|
||||
oai_emulation.info.node_timing[0] = enb_properties->properties[0]->cc_node_timing[0];
|
||||
downlink_frequency[0][0] = enb_properties->properties[0]->downlink_frequency[0];
|
||||
uplink_frequency_offset[0][0] = enb_properties->properties[0]->uplink_frequency_offset[0];
|
||||
oai_emulation.info.N_RB_DL[0] = enb_properties->properties[0]->N_RB_DL[0];
|
||||
if (enb_properties->number > 0) {
|
||||
//Update some simulation parameters
|
||||
oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0];
|
||||
oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0];
|
||||
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[0]->tdd_config_s[0];
|
||||
oai_emulation.info.extended_prefix_flag[0] = enb_properties->properties[0]->prefix_type[0];
|
||||
|
||||
oai_emulation.info.node_function[0] = enb_properties->properties[0]->cc_node_function[0];
|
||||
oai_emulation.info.node_timing[0] = enb_properties->properties[0]->cc_node_timing[0];
|
||||
downlink_frequency[0][0] = enb_properties->properties[0]->downlink_frequency[0];
|
||||
uplink_frequency_offset[0][0] = enb_properties->properties[0]->uplink_frequency_offset[0];
|
||||
oai_emulation.info.N_RB_DL[0] = enb_properties->properties[0]->N_RB_DL[0];
|
||||
LOG_E(EMU,"Please use only RRU with oaisim, remove eNB descriptors in configuration file\n");
|
||||
exit(-1);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else {
|
||||
printf("Please provide a configuration file\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
free(conf_config_file_name);
|
||||
conf_config_file_name = 0;
|
||||
}
|
||||
|
||||
void check_and_adjust_params(void)
|
||||
@@ -910,6 +915,7 @@ void check_and_adjust_params(void)
|
||||
NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote;
|
||||
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
|
||||
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
|
||||
NB_RU = oai_emulation.info.nb_ru_local + oai_emulation.info.nb_ru_remote;
|
||||
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES) && defined(OPENAIR2)
|
||||
pdcp_netlink_init();
|
||||
@@ -994,35 +1000,35 @@ void init_seed(uint8_t set_seed)
|
||||
}
|
||||
}
|
||||
|
||||
openair0_timestamp current_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
|
||||
int eNB_trx_start(openair0_device *device) {
|
||||
int ru_trx_start(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
void eNB_trx_end(openair0_device *device) {
|
||||
void ru_trx_end(openair0_device *device) {
|
||||
return;
|
||||
}
|
||||
|
||||
int eNB_trx_stop(openair0_device *device) {
|
||||
int ru_trx_stop(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_start(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_end(openair0_device *device) {
|
||||
return(0);
|
||||
void UE_trx_end(openair0_device *device) {
|
||||
return;
|
||||
}
|
||||
int UE_trx_stop(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
int eNB_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
int ru_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
return(0);
|
||||
}
|
||||
int eNB_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
int ru_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
@@ -1033,53 +1039,53 @@ int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
}
|
||||
|
||||
extern pthread_mutex_t subframe_mutex;
|
||||
extern int subframe_eNB_mask,subframe_UE_mask;
|
||||
extern int subframe_ru_mask,subframe_UE_mask;
|
||||
|
||||
int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
|
||||
int eNB_id = device->Mod_id;
|
||||
int ru_id = device->Mod_id;
|
||||
int CC_id = device->CC_id;
|
||||
|
||||
int subframe;
|
||||
int sample_count=0;
|
||||
|
||||
*ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id];
|
||||
*ptimestamp = last_ru_rx_timestamp[ru_id][CC_id];
|
||||
|
||||
LOG_D(EMU,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
|
||||
(unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
(unsigned long long)last_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
(*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10);
|
||||
// if we're at a subframe boundary generate UL signals for this eNB
|
||||
LOG_D(EMU,"RU_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
|
||||
(unsigned long long)current_ru_rx_timestamp[ru_id][CC_id],
|
||||
(unsigned long long)last_ru_rx_timestamp[ru_id][CC_id],
|
||||
(int)((*ptimestamp/RC.ru[ru_id]->frame_parms.samples_per_tti)%10));
|
||||
// if we're at a subframe boundary generate UL signals for this ru
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
while (current_eNB_rx_timestamp[eNB_id][CC_id]<
|
||||
(nsamps+last_eNB_rx_timestamp[eNB_id][CC_id])) {
|
||||
// LOG_D(EMU,"eNB: current TS %llu, last TS %llu, sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]);
|
||||
while (current_ru_rx_timestamp[ru_id][CC_id]<
|
||||
(nsamps+last_ru_rx_timestamp[ru_id][CC_id])) {
|
||||
LOG_D(EMU,"eNB: current TS %llu, last TS %llu, sleeping\n",current_ru_rx_timestamp[ru_id][CC_id],last_ru_rx_timestamp[ru_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
// tell top-level we are busy
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
subframe_eNB_mask|=(1<<eNB_id);
|
||||
subframe_ru_mask|=(1<<ru_id);
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
|
||||
subframe = (last_eNB_rx_timestamp[eNB_id][CC_id]/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
LOG_D(EMU,"eNB_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe = (last_ru_rx_timestamp[ru_id][CC_id]/RC.ru[ru_id]->frame_parms.samples_per_tti)%10;
|
||||
LOG_D(EMU,"RU_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id]);
|
||||
(unsigned long long)current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
|
||||
do_UL_sig(UE2eNB,
|
||||
do_UL_sig(UE2RU,
|
||||
enb_data,
|
||||
ue_data,
|
||||
subframe,
|
||||
0, // abstraction_flag
|
||||
&PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms,
|
||||
&RC.ru[ru_id]->frame_parms,
|
||||
0, // frame is only used for abstraction
|
||||
eNB_id,
|
||||
ru_id,
|
||||
CC_id);
|
||||
|
||||
last_eNB_rx_timestamp[eNB_id][CC_id] += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
|
||||
sample_count += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
|
||||
last_ru_rx_timestamp[ru_id][CC_id] += RC.ru[ru_id]->frame_parms.samples_per_tti;
|
||||
sample_count += RC.ru[ru_id]->frame_parms.samples_per_tti;
|
||||
}
|
||||
|
||||
|
||||
@@ -1137,7 +1143,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
|
||||
do_DL_sig(eNB2UE,
|
||||
do_DL_sig(RU2UE,
|
||||
enb_data,
|
||||
ue_data,
|
||||
subframe,
|
||||
@@ -1153,7 +1159,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
int eNB_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
int ru_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
|
||||
return(nsamps);
|
||||
}
|
||||
@@ -1163,10 +1169,11 @@ int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **bu
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
void init_openair0(void);
|
||||
//void init_openair0(void);
|
||||
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
//openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
/*
|
||||
void init_openair0() {
|
||||
|
||||
int card;
|
||||
@@ -1219,19 +1226,19 @@ void init_openair0() {
|
||||
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
|
||||
PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
RC.ru[0]->nb_tx,
|
||||
RC.ru[0]->nb_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
|
||||
|
||||
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
openair0_cfg[card].tx_num_channels=min(2,PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].tx_num_channels=min(2,RC.ru[0]->nb_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,RC.ru[0]->nb_rx);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
|
||||
openair0_cfg[card].rx_gain[i] = PHY_vars_eNB_g[0][0]->rx_total_gain_dB;
|
||||
openair0_cfg[card].rx_gain[i] = RC.ru[0]->rx_total_gain_dB;
|
||||
|
||||
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
||||
card,i, openair0_cfg[card].tx_gain[i],
|
||||
@@ -1241,230 +1248,65 @@ void init_openair0() {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void init_devices(void){
|
||||
|
||||
module_id_t UE_id, eNB_id;
|
||||
module_id_t UE_id, ru_id;
|
||||
uint8_t CC_id;
|
||||
RU_t *ru;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.Mod_id = eNB_id;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.CC_id = CC_id;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_start_func = eNB_trx_start;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_read_func = eNB_trx_read;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_write_func = eNB_trx_write;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_end_func = eNB_trx_end;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_stop_func = eNB_trx_stop;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_freq_func = eNB_trx_set_freq;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_gains_func = eNB_trx_set_gains;
|
||||
current_eNB_rx_timestamp[eNB_id][CC_id] = PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
|
||||
last_eNB_rx_timestamp[eNB_id][CC_id] = 0;
|
||||
}
|
||||
// allocate memory for RU if not already done
|
||||
if (RC.ru==NULL) RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*));
|
||||
|
||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
||||
LOG_I(EMU,"Initiaizing rfdevice for RU %d\n",ru_id);
|
||||
if (RC.ru[ru_id]==NULL) RC.ru[ru_id] = (RU_t*)malloc(sizeof(RU_t));
|
||||
ru = RC.ru[ru_id];
|
||||
ru->rfdevice.Mod_id = ru_id;
|
||||
ru->rfdevice.CC_id = 0;
|
||||
ru->rfdevice.trx_start_func = ru_trx_start;
|
||||
ru->rfdevice.trx_read_func = ru_trx_read;
|
||||
ru->rfdevice.trx_write_func = ru_trx_write;
|
||||
ru->rfdevice.trx_end_func = ru_trx_end;
|
||||
ru->rfdevice.trx_stop_func = ru_trx_stop;
|
||||
ru->rfdevice.trx_set_freq_func = ru_trx_set_freq;
|
||||
ru->rfdevice.trx_set_gains_func = ru_trx_set_gains;
|
||||
last_ru_rx_timestamp[ru_id][0] = 0;
|
||||
}
|
||||
if (PHY_vars_UE_g==NULL) {
|
||||
PHY_vars_UE_g = (PHY_VARS_UE ***)malloc((1+NB_UE_INST)*sizeof(PHY_VARS_UE*));
|
||||
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.Mod_id = UE_id;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.CC_id = CC_id;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_start_func = UE_trx_start;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_read_func = UE_trx_read;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_write_func = UE_trx_write;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_end_func = UE_trx_end;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_stop_func = UE_trx_stop;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
|
||||
current_UE_rx_timestamp[UE_id][CC_id] = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
|
||||
last_UE_rx_timestamp[UE_id][CC_id] = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init_openair1(void)
|
||||
{
|
||||
module_id_t UE_id, eNB_id;
|
||||
uint8_t CC_id;
|
||||
#if ENABLE_RAL
|
||||
int list_index;
|
||||
#endif
|
||||
|
||||
// change the nb_connected_eNB
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
init_lte_vars (&frame_parms[CC_id],
|
||||
oai_emulation.info.frame_type[CC_id],
|
||||
oai_emulation.info.tdd_config[CC_id],
|
||||
oai_emulation.info.tdd_config_S[CC_id],
|
||||
oai_emulation.info.extended_prefix_flag[CC_id],
|
||||
oai_emulation.info.N_RB_DL[CC_id],
|
||||
enb_properties->properties[0]->Nid_cell[CC_id],
|
||||
cooperation_flag,
|
||||
enb_properties->properties[0]->nb_antenna_ports[CC_id],
|
||||
abstraction_flag,
|
||||
enb_properties->properties[0]->nb_antennas_rx[CC_id],
|
||||
enb_properties->properties[0]->nb_antennas_tx[CC_id],
|
||||
nb_antennas_rx_ue,
|
||||
oai_emulation.info.eMBMS_active_state);
|
||||
|
||||
// This is for IF4p5 RRU, gets done by RRC configuration of eNB
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = enb_properties->properties[0]->prach_config_index[CC_id];
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = enb_properties->properties[0]->prach_freq_offset[CC_id];
|
||||
|
||||
}
|
||||
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_CQI_Index = beta_CQI;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.p_b = (frame_parms[CC_id]->nb_antenna_ports_eNB>1) ? 1 : 0; // rho_A = rho_B
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index = beta_ACK;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_RI_Index = beta_RI;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index = beta_CQI;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.pdsch_config_common.p_b = (frame_parms[CC_id]->nb_antenna_ports_eNB>1) ? 1 : 0; // rho_A = rho_B
|
||||
PHY_vars_UE_g[UE_id] = (PHY_VARS_UE **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_UE*));
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
PHY_vars_UE_g[UE_id][CC_id] = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE));
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.Mod_id = UE_id;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.CC_id = CC_id;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_start_func = UE_trx_start;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_read_func = UE_trx_read;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_write_func = UE_trx_write;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_end_func = UE_trx_end;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_stop_func = UE_trx_stop;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
|
||||
last_UE_rx_timestamp[UE_id][CC_id] = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf ("AFTER init: MAX_NUM_CCs %d, Nid_cell %d frame_type %d,tdd_config %d\n",
|
||||
MAX_NUM_CCs,
|
||||
PHY_vars_eNB_g[0][0]->frame_parms.Nid_cell,
|
||||
PHY_vars_eNB_g[0][0]->frame_parms.frame_type,
|
||||
PHY_vars_eNB_g[0][0]->frame_parms.tdd_config);
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
// openair_daq_vars.rx_rf_mode = 1;
|
||||
// openair_daq_vars.tdd = 1;
|
||||
// openair_daq_vars.rx_gain_mode = DAQ_AGC_ON;
|
||||
|
||||
// openair_daq_vars.dlsch_transmission_mode = oai_emulation.info.transmission_mode[0];
|
||||
//#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
|
||||
// openair_daq_vars.target_ue_dl_mcs = cmin(target_dl_mcs,16);
|
||||
// openair_daq_vars.target_ue_ul_mcs = target_ul_mcs;
|
||||
// openair_daq_vars.ue_dl_rb_alloc=0x1fff;
|
||||
// openair_daq_vars.ue_ul_nb_rb=6;
|
||||
// openair_daq_vars.dlsch_rate_adaptation = rate_adaptation_flag;
|
||||
|
||||
//N_TA_offset
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->use_ia_receiver = 0;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->mode = normal_txrx;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled = 1;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->no_timing_correction = 1;
|
||||
|
||||
if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.frame_type == TDD) {
|
||||
if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 100)
|
||||
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624;
|
||||
else if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 50)
|
||||
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/2;
|
||||
else if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 25)
|
||||
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/4;
|
||||
} else {
|
||||
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.frame_type == TDD) {
|
||||
if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 100)
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624;
|
||||
else if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 50)
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/2;
|
||||
else if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 25)
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/4;
|
||||
} else {
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 0;
|
||||
}
|
||||
} // eNB_id
|
||||
} // CC_id
|
||||
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
if (phy_test==1)
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=0;
|
||||
else
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=1;
|
||||
}
|
||||
}
|
||||
|
||||
init_devices ();
|
||||
|
||||
init_eNB(oai_emulation.info.node_function,oai_emulation.info.node_timing,NB_eNB_INST,eth_params,1,0);
|
||||
|
||||
// init_ue_status();
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_max_dBm=10;
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=100;
|
||||
|
||||
// update UE_mode for each eNB_id not just 0
|
||||
if (abstraction_flag == 0) {
|
||||
if (phy_test==0) PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = NOT_SYNCHED;
|
||||
else PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PUSCH;
|
||||
} else {
|
||||
// 0 is the index of the connected eNB
|
||||
PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH;
|
||||
}
|
||||
|
||||
if (phy_test==1)
|
||||
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=0;
|
||||
else
|
||||
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1;
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0]->crnti = 0x1235 + UE_id;
|
||||
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
|
||||
|
||||
LOG_I(EMU, "UE %d mode is initialized to %d\n", UE_id, PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] );
|
||||
#if ENABLE_RAL
|
||||
PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_timed = hashtable_create (64, NULL, NULL);
|
||||
|
||||
for (list_index = 0; list_index < RAL_LINK_PARAM_GEN_MAX; list_index++) {
|
||||
SLIST_INIT(&PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_gen_polled[list_index]);
|
||||
}
|
||||
|
||||
for (list_index = 0; list_index < RAL_LINK_PARAM_LTE_MAX; list_index++) {
|
||||
SLIST_INIT(&PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_lte_polled[list_index]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // CC_id
|
||||
} // UE_id
|
||||
init_UE(NB_UE_INST);
|
||||
}
|
||||
|
||||
void init_openair2(void)
|
||||
{
|
||||
#ifdef OPENAIR2
|
||||
int CC_id;
|
||||
//#warning "eNB index is hard coded to zero"
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
l2_init (&PHY_vars_eNB_g[0][CC_id]->frame_parms,
|
||||
oai_emulation.info.eMBMS_active_state,
|
||||
NULL,
|
||||
oai_emulation.info.cba_group_active,
|
||||
oai_emulation.info.handover_active);
|
||||
|
||||
mac_xface->macphy_exit = exit_fun;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void init_ocm(void)
|
||||
{
|
||||
module_id_t UE_id, eNB_id;
|
||||
module_id_t UE_id, ru_id;
|
||||
int CC_id;
|
||||
|
||||
/* Added for PHY abstraction */
|
||||
|
||||
char* frame_type = "unknown";
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.ru[0]->frame_parms;
|
||||
|
||||
switch (oai_emulation.info.frame_type[0]) {
|
||||
switch (fp->frame_type) {
|
||||
case FDD:
|
||||
frame_type = "FDD";
|
||||
break;
|
||||
@@ -1474,10 +1316,6 @@ void init_ocm(void)
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_I(OCM,"Running with frame_type %d (%s), Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n",
|
||||
oai_emulation.info.frame_type[0], frame_type, Nid_cell, oai_emulation.info.N_RB_DL[0], oai_emulation.info.extended_prefix_flag[0], oai_emulation.info.transmission_mode[0],target_dl_mcs,
|
||||
rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
|
||||
|
||||
if (abstraction_flag) {
|
||||
|
||||
get_beta_map();
|
||||
@@ -1490,9 +1328,9 @@ void init_ocm(void)
|
||||
}
|
||||
|
||||
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
enb_data[eNB_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
|
||||
init_enb(enb_data[eNB_id],oai_emulation.environment_system_config.antenna.eNB_antenna);
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
enb_data[ru_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
|
||||
init_enb(enb_data[ru_id],oai_emulation.environment_system_config.antenna.eNB_antenna);
|
||||
}
|
||||
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
@@ -1516,43 +1354,43 @@ void init_ocm(void)
|
||||
}
|
||||
|
||||
if (abstraction_flag == 0)
|
||||
init_channel_vars (frame_parms[0], &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
|
||||
init_channel_vars (fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
|
||||
|
||||
// initialize channel descriptors
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_D(OCM,"Initializing channel (%s, %d) from eNB %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), eNB_id, UE_id);
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), ru_id, UE_id);
|
||||
|
||||
|
||||
eNB2UE[eNB_id][UE_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
RU2UE[ru_id][UE_id][CC_id] =
|
||||
new_channel_desc_scm(RC.ru[ru_id]->nb_tx,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option),
|
||||
N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL),
|
||||
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
0,
|
||||
0);
|
||||
random_channel(eNB2UE[eNB_id][UE_id][CC_id],abstraction_flag);
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s, %d) from UE %d to eNB %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, eNB_id);
|
||||
random_channel(RU2UE[ru_id][UE_id][CC_id],abstraction_flag);
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s, %d) from UE %d to ru %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, ru_id);
|
||||
|
||||
UE2eNB[UE_id][eNB_id][CC_id] =
|
||||
UE2RU[UE_id][ru_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
RC.ru[ru_id]->nb_rx,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),
|
||||
N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_UL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_UL),
|
||||
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms.N_RB_UL),
|
||||
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms.N_RB_UL),
|
||||
forgetting_factor,
|
||||
0,
|
||||
0);
|
||||
|
||||
random_channel(UE2eNB[UE_id][eNB_id][CC_id],abstraction_flag);
|
||||
random_channel(UE2RU[UE_id][ru_id][CC_id],abstraction_flag);
|
||||
|
||||
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
|
||||
//UE2eNB[UE_id][eNB_id] = eNB2UE[eNB_id][UE_id];
|
||||
//UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1609,22 +1447,24 @@ void update_omg_ocm()
|
||||
|
||||
void update_ocm()
|
||||
{
|
||||
module_id_t UE_id, eNB_id;
|
||||
module_id_t UE_id, ru_id;
|
||||
int CC_id;
|
||||
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++)
|
||||
enb_data[eNB_id]->tx_power_dBm = PHY_vars_eNB_g[eNB_id][0]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
|
||||
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm[0];
|
||||
|
||||
|
||||
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
|
||||
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
|
||||
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++)
|
||||
enb_data[ru_id]->tx_power_dBm = RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
|
||||
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm[0];
|
||||
|
||||
//LOG_D(OMG," extracting position of eNb...\n");
|
||||
//display_node_list(enb_node_list);
|
||||
// display_node_list(ue_node_list);
|
||||
extract_position(enb_node_list, enb_data, NB_eNB_INST);
|
||||
extract_position(enb_node_list, enb_data, RC.nb_RU);
|
||||
//extract_position_fixed_enb(enb_data, NB_eNB_INST,frame);
|
||||
//LOG_D(OMG," extracting position of UE...\n");
|
||||
// if (oai_emulation.info.omg_model_ue == TRACE)
|
||||
@@ -1634,21 +1474,21 @@ void update_ocm()
|
||||
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
|
||||
*/
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id][CC_id], oai_emulation.environment_system_config,ShaF);
|
||||
//calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,0);
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB;
|
||||
calc_path_loss (enb_data[ru_id], ue_data[UE_id], RU2UE[ru_id][UE_id][CC_id], oai_emulation.environment_system_config,ShaF);
|
||||
//calc_path_loss (enb_data[ru_id], ue_data[UE_id], RU2UE[ru_id][UE_id], oai_emulation.environment_system_config,0);
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = RU2UE[ru_id][UE_id][CC_id]->path_loss_dB;
|
||||
// if (frame % 50 == 0)
|
||||
LOG_D(OCM,"Path loss (CCid %d) between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
|
||||
CC_id,eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, eNB2UE[eNB_id][UE_id][CC_id]->aoa);
|
||||
CC_id,ru_id,enb_data[ru_id]->x,enb_data[ru_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB, RU2UE[ru_id][UE_id][CC_id]->aoa);
|
||||
//double dx, dy, distance;
|
||||
//dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
|
||||
//dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
|
||||
//dx = enb_data[ru_id]->x - ue_data[UE_id]->x;
|
||||
//dy = enb_data[ru_id]->y - ue_data[UE_id]->y;
|
||||
//distance = sqrt(dx * dx + dy * dy);
|
||||
/*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
|
||||
eNB_id, enb_data[eNB_id]->x,enb_data[eNB_id]->y,
|
||||
ru_id, enb_data[ru_id]->x,enb_data[ru_id]->y,
|
||||
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
|
||||
distance);*/
|
||||
}
|
||||
@@ -1657,26 +1497,28 @@ void update_ocm()
|
||||
}
|
||||
|
||||
else {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (eNB_id == (UE_id % NB_eNB_INST)) {
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
}
|
||||
|
||||
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id,
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB,
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
|
||||
|
||||
}
|
||||
AssertFatal(RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(UE2RU[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (ru_id == (UE_id % RC.nb_RU)) {
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
}
|
||||
|
||||
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",ru_id,UE_id,CC_id,
|
||||
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB,
|
||||
RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1715,7 +1557,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
(otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA;
|
||||
//Adding the packet to the OTG-PDCP buffer
|
||||
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[enb_module_idP]));
|
||||
LOG_I(EMU,"[eNB %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d for app id %d \n",
|
||||
LOG_D(EMU,"[eNB %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d for app id %d \n",
|
||||
(otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id, app_id);
|
||||
} else {
|
||||
free(otg_pkt);
|
||||
@@ -1749,7 +1591,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
//Adding the packet to the OTG-PDCP buffer
|
||||
(otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_TRANSPARENT;
|
||||
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[enb_module_idP]));
|
||||
LOG_I(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n",
|
||||
LOG_D(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n",
|
||||
(otg_pkt->otg_pkt).module_id, otg_pkt, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
|
||||
} else {
|
||||
//LOG_I(EMU, "OTG returns null \n");
|
||||
@@ -1812,7 +1654,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
(otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA;
|
||||
//Adding the packet to the OTG-PDCP buffer
|
||||
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_idP]));
|
||||
LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
|
||||
LOG_D(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
|
||||
} else {
|
||||
//LOG_I(EMU, "OTG returns null \n");
|
||||
free(otg_pkt);
|
||||
@@ -1860,7 +1702,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
|
||||
//Adding the packet to the OTG-PDCP buffer
|
||||
(otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA;
|
||||
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
|
||||
LOG_I(EMU, "[UE %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d \n",
|
||||
LOG_D(EMU, "[UE %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d \n",
|
||||
(otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
|
||||
} else {
|
||||
free(otg_pkt);
|
||||
|
||||
Reference in New Issue
Block a user