Commit b1e633bb authored by knopp's avatar knopp

Merge branch 'enhancement-10-harmony' of...

Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony

Conflicts:
	openair1/PHY/defs.h
	targets/RT/USER/lte-enb.c
	targets/RT/USER/lte-softmodem.c
parents 6e4d361e 2e29052f
...@@ -170,8 +170,6 @@ typedef enum { ...@@ -170,8 +170,6 @@ typedef enum {
synch_to_other // synch to another source (timer, other CC_id) synch_to_other // synch to another source (timer, other CC_id)
} eNB_timing_t; } eNB_timing_t;
typedef struct UE_SCAN_INFO_s { typedef struct UE_SCAN_INFO_s {
/// 10 best amplitudes (linear) for each pss signals /// 10 best amplitudes (linear) for each pss signals
int32_t amp[3][10]; int32_t amp[3][10];
...@@ -810,11 +808,4 @@ typedef struct { ...@@ -810,11 +808,4 @@ typedef struct {
#include "SIMULATION/ETH_TRANSPORT/defs.h" #include "SIMULATION/ETH_TRANSPORT/defs.h"
#endif //OPENAIR_LTE #endif //OPENAIR_LTE
#endif // __PHY_DEFS__H__ #endif // __PHY_DEFS__H__
...@@ -2517,31 +2517,29 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2517,31 +2517,29 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) { void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) {
int i,l; int l;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
int subframe = proc->subframe_rx;
int frame = proc->frame_rx; const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx;
uint8_t seqno=0; uint8_t seqno=0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 1 );
start_meas(&eNB->phy_proc_rx); start_meas(&eNB->phy_proc_rx);
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,frame, subframe); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe);
#endif #endif
if (abstraction_flag==0) { // grab signal in chunks of 500 us (1 slot) if (abstraction_flag==0) {
if ((eNB->node_function == NGFI_RRU_IF4) || if ((eNB->node_function == NGFI_RRU_IF4) ||
(eNB->node_function == eNodeB_3GPP) || (eNB->node_function == eNodeB_3GPP) ||
(eNB->node_function == eNodeB_3GPP_BBU)) { // front-end processing (eNB->node_function == eNodeB_3GPP_BBU)) { // front-end processing
// now do common RX processing for first slot in subframe // now do common RX processing for first slot in subframe
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
...@@ -2564,7 +2562,6 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2564,7 +2562,6 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
); );
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
if (eNB->node_function == NGFI_RRU_IF4) { if (eNB->node_function == NGFI_RRU_IF4) {
...@@ -2572,10 +2569,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2572,10 +2569,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
send_IF4(eNB, proc->frame_rx, proc->subframe_rx, IF4_PULFFT, 0); send_IF4(eNB, proc->frame_rx, proc->subframe_rx, IF4_PULFFT, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
}
}
} }
else if (eNB->node_function == NGFI_RRU_IF5) { else if (eNB->node_function == NGFI_RRU_IF5) {
/// **** send_IF5 of rxdata to BBU **** /// /// **** send_IF5 of rxdata to BBU **** ///
...@@ -2587,12 +2581,12 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2587,12 +2581,12 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
/// **** send_IF4 of prach to RCC **** /// done in prach thread (below) /// **** send_IF4 of prach to RCC **** /// done in prach thread (below)
// check if we have to detect PRACH first // check if we have to detect PRACH first
if ((eNB->node_function != NGFI_RRU_IF5) && if ((eNB->node_function != NGFI_RRU_IF5) &&
(is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0)) { // any other node must call prach procedure (is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0)) { // any other node must call prach procedure
// wake up thread for PRACH RX // wake up thread for PRACH RX
if (pthread_mutex_lock(&proc->mutex_prach) != 0) { if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach ); LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
exit_fun( "error locking mutex_prach" ); exit_fun( "error locking mutex_prach" );
return; return;
} }
int cnt_prach = ++proc->instance_cnt_prach; int cnt_prach = ++proc->instance_cnt_prach;
...@@ -2603,18 +2597,19 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2603,18 +2597,19 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
pthread_mutex_unlock( &proc->mutex_prach ); pthread_mutex_unlock( &proc->mutex_prach );
if (cnt_prach == 0) { if (cnt_prach == 0) {
// the thread was presumably waiting where it should and can now be woken up // the thread was presumably waiting where it should and can now be woken up
if (pthread_cond_signal(&proc->cond_prach) != 0) { if (pthread_cond_signal(&proc->cond_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB PRACH thread %d\n", proc->thread_index); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB PRACH thread %d\n", proc->thread_index);
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return; return;
} }
} else { } else {
LOG_W( PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", proc->frame_rx,proc->subframe_rx,cnt_prach); LOG_W( PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", proc->frame_rx,proc->subframe_rx,cnt_prach);
exit_fun( "PRACH thread busy" ); exit_fun( "PRACH thread busy" );
return; return;
} }
} }
} else { // grab transport channel information from network interface } else { // grab transport channel information from network interface
} }
...@@ -2641,7 +2636,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2641,7 +2636,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 );
start_meas(&eNB->phy_proc_rx); start_meas(&eNB->phy_proc_rx);
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,frame, subframe); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe);
#endif #endif
T(T_ENB_PHY_UL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe)); T(T_ENB_PHY_UL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe));
......
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" #define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function" #define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing" #define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" #define ENB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" #define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config"
...@@ -303,25 +304,26 @@ void enb_config_display(void) ...@@ -303,25 +304,26 @@ void enb_config_display(void)
printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift); printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : (enb_properties.properties[i]->rrh_gw_config[j].rawif4 == 1)? "RAW_IF4" : (enb_properties.properties[i]->rrh_gw_config[j].udpif4 == 1)? "UDP_IF4" : (enb_properties.properties[i]->rrh_gw_config[j].rawif5_mobipass == 1)? "RAW_IF5_MOBIPASS" : "UDP"); printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : (enb_properties.properties[i]->rrh_gw_config[j].rawif4 == 1)? "RAW_IF4" : (enb_properties.properties[i]->rrh_gw_config[j].udpif4 == 1)? "UDP_IF4" : (enb_properties.properties[i]->rrh_gw_config[j].rawif5_mobipass == 1)? "RAW_IF5_MOBIPASS" : "UDP");
if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) { if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
printf( "\tRF target : \tEXMIMO:\n\n"); printf( "\tRF target : \tEXMIMO:\n");
} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) { } else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
printf( "\tRF target : \tUSRP_B200:\n\n"); printf( "\tRF target : \tUSRP_B200:\n");
} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) { } else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) {
printf( "\tRF target : \tUSRP_X300:\n\n"); printf( "\tRF target : \tUSRP_X300:\n");
} else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) { } else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) {
printf( "\tRF target : \tBLADERF:\n\n"); printf( "\tRF target : \tBLADERF:\n");
} else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) { } else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) {
printf( "\tRF target : \tLMSSDR:\n\n"); printf( "\tRF target : \tLMSSDR:\n");
} else { } else {
printf( "\tRF target : \tNONE:\n\n"); printf( "\tRF target : \tNONE:\n");
} }
} }
} }
for (j=0; j< enb_properties.properties[i]->nb_cc; j++) { for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
// CC_ID node function/timing // CC_ID node function/timing
printf( "\tnode_function for CC %d:\t%d:\n",j,enb_properties.properties[i]->cc_node_function[j]); printf( "\n\tnode_function for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_function[j]);
printf( "\tnode_timing for CC %d:\t%d:\n",j,enb_properties.properties[i]->cc_node_timing[j]); printf( "\tnode_timing for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_timing[j]);
printf( "\tnode_synch_ref for CC %d: \t%d:\n",j,enb_properties.properties[i]->cc_node_synch_ref[j]);
printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]); printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
printf( "\tdownlink freq for CC %d: \t%"PRIu64":\n",j,enb_properties.properties[i]->downlink_frequency[j]); printf( "\tdownlink freq for CC %d: \t%"PRIu64":\n",j,enb_properties.properties[i]->downlink_frequency[j]);
...@@ -416,17 +418,17 @@ void enb_config_display(void) ...@@ -416,17 +418,17 @@ void enb_config_display(void)
printf( "\tue_TimersAndConstants_t310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t310[j]); printf( "\tue_TimersAndConstants_t310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t310[j]);
printf( "\tue_TimersAndConstants_n310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n310[j]); printf( "\tue_TimersAndConstants_n310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n310[j]);
printf( "\tue_TimersAndConstants_t311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t311[j]); printf( "\tue_TimersAndConstants_t311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t311[j]);
printf( "\tue_TimersAndConstants_n311 for CC %d:\t%ld:\n\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]); printf( "\tue_TimersAndConstants_n311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]);
} }
for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) { for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) {
printf( "\tOTG Destination UE ID: \t%"PRIu16, enb_properties.properties[i]->otg_ue_id[j]); printf( "\n\tOTG Destination UE ID: \t%"PRIu16, enb_properties.properties[i]->otg_ue_id[j]);
printf( "\n\tOTG App Type: \t%"PRIu8, enb_properties.properties[i]->otg_app_type[j]); printf( "\n\tOTG App Type: \t%"PRIu8, enb_properties.properties[i]->otg_app_type[j]);
printf( "\n\tOTG Background Traffic: \t%s\n", (enb_properties.properties[i]->otg_bg_traffic[j]==1) ? "Enabled" : "Disabled"); printf( "\n\tOTG Background Traffic: \t%s\n", (enb_properties.properties[i]->otg_bg_traffic[j]==1) ? "Enabled" : "Disabled");
} }
printf( "\tGlobal log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->glog_level)); printf( "\n\tGlobal log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->glog_level));
printf( "\tHW log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->hw_log_level)); printf( "\tHW log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->hw_log_level));
printf( "\tPHY log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->phy_log_level)); printf( "\tPHY log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->phy_log_level));
printf( "\tMAC log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->mac_log_level)); printf( "\tMAC log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->mac_log_level));
...@@ -521,6 +523,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -521,6 +523,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
const char* cc_node_function = NULL; const char* cc_node_function = NULL;
const char* cc_node_timing = NULL; const char* cc_node_timing = NULL;
int cc_node_synch_ref = 0;
const char* cell_type = NULL; const char* cell_type = NULL;
const char* tac = 0; const char* tac = 0;
...@@ -800,6 +803,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -800,6 +803,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
//printf("Component carrier %d\n",component_carrier); //printf("Component carrier %d\n",component_carrier);
if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_CC_NODE_FUNCTION, &cc_node_function) if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_CC_NODE_FUNCTION, &cc_node_function)
&& config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_CC_NODE_TIMING, &cc_node_timing) && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_CC_NODE_TIMING, &cc_node_timing)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CC_NODE_SYNCH_REF, &cc_node_synch_ref)
&& config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s)
...@@ -894,9 +898,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -894,9 +898,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
lib_config_file_name_pP, i, cc_node_function); lib_config_file_name_pP, i, cc_node_function);
} }
if (strcmp(cc_node_timing, "SYNCH_TO_DEVICE") == 0) { if (strcmp(cc_node_timing, "synch_to_ext_device") == 0) {
enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_ext_device; enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_ext_device;
} else if (strcmp(cc_node_timing, "SYNCH_TO_OTHER") == 0) { } else if (strcmp(cc_node_timing, "synch_to_other") == 0) {
enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_other; enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_other;
} else { } else {
AssertError (0, parse_errors ++, AssertError (0, parse_errors ++,
...@@ -904,6 +908,14 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -904,6 +908,14 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
lib_config_file_name_pP, i, cc_node_timing); lib_config_file_name_pP, i, cc_node_timing);
} }
if ((cc_node_synch_ref >= -1) && (cc_node_synch_ref < num_component_carriers)) {
enb_properties.properties[enb_properties_index]->cc_node_synch_ref[j] = (int16_t) cc_node_synch_ref;
} else {
AssertError (0, parse_errors ++,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for node_synch_ref choice: valid CC_id or -1 !\n",
lib_config_file_name_pP, i, cc_node_synch_ref);
}
enb_properties.properties[enb_properties_index]->tdd_config[j] = tdd_config; enb_properties.properties[enb_properties_index]->tdd_config[j] = tdd_config;
AssertError (tdd_config <= TDD_Config__subframeAssignment_sa6, parse_errors ++, AssertError (tdd_config <= TDD_Config__subframeAssignment_sa6, parse_errors ++,
"Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!",
......
...@@ -132,6 +132,7 @@ typedef struct Enb_properties_s { ...@@ -132,6 +132,7 @@ typedef struct Enb_properties_s {
int16_t nb_cc; int16_t nb_cc;
eNB_func_t cc_node_function[1+MAX_NUM_CCs]; eNB_func_t cc_node_function[1+MAX_NUM_CCs];
eNB_timing_t cc_node_timing[1+MAX_NUM_CCs]; eNB_timing_t cc_node_timing[1+MAX_NUM_CCs];
int16_t cc_node_synch_ref[1+MAX_NUM_CCs];
lte_frame_type_t frame_type[1+MAX_NUM_CCs]; lte_frame_type_t frame_type[1+MAX_NUM_CCs];
uint8_t tdd_config[1+MAX_NUM_CCs]; uint8_t tdd_config[1+MAX_NUM_CCs];
uint8_t tdd_config_s[1+MAX_NUM_CCs]; uint8_t tdd_config_s[1+MAX_NUM_CCs];
......
...@@ -157,7 +157,7 @@ static struct { ...@@ -157,7 +157,7 @@ static struct {
void exit_fun(const char* s); void exit_fun(const char* s);
void init_eNB(eNB_func_t node_function,int nb_inst); void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[]);
void stop_eNB(void); void stop_eNB(void);
...@@ -496,7 +496,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -496,7 +496,7 @@ static void* eNB_thread_rxtx( void* param ) {
LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc\n"); LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc\n");
exit_fun("nothing to add"); exit_fun("nothing to add");
break; break;
} }
} else if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == NGFI_RRU_IF4) { } else if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == NGFI_RRU_IF4) {
/// **** recv_IF4 of txdataF from RCC **** /// /// **** recv_IF4 of txdataF from RCC **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
...@@ -604,10 +604,8 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -604,10 +604,8 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
printf( "Exiting eNB thread RXn_TXnp4\n"); printf( "Exiting eNB thread RXn_TXnp4\n");
eNB_thread_rxtx_status = 0; eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status; return &eNB_thread_rxtx_status;
} }
...@@ -770,7 +768,6 @@ static void* eNB_thread_asynch_rx( void* param ) { ...@@ -770,7 +768,6 @@ static void* eNB_thread_asynch_rx( void* param ) {
prach_rx = 0; prach_rx = 0;
do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!! do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!!
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
recv_IF4(eNB, &frame_rx, &subframe_rx, &packet_type, &symbol_number); recv_IF4(eNB, &frame_rx, &subframe_rx, &packet_type, &symbol_number);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
...@@ -781,10 +778,7 @@ static void* eNB_thread_asynch_rx( void* param ) { ...@@ -781,10 +778,7 @@ static void* eNB_thread_asynch_rx( void* param ) {
} else if (packet_type == IF4_PRACH) { } else if (packet_type == IF4_PRACH) {
// wake up thread for PRACH RX // wake up thread for PRACH RX
prach_rx = 1; prach_rx = 1;
} }
} while( (symbol_mask != symbol_mask_full) && (prach_rx == 0)); } while( (symbol_mask != symbol_mask_full) && (prach_rx == 0));
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
...@@ -823,16 +817,12 @@ static void* eNB_thread_FH( void* param ) { ...@@ -823,16 +817,12 @@ static void* eNB_thread_FH( void* param ) {
int i; int i;
int prach_rx; int prach_rx;
uint16_t packet_type; uint16_t packet_type;
uint32_t symbol_number=0; uint32_t symbol_number=0;
uint32_t symbol_mask, symbol_mask_full; uint32_t symbol_mask, symbol_mask_full;
int subframe = proc->subframe_rx; int subframe=0, frame=0;
int frame = proc->frame_rx;
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
...@@ -983,76 +973,75 @@ static void* eNB_thread_FH( void* param ) { ...@@ -983,76 +973,75 @@ static void* eNB_thread_FH( void* param ) {
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while (!oai_exit) { while (!oai_exit) {
if (oai_exit) break; if (oai_exit) break;
// This case is for synchronization to another thread
if ((eNB->node_timing == synch_to_other) && if ((eNB->node_timing == synch_to_other) &&
((eNB->node_function == NGFI_RRU_IF4) || ((eNB->node_function == NGFI_RCC_IF4) ||
(eNB->node_function == NGFI_RRU_IF5) || (eNB->node_function == eNodeB_3GPP_BBU))) {
(eNB->node_function == eNodeB_3GPP))) { // This case is for synchronization to another thread
//wait for event //wait for event
// how long should we wait here, for MOBIPASS this could be long // how long should we wait here, for MOBIPASS this could be long
// if (pthread_mutex_timedlock(&proc->mutex_FH,&wait) != 0) { // if (pthread_mutex_timedlock(&proc->mutex_FH,&wait) != 0) {
if (pthread_mutex_lock(&proc->mutex_FH) != 0) { if (pthread_mutex_lock(&proc->mutex_FH) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for FH\n"); LOG_E( PHY, "[SCHED][eNB] error locking mutex for FH\n");
exit_fun( "error locking mutex" ); exit_fun( "error locking mutex" );
break; break;
} }
while (proc->instance_cnt_FH < 0) { while (proc->instance_cnt_FH < 0) {
// most of the time the thread is waiting here // most of the time the thread is waiting here
// proc->instance_cnt_prach is -1 // proc->instance_cnt_prach is -1
pthread_cond_wait( &proc->cond_FH,&proc->mutex_FH ); // this unlocks mutex_rxtx while waiting and then locks it again pthread_cond_wait( &proc->cond_FH,&proc->mutex_FH ); // this unlocks mutex_rxtx while waiting and then locks it again
} }
proc->instance_cnt_FH++; proc->instance_cnt_FH++;
} }
// Remaining cases are all for synchronization on FH interface // Remaining cases are all for synchronization on FH interface
else if ((eNB->node_timing == synch_to_ext_device) && else if ((eNB->node_timing == synch_to_ext_device) &&
((eNB->node_function == NGFI_RRU_IF4) || ((eNB->node_function == NGFI_RRU_IF4) ||
(eNB->node_function == NGFI_RRU_IF5) || (eNB->node_function == NGFI_RRU_IF5) ||
(eNB->node_function == eNodeB_3GPP))) { // acquisition from RF (eNB->node_function == eNodeB_3GPP))) { // acquisition from RF
for (i=0; i<fp->nb_antennas_rx; i++) for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti]; rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
// sanitycheck
if (subframe==9) { if (subframe==9) {
subframe=0; subframe=0;
frame++; frame++;
frame&=1023; frame&=1023;
} else { } else {
subframe++; subframe++;
} }
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice, rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
&proc->timestamp_rx, &proc->timestamp_rx,
rxp, rxp,
fp->samples_per_tti, fp->samples_per_tti,
fp->nb_antennas_rx); fp->nb_antennas_rx);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023; proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10; proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->subframe_rx != subframe){ if (proc->subframe_rx != subframe){
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,subframe); LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,subframe);
exit_fun("Exiting"); exit_fun("Exiting");
} }
if (proc->frame_rx != frame) { if (proc->frame_rx != frame) {
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,frame); LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,frame);
exit_fun("Exiting"); exit_fun("Exiting");
} }
} else { } else {
proc->first_rx = 0; proc->first_rx = 0;
frame = proc->frame_rx;
subframe = proc->subframe_rx;
} }
// printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",proc->timestamp_rx,proc->frame_rx,frame,proc->subframe_rx,subframe); //printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",proc->timestamp_rx,proc->frame_rx,frame,proc->subframe_rx,subframe);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx );
...@@ -1065,7 +1054,7 @@ static void* eNB_thread_FH( void* param ) { ...@@ -1065,7 +1054,7 @@ static void* eNB_thread_FH( void* param ) {