From fa4cfad5cb83068957c48e05a552876e006fccaa Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Tue, 19 Jul 2016 15:53:19 +0200 Subject: [PATCH 1/3] add mmapped-dma option for lte-softmodem --- targets/RT/USER/lte-softmodem.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index c8b8eea760..eedc641574 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -169,6 +169,7 @@ volatile int oai_exit = 0; static char UE_flag=0; +unsigned int mmapped_dma=0; //static uint8_t eNB_id=0,UE_id=0; static char threequarter_fs=0; @@ -385,11 +386,12 @@ void help (void) { printf(" --ue-txgain set UE TX gain\n"); printf(" --ue-scan_carrier set UE to scan around carrier\n"); printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n"); + printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n"); printf(" --RCC run using NGFI RCC node function IF4 split\n"); printf(" --RRU run using NGFI RRU node function IF4 split\n"); printf(" --eNB run using 3GPP eNB node function\n"); printf(" --BBU run using 3GPP eNB node function with IF5 split\n"); - printf(" --RRH run using RRH node function with IF5 split\n"); + printf(" --RRH run using RRH node function with IF5 split\n"); printf(" -C Set the downlink frequency for all component carriers\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"); @@ -686,6 +688,7 @@ static void get_options (int argc, char **argv) LONG_OPTION_DUMP_FRAME, LONG_OPTION_LOOPMEMORY, LONG_OPTION_PHYTEST, + LONG_OPTION_MMAPPED_DMA, LONG_OPTION_RCC, LONG_OPTION_RRU, LONG_OPTION_ENB, @@ -714,6 +717,7 @@ static void get_options (int argc, char **argv) {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME}, {"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY}, {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST}, + {"mmapped-dma", no_argument, NULL, LONG_OPTION_MMAPPED_DMA}, {"RCC", no_argument, NULL, LONG_OPTION_RCC}, {"RRU", no_argument, NULL, LONG_OPTION_RRU}, {"eNB", no_argument, NULL, LONG_OPTION_ENB}, @@ -810,6 +814,10 @@ static void get_options (int argc, char **argv) phy_test = 1; break; + case LONG_OPTION_MMAPPED_DMA: + mmapped_dma = 1; + break; + case LONG_OPTION_RCC: node_function = NGFI_RCC_IF4; break; @@ -829,7 +837,7 @@ static void get_options (int argc, char **argv) case LONG_OPTION_RRH: node_function = NGFI_RRU_IF5; break; - + #if T_TRACER case LONG_OPTION_T_PORT: { extern int T_port; @@ -1514,10 +1522,7 @@ int main( int argc, char **argv ) for (card=0; cardN_RB_DL == 100) { if (frame_parms[0]->threequarter_fs) { From bbe47d6fb5765de9bb8fc6270e8973bd9577581b Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Wed, 20 Jul 2016 12:55:12 +0200 Subject: [PATCH 2/3] some additions to config files, needs merge --- openair1/PHY/defs.h | 5 ++++ openair2/ENB_APP/enb_config.c | 51 ++++++++++++++++++++++++++++++----- openair2/ENB_APP/enb_config.h | 4 ++- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index e1b2627c09..8232900c9f 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -164,6 +164,11 @@ typedef enum { NGFI_RRU_IF4, // NGFI_RRU (NGFI remote radio-unit, currently split at common - ue_specific interface, IF4) NGFI_RCC_IF4 // NGFI_RCC (NGFI radio cloud center, currently split at common - ue_specific interface, IF4) } eNB_func_t; + +typedef enum { + synch_to_device=0, + synch_to_other +} eNB_timing_t; typedef struct UE_SCAN_INFO_s { /// 10 best amplitudes (linear) for each pss signals diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index d67c6eb6d7..c7a74277bf 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -73,6 +73,9 @@ #define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" +#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function" +#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing" + #define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" #define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" #define ENB_CONFIG_STRING_TDD_CONFIG_S "tdd_config_s" @@ -316,6 +319,10 @@ void enb_config_display(void) } for (j=0; j< enb_properties.properties[i]->nb_cc; j++) { + // CC_ID node function/timing + printf( "\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( "\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( "\tuplink freq offset for CC %d: \t%"PRId32":\n",j,enb_properties.properties[i]->uplink_frequency_offset[j]); @@ -324,7 +331,7 @@ void enb_config_display(void) printf( "\tN_RB_DL for CC %d:\t%"PRId16":\n",j,enb_properties.properties[i]->N_RB_DL[j]); printf( "\tnb_antennas_tx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_tx[j]); printf( "\tnb_antennas_rx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_rx[j]); - + // RACH-Config printf( "\trach_numberOfRA_Preambles for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_numberOfRA_Preambles[j]); printf( "\trach_preamblesGroupAConfig for CC %d:\t%d:\n",j,enb_properties.properties[i]->rach_preamblesGroupAConfig[j]); @@ -409,17 +416,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_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_n311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]); + printf( "\tue_TimersAndConstants_n311 for CC %d:\t%ld:\n\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]); } for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) { - printf( "\n\tOTG Destination UE ID: \t%"PRIu16, enb_properties.properties[i]->otg_ue_id[j]); + printf( "\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 Background Traffic: \t%s\n", (enb_properties.properties[i]->otg_bg_traffic[j]==1) ? "Enabled" : "Disabled"); } - printf( "\n\tGlobal log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->glog_level)); + printf( "\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( "\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)); @@ -511,6 +518,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) int j = 0; int parse_errors = 0; libconfig_int enb_id = 0; + + const char* cc_node_function = NULL; + const char* cc_node_timing = NULL; + const char* cell_type = NULL; const char* tac = 0; const char* enb_name = NULL; @@ -787,7 +798,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) component_carrier = config_setting_get_elem(setting_component_carriers, j); //printf("Component carrier %d\n",component_carrier); - if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) + 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_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_S, &tdd_config_s) && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type) @@ -865,6 +878,32 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) enb_properties.properties[enb_properties_index]->nb_cc++; + if (strcmp(cc_node_function, "eNodeB_3GPP") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_function[j] = eNodeB_3GPP; + } else if (strcmp(cc_node_function, "eNodeB_3GPP_BBU") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_function[j] = eNodeB_3GPP_BBU; + } else if (strcmp(cc_node_function, "NGFI_RCC_IF4") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_function[j] = NGFI_RCC_IF4; + } else if (strcmp(cc_node_function, "NGFI_RRU_IF4") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_function[j] = NGFI_RRU_IF4; + } else if (strcmp(cc_node_function, "NGFI_RRU_IF5") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_function[j] = NGFI_RRU_IF5; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: eNodeB_3GPP or eNodeB_3GPP_BBU or NGFI_IF4_RCC or NGFI_IF4_RRU or NGFI_IF5_RRU !\n", + lib_config_file_name_pP, i, cc_node_function); + } + + if (strcmp(cc_node_timing, "SYNCH_TO_DEVICE") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_device; + } else if (strcmp(cc_node_timing, "SYNCH_TO_OTHER") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_other; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: SYNCH_TO_DEVICE or SYNCH_TO_OTHER !\n", + lib_config_file_name_pP, i, cc_node_timing); + } + enb_properties.properties[enb_properties_index]->tdd_config[j] = tdd_config; 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)!", @@ -888,7 +927,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", lib_config_file_name_pP, i, prefix_type); } - + enb_properties.properties[enb_properties_index]->eutra_band[j] = eutra_band; enb_properties.properties[enb_properties_index]->downlink_frequency[j] = (uint32_t) downlink_frequency; enb_properties.properties[enb_properties_index]->uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 716d400178..3feeb5e828 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -45,6 +45,7 @@ #include "platform_types.h" #include "platform_constants.h" #include "PHY/impl_defs_lte.h" +#include "PHY/defs.h" #include "s1ap_messages_types.h" #ifdef CMAKER #include "SystemInformationBlockType2.h" @@ -129,6 +130,8 @@ typedef struct Enb_properties_s { /* Physical parameters */ int16_t nb_cc; + eNB_func_t cc_node_function[1+MAX_NUM_CCs]; + eNB_timing_t cc_node_timing[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_s[1+MAX_NUM_CCs]; @@ -202,7 +205,6 @@ typedef struct Enb_properties_s { long ue_TimersAndConstants_n310[1+MAX_NUM_CCs]; long ue_TimersAndConstants_n311[1+MAX_NUM_CCs]; - long srb1_timer_poll_retransmit; long srb1_timer_reordering; long srb1_timer_status_prohibit; From 07b3a0a9d10689bd77f29ff7835657b1460e632b Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Wed, 20 Jul 2016 19:56:17 +0200 Subject: [PATCH 3/3] prach data seems ok but no rx yet --- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 2 +- openair1/PHY/LTE_TRANSPORT/prach.c | 36 ++++++++++++++++++++++++- openair1/SCHED/phy_procedures_lte_eNb.c | 9 +++---- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 0fb5404538..572bcd73b7 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -139,7 +139,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, gen_IF4_prach_header(prach_header, frame, subframe); memcpy((int16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t), - (&rxsigF[0][0]+k), + (&rxsigF[0][k]), db_fulllength*sizeof(int16_t)); if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 4634be7321..752aee11cd 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1104,7 +1104,12 @@ void rx_prach(PHY_VARS_eNB *eNB, for (aa=0; aacommon_vars.rxdata[0][aa][subframe*eNB->frame_parms.samples_per_tti-eNB->N_TA_offset]; } - + + int energy = dB_fixed(signal_energy(prach[0], eNB->frame_parms.samples_per_tti)); + //if (energy >= 45) { + // printf("prach subframe energy %d\n",energy); + //} + // First compute physical root sequence if (restricted_set == 0) { if (Ncs_config>15) { @@ -1285,7 +1290,36 @@ void rx_prach(PHY_VARS_eNB *eNB, send_IF4(eNB, eNB->proc.frame_rx, eNB->proc.subframe_rx, IF4_PRACH, k); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); + energy = dB_fixed(signal_energy(&rxsigF[0][k], 839)); + if (energy >=45) { + printf(" prach freq-domain energy %d\n",eNB->proc.frame_rx, energy); + //write_output("beforecomp.m","rxF",&rxsigF[0][k],839*2,1,0); + //exit(1); + } + return; + } else if (eNB->node_function == NGFI_RCC_IF4) { + k = (12*n_ra_prb) - 6*eNB->frame_parms.N_RB_UL; + + if (k<0) { + k+=(eNB->frame_parms.ofdm_symbol_size); + } + + k*=12; + k+=13; + k*=2; + + // Adjust received rxsigF offset + memmove((&rxsigF[0][k]), + (&rxsigF[0][0]), + 839*2*sizeof(int16_t)); + + energy = dB_fixed(signal_energy(&rxsigF[0][k], 839)); + if (energy >=45) { + printf(" prach freq-domain energy %d\n",eNB->proc.frame_rx, energy); + //write_output("aftercomp.m","rxF",&rxsigF[0][k],839*2,1,0); + //exit(1); + } } // in case of RCC and prach received rx_thread wakes up prach diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 79a6a1d0b7..9262afcdb9 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2641,11 +2641,12 @@ 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); - if (eNB->node_function == NGFI_RRU_IF4 && is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)<=0) { + if (eNB->node_function == NGFI_RRU_IF4) { /// **** send_IF4 of rxdataF to RCC (no prach now) **** /// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); - send_IF4(eNB, frame, subframe, 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 ); + } /// **** send_IF4 of prach to RCC **** /// done in prach thread (below) @@ -2735,7 +2736,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl } } - } while( (symbol_mask != symbol_mask_full) && (prach_rx == 0)); + } while(symbol_mask != symbol_mask_full); if (proc->first_rx == 0) { if (proc->subframe_rx != subframe){ @@ -2753,8 +2754,6 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl 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_SUBFRAME_NUMBER_RX_ENB, proc->subframe_rx ); - - // Tobi aka mr monaco: ETH } else { // should not get here AssertFatal(1==0, "Unknown eNB->node_function %d",eNB->node_function);