Merge remote-tracking branch 'origin/develop' into develop-nos1-fixes

Conflicts:
	cmake_targets/CMakeLists.txt
	openair1/PHY/LTE_TRANSPORT/dci_tools.c
	openair2/RRC/LITE/rrc_UE.c
This commit is contained in:
Raymond Knopp
2018-01-24 23:36:39 -08:00
288 changed files with 4586 additions and 28802 deletions
+5 -17
View File
@@ -29,13 +29,12 @@ endif
CFLAGS += -Wpointer-sign
CFLAGS += -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
CFLAGS += -DOPENAIR_LTE -DPUCCH #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -DPHY_ABSTRACTION #-DPHY_ABSTRACTION_UL #-DRLC_UM_TEST_TRAFFIC=1
CFLAGS += -DNEW_FFT
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 #-DRLC_UM_TEST_TRAFFIC=1
#CFLAGS += -DLLR8
CFLAGS += -DPACKAGE_NAME='"oaisim"'
@@ -48,15 +47,6 @@ DISABLE_XER_PRINT=0
MSG_PRINT=1
endif
ifndef OPENAIR_EMU
export OPENAIR_EMU=1
CFLAGS += -DOAISIM
endif
ifdef EMOS
CFLAGS+=-DEMOS
endif
ifeq ($(LOCALIZATION), 1)
CFLAGS += -DLOCALIZATION
endif
@@ -141,8 +131,6 @@ CFLAGS += -DSTOP_ON_IP_TRAFFIC_OVERLOAD
endif
ifeq ($(MIH_C_MEDIEVAL_EXTENSIONS), 1)
CFLAGS += -DMIH_C_MEDIEVAL_EXTENSIONS
ifeq ($(USE_3GPP_ADDR_AS_LINK_ADDR), 1)
CFLAGS += -DUSE_3GPP_ADDR_AS_LINK_ADDR
endif
@@ -179,7 +167,7 @@ ifdef OAI_NW_DRIVER_TYPE_ETHERNET
CFLAGS+=-DOAI_NW_DRIVER_TYPE_ETHERNET
endif
CFLAGS += -DENABLE_FXP -DOAI_EMU -DENABLE_USE_CPU_EXECUTION_TIME
CFLAGS += -DENABLE_USE_CPU_EXECUTION_TIME
ifndef DISABLE_XER_PRINT
CFLAGS += -DXER_PRINT
endif
@@ -272,7 +260,7 @@ endif
# Check if libpgm is installed and use it if found instead of the unreliable
# multicast
ifeq ($(PGM_FOUND), 1)
CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
CFLAGS += $(PGM_CFLAGS)
LIBS += $(PGM_LIBS)
endif
-43
View File
@@ -435,9 +435,6 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
{
int32_t **txdata,**rxdata;
#ifdef PHY_ABSTRACTION_UL
int32_t att_eNB_id=-1;
#endif
uint8_t UE_id=0;
uint8_t nb_antennas_rx = UE2RU[0][0][CC_id]->nb_rx; // number of rx antennas at eNB
@@ -450,14 +447,6 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
uint8_t hold_channel=0;
#ifdef PHY_ABSTRACTION_UL
double min_path_loss=-200;
uint16_t ul_nb_rb=0 ;
uint16_t ul_fr_rb=0;
int ulnbrb2 ;
int ulfrrb2 ;
uint8_t harq_pid;
#endif
double s_re0[30720];
double s_re1[30720];
double *s_re[2];
@@ -482,38 +471,6 @@ void do_UL_sig(channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM
r_im0[1] = r_im01;
if (abstraction_flag!=0) {
#ifdef PHY_ABSTRACTION_UL
// wire this to 0 until we figure this out
int eNB_id=0;
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
if (!hold_channel) {
random_channel(UE2RU[UE_id][eNB_id][CC_id],abstraction_flag);
freq_channel(UE2RU[UE_id][eNB_id][CC_id], frame_parms->N_RB_UL,frame_parms->N_RB_UL*12+1);
// REceived power at the eNB
rx_pwr = signal_energy_fp2(UE2RU[UE_id][eNB_id][CC_id]->ch[0],
UE2RU[UE_id][eNB_id][CC_id]->channel_length)*UE2RU[UE_id][att_eNB_id][CC_id]->channel_length; // calculate the rx power at the eNB
}
// write_output("SINRch.m","SINRch",PHY_vars_eNB_g[att_eNB_id]->sinr_dB_eNB,frame_parms->N_RB_UL*12+1,1,1);
if(subframe>1 && subframe <5) {
harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
ul_nb_rb = RC.eNB[att_eNB_id][CC_id].ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->nb_rb;
ul_fr_rb = RC.eNB[att_eNB_id][CC_id].ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->first_rb;
}
if(ul_nb_rb>1 && (ul_fr_rb < 25 && ul_fr_rb > -1)) {
number_rb_ul = ul_nb_rb;
first_rbUL = ul_fr_rb;
init_snr_up(UE2RU[UE_id][att_eNB_id][CC_id],enb_data[att_eNB_id], ue_data[UE_id],PHY_vars_eNB_g[att_eNB_id][CC_id]->sinr_dB,&PHY_vars_UE_g[att_eNB_id][CC_id]->N0,ul_nb_rb,ul_fr_rb);
}
} //UE_id
#else
#endif
} else { //without abstraction
pthread_mutex_lock(&UE_output_mutex[ru_id]);
-160
View File
@@ -1368,9 +1368,6 @@ void init_ocm(void)
if (abstraction_flag) {
get_beta_map();
#ifdef PHY_ABSTRACTION_UL
get_beta_map_up();
#endif
get_MIESM_param();
//load_pbch_desc();
@@ -1576,117 +1573,6 @@ void update_ocm()
void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
{
#if defined(USER_MODE) && defined(OAI_EMU)
//int rrc_state=0;
if (oai_emulation.info.otg_enabled ==1 ) {
int dst_id, app_id;
Packet_otg_elt_t *otg_pkt;
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
for_times += 1;
// generate traffic if the ue is rrc reconfigured state
//if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) {
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
if_times += 1;
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(enb_module_idP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
otg_times += 1;
(otg_pkt->otg_pkt).rb_id = DTCH-2; // app could be binded to a given DRB
(otg_pkt->otg_pkt).module_id = enb_module_idP;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 0;
(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_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);
otg_pkt=NULL;
}
}
}
}
#if defined(Rel10) || defined(Rel14)
mbms_service_id_t service_id;
mbms_session_id_t session_id;
rb_id_t rb_id;
// MBSM multicast traffic
if (ctime >= 500 ) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
if (pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].instanciated_instance == TRUE) { // this service/session is configured
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n", service_id, session_id, service_id*maxSessionPerPMCH + session_id);
rb_id = pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].rb_id;
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen_multicast(enb_module_idP, session_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = enb_module_idP;
(otg_pkt->otg_pkt).dst_id = session_id;
(otg_pkt->otg_pkt).is_ue = FALSE;
//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_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");
free(otg_pkt);
otg_pkt=NULL;
}
// old version
/* // MBSM multicast traffic
#if defined(Rel10) || defined(Rel14)
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
if ((pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].instanciated_instance== module_idP + 1) && (eNB_flag == 1)){ // this service/session is configured
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d)\n", service_id, session_id);
// Duy add
LOG_I(OTG, "frame %d, multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n",frame, service_id, session_id,service_id*maxSessionPerPMCH + session_id);
// end Duy add
rb_id = pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].rb_id;
otg_pkt=(uint8_t*) packet_gen_multicast(module_idP, session_id, ctime, &pkt_size);
if (otg_pkt != NULL) {
LOG_D(OTG,"[eNB %d] sending a multicast packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", eNB_index, module_idP, rb_id, module_idP, session_id, pkt_size);
pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,PDCP_TM);
free(otg_pkt);
}
}
}
}
} // end multicast traffic
#endif
*/
}
}
}
} // end multicast traffic
#endif
}
#else
#if 0 // defined(EXMIMO) || defined(OAI_USRP)
if (otg_enabled==1) {
ctime = frame * 100;
@@ -1713,57 +1599,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
}
}
}
#endif
#endif
}
void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
{
#if defined(USER_MODE) && defined(OAI_EMU)
int app_id;
if (oai_emulation.info.otg_enabled ==1 ) {
module_id_t dst_id, src_id; //dst_id = eNB_index
module_id_t module_id = ue_mod_idP+NB_eNB_INST;
src_id = module_id;
for (dst_id=0; dst_id<NB_SIG_CNX_UE; dst_id++) {
// only consider the first attached eNB
if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) {
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t));
if (otg_pkt!=NULL)
memset(otg_pkt,0,sizeof(Packet_otg_elt_t));
else {
LOG_E(OTG,"not enough memory\n");
exit(-1);
}// Manage to add this packet to the tail of your list
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = DTCH-2;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 1;
//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_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);
otg_pkt=NULL;
}
}
}
}
}
#endif
}
#endif
-117
View File
@@ -475,70 +475,6 @@ void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_dat
}//switch
}//function ends
#ifdef PHY_ABSTRACTION_UL
void init_snr_up(channel_desc_t* UE2eNB, node_desc_t *enb_data, node_desc_t *ue_data, double* sinr_dB, double* N0,uint16_t nb_rb,uint16_t fr_rb)
{
int return_value;
double thermal_noise;
int count;
int aarx;
// nb_rb = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb;
/* Thermal noise is calculated using 10log10(K*T*B) K = Boltzmann's constant T = room temperature B = bandwidth */
thermal_noise = -174 + 10*log10(UE2eNB->sampling_rate*1e6); //value in dBm
*N0 = thermal_noise + enb_data->rx_noise_level;//? all the element have the same noise level?????
double lambda ;
double residual;
double sinrlin;
double residual_db;
residual = 0 ;
int ccc;
/*
for (count = (fr_rb*12) ; count < (12 * (fr_rb+nb_rb)); count++)
{
residual += ( 1 / ( pow((UE2eNB -> chF[0][count].x),2) + pow((UE2eNB -> chF[0][count].y),2)));
}
*///sinreff(nn) = ((sum((1/p).*(snrm(nn,:)./(snrm(nn,:)+1)),2).^(-1) )-1).^-1;
sinrlin = 0 ;
lambda = 0;
////First calculate SINRs of subcarriers just like OFDM
for (count = (fr_rb*12) ; count < (12 * (fr_rb+nb_rb)); count++) {
sinr_dB[count] = ue_data->tx_power_dBm
+ UE2eNB->path_loss_dB
- (thermal_noise + enb_data->rx_noise_level)
+ 10 * log10 (pow(UE2eNB->chF[0][count].x, 2)
+ pow(UE2eNB->chF[0][count].y, 2));
}
//Then apply formula :
if(nb_rb > 0) {
//calculate lambdas and fill the same with all but just use one of them when necessary for abstraction
for (count = fr_rb*12; count < (12 * (fr_rb+nb_rb)); count++) {
sinrlin = pow((sinr_dB[count]/10),10); // convert SINR to linear
lambda += (sinrlin / (sinrlin + 1)) ;
}
for (count = fr_rb*12; count < (12 * (fr_rb+nb_rb)); count++) {
sinr_dB[count] = pow(lambda,2) /(((nb_rb)*lambda)-pow(lambda,2)) ;
sinr_dB[count] = 10*log10(sinr_dB[count]) ; //save it in db
}
printf("tx_power %g, path_loss %g, sinr_dB[0] %g\n",ue_data->tx_power_dBm ,UE2eNB->path_loss_dB,sinr_dB[count-1]);
for (ccc = 0; ccc < 301 ; ccc++ ) {
SINRpost_eff[ccc] = 0;
SINRpost_eff[ccc] = sinr_dB[ccc];
}
}
}//function ends
#endif
void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_data, double *sinr_dB, uint16_t nb_rb)
{
@@ -737,60 +673,7 @@ void get_MIESM_param()
free(file_path);
}
#ifdef PHY_ABSTRACTION_UL
void get_beta_map_up()
{
char *file_path = NULL;
int table_len = 0;
int mcs = 0;
char *sinr_bler;
char buffer[1000];
FILE *fp;
file_path = (char*) malloc(512);
for (mcs = 0; mcs < MCS_COUNT; mcs++) {
sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/awgn_abst/awgn_snr_bler_mcs%d_up.csv",getenv("OPENAIR1_DIR"),mcs);
fp = fopen(file_path,"r");
if (fp == NULL) {
LOG_W(OCM,"ERROR: Unable to open the file %s, try an alternative path\n", file_path);
memset(file_path, 0, 512);
sprintf(file_path,"AWGN/awgn_snr_bler_mcs%d.csv",mcs);
LOG_I(OCM,"Opening the alternative path %s\n", file_path);
fp = fopen(file_path,"r");
if (fp == NULL) {
LOG_E(OCM,"ERROR: Unable to open the file %s, exisitng\n", file_path);
exit(-1);
}
}
// else {
fgets(buffer, 1000, fp);
table_len=0;
while (!feof(fp)) {
sinr_bler = strtok(buffer, ",");
sinr_bler_map_up[mcs][0][table_len] = atof(sinr_bler);
sinr_bler = strtok(NULL,",");
sinr_bler_map_up[mcs][1][table_len] = atof(sinr_bler);
table_len++;
fgets(buffer, 1000, fp);
}
fclose(fp);
// }
LOG_D(OCM,"Print the table for mcs %d\n",mcs);
for (table_len = 0; table_len < 16; table_len++)
LOG_D(OCM,"%lf %lf \n ",sinr_bler_map_up[mcs][0][table_len],sinr_bler_map_up[mcs][1][table_len]);
}
free(file_path);
}
#endif